//===== eathena script ======================================= //= job changer and platinum skill function and npc //===== by: ================================================== //= legionaire of eathena //===== current version: ===================================== //= ver. 1.30 [ complete ] //===== compatible with: ===================================== //= probably most svn //===== description: ========================================= //= job changer with platinum skills function //===== additional comments: ================================= //= just read the notations next to the arrays and it //= should make sense. //============================================================ prontera.gat,153,193,4 script job mistress 831,{ setarray @rjc[0],45; // super novice job change level. setarray @rjc[1],10; // novice job level check. setarray @rjc[2],40; // first class job level check. setarray @rjc[3],50; // rebirth job level check. setarray @rjc[4],99; // rebirth base level check. setarray @rjc[5],0; // skip to transcent class: 0 - don't skip, 1 - skip to first class, 2 - skip to second class. setarray @rjc[6],1; // platinum skill check: 0 - don't get platinum skills, 1 - get platinum skills. setarray @rjc[7],1; // restrict job tree: 0 - no, 1 - yes. setarray @rjc[8],0; // enable gunslinger and ninja: 0 - no, 1 - yes. setarray @rjc[9],0; // rebirth reset: 0 - reset, 1 don't reset. setarray @rjc[10],0; // enable new platinum skills: 0 - no, 1 - yes. setarray @rjc[11],1; // enable skill point deletion: 0 - no, 1 - yes. setarray @rjc[12],1; // check for basic skills: 0 - no, 1 - yes. set @npc_name$, "[^ff0000job mistress^000000]"; //=== do not edit the following setarray @rjcf[0],0,0,0,0; if((class >= 4008 && class < 4022) || (class >=4030 && class <= 4045) || (class >= 4047 && class <=4049) || class == 24 || class == 25 || class == 23){ mes @npc_name$; mes "i am sorry, you can advance no further."; close; } if(@rjc[11] == 1){ mes @npc_name$; mes "take note, when changing classes, i will automatically set skill points to 0, so please be aware."; next; mes @npc_name$; mes "as such, you currently have:"; mes "[^ff0000"+skillpoint+"^000000] ^880000unused skill points^000000."; next; mes @npc_name$; mes "proceed?"; next; menu "yes",-, "no",l_leave; } if(@rjc[12] == 1 && getskilllv(1) < 9){ mes @npc_name$; mes "sorry, but you don't seem to have your basic skills. without those, i can not change your job.";
close; } if(((class > 4001 && class < 4008) && @rjc[7] == 1) || (class >= 4024 && class <= 4029)){ setarray @rjcf[0],@rjc[2]; if(joblevel < @rjcf[0]) goto l_lmissing; if(sjob <= 0) goto l_second; setarray @rjcf[3],4001+sjob; callfunc "jchanging"; }else if((class > 4001 && class < 4008) && @rjc[7] == 0){ goto l_second; } if(class == 0 || class == 4001 || class == 4023){ setarray @rjcf[0],@rjc[1]; if(joblevel < @rjcf[0]) goto l_lmissing; if(class == 4001 && fjob == 0) goto l_first; if(class == 4001 && @rjc[7] == 1){ setarray @rjcf[3],4001+fjob; callfunc "jchanging"; } l_first: if(class == 0 && @rjc[8] == 0)set @jmenu,select("swordman","mage","archer","acolyte","merchant","thief","taekwon","s uper novice"); if(class == 0 && @rjc[8] == 1)set @jmenu,select("swordman","mage","archer","acolyte","merchant","thief","taekwon","s uper novice","gunslinger","ninja"); if(class == 4023) set @jmenu,select("baby swordsman","baby mage","baby archer","baby acolyte","baby merchant","baby thief","baby super novice"); if(class == 4001 || @rjcf[4] == 1) set @jmenu,select("swordman high","mage high","archer high","acolyte high","merchant high","thief high"); mes @npc_name$; mes "do you wish to change your job?"; next; menu "yes",-, "no",l_leave; switch(@jmenu){ case 1: if(class == 0){ setarray @rjcf[3],1; }else if(class == 4001 || @rjcf[4] == 1){ setarray @rjcf[3],4002; }else if(class == 4023){ setarray @rjcf[3],4024; } callfunc "jchanging"; case 2: if(class == 0){ setarray @rjcf[3],2; }else if(class == 4001 || @rjcf[4] == 1){ setarray @rjcf[3],4003; }else if(class == 4023){ setarray @rjcf[3],4025; } callfunc "jchanging"; case 3: if(class == 0){ setarray @rjcf[3],3; }else if(class == 4001 || @rjcf[4] == 1){ setarray @rjcf[3],4004; }else if(class == 4023){ setarray @rjcf[3],4026; } callfunc "jchanging"; case 4: if(class == 0){ setarray @rjcf[3],4;}else if(class == 4001 || @rjcf[4] == 1){ setarray @rjcf[3],4005; }else if(class == 4023){ setarray @rjcf[3],4027; } callfunc "jchanging"; case 5: if(class == 0){ setarray @rjcf[3],5; }else if(class == 4001 || @rjcf[4] == 1){ setarray @rjcf[3],4006; }else if(class == 4023){ setarray @rjcf[3],4028; } callfunc "jchanging"; case 6: if(class == 0){ setarray @rjcf[3],6; }else if(class == 4001 || @rjcf[4]
== 1){ setarray @rjcf[3],4007; }else if(class == 4023){ setarray @rjcf[3],4029; } callfunc "jchanging"; case 7: if(class == 0){ setarray @rjcf[3],4046; }else if(class == 4023){ if(baselevel < @rjc[0]){ setarray @rjcf[1],@rjc[0]-baselevel; goto l_lmissing; } setarray @rjcf[3],4045; } callfunc "jchanging"; case 8: if(baselevel < @rjc[0]){ setarray @rjcf[1],@rjc[0]-baselevel; goto l_lmissing; }else if(class == 0){ setarray @rjcf[3],23; } callfunc "jchanging"; case 9: setarray @rjcf[3],24; callfunc "jchanging"; case 10: setarray @rjcf[3],25; callfunc "jchanging"; } } if((class >= 1) && (class <= 6) || (class == 4046)){ set @rjcf[0],@rjc[2]; if(joblevel < @rjc[2]) goto l_lmissing; if(class == 4046){ set @jmenu,select("star gladiator","soul linker"); switch(@jmenu){ case 1: setarray @rjcf[3],4047; callfunc "jchanging"; case 2: setarray @rjcf[3],4049; callfunc "jchanging"; } } l_second: if(class == 1 || class == 4002 || class == 4024){ if(class < 4001){ set @jmenu,select("knight","crusader"); }else if(class == 4002){ set @jmenu,select("lord knight","paladin"); }else if(class == 4024){ set @jmenu,select("baby knight","baby crusader"); } switch(@jmenu){ case 1: setarray @rjcf[3],7; if(class == 4002){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4024){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; case 2: setarray @rjcf[3],14; if(class == 4002){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4024){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; } } if(class == 2 || class == 4003 || class == 4025){ if(class < 4001){ set @jmenu,select("wizard","sage"); }else if(class == 4003){ set @jmenu,select("high wizard","professor"); }else if(class == 4025){ set @jmenu,select("baby wizard","baby sage"); } switch(@jmenu){ case 1: setarray @rjcf[3],9;
if(class == 4003){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4025){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; case 2: setarray @rjcf[3],16; if(class == 4003){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4025){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; } } if(class == 3 || class == 4004 || class == 4026){ if(sex == 0 && class < 4001){ set @jmenu,select("hunter","dancer"); }else if(sex == 0 && class == 4004){ set @jmenu,select("sniper","gypsy"); }else if(sex == 1 && class < 4001){ set @jmenu,select("hunter","bard"); }else if(sex == 1 && class == 4004){ set @jmenu,select("sniper","clown"); }else if(sex == 0 && class == 4026){ set @jmenu,select("baby hunter","baby dancer"); }else if(sex == 1 && class == 4026){ set @jmenu,select("baby hunter","baby bard"); } switch(@jmenu){ case 1: setarray @rjcf[3],11; if(class == 4004){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4026){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; case 2: if(sex == 0){ setarray @rjcf[3],20; }else if(sex == 1){ setarray @rjcf[3],19; } if(class == 4004){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4026){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; } } if(class == 4 || class == 4005 || class == 4027){ if(class < 4001){ set @jmenu,select("priest","monk"); }else if(class == 4005){ set @jmenu,select("high priest","champion"); }else if(class == 4027){ set @jmenu,select("baby priest","baby monk"); } switch(@jmenu){ case 1: setarray @rjcf[3],8; if(class == 4005){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4027){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; case 2: setarray @rjcf[3],15; if(class == 4005){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4027){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; } } if(class == 5 || class == 4006 || class == 4028){ if(class < 4001){ set @jmenu,select("blacksmith","alchemist"); }else if(class == 4006){ set @jmenu,select("whitesmith","creator"); }else if(class == 4028){ set @jmenu,select("baby blacksmith","baby alchemist"); } switch(@jmenu){ case 1: setarray @rjcf[3],10; if(class == 4006){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4028){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging";
case 2: setarray @rjcf[3],18; if(class == 4006){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4028){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; } } if(class == 6 || class == 4007){ if(class < 4001){ set @jmenu,select("assassin","rogue"); }else if(class == 4007){ set @jmenu,select("assassin cross","stalker"); }else if(class == 4029){ set @jmenu,select("baby assassin","baby rogue"); } switch(@jmenu){ case 1: setarray @rjcf[3],12; if(class == 4007){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4029){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; case 2: setarray @rjcf[3],17; if(class == 4007){ setarray @rjcf[3],@rjcf[3]+4001; }else if(class == 4029){ setarray @rjcf[3],@rjcf[3]+4023; } callfunc "jchanging"; } } } if(class >= 7 && class <= 22){ setarray @rjcf[0],@rjc[3]; if(@rjc[4] > baselevel){ goto l_lmissing; }else if(@rjcf[0] > joblevel){ goto l_lmissing; } mes @npc_name$; mes "do you wish to proceed with the rebirth process now?"; next; menu "yes",-, "no",l_leave; if(@rjc[5] == 0){ setarray @rjcf[3],4001; setarray @rjcf[4],1; }else if(@rjc[5] == 1){ setarray @rjcf[4],1; if(@rjc[7] == 0) goto l_first; setarray @rjcf[3],4001+fjob; }else if(@rjc[5] == 2){ setarray @rjcf[4],1; if(@rjc[7] == 1) goto l_second; setarray @rjcf[3],4001+class; } callfunc "jchanging"; end; } l_lmissing: if(class >= 7 && class <= 21){ setarray @rjcf[1],@rjc[4]-baselevel; } else if(class >= 4001 && class <= 4022){ setarray @rjcf[1],0; } setarray @rjcf[2], @rjcf[0]-joblevel; if(@rjcf[1] < 0) setarray @rjcf[1],0; if(@rjcf[2] < 0) setarray @rjcf[2],0; mes @npc_name$; mes "you are short of the following levels to advance to the next class."; if(@rjcf[1]) mes "- ^ff0000"+@rjcf[1]+"^000000 base levels."; mes "- ^ff0000"+@rjcf[2]+"^000000 job levels."; next; mes @npc_name$; mes "come back when you have attained the required levels."; close; l_leave:
mes @npc_name$; mes "come again, when you wish."; close; } function
skill
skill skill
skill
script
platskills
{
if(baseclass == job_novice){ skill 142,1,0; skill 143,1,0; } if(baseclass == job_swordman){ skill 142,1,0; skill 144,1,0; skill 145,1,0; 146,1,0; } if(baseclass == job_mage){ skill 142,1,0; skill 157,1,0; } if(baseclass == job_archer){ skill 142,1,0; skill 148,1,0; skill 147,1,0; } if(baseclass == job_acolyte){ skill 142,1,0; skill 156,1,0; } if(baseclass == job_merchant){ skill 142,1,0; skill 154,1,0; skill 155,1,0; 153,1,0; } if(baseclass == job_thief){ skill 142,1,0; skill 150,1,0; skill 151,1,0; 152,1,0; skill 149,1,0; } if(@rjc[10] == 1){ if(baseclass == job_knight){ skill 1001,1,0; } if(baseclass == job_crusader){ skill 1002,1,0; } if(baseclass == job_assassin){ skill 1003,1,0; skill 1004,1,0; } if(baseclass == job_rogue){ skill 1005,1,0; } if(baseclass == job_wizard){ skill 1006,1,0; } if(baseclass == job_sage){ skill 1007,1,0; skill 1008,1,0; skill 1017,1,0; 1018,1,0; skill 1019,1,0; } if(baseclass == job_hunter){ skill 1009,1,0; } if(baseclass == job_bard){ skill 1010,1,0; } if(baseclass == job_dancer){ skill 1011,1,0; } if(baseclass == job_blacksmith){ skill 1012,1,0; skill 1013,1,0; } if(baseclass == job_priest){ skill 1014,1,0; } if(baseclass == job_monk){ skill 1015,1,0; skill 1016,1,0; } } mes @npc_name$; mes "platinum skill obtained."; close;
} function
script
jchanging
{
if(@rjcf[4] == 1 && (class >= 7 && class <= 21)){ if((checkcart() == 1) || (checkriding() == 1) || (checkfalcon() == 1)) atcommand strcharinfo(0)+":@option 0 0 0"; set sjob,class; jobchange @rjcf[3]; if(@rjc[9] == 0) resetlvl(1); if(@rjc[7] == 0){ set fjob,""; set sjob,""; } if(@rjc[6]) callfunc "platskills"; close; } if((class >= 1 && class <= 6) || (class >= 4002 && class <= 4007)){ mes @npc_name$; mes "do you wish to change your job?"; next; set @menu,select("yes","no"); switch(@menu){ case 1: goto l_jc; case 2: close;
}
} } l_jc: if(@rjc[11] == 1) set skillpoint,0; if((class >= 1 && class <= 6) && @rjc[7] == 1) set fjob,class; jobchange @rjcf[3]; if(class >= 4008){ set fjob,""; set sjob,""; } if(@rjc[6]) callfunc "platskills"; close;