Jump to content

shadowofdoom

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by shadowofdoom

  1. I also need this script. Anyone can fix it for latest rAathena?
  2. I'm using Euphy's Class Mastery system. //===== eAthena Script ======================================= //= Class Mastery System //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.2 //===== Description: ========================================= //= An advanced job & build switcher. //== Classes either become available as they are mastered, //== or when purchased from an NPC. //============================================================ prontera,148,203,4 script Class Mastery::CMSys 405,{ set [email protected]$,"[Class Mastery]"; mes [email protected]$; mes "How may I assist you?"; next; switch(select(" ~ Purchase a manual: ~ Purchase classes: ~ ^777777Close^000000")) { case 1: mes [email protected]$; if (!.Mode[3]) { mes "It seems like we're out of stock"; mes "at the moment. My apologies."; close; } if (countitem(.ManualID)) { mes "We only allow one manual per character. Orders, orders..."; close; } mes "Manuals cost ^FF0000"+.Mode[3]+" Zeny^000000."; mes "Would you like one?"; next; switch(select(" ~ Sure!: ~ I'll think about it.")) { case 1: mes [email protected]$; if (Zeny < .Mode[3]) { mes "You don't appear to have"; mes "enough Zeny... These are very"; mes "valuable books, you know?"; close; } set Zeny, Zeny-.Mode[3]; getitem .ManualID,1; specialeffect2 441; mes "Enjoy!"; close; case 2: mes [email protected]$; mes "Okay. Take your time."; close; } case 2: mes [email protected]$; if (!.Mode[4]) { mes "No classes are available for"; mes "purchase. You'll have to earn"; mes "them manually, I suppose..."; close; } if (!countitem(.ManualID)) { mes "You'll need a manual first!"; close; } mes "Entries cost ^FF0000"+.Mode[4]+" Zeny^000000 each."; if (Zeny < .Mode[4]) { mes "Go earn some more!"; close; } set [email protected]$,""; for(set [email protected],1; [email protected]<getarraysize(.JobList); set [email protected],[email protected]+1) { if (!(Class_Mastery & pow(2,[email protected]))) set [email protected]$, [email protected]$+" ~ "+jobname(.JobList[[email protected]]); set [email protected]$, [email protected]$+":"; } set [email protected]$, [email protected]$+" ~ ^777777Cancel^000000"; next; set [email protected], select([email protected]$); if ([email protected] == getarraysize(.JobList)) close; mes [email protected]$; mes "Are you sure you want to purchase an entry for the ^0055FF"+jobname(.JobList[[email protected]])+" ^000000class?"; next; if(select(" ~ I'm sure.: ~ No, wait...") == 2) { mes [email protected]$; mes "That's perfectly fine."; mes "Come back whenever you'd like."; close; } mes [email protected]$; set Zeny, Zeny-.Mode[4]; set Class_Mastery, Class_Mastery | pow(2,[email protected]); specialeffect2 441; mes "There you go, all done!"; message strcharinfo(0),jobname(.JobList[[email protected]])+" added to Class Manual."; close; case 3: close; } OnPCJobLvUpEvent: if (!.Mode[1]) end; if (@JNull$ == jobname(Class)) end; else set @JNull$,""; if ([email protected] || .JobList[@JIndex] != Class) { set @JIndex,0; for(set [email protected],1; [email protected]<=getarraysize(.JobList); set [email protected],[email protected]+1) if (Class == .JobList[[email protected]]) { set @JIndex, [email protected]; break; } if ([email protected]) { set @JNull$, jobname(Class); end; } } if ((JobLevel == .JLvlMax[@JIndex]) && !(Class_Mastery & pow(2,@JIndex))) { set Class_Mastery, Class_Mastery | pow(2,@JIndex); atcommand "@allskill"; message strcharinfo(0),jobname(Class)+" added to Class Manual."; for(set [email protected],0; [email protected]<4; set [email protected], [email protected]+1) { specialeffect2 441; sleep2 50; } } end; OnPCLoginEvent: if (.Mode[0] && !countitem(.ManualID)) getitem .ManualID,1; end; OnTimer50: stopnpctimer; setnpctimer 0; close; OnInit: // --------------------- Config --------------------- // Mode: // [0] Manual received automatically upon login? (1: yes / 0: no) // [1] Classes added automatically through leveling up? (1: yes / 0: no) // [2] Enable NPC to purchase manual/classes? (1: yes / 0: no) // [3] Price of manual, in Zeny (if NPC enabled; 0 to disable) // [4] Price per class, in Zeny (if NPC enabled; 0 to disable) setarray .Mode[0],0,1,1,10000000,5000000; // JobList: All the classes (ID) that are available. // JLvlMax: The max job level of classes in JobList. setarray .JobList[1],0, 4008,4009,4010,4011,4012,4013,4015,4016,4017,4018,4019,4020,4021,23,24,25,4046,4047,4049; setarray .JLvlMax[1],10, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,99,70,70, 50, 50, 50; set .ManualID,3333; // Item ID of manual set .CastTime,4; // Seconds for class change set .Interrupt,1; // Class change is interruptable? (1: yes / 0: no) set .BuildCount,4; // Number of builds and Quick Change options (max 26) set .MaxLevel,99; // Maximum base level (to prevent stat overflow) // -------------------------------------------------- if (!.Mode[2]) hideonnpc "CMSys"; end; } function script Class_Mastery { function Class_Change; function Get_Menu; function Save_Build; function Load_Build; if (!Class_Mastery) { message strcharinfo(0),"The book does not respond."; end; } while(1) { message strcharinfo(0)," ~ Class Mastery System ~ "; switch(select(" > Quick Change: > Set Quick Change Options: > Switch Classes: > Manage Builds: > ^777777Close^000000")) { case 1: message strcharinfo(0),"Quick Change:"; set [email protected], Get_Menu(1,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if ([email protected][[email protected]] && ([email protected][[email protected]] || BaseLevel < getvariableofnpc(.MaxLevel,"CMSys"))) { message strcharinfo(0),"Class change failed."; close; } if (@QC1[[email protected]]) Class_Change(@QC1[[email protected]]); if (@QC2[[email protected]]) { if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) message strcharinfo(0),"Level requirement not met for build change."; else Load_Build(getd("Build_"[email protected][[email protected]]+"$")); } close; case 2: setarray [email protected]$[0],"*","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"; while(1) { message strcharinfo(0),"Set Quick Change Options:"; set [email protected], Get_Menu(1,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; message strcharinfo(0),"Set Quick Change Options > Slot "[email protected]+":"; switch(select(" > Edit job ("+((@QC1[[email protected]])?"^0055FF"+jobname(getvariableofnpc(.JobList[@QC1[[email protected]]],"CMSys")):"^777777none")+"^000000): > Edit build ("+((@QC2[[email protected]])?"^0055FF"[email protected][[email protected]]:"^777777none")+"^000000): > ^777777Back^000000")) { case 1: message strcharinfo(0),"Set Quick Change Options > Slot "[email protected]+" > Edit job:"; set [email protected], Get_Menu(2,getarraysize(getvariableofnpc(.JobList,"CMSys"))); if ([email protected] == getarraysize(getvariableofnpc(.JobList,"CMSys"))) break; set @QC1[[email protected]], [email protected]; set QC1$,"_"; for(set [email protected],1; [email protected]<=getvariableofnpc(.BuildCount,"CMSys"); set [email protected],[email protected]+1) set QC1$, [email protected]$[@QC1[[email protected]]]; message strcharinfo(0),"Changes saved."; sleep2 250; break; case 2: message strcharinfo(0),"Set Quick Change Options > Slot "[email protected]+" > Edit build:"; if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) { message strcharinfo(0),"You must be level "+getvariableofnpc(.MaxLevel,"CMSys")+" to use this."; sleep2 250; break; } set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys"),1); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+2) break; if (getd("Build_"[email protected]+"$")=="" && [email protected] != getvariableofnpc(.BuildCount,"CMSys")+1) { message strcharinfo(0),"No build info found."; sleep2 250; break; } else set @QC2[[email protected]], ((([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1))?0:[email protected]); set QC2$,"_"; for(set [email protected],1; [email protected]<=getvariableofnpc(.BuildCount,"CMSys"); set [email protected],[email protected]+1) set QC2$, [email protected]$[@QC2[[email protected]]]; message strcharinfo(0),"Changes saved."; sleep2 250; break; case 3: break; } sleep2 250; } break; case 3: message strcharinfo(0),"Switch Classes:"; set [email protected], Get_Menu(2,getarraysize(getvariableofnpc(.JobList,"CMSys"))); if ([email protected] == getarraysize(getvariableofnpc(.JobList,"CMSys"))) break; if (Class == getvariableofnpc(.JobList[[email protected]],"CMSys")) { message strcharinfo(0),"Class change failed."; close; } message strcharinfo(0),"Select '"+jobname(getvariableofnpc(.JobList[[email protected]],"CMSys"))+"'?"; if (select("Yes:No") == 2) break; Class_Change([email protected]); close; case 4: if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) { message strcharinfo(0),"You must be level "+getvariableofnpc(.MaxLevel,"CMSys")+" to use this."; sleep2 250; break; } while(1) { message strcharinfo(0),"Build Manager:"; switch(select(" > Save Build...: > Load Build...: > Rename Build...: > ^777777Back^000000")) { case 1: message strcharinfo(0),"Build Manager > Save Build:"; set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if (getd("Build_"[email protected]+"$")!="") { message strcharinfo(0),"Overwrite previous build #"[email protected]+"?"; if(select("Save new build:Cancel")==2) break; } Save_Build([email protected]); message strcharinfo(0),"Type a name for your build."; input getd("Build_"[email protected]+"n$"); message strcharinfo(0),"Build #"[email protected]+" ("+getd("Build_"[email protected]+"n$")+") saved."; sleep2 250; break; case 2: message strcharinfo(0),"Build Manager > Load Build:"; set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if (getd("Build_"[email protected]+"$")=="") { message strcharinfo(0),"No build info found."; sleep2 250; break; } Load_Build(getd("Build_"[email protected]+"$")); message strcharinfo(0),"Build #"[email protected]+" loaded."; sleep2 250; break; case 3: message strcharinfo(0),"Build Manager > Rename Build:"; set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if (getd("Build_"[email protected]+"$")=="") { message strcharinfo(0),"No build info found."; sleep2 250; break; } message strcharinfo(0),"Type a new name for Build #"[email protected]+" ("+getd("Build_"[email protected]+"n$")+")."; input getd("Build_"[email protected]+"n$"); message strcharinfo(0),"Build #"[email protected]+" renamed."; sleep2 250; break; case 4: set [email protected],1; break; } if ([email protected]) { set [email protected],0; break; } sleep2 250; } break; case 5: close; } sleep2 250; } function Class_Change { specialeffect2 348; if (getvariableofnpc(.Interrupt,"CMSys")) { message strcharinfo(0),"Casting..."; initnpctimer "CMSys",1; progressbar "", getvariableofnpc(.CastTime,"CMSys"); } else for(set [email protected],0; [email protected]<getvariableofnpc(.CastTime,"CMSys"); set [email protected],[email protected]+1) { message strcharinfo(0),(getvariableofnpc(.CastTime,"CMSys")[email protected])+" seconds remaining..."; sleep2 1000; } jobchange getvariableofnpc(.JobList[getarg(0)],"CMSys"); set JobLevel, getvariableofnpc(.JLvlMax[getarg(0)],"CMSys"); atcommand "@allskill"; set SkillPoint,0; skilleffect 292,0; return; } function Get_Menu { set [email protected]$,""; switch(getarg(0)) { case 1: deletearray @QC1[0],getarraysize(@QC1); deletearray @QC2[0],getarraysize(@QC2); setarray [email protected]$[0],"*","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"; set [email protected]$,"_"; for(set [email protected],1; [email protected]<=getstrlen(QC1$); set [email protected],[email protected]+1) for(set [email protected],0; [email protected]<27; set [email protected],[email protected]+1) if (compare(QC1$,[email protected][email protected]$[[email protected]])) { set @QC1[[email protected]], [email protected]; set [email protected]$, [email protected][email protected]$[[email protected]]; break; } set [email protected]$,"_"; for(set [email protected],1; [email protected]<=getstrlen(QC2$); set [email protected],[email protected]+1) for(set [email protected],0; [email protected]<27; set [email protected],[email protected]+1) if (compare(QC2$,[email protected][email protected]$[[email protected]])) { set @QC2[[email protected]], [email protected]; set [email protected]$, [email protected][email protected]$[[email protected]]; break; } for(set [email protected],1; [email protected]<=getarg(1); set [email protected],[email protected]+1) set [email protected]$, [email protected]$+" > "+((@QC1[[email protected]])?"^0055FF"+jobname(getvariableofnpc(.JobList[@QC1[[email protected]]],"CMSys")):"^777777no job")+"^000000 / build "+((@QC2[[email protected]])?"^0055FF"[email protected][[email protected]]:"^777777empty")+"^000000:"; set [email protected]$, [email protected]$+" > ^777777Back^000000"; break; case 2: for(set [email protected],1; [email protected]<getarg(1); set [email protected],[email protected]+1) { if (Class_Mastery & pow(2,[email protected])) set [email protected]$, [email protected]$+" > "+jobname(getvariableofnpc(.JobList[[email protected]],"CMSys")); set [email protected]$, [email protected]$+":"; } set [email protected]$, [email protected]$+" > ^777777Back^000000"; break; case 3: for(set [email protected],1; [email protected]<=getarg(1); set [email protected],[email protected]+1) set [email protected]$, [email protected]$+" > Slot "[email protected]+" ("+((getd("Build_"[email protected]+"n$")=="")?"^777777empty":"^0055FF"+getd("Build_"[email protected]+"n$"))+"^000000):"; if (getarg(2,0)) set [email protected]$, [email protected]$+" > No build:"; set [email protected]$, [email protected]$+" > ^777777Back^000000"; break; } return select([email protected]$); } function Save_Build { setarray [email protected]$[0],"a","b","c","d","e","f","g"; set [email protected]$,""; for(set [email protected],0; [email protected]<7; set [email protected],[email protected]+1) set [email protected]$,[email protected][email protected]$[[email protected]]+(([email protected]==6)?StatusPoint:readparam([email protected]+13))+"|"; setd "Build_"+getarg(0)+"$", [email protected]$; return; } function Load_Build { setarray [email protected]$[0],"0","1","2","3","4","5","6","7","8","9"; setarray [email protected]$[0],"a","b","c","d","e","f","g"; ResetStatus; for(set [email protected],13; [email protected]<20; set [email protected],[email protected]+1) { set [email protected]$,""; set [email protected]$,[email protected]$[[email protected]]; while(1) { for(set [email protected],0; [email protected]<10; set [email protected],[email protected]+1) { if (compare(getarg(0),[email protected][email protected]$[[email protected]])) { set [email protected]$,[email protected][email protected]$[[email protected]]; set [email protected]$,[email protected][email protected]$[[email protected]]; break; } } if (compare(getarg(0),[email protected]$+"|")) break; } if ([email protected]==19) set StatusPoint, atoi([email protected]$); else statusup2 [email protected], atoi([email protected]$)-1; } return; } } I changed the job list to transcendent 3rd jobs and some minor config modifications. Here's my actual script. //===== eAthena Script ======================================= //= Class Mastery System //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.2 //===== Description: ========================================= //= An advanced job & build switcher. //== Classes either become available as they are mastered, //== or when purchased from an NPC. //============================================================ prontera,163,174,3 script Class Mastery::CMSys 405,{ set [email protected]$,"[Class Mastery]"; mes [email protected]$; mes "How may I assist you?"; next; switch(select(" ~ Purchase a manual: ~ Purchase classes: ~ ^777777Close^000000")) { case 1: mes [email protected]$; if (!.Mode[3]) { mes "It seems like we're out of stock"; mes "at the moment. My apologies."; close; } if (countitem(.ManualID)) { mes "We only allow one manual per character. Orders, orders..."; close; } mes "Manuals cost ^FF0000"+.Mode[3]+" Zeny^000000."; mes "Would you like one?"; next; switch(select(" ~ Sure!: ~ I'll think about it.")) { case 1: mes [email protected]$; if (Zeny < .Mode[3]) { mes "You don't appear to have"; mes "enough Zeny... These are very"; mes "valuable books, you know?"; close; } set Zeny, Zeny-.Mode[3]; getitem .ManualID,1; specialeffect2 441; mes "Enjoy!"; close; case 2: mes [email protected]$; mes "Okay. Take your time."; close; } case 2: mes [email protected]$; if (!.Mode[4]) { mes "No classes are available for"; mes "purchase. You'll have to earn"; mes "them manually, I suppose..."; close; } if (!countitem(.ManualID)) { mes "You'll need a manual first!"; close; } mes "Entries cost ^FF0000"+.Mode[4]+" Zeny^000000 each."; if (Zeny < .Mode[4]) { mes "Go earn some more!"; close; } set [email protected]$,""; for(set [email protected],1; [email protected]<getarraysize(.JobList); set [email protected],[email protected]+1) { if (!(Class_Mastery & pow(2,[email protected]))) set [email protected]$, [email protected]$+" ~ "+jobname(.JobList[[email protected]]); set [email protected]$, [email protected]$+":"; } set [email protected]$, [email protected]$+" ~ ^777777Cancel^000000"; next; set [email protected], select([email protected]$); if ([email protected] == getarraysize(.JobList)) close; mes [email protected]$; mes "Are you sure you want to purchase an entry for the ^0055FF"+jobname(.JobList[[email protected]])+" ^000000class?"; next; if(select(" ~ I'm sure.: ~ No, wait...") == 2) { mes [email protected]$; mes "That's perfectly fine."; mes "Come back whenever you'd like."; close; } mes [email protected]$; set Zeny, Zeny-.Mode[4]; set Class_Mastery, Class_Mastery | pow(2,[email protected]); specialeffect2 441; mes "There you go, all done!"; message strcharinfo(0),jobname(.JobList[[email protected]])+" added to Class Manual."; close; case 3: close; } OnPCJobLvUpEvent: if (!.Mode[1]) end; if (@JNull$ == jobname(Class)) end; else set @JNull$,""; if ([email protected] || .JobList[@JIndex] != Class) { set @JIndex,0; for(set [email protected],1; [email protected]<=getarraysize(.JobList); set [email protected],[email protected]+1) if (Class == .JobList[[email protected]]) { set @JIndex, [email protected]; break; } if ([email protected]) { set @JNull$, jobname(Class); end; } } if ((JobLevel == .JLvlMax[@JIndex]) && !(Class_Mastery & pow(2,@JIndex))) { set Class_Mastery, Class_Mastery | pow(2,@JIndex); atcommand "@allskill"; message strcharinfo(0),jobname(Class)+" added to Class Manual."; for(set [email protected],0; [email protected]<4; set [email protected], [email protected]+1) { specialeffect2 441; sleep2 50; } } end; OnPCLoginEvent: if (.Mode[0] && !countitem(.ManualID)) getitem .ManualID,1; end; OnTimer50: stopnpctimer; setnpctimer 0; close; OnInit: // --------------------- Config --------------------- // Mode: // [0] Manual received automatically upon login? (1: yes / 0: no) // [1] Classes added automatically through leveling up? (1: yes / 0: no) // [2] Enable NPC to purchase manual/classes? (1: yes / 0: no) // [3] Price of manual, in Zeny (if NPC enabled; 0 to disable) // [4] Price per class, in Zeny (if NPC enabled; 0 to disable) setarray .Mode[0],0,1,1,10000000,100000000; // JobList: All the classes (ID) that are available. // JLvlMax: The max job level of classes in JobList. setarray .JobList[1],0, 4060,4061,4062,4063,4064,4065,4073,4074,4075,4076,4077,4078,4079,4190,4215,4211,4212,4047,4049; setarray .JLvlMax[1],10, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120; set .ManualID,30100; // Item ID of manual set .CastTime,4; // Seconds for class change set .Interrupt,1; // Class change is interruptable? (1: yes / 0: no) set .BuildCount,4; // Number of builds and Quick Change options (max 26) set .MaxLevel,300; // Maximum base level (to prevent stat overflow) // -------------------------------------------------- if (!.Mode[2]) hideonnpc "CMSys"; end; } function script Class_Mastery { function Class_Change; function Get_Menu; function Save_Build; function Load_Build; if (!Class_Mastery) { message strcharinfo(0),"The book does not respond."; end; } while(1) { message strcharinfo(0)," ~ Class Mastery System ~ "; switch(select(" > Quick Change: > Set Quick Change Options: > Switch Classes: > Manage Builds: > ^777777Close^000000")) { case 1: message strcharinfo(0),"Quick Change:"; set [email protected], Get_Menu(1,getvariableofnpc(.BuildCount,"CMSys")); if (.[email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if ([email protected][[email protected]] && ([email protected][[email protected]] || BaseLevel < getvariableofnpc(.MaxLevel,"CMSys"))) { message strcharinfo(0),"Class change failed."; close; } if (@QC1[[email protected]]) Class_Change(@QC1[[email protected]]); if (@QC2[[email protected]]) { if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) message strcharinfo(0),"Level requirement not met for build change."; else Load_Build(getd("Build_"[email protected][[email protected]]+"$")); } close; case 2: setarray [email protected]$[0],"*","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"; while(1) { message strcharinfo(0),"Set Quick Change Options:"; set [email protected], Get_Menu(1,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; message strcharinfo(0),"Set Quick Change Options > Slot "[email protected]+":"; switch(select(" > Edit job ("+((@QC1[[email protected]])?"^0055FF"+jobname(getvariableofnpc(.JobList[@QC1[[email protected]]],"CMSys")):"^777777none")+"^000000): > Edit build ("+((@QC2[[email protected]])?"^0055FF"[email protected][[email protected]]:"^777777none")+"^000000): > ^777777Back^000000")) { case 1: message strcharinfo(0),"Set Quick Change Options > Slot "[email protected]+" > Edit job:"; set [email protected], Get_Menu(2,getarraysize(getvariableofnpc(.JobList,"CMSys"))); if ([email protected] == getarraysize(getvariableofnpc(.JobList,"CMSys"))) break; set @QC1[[email protected]], [email protected]; set QC1$,"_"; for(set [email protected],1; [email protected]<=getvariableofnpc(.BuildCount,"CMSys"); set [email protected],[email protected]+1) set QC1$, [email protected]$[@QC1[[email protected]]]; message strcharinfo(0),"Changes saved."; sleep2 250; break; case 2: message strcharinfo(0),"Set Quick Change Options > Slot "[email protected]+" > Edit build:"; if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) { message strcharinfo(0),"You must be level "+getvariableofnpc(.MaxLevel,"CMSys")+" to use this."; sleep2 250; break; } set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys"),1); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+2) break; if (getd("Build_"[email protected]+"$")=="" && [email protected] != getvariableofnpc(.BuildCount,"CMSys")+1) { message strcharinfo(0),"No build info found."; sleep2 250; break; } else set @QC2[[email protected]], ((([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1))?0:[email protected]); set QC2$,"_"; for(set [email protected],1; [email protected]<=getvariableofnpc(.BuildCount,"CMSys"); set [email protected],[email protected]+1) set QC2$, [email protected]$[@QC2[[email protected]]]; message strcharinfo(0),"Changes saved."; sleep2 250; break; case 3: break; } sleep2 250; } break; case 3: message strcharinfo(0),"Switch Classes:"; set [email protected], Get_Menu(2,getarraysize(getvariableofnpc(.JobList,"CMSys"))); if ([email protected] == getarraysize(getvariableofnpc(.JobList,"CMSys"))) break; if (Class == getvariableofnpc(.JobList[[email protected]],"CMSys")) { message strcharinfo(0),"Class change failed."; close; } message strcharinfo(0),"Select '"+jobname(getvariableofnpc(.JobList[[email protected]],"CMSys"))+"'?"; if (select("Yes:No") == 2) break; Class_Change([email protected]); close; case 4: if (BaseLevel < getvariableofnpc(.MaxLevel,"CMSys")) { message strcharinfo(0),"You must be level "+getvariableofnpc(.MaxLevel,"CMSys")+" to use this."; sleep2 250; break; } while(1) { message strcharinfo(0),"Build Manager:"; switch(select(" > Save Build...: > Load Build...: > Rename Build...: > ^777777Back^000000")) { case 1: message strcharinfo(0),"Build Manager > Save Build:"; set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if (getd("Build_"[email protected]+"$")!="") { message strcharinfo(0),"Overwrite previous build #"[email protected]+"?"; if(select("Save new build:Cancel")==2) break; } Save_Build([email protected]); message strcharinfo(0),"Type a name for your build."; input getd("Build_"[email protected]+"n$"); message strcharinfo(0),"Build #"[email protected]+" ("+getd("Build_"[email protected]+"n$")+") saved."; sleep2 250; break; case 2: message strcharinfo(0),"Build Manager > Load Build:"; set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if (getd("Build_"[email protected]+"$")=="") { message strcharinfo(0),"No build info found."; sleep2 250; break; } Load_Build(getd("Build_"[email protected]+"$")); message strcharinfo(0),"Build #"[email protected]+" loaded."; sleep2 250; break; case 3: message strcharinfo(0),"Build Manager > Rename Build:"; set [email protected], Get_Menu(3,getvariableofnpc(.BuildCount,"CMSys")); if ([email protected] == getvariableofnpc(.BuildCount,"CMSys")+1) break; if (getd("Build_"[email protected]+"$")=="") { message strcharinfo(0),"No build info found."; sleep2 250; break; } message strcharinfo(0),"Type a new name for Build #"[email protected]+" ("+getd("Build_"[email protected]+"n$")+")."; input getd("Build_"[email protected]+"n$"); message strcharinfo(0),"Build #"[email protected]+" renamed."; sleep2 250; break; case 4: set [email protected],1; break; } if ([email protected]) { set [email protected],0; break; } sleep2 250; } break; case 5: close; } sleep2 250; } function Class_Change { specialeffect2 348; if (getvariableofnpc(.Interrupt,"CMSys")) { message strcharinfo(0),"Casting..."; initnpctimer "CMSys",1; progressbar "", getvariableofnpc(.CastTime,"CMSys"); } else for(set [email protected],0; [email protected]<getvariableofnpc(.CastTime,"CMSys"); set [email protected],[email protected]+1) { message strcharinfo(0),(getvariableofnpc(.CastTime,"CMSys")[email protected])+" seconds remaining..."; sleep2 1000; } jobchange getvariableofnpc(.JobList[getarg(0)],"CMSys"); set JobLevel, getvariableofnpc(.JLvlMax[getarg(0)],"CMSys"); atcommand "@allskill"; set SkillPoint,0; skilleffect 292,0; return; } function Get_Menu { set [email protected]$,""; switch(getarg(0)) { case 1: deletearray @QC1[0],getarraysize(@QC1); deletearray @QC2[0],getarraysize(@QC2); setarray [email protected]$[0],"*","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"; set [email protected]$,"_"; for(set [email protected],1; [email protected]<=getstrlen(QC1$); set [email protected],[email protected]+1) for(set [email protected],0; [email protected]<27; set [email protected],[email protected]+1) if (compare(QC1$,[email protected][email protected]$[[email protected]])) { set @QC1[[email protected]], [email protected]; set [email protected]$, [email protected][email protected]$[[email protected]]; break; } set [email protected]$,"_"; for(set [email protected],1; [email protected]<=getstrlen(QC2$); set [email protected],[email protected]+1) for(set [email protected],0; [email protected]<27; set [email protected],[email protected]+1) if (compare(QC2$,[email protected][email protected]$[[email protected]])) { set @QC2[[email protected]], [email protected]; set [email protected]$, [email protected][email protected]$[[email protected]]; break; } for(set [email protected],1; [email protected]<=getarg(1); set [email protected],[email protected]+1) set [email protected]$, [email protected]$+" > "+((@QC1[[email protected]])?"^0055FF"+jobname(getvariableofnpc(.JobList[@QC1[[email protected]]],"CMSys")):"^777777no job")+"^000000 / build "+((@QC2[[email protected]])?"^0055FF"[email protected][[email protected]]:"^777777empty")+"^000000:"; set [email protected]$, [email protected]$+" > ^777777Back^000000"; break; case 2: for(set [email protected],1; [email protected]<getarg(1); set [email protected],[email protected]+1) { if (Class_Mastery & pow(2,[email protected])) set [email protected]$, [email protected]$+" > "+jobname(getvariableofnpc(.JobList[[email protected]],"CMSys")); set [email protected]$, [email protected]$+":"; } set [email protected]$, [email protected]$+" > ^777777Back^000000"; break; case 3: for(set [email protected],1; [email protected]<=getarg(1); set [email protected],[email protected]+1) set [email protected]$, [email protected]$+" > Slot "[email protected]+" ("+((getd("Build_"[email protected]+"n$")=="")?"^777777empty":"^0055FF"+getd("Build_"[email protected]+"n$"))+"^000000):"; if (getarg(2,0)) set [email protected]$, [email protected]$+" > No build:"; set [email protected]$, [email protected]$+" > ^777777Back^000000"; break; } return select([email protected]$); } function Save_Build { setarray [email protected]$[0],"a","b","c","d","e","f","g"; set [email protected]$,""; for(set [email protected],0; [email protected]<7; set [email protected],[email protected]+1) set [email protected]$,[email protected][email protected]$[[email protected]]+(([email protected]==6)?StatusPoint:readparam([email protected]+13))+"|"; setd "Build_"+getarg(0)+"$", [email protected]$; return; } function Load_Build { setarray [email protected]$[0],"0","1","2","3","4","5","6","7","8","9"; setarray [email protected]$[0],"a","b","c","d","e","f","g"; ResetStatus; for(set [email protected],13; [email protected]<20; set [email protected],[email protected]+1) { set [email protected]$,""; set [email protected]$,[email protected]$[[email protected]]; while(1) { for(set [email protected],0; [email protected]<10; set [email protected],[email protected]+1) { if (compare(getarg(0),[email protected][email protected]$[[email protected]])) { set [email protected]$,[email protected][email protected]$[[email protected]]; set [email protected]$,[email protected][email protected]$[[email protected]]; break; } } if (compare(getarg(0),[email protected]$+"|")) break; } if ([email protected]==19) set StatusPoint, atoi([email protected]$); else statusup2 [email protected], atoi([email protected]$)-1; } return; } } The script run smoothly. I can buy the manual from the NPC, buy job lists, switching my job, etc. The only problem is when my character is on 3rd job (and some expanded classes too, like expanded super novice), I can't trigger the "Class_Mastery" function when double clicking on the item manual. It just doing nothing. Like when we double clicking on unusable item, nothing happened. So which line should I change for the function to be working while we are on 3rd job?
  3. Hello. How exactly we apply this patch? Could you please give detailed steps on how to do it. I'm a total newbie to this topic, so please pardon me. EDIT: Figured it out. Thank you very much! EDIT2: The custom item's sprite strangely couldn't be loaded. I'm using the default script above. -- Load the original file. As you might have guessed you can also load your translated file here instead -- (just make sure the "tbl" array contains your item info) dofile("System/iteminfo.lub") -- Now as a simple example . I am simply going to change name of Red Potion to Crimson Potion. -- But you can add anything in the same way. Format is same as the original one, just -- the table name is different tbl_custom = { [501] = { unidentifiedDisplayName = "Crimson Potion", unidentifiedResourceName = "»¡°£Æ÷¼Ç", unidentifiedDescriptionName = { "A potion made from", "grinded Red Herbs that", "restores ^000088about 45 HP^000000.", "^ffffff_^000000", "Weight: ^7777777^000000" }, identifiedDisplayName = "Crimson Potion", identifiedResourceName = "»¡°£Æ÷¼Ç", identifiedDescriptionName = { "^000088HP Recovery Item^000000", "A potion made from", "grinded Red Herbs that", "restores ^000088about 45 HP^000000.", "^ffffff_^000000", "Weight: ^7777777^000000" }, slotCount = 0, ClassNum = 0 }, } -- Now for a helper function because i hate repetitions -- It adds items from curTable if it is not present in refTable function itemAdder(curTable, refTable) for ItemID,DESC in pairs(curTable) do if refTable == nil or refTable[ItemID] == nil then result, msg = AddItem(ItemID, DESC.unidentifiedDisplayName, DESC.unidentifiedResourceName, DESC.identifiedDisplayName, DESC.identifiedResourceName, DESC.slotCount, DESC.ClassNum) if not result then return false, msg end for k,v in pairs(DESC.unidentifiedDescriptionName) do result, msg = AddItemUnidentifiedDesc(ItemID, v) if not result then return false, msg end end for k,v in pairs(DESC.identifiedDescriptionName) do result, msg = AddItemIdentifiedDesc(ItemID, v) if not result then return false, msg end end end end return true, "good" end -- And the newly designed main function function main() result, msg = itemAdder(tbl_custom, nil) -- add custom items (including official overrides) if result then result, msg = itemAdder(tbl, tbl_custom) -- add non-overridden official items end return result, msg end My client version is 2015-11-04aRagexe.exe EDIT3: Solved. Turns out the script only read the data folder while ignoring GRF files. All of my sprites are in GRF files, that's why the error occured.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.