Jump to content

n0tttt

Members
  • Posts

    303
  • Joined

  • Days Won

    12

Everything posted by n0tttt

  1. If you don't have a problem with the NPC moving anywhere and then other players unable to do the quest until the NPC arrives, then... if(.m$ == "") { getmapxy .m$,.x,.y,UNITTYPE_NPC; doevent strnpcinfo(0)+"::OnFollow"; } end; OnFollow: .@npc_id = getnpcid(0); .@time = 10*60/2; while(.@timer < .@time && playerattached()) { getmapxy .@m0$,.@x0,.@y0,UNITTYPE_PC; getmapxy .@m1$,.@x1,.@y1,UNITTYPE_NPC; .@dis = distance(.@x0,.@y0,.@x1,.@y1); getfreecell .@m0$,.@x1,.@y1,.@x0,.@y0,2,2,1|4; if(.@dis > 14 || .@m0$ != .@m1$) unitwarp .@npc_id,.@m0$,.@x1,.@y1; else npcwalkto .@x1,.@y1; .@timer++; sleep2 2000; } unitwarp .@npc_id,.m$,.x,.y; .m$ = ""; .x = .y = 0; end;
  2. Test changing: .@fromid = getarg(1); .@fromname$ = getarg(2); .@toid = getarg(3); .@toname$ = getarg(4); to: .@fromid = getarg(1); .@fromname$ = getarg(0); .@toid = getarg(3); .@toname$ = getarg(2);
  3. //===== rAthena Script ======================================= //= Euphy's WOE Controller //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.5 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= A controller for War of Emperium designed for //= simplicity and ease of use. //= Many concepts taken from ToastOfDoom's script, //= and "rewards" function originally by Goddameit. //===== Additional Comments: ================================= //= Be sure to disable the default agit controllers! //== npc\guild\agit_controller.txt //== npc\guild2\agit_start_se.txt //============================================================ // Information NPC //============================================================ prontera,149,193,4 script WOE Information 835,{ doevent "WOE_CONTROL::OnMenu"; end; OnAgitStart: while(agitcheck()) { specialeffect EF_BEGINSPELL6; sleep 425; } end; } // Script Core //============================================================ - script WOE_CONTROL -1,{ function Disp_Owner; function Add_Zero; OnInit: // ----------------------------------------------------------- // Configuration settings. // ----------------------------------------------------------- set .CastleWarp,0; // 1: Always enable all castle warps. | 0: Warp only to active castles. set .AutoKick,1; // Automatically kick players from inactive castles during WOE? (1:yes / 0:no) set .NoOwner,0; // Automatically kick players from unconquered castles outside of WOE? (1:yes / 0:no) set .ExitWarp,0; // Warp all players from castles when WOE ends? (1:yes / 0:no) set .GMAccess,99; // GM level required to access Session Manager. // ----------------------------------------------------------- // Reward options. // ----------------------------------------------------------- // [1] Enable rewards. // [2] Mail all rewards. // - If not set, players receive items in their inventory. // - Only ONE item can be sent via mail, plus Zeny. // - Note that offline players do NOT receive rewards. // [4] Only reward Guild Masters. // - If not set, all guild members are rewarded. // - If mailing is enabled (option 2), offline Guild Masters WILL receive rewards. // [8] Duplicate IP check. // - Members in a guild with the same IP address are not rewarded. // - If Guild Masters is enabled (option 4), this feature is not used. // ----------------------------------------------------------- // Combine values as needed (e.g. 1|8 = 1+8 = 9). set .Options, 1|8; // Rewards per castle. // -- when given directly: <itemID>,<amount>{,<itemID>,<amount>,...} // -- via mail (option 2): <itemID>,<amount>,<Zeny> setarray .Reward[0],45001,1; setarray .Reward_Leader[0], 45000, 1; // ----------------------------------------------------------- // Constants (leave this section alone). // ----------------------------------------------------------- setarray .Castles$[0], "prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05", "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05", "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05", "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05", "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05", "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05"; setarray .EndLabel$[0],"ar01","ar02","ar03","ar04","ar05","sc01","sc02","sc03","sc04","sc05"; setarray .Days$[0],"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"; setarray .Regions$[0],"Prontera","Payon","Geffen","Aldebaran","Arunafeltz","Schwaltzvalt"; setarray .Map$[0],"prt_gld","pay_gld","gef_fild13","alde_gld","aru_gld","sch_gld"; setarray .MapX[0],134,240,153,111,208,121,295,317,140,204,214,308,143,193,305,48, 95,142,239,264,158,83, 68,299,292,293,288, 97,137, 71; setarray .MapY[0], 65,128,137,240,240,233,116,293,160,266, 75,240,240,278, 87,83,249, 85,242, 90,272,47,155,345,107,100,252,196, 90,315; // ----------------------------------------------------------- set .Size, getarraysize($WOE_CONTROL); if (.AutoKick || .NoOwner) for(set .@i,0; .@i<30; set .@i,.@i+1) { setmapflag .Castles$[.@i], mf_loadevent; setd "."+.Castles$[.@i], .@i; } if (!agitcheck() && !agitcheck2()) sleep 4000; set .Init,1; OnMinute00: freeloop(1); if (agitcheck() || agitcheck2()) { for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) == $WOE_CONTROL[.@i+2]) { OnWOEEnd: announce "The War Of Emperium is over!",bc_all|bc_woe; AgitEnd; AgitEnd2; sleep 1000; for(set .@j,0; .@j<30; set .@j,.@j+1) { if (.Active[0]&(1<<.@j)) Disp_Owner(.Castles$[.@j],1); if (.ExitWarp) maprespawnguildid .Castles$[.@j],0,3; } if ((.Options&1) && .Active[0] && .ForceEnd != 2) callsub OnReward, .Active[0]; deletearray .Active[0],2; if (.ForceEnd) { set .ForceEnd,0; end; } break; } } if ((!agitcheck() && !agitcheck2()) || .Init) { if (!agitcheck() && !agitcheck2()) set .Init,0; for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) { deletearray .Active[0],2; set .Active[0], $WOE_CONTROL[.@i+3]; if (.Init) { AgitEnd; AgitEnd2; } else announce "The War Of Emperium has begun!",bc_all|bc_woe; sleep 1000; AgitStart; AgitStart2; for(set .@j,0; .@j<30; set .@j,.@j+1) { if (.Active[0]&(1<<.@j)) { if (!.Init) Disp_Owner(.Castles$[.@j],0); set .Active[1], .Active[1] | (1<<((.@j/5)+1)); } else { if (.@j<20) { donpcevent "Agit#"+.Castles$[.@j]+"::OnAgitEnd"; killmonster .Castles$[.@j], "Agit#"+.Castles$[.@j]+"::OnAgitBreak"; } else { donpcevent "Manager#"+.Castles$[.@j]+"::OnAgitEnd2"; killmonster .Castles$[.@j], "Steward#"+.EndLabel$[.@j-20]+"::OnStartArena"; } } } break; } } set .Init,0; end; function Disp_Owner { set .@o, getcastledata(getarg(0),1); if (.@o) announce "The ["+getcastlename(getarg(0))+"] castle "+((getarg(1))?"has been conquered":"is currently held")+" by the ["+getguildname(.@o)+"] guild.",bc_all|bc_woe; else announce "The ["+getcastlename(getarg(0))+"] castle is currently unoccupied.",bc_all|bc_woe; return; } function Add_Zero { return ((getarg(0)<10)?"0":"")+getarg(0)+(getarg(1,0)?".":":")+"00"; } OnReward: set .@sql$, ((.Options&4)?"position = 0":"online = 1"); if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21); freeloop(1); for(set .@i,0; .@i<30; set .@i,.@i+1) if (getarg(0)&(1<<.@i)) { set .@gid, getcastledata(.Castles$[.@i],1); if (!.@gid) continue; set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid); set .@leader_cid, getguildmasterid(.@gid); for(set .@j,0; .@j<.@size; set .@j,.@j+1) { if ((.Options&8) && !(.Options&4)) { set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a"); if (getd(".@ip_"+.@i+"_"+.@ip$)) continue; setd ".@ip_"+.@i+"_"+.@ip$,1; } if (.Options&2) { if (.@cid[.@j] == .@leader_cid) { .@reward_id = .Reward[0]; .@reward_amt = .Reward[1]; .@reward_zeny = .Reward[2]; } else { .@reward_id = .Reward_Leader[0]; .@reward_amt = .Reward_Leader[1]; .@reward_zeny = .Reward_Leader[2]; } query_sql("INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) VALUES ("+ "'no-reply',"+.@cid[.@j]+",'** Siege Reward: "+getcastlename(.Castles$[.@i])+" **',"+ "'Brave one,% % Congratulations!% Your guild has successfully occupied% territory in the War of Emperium on% "+.@str$+".% % % % % [ Your reward is attached. ]',"+ .@reward_id+","+.@reward_amt+",0,"+..@reward_zeny+",UNIX_TIMESTAMP(NOW()))"); if (!getd(".@str_"+.@cid[.@j]) && isloggedin(.@aid[.@j],.@cid[.@j])) { setd ".@str_"+.@cid[.@j],1; message rid2name(.@aid[.@j]),"You've got mail! Please re-login to update your mailing list."; } } else if (isloggedin(.@aid[.@j])) { deletearray .@reward; if (.@cid[.@j] == .@leader_cid) copyarray .@reward[0],.Reward_Leader[0],getarraysize(.Reward_Leader); else copyarray .@reward[0],.Reward[0],getarraysize(.Reward); .@size = getarraysize(.@reward); for(set .@k,0; .@k<.@size; set .@k,.@k+2) getitem .@reward[.@k], .@reward[.@k+1], .@aid[.@j]; message rid2name(.@aid[.@j]),"You have been rewarded for conquering "+getcastlename(.Castles$[.@i])+"."; } } } if (.Options&2) query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'"); return; OnPCLoadMapEvent: if (!compare(strcharinfo(3),"g_cas")) end; if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(3),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(3))))) { if (getcharid(2) && getcastledata(strcharinfo(3),1) == getcharid(2)) end; sleep2 1000; message strcharinfo(0), getcastlename(strcharinfo(3))+" is currently inactive."; sleep2 5000; if (compare(strcharinfo(3),"g_cas")) warp "SavePoint",0,0; } end; OnMenu: while(1) { mes "[WOE Information]"; if (agitcheck() || agitcheck2()) { if (.Active[0]) { for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) { set .@i, $WOE_CONTROL[.@i+2]; break; } mes "The War of Emperium is ^0055FFactive^000000 until ^FF0000"+Add_Zero(.@i)+"^000000 in the following regions:"; mes " "; for(set .@i,0; .@i<6; set .@i,.@i+1) if (.Active[1]&(1<<(.@i+1))) mes " > ^777777"+.Regions$[.@i]+"^000000"; } else mes "The War of Emperium is ^0055FFactive^000000."; } else { for(set .@i,0; .@i<.Size; set .@i,.@i+4) if ((gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) <= $WOE_CONTROL[.@i+1]) || gettime(DT_DAYOFWEEK) < $WOE_CONTROL[.@i]) { setarray .@time[0],$WOE_CONTROL[.@i],$WOE_CONTROL[.@i+1]; break; } if (!getarraysize(.@time)) setarray .@time[0],$WOE_CONTROL[0],$WOE_CONTROL[1]; mes "The War of Emperium is ^777777inactive^000000."; if (.Size) { mes " "; mes "The next session will begin"; mes "on ^0055FF"+.Days$[.@time[0]]+"^000000 at "+Add_Zero(.@time[1])+"^000000."; } } next; switch(select(""+((.CastleWarp || .Active[1])?" ~ Warp to castles...":"")+": ~ Check schedule...: ~ View castle owners...:"+((getgmlevel()<.GMAccess || !getgmlevel())?"":" ~ Manage sessions...")+": ~ ^777777Cancel^000000")) { case 1: if (.CastleWarp) set .@clr$,"^0055FF"; set .@menu$,""; for(set .@i,0; .@i<6; set .@i,.@i+1) { if (.CastleWarp || .Active[1]&(1<<(.@i+1))) set .@menu$, .@menu$+" ~ "+((.Active[1]&(1<<(.@i+1)))?.@clr$:"^777777")+.Regions$[.@i]+" Castles^000000"; set .@menu$, .@menu$+":"; } set .@i, select(.@menu$)-1; set .@menu$,""; for(set .@j,.@i*5; .@j<(.@i*5)+5; set .@j,.@j+1) { if (.CastleWarp || .Active[0]&(1<<.@j)) set .@menu$, .@menu$+" ~ "+((.Active[0]&(1<<.@j))?.@clr$:"^777777")+getcastlename(.Castles$[.@j])+"^000000"; set .@menu$, .@menu$+":"; } set .@j, select(.@menu$)-1; warp .Map$[.@i],.MapX[(.@i*5)+.@j],.MapY[(.@i*5)+.@j]; close; case 2: mes "[Schedule]"; if (.Size) { freeloop(1); for(set .@i,0; .@i<.Size; set .@i,.@i+4) { mes "> ^FF0000"+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1])+"-"+Add_Zero($WOE_CONTROL[.@i+2])+")^000000"; for(set .@j,0; .@j<30; set .@j,.@j+1) if ($WOE_CONTROL[.@i+3]&(1<<.@j)) mes " ~ "+getcastlename(.Castles$[.@j])+" ^777777("+.Castles$[.@j]+")^000000"; if (.@i+4 < .Size) mes " "; } freeloop(0); } else mes "No times are configured."; next; break; case 3: mes "[Castle Ownership]"; for(set .@i,0; .@i<6; set .@i,.@i+1) { set .@k, .@i*5; mes "> ^FF0000"+.Regions$[.@i]+"^000000"; for(set .@j,.@k; .@j<(.@k+5); set .@j,.@j+1) { set .@t, getcastledata(.Castles$[.@j],1); mes " ~ "+getcastlename(.Castles$[.@j])+": "+((.@t)?"^0055FF"+getguildname(.@t):"^777777unoccupied")+"^000000"; } if (.@i < 5) mes " "; } next; break; case 4: while(1) { mes "[Session Manager]"; mes "There are ^0055FF"+(.Size/4)+" session(s)^000000 configured."; mes "What would you like to do?"; next; switch(select(" ~ Add a session...: ~ Delete a session...: ~ Reload settings...:"+((agitcheck() || agitcheck2())?" ~ End WOE session...":"")+": ~ ^777777Go back^000000")) { case 1: mes "[New Session]"; if (.Size > 127) { mes "You have already reached the maximum of 32 sessions."; next; break; } mes "Select a day."; next; set .@Day, select(" ~ "+implode(.Days$,": ~ "))-1; mes "[New Session]"; mes "Select a start time for ^0055FF"+.Days$[.@Day]+"^000000."; next; set .@menu$,""; for(set .@i,0; .@i<23; set .@i,.@i+1) set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":"; set .@Start, select(.@menu$)-1; mes "[New Session]"; mes "Select an end time for ^0055FF"+.Days$[.@Day]+"^000000."; next; set .@menu$,""; for(set .@i,.@Start+1; .@i<24; set.@i,.@i+1) set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":"; set .@End, select(.@menu$)+.@Start; for(set .@i,0; .@i<.Size; set .@i,.@i+4) if (.@Day == $WOE_CONTROL[.@i] && ((.@Start >= $WOE_CONTROL[.@i+1] && .@Start < $WOE_CONTROL[.@i+2]) || (.@End > $WOE_CONTROL[.@i+1] && .@End <= $WOE_CONTROL[.@i+2]) || (.@Start <= $WOE_CONTROL[.@i+1] && .@End >= $WOE_CONTROL[.@i+2]))) { mes "[New Session]"; mes "The chosen times overlap with an existing session."; next; set .@d,1; break; } if (.@d) { set .@d,0; break; } set .@Castle,0; while(1) { mes "[New Session]"; mes "^0055FF"+.Days$[.@Day]+" ("+Add_Zero(.@Start)+"-"+Add_Zero(.@End)+")^000000"; mes " > Castles:"; if (!.@Castle) mes " ~ ^777777(none selected)^000000"; else for(set .@i,0; .@i<30; set .@i,.@i+1) if (.@Castle&(1<<.@i)) mes " ~ "+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")"; next; set .@menu$,((.@Castle)?" ~ ^FF0000Finished...^000000":"")+":"; for(set .@i,0; .@i<30; set .@i,.@i+1) set .@menu$, .@menu$+" ~ "+((.@Castle&(1<<.@i))?"^0055FF":"")+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")^000000:"; set .@i, select(.@menu$)-1; if (.@i) set .@Castle, .@Castle^(1<<(.@i-1)); else { mes "[New Session]"; mes "Are you sure?"; next; switch(select(" ~ ^0055FFAdd session...^000000: ~ Continue selecting castles...: ~ ^777777Cancel^000000")) { case 1: for(set .@i,0; .@i<.Size; set .@i,.@i+4) if ((.@Day == $WOE_CONTROL[.@i] && .@End <= $WOE_CONTROL[.@i+1]) || .@Day < $WOE_CONTROL[.@i]) { set .@d,1; break; } if (!.@d) { set .@d,1; set .@i,.Size; } copyarray $WOE_CONTROL[.@i+4], $WOE_CONTROL[.@i], .Size-.@i; setarray $WOE_CONTROL[.@i], .@Day, .@Start, .@End, .@Castle; set .Size, getarraysize($WOE_CONTROL); case 3: mes "[New Session]"; mes ((.@d)?"Session added.":"cancelled."); next; set .@d,1; case 2: break; } if (.@d) { set .@d,0; break; } } } break; case 2: mes "[Remove Session]"; if (!.Size) { mes "There are no sessions configured."; next; break; } mes "Select a session to remove."; next; set .@menu$,""; for(set .@i,0; .@i<.Size; set .@i,.@i+4) set .@menu$, .@menu$+" ~ "+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1],1)+"-"+Add_Zero($WOE_CONTROL[.@i+2],1)+"):"; set .@menu$, .@menu$+" ~ ^777777Cancel^000000"; set .@i, select(.@menu$)-1; if (.@i == (.Size/4)) break; mes "[Remove Session]"; mes "Delete ^0055FF"+.Days$[$WOE_CONTROL[.@i*4]]+"'s^000000 session?"; mes "This action cannot be undone."; next; set .@j, select(" ~ ^FF0000Delete session...^000000: ~ ^777777Cancel^000000"); mes "[Remove Session]"; if (.@j == 2) mes "cancelled."; else { deletearray $WOE_CONTROL[.@i*4],4; set .Size, getarraysize($WOE_CONTROL); mes "Session deleted."; } next; break; case 3: mes "[Reload Settings]"; mes "This will trigger all events related to new session configurations, if any."; if (agitcheck() || agitcheck2()) { mes " "; mes "Be aware that this will disrupt the current WOE session."; } next; set .@i, select(" ~ ^0055FFReload settings...^000000: ~ ^777777Cancel^000000"); mes "[Reload Settings]"; if (.@i == 2) mes "cancelled."; else { set .Init,1; donpcevent "WOE_CONTROL::OnMinute00"; mes "Variables have been re-initialized."; } next; break; case 4: mes "[Force Agit End]"; if (!agitcheck() && !agitcheck2()) { mes "WOE has already ended."; next; break; } mes "This command will safely execute all AgitEnd events."; mes " "; mes "Kill the current WOE session?"; next; set .@i, select(" ~ ^FF0000End session...^000000:"+((.Options&1)?" ~ ^FF0000End session without rewards...^000000":"")+": ~ ^777777Cancel^000000"); mes "[Force Agit End]"; if (.@i == 3) mes "cancelled."; else { set .ForceEnd, .@i; donpcevent "WOE_CONTROL::OnWOEEnd"; mes "WOE session terminated."; } next; break; case 5: set .@d,1; break; } if (.@d) { set .@d,0; break; } } break; case 5: close; } } } // Rewards per castle. // -- when given directly: <itemID>,<amount>{,<itemID>,<amount>,...} // -- via mail (option 2): <itemID>,<amount>,<Zeny> setarray .Reward[0],45001,1; setarray .Reward_Leader[0], 45000, 1;
  4. Might want to add agitcheck in there. Players could win points dueling.
  5. You could try creating a diff. Another option is to use Server Database Editor (http://www.mediafire.com/download/p0zhcc8ipa6cjt3). It has a feature to autogenerate clientside descriptions. You can test it yourself, it's pretty great.
  6. Didn't you you wanted that. prontera,150,150,4 script Stylist 4_F_NYDHOG,{ if(!(eaclass() & EAJ_SUMMONER)) { setarray .@max[1], getbattleflag("max_hair_style"), getbattleflag("max_hair_color"), ((!getlook(LOOK_BODY2))? getbattleflag("max_cloth_color") : .max[4]); } else { copyarray .@max[1],.max[1],3; } setarray .@min[1], 1, // Hair style 0 crashed my client last time I tested. 0, 0; setarray .@s[1], LOOK_HAIR, LOOK_HAIR_COLOR, LOOK_CLOTHES_COLOR; .@size = getarraysize(.blacklist$); .@n$ = "^3227cd[Stylist]^000000"; mes .@n$; mes "Hello "+strcharinfo(0)+"."; mes "Current hairstyle: ^00457f"+getlook(LOOK_HAIR)+"^000000."; mes "Current haircolor: ^215d90"+getlook(LOOK_HAIR_COLOR)+"^000000."; mes "Current clothcolor: ^4c9fe5"+getlook(LOOK_CLOTHES_COLOR)+"^000000."; mes "Do you want to change something?"; while(playerattached()) { next; .@sty = select("^911b1bExit.^000000","Hairstyle.","Haircolor.","Clothes color.") - 1; mes .@n$; if(!.@sty) { mes "Have a nice day."; close; } .@o = getlook(.@s[.@sty]); mes "Where do you want to start from?"; next; .@s = select("From the beggining.","From my current style.","Specific style.","Random style."); mes .@n$; if(.@s == 3) { mes "Input the number you'd like to start from."; mes "("+.@min[.@sty]+" - "+.@max[.@sty]+")"; mes "Your current style is: ^e83333"+.@o+"^000000."; input .@num; if(.@num > .@max[.@sty] || .@num < .@min[.@sty]) .@num = rand(.@min[.@sty],.@max[.@sty]); } else { .@num = ((.@s == 1)? .@min[.@sty] : ((.@s == 2)? .@o : ((.@s == 4)? rand(.@min[.@sty],.@max[.@sty]) : .@min[.@sty]))); } if(!.@opt) { stand; getmapxy .@m$,.@x,.@y,UNITTYPE_PC; unitwalk getcharid(3),.@x,.@y - 1; } mes "Great, we can start now."; next; do { mes .@n$; if(.@s[.@sty] == LOOK_CLOTHES_COLOR) { for(.@i = 0;.@i < .@size && !.@blacklist;.@i++) { if(compare(.blacklist$[.@i],"-")) { explode .@bl$,.blacklist$[.@i],"-"; .@min = atoi(.@bl$[0]); .@max = atoi(.@bl$[1]); if(.@num >= .@min && .@num <= .@max) { if(!.@revert) .@num = .@max + 1; else .@num = .@min - 1; } } else { if(.@num == atoi(.blacklist$[.@i])) .@num+= pow(-1,.@revert); } } } mes "Style n°^e83333"+.@num+"^000000."; setlook .@s[.@sty],.@num; if(!.@random) { .@sty_1$ = ((.@revert)? "Previous [^e83c00"+((.@num - 1 < .@min[.@sty])? .@max[.@sty] : .@num - 1)+"^000000]" : "Next [^e83c00"+((.@num + 1 > .@max[.@sty])? .@min[.@sty] : .@num + 1) +"^000000]"); .@sty_2$ = ((.@revert)? "Next [^e83c00"+((.@num + 1 > .@max[.@sty])?.@min[.@sty] : .@num + 1)+"^000000]" : "Previous [^e83c00"+((.@num - 1 < .@min[.@sty])? .@max[.@sty] : .@num - 1) +"^000000]"); .@opt = select(.@sty_1$,.@sty_2$,"^911b1bI want this one.^000000","Jump to a number ("+.@min[.@sty]+"-"+.@max[.@sty]+").","Jump to a random number.","Revert changes.","^614c9cRandom mode^000000 [^e81600off^000000]"); if(.@opt + .@revert == 2) .@num--; else if(.@opt + .@revert == 1) .@num++; if(.@num < .@min[.@sty]) .@num = .@max[.@sty]; else if(.@num > .@max[.@sty]) .@num = .@min[.@sty]; if(.@opt == 2) .@revert = !.@revert; } else { .@opt = select("Next.","^911b1bI want this one.^000000","Jump to a number ("+.@min[.@sty]+"-"+.@max[.@sty]+").","Revert changes.","^614c9cRandom mode^000000 [^50bf19on^000000]"); if(.@opt > 2) .@opt++; if(.@opt > 4) .@opt++; } if(.@opt == 4) { input .@num; if(.@num > .@max[.@sty] || .@num < .@min[.@sty]) .@num = rand(.@min[.@sty],.@max[.@sty]); } else if(.@opt == 5 || (.@random && .@opt == 1)) { .@num = rand(.@min[.@sty],.@max[.@sty]); } else if(.@opt == 6) { .@num = .@o; } else if(.@opt == 7) { .@random = !.@random; } clear; } while(.@opt != (3 - .@random)); next; mes .@n$; mes "Do you want to change something else?"; .@num = 0; .@revert = false; .@random = false; } OnInit: //==============Settings:=============================================== setarray .max[1], 6, // Max summoner hairstyle. 10, // Max summoner hair color. 10, // Max summoner clothes color. 553; // Alternative outfist clothes color. setarray .blacklist$[0],"30-200","999"; // Blacklist for cloth color. //====================================================================== }
  7. Put it in codebox, not quote. And you can show a screenshot if there's an error. Anyways, I have an old stylist and added your change. Tell me how it goes: prontera,150,150,4 script Stylist 4_F_NYDHOG,{ if(!(eaclass() & EAJ_SUMMONER)) { setarray .@max[1], getbattleflag("max_hair_style"), getbattleflag("max_hair_color"), ((!getlook(LOOK_BODY2))? getbattleflag("max_cloth_color") : .max[4]); } else { copyarray .@max[1],.max[1],3; } setarray .@min[1], 1, // Hair style 0 crashed my client last time I tested. 0, 0; setarray .@s[1], LOOK_HAIR, LOOK_HAIR_COLOR, LOOK_CLOTHES_COLOR; .@size = getarraysize(.blacklist$); .@n$ = "^3227cd[Stylist]^000000"; mes .@n$; mes "Hello "+strcharinfo(0)+"."; mes "Current hairstyle: ^00457f"+getlook(LOOK_HAIR)+"^000000."; mes "Current haircolor: ^215d90"+getlook(LOOK_HAIR_COLOR)+"^000000."; mes "Current clothcolor: ^4c9fe5"+getlook(LOOK_CLOTHES_COLOR)+"^000000."; mes "Do you want to change something?"; while(playerattached()) { next; .@sty = select("^911b1bExit.^000000","Hairstyle.","Haircolor.","Clothes color.") - 1; mes .@n$; if(!.@sty) { mes "Have a nice day."; close; } .@o = getlook(.@s[.@sty]); mes "Where do you want to start from?"; next; .@s = select("From the beggining.","From my current style.","Specific style.","Random style."); mes .@n$; if(.@s == 3) { mes "Input the number you'd like to start from."; mes "("+.@min[.@sty]+" - "+.@max[.@sty]+")"; mes "Your current style is: ^e83333"+.@o+"^000000."; input .@num; if(.@num > .@max[.@sty] || .@num < .@min[.@sty]) .@num = rand(.@min[.@sty],.@max[.@sty]); } else { .@num = ((.@s == 1)? .@min[.@sty] : ((.@s == 2)? .@o : ((.@s == 4)? rand(.@min[.@sty],.@max[.@sty]) : .@min[.@sty]))); } if(!.@opt) { stand; getmapxy .@m$,.@x,.@y,UNITTYPE_PC; unitwalk getcharid(3),.@x,.@y - 1; } mes "Great, we can start now."; next; do { mes .@n$; mes "Style n°^e83333"+.@num+"^000000."; .@blacklist = false; if(.@s[.@sty] == LOOK_CLOTHES_COLOR) { for(.@i = 0;.@i < .@size && !.@blacklist;.@i++) { if(compare(.blacklist$[.@i],"-")) { explode .@bl$,.blacklist$[.@i],"-"; .@min = atoi(.@bl$[0]); .@max = atoi(.@bl$[1]); if(.@num >= .@min && .@num <= .@max) .@blacklist = true; } else { if(.@num == atoi(.blacklist$[.@i])) .@blacklist = true; } } } if(.@blacklist) mes "^e20404Blacklisted^000000"; else setlook .@s[.@sty],.@num; if(!.@random) { .@sty_1$ = ((.@revert)? "Previous [^e83c00"+((.@num - 1 < .@min[.@sty])? .@max[.@sty] : .@num - 1)+"^000000]" : "Next [^e83c00"+((.@num + 1 > .@max[.@sty])? .@min[.@sty] : .@num + 1) +"^000000]"); .@sty_2$ = ((.@revert)? "Next [^e83c00"+((.@num + 1 > .@max[.@sty])?.@min[.@sty] : .@num + 1)+"^000000]" : "Previous [^e83c00"+((.@num - 1 < .@min[.@sty])? .@max[.@sty] : .@num - 1) +"^000000]"); .@opt = select(.@sty_1$,.@sty_2$,"^911b1bI want this one.^000000","Jump to a number ("+.@min[.@sty]+"-"+.@max[.@sty]+").","Jump to a random number.","Revert changes.","^614c9cRandom mode^000000 [^e81600off^000000]"); if(.@opt + .@revert == 2) .@num--; else if(.@opt + .@revert == 1) .@num++; if(.@num < .@min[.@sty]) .@num = .@max[.@sty]; else if(.@num > .@max[.@sty]) .@num = .@min[.@sty]; if(.@opt == 2) .@revert = !.@revert; } else { .@opt = select("Next.","^911b1bI want this one.^000000","Jump to a number ("+.@min[.@sty]+"-"+.@max[.@sty]+").","Revert changes.","^614c9cRandom mode^000000 [^50bf19on^000000]"); if(.@opt > 2) .@opt++; if(.@opt > 4) .@opt++; } if(.@opt == 4) { input .@num; if(.@num > .@max[.@sty] || .@num < .@min[.@sty]) .@num = rand(.@min[.@sty],.@max[.@sty]); } else if(.@opt == 5 || (.@random && .@opt == 1)) { .@num = rand(.@min[.@sty],.@max[.@sty]); } else if(.@opt == 6) { .@num = .@o; } else if(.@opt == 7) { .@random = !.@random; } clear; } while(.@opt != (3 - .@random)); next; mes .@n$; mes "Do you want to change something else?"; .@num = 0; .@revert = false; .@random = false; } OnInit: //==============Settings:=============================================== setarray .max[1], 6, // Max summoner hairstyle. 10, // Max summoner hair color. 10, // Max summoner clothes color. 553; // Alternative outfist clothes color. setarray .blacklist$[0],"30-200","999"; // Blacklist for cloth color. //====================================================================== } You can add ranges in the blacklist, like "500-2000" (I only added it for clothes color), and single values.
  8. Always the script command if it's avaiaible. It's cleaner this way. So I'd say homevolution.
  9. if(countstr("map1 map2 map3 map4",strcharinfo(3)) { ... }
  10. What do you mean with real? Adding overcharge? I have a script of this. .@over = getskilllv("MC_OVERCHARGE"); if(.@over > 0) .@plus = 5 + 2*.@over - .@over/10; for(.@i = 0;.@i < .@sell_size;.@i++) { .@total+= getiteminfo(.@sell_id[.@i],1)*countitem(.@sell_id[.@i]) * (100 + .@plus) / 100; delitem2 .@sell_id[.@i],countitem(.@sell_id[.@i]),true,0,0,0,0,0,0; } Maybe this can help?
  11. core1,156,123,3 script Freebies NPC 4_GEFFEN_10,{ soundeffect "freebies.wav",0; cutin "igu03",2; set .@n$, "[Freebies NPC]"; setarray .@rwd[0],22808,1,7037,200,13973,100,40105,1,4399,1,4302,1,4407,1,4419,1,4441,1,4128,1,4330,1,4047,2,4174,2,4302 ,1; // Rewards: <item id>,<item amount> query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$); if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0) { mes .@n$; mes "I'm sorry, the rewards are exclusively for new players."; close2; cutin "",255; end; } mes .@n$; mes "Welcome! Here are some free gifts"; mes "For newcomers:"; announce "Ragnarok : Please welcome [ "+strcharinfo(0)+" ] !!",0; for ( set .@size, getarraysize(.@rwd); .@i < .@size;set .@i, .@i + 2 ) mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]); close2; set #NewbieGift, 1; setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1; for ( set .@size, getarraysize(.@rwd); .@i < .@size;set .@i, .@i + 2 ) getitem .@rwd[.@i], .@rwd[.@i+1]; cutin "",255; save "prontera",156,161,2,2; warp "prontera",156,161; end; OnInit: waitingroom "Freebies v2",0; end; }
  12. Like this? for(.@size = getarraysize(.@array);.@i < .@size;.@i++) { .@count = countinarray(.@array[.@i],.@array[0]); if(.@count > 1) { .@val = .@array[.@i]; .@k = .@count - 1; do { .@j = inarray(.@array,.@val); if(.@j >= 0) deletearray .@array[.@j],1; } while(.@j != -1 && .@k--); .@size-= (.@count - 1); .@i-= (.@count - 1); } }
  13. Test this script by Stolao: https://raw.githubusercontent.com/Stolao/Npc_Release/master/Daily_Reward/DailyReward_v2.txt You can delete the "normal" rewards and change this message: message strcharinfo(0),"[Daily Rewards]: No more rewards remaining this month."; Or... you can have better rewards for VIP players. It's up to you.
  14. //===== rAthena Script ======================================= //= Stylist //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.1 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= Changes your hair style, hair color, and cloth color. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy] //============================================================ prontera,170,180,1 script Stylist#custom_stylist 122,{ setarray .@Styles[1], getbattleflag("max_cloth_color"), getbattleflag("max_hair_style"), getbattleflag("max_hair_color"); setarray .@Look[1], LOOK_CLOTHES_COLOR, LOOK_HAIR, LOOK_HAIR_COLOR; set .@s, select(" ~ Cloth color: ~ Hairstyle: ~ Hair color"); set .@Revert, getlook(.@Look[.@s]); set .@Style,1; while(1) { if ((.@Style < 30 || (.@Style > 200 && .@Style <= 500)) || .@Look[.@s] != LOOK_CLOTHES_COLOR) { message strcharinfo(0),"This is style #"+.@Style+"."; setlook .@Look[.@s], .@Style; } else message strcharinfo(0),"The style #"+.@Style+" is unavaiaible."; set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)"; switch(select(.@menu$)) { case 1: set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1); break; case 2: set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]); break; case 3: message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+"."; input .@Style,0,.@Styles[.@s]; if (!.@Style) set .@Style, rand(1,.@Styles[.@s]); break; case 4: set .@Style, .@Revert; setlook .@Look[.@s], .@Revert; break; } } }
  15. Try this. pc.cpp Change: /*========================================== * Append a card to an item ? *------------------------------------------*/ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) { int i; unsigned short nameid; nullpo_ret(sd); if( idx_equip < 0 || idx_equip >= MAX_INVENTORY || sd->inventory_data[idx_equip] == NULL ) return 0; //Invalid item index. if( idx_card < 0 || idx_card >= MAX_INVENTORY || sd->inventory_data[idx_card] == NULL ) return 0; //Invalid card index. if( sd->inventory.u.items_inventory[idx_equip].nameid <= 0 || sd->inventory.u.items_inventory[idx_equip].amount < 1 ) return 0; // target item missing if( sd->inventory.u.items_inventory[idx_card].nameid <= 0 || sd->inventory.u.items_inventory[idx_card].amount < 1 ) return 0; // target card missing if( sd->inventory_data[idx_equip]->type != IT_WEAPON && sd->inventory_data[idx_equip]->type != IT_ARMOR ) return 0; // only weapons and armor are allowed if( sd->inventory_data[idx_card]->type != IT_CARD ) return 0; // must be a card if( sd->inventory.u.items_inventory[idx_equip].identify == 0 ) return 0; // target must be identified if( itemdb_isspecial(sd->inventory.u.items_inventory[idx_equip].card[0]) ) return 0; // card slots reserved for other purposes if( (sd->inventory_data[idx_equip]->equip & sd->inventory_data[idx_card]->equip) == 0 ) return 0; // card cannot be compounded on this item type if( sd->inventory_data[idx_equip]->type == IT_WEAPON && sd->inventory_data[idx_card]->equip == EQP_SHIELD ) return 0; // attempted to place shield card on left-hand weapon. if( sd->inventory.u.items_inventory[idx_equip].equip != 0 ) return 0; // item must be unequipped ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->inventory.u.items_inventory[idx_equip].card[i] == 0 ); if( i == sd->inventory_data[idx_equip]->slot ) return 0; // no free slots // remember the card id to insert nameid = sd->inventory.u.items_inventory[idx_card].nameid; if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 ) {// failed clif_insert_card(sd,idx_equip,idx_card,1); } else {// success log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->inventory.u.items_inventory[idx_equip]); sd->inventory.u.items_inventory[idx_equip].card[i] = nameid; log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->inventory.u.items_inventory[idx_equip]); clif_insert_card(sd,idx_equip,idx_card,0); } return 0; } to: /*========================================== * Append a card to an item ? *------------------------------------------*/ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) { int i; unsigned short nameid; nullpo_ret(sd); if( idx_equip < 0 || idx_equip >= MAX_INVENTORY || sd->inventory_data[idx_equip] == NULL ) return 0; //Invalid item index. if( idx_card < 0 || idx_card >= MAX_INVENTORY || sd->inventory_data[idx_card] == NULL ) return 0; //Invalid card index. if( sd->inventory.u.items_inventory[idx_equip].nameid <= 0 || sd->inventory.u.items_inventory[idx_equip].amount < 1 ) return 0; // target item missing if( sd->inventory.u.items_inventory[idx_card].nameid <= 0 || sd->inventory.u.items_inventory[idx_card].amount < 1 ) return 0; // target card missing if( sd->inventory_data[idx_equip]->type != IT_WEAPON && sd->inventory_data[idx_equip]->type != IT_ARMOR ) return 0; // only weapons and armor are allowed if( sd->inventory_data[idx_card]->type != IT_CARD ) return 0; // must be a card if( sd->inventory.u.items_inventory[idx_equip].identify == 0 ) return 0; // target must be identified if( itemdb_isspecial(sd->inventory.u.items_inventory[idx_equip].card[0]) ) return 0; // card slots reserved for other purposes if( (sd->inventory_data[idx_equip]->equip & sd->inventory_data[idx_card]->equip) == 0 ) return 0; // card cannot be compounded on this item type if( sd->inventory_data[idx_equip]->type == IT_WEAPON && sd->inventory_data[idx_card]->equip == EQP_SHIELD ) return 0; // attempted to place shield card on left-hand weapon. if( sd->inventory.u.items_inventory[idx_equip].equip != 0 ) return 0; // item must be unequipped ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->inventory.u.items_inventory[idx_equip].card[i] == 0 ); if( i == sd->inventory_data[idx_equip]->slot ) return 0; // no free slots struct item_data* data; data = itemdb_search(item->nameid); if(data->stack.inventory) { int count; for(i = 0; i < sd->inventory_data[idx_equip]->slot; i++) { if(sd->inventory.u.items_inventory[idx_equip].card[i] == nameid) count++; } if(count >= data->stack.amount) { char output[255]; sprintf(output, "This card cannot be stacked %d times or more.", data->stack.amount); clif_messagecolor(&sd->bl, color_table[COLOR_RED], output, false, SELF); return 0; } } // remember the card id to insert nameid = sd->inventory.u.items_inventory[idx_card].nameid; if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 ) {// failed clif_insert_card(sd,idx_equip,idx_card,1); } else {// success log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->inventory.u.items_inventory[idx_equip]); sd->inventory.u.items_inventory[idx_equip].card[i] = nameid; log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->inventory.u.items_inventory[idx_equip]); clif_insert_card(sd,idx_equip,idx_card,0); } return 0; } And change: /*========================================== * Checking if we have enough place on inventory for new item * Make sure to take 30k as limit (for client I guess) * @param sd * @param nameid * @param amount * @return e_chkitem_result *------------------------------------------*/ char pc_checkadditem(struct map_session_data *sd, unsigned short nameid, int amount) { int i; struct item_data* data; nullpo_ret(sd); if(amount > MAX_AMOUNT) return CHKADDITEM_OVERAMOUNT; data = itemdb_search(nameid); if(!itemdb_isstackable2(data)) return CHKADDITEM_NEW; if( data->stack.inventory && amount > data->stack.amount ) return CHKADDITEM_OVERAMOUNT; for(i=0;i<MAX_INVENTORY;i++){ // FIXME: This does not consider the checked item's cards, thus could check a wrong slot for stackability. if(sd->inventory.u.items_inventory[i].nameid == nameid){ if( amount > MAX_AMOUNT - sd->inventory.u.items_inventory[i].amount || ( data->stack.inventory && amount > data->stack.amount - sd->inventory.u.items_inventory[i].amount ) ) return CHKADDITEM_OVERAMOUNT; return CHKADDITEM_EXIST; } } return CHKADDITEM_NEW; } to: /*========================================== * Checking if we have enough place on inventory for new item * Make sure to take 30k as limit (for client I guess) * @param sd * @param nameid * @param amount * @return e_chkitem_result *------------------------------------------*/ char pc_checkadditem(struct map_session_data *sd, unsigned short nameid, int amount) { int i; struct item_data* data; nullpo_ret(sd); if(amount > MAX_AMOUNT) return CHKADDITEM_OVERAMOUNT; data = itemdb_search(nameid); if(!itemdb_isstackable2(data)) return CHKADDITEM_NEW; if(itemdb_type(nameid) == IT_CARD) return CHKADDITEM_NEW; if( data->stack.inventory && amount > data->stack.amount ) return CHKADDITEM_OVERAMOUNT; for(i=0;i<MAX_INVENTORY;i++){ // FIXME: This does not consider the checked item's cards, thus could check a wrong slot for stackability. if(sd->inventory.u.items_inventory[i].nameid == nameid){ if( amount > MAX_AMOUNT - sd->inventory.u.items_inventory[i].amount || ( data->stack.inventory && amount > data->stack.amount - sd->inventory.u.items_inventory[i].amount ) ) return CHKADDITEM_OVERAMOUNT; return CHKADDITEM_EXIST; } } return CHKADDITEM_NEW; } Then you add the cards in item_stack.txt 4001,1,1 // Poring Card This way you can't insert the card more than X times. It's better than having a division or nullifying the effects since the player doesn't waste cards.
  16. I didn't understand very well. Could you try with one of these commands? Like sleep 2 * 60 * 60 * 1000; *sleep {<milliseconds>}; *sleep2 {<milliseconds>}; *awake "<NPC name>"; These commands are used to control the pause of a NPC. sleep and sleep2 will pause the script for the given amount of milliseconds. Awake is used to cancel a sleep. When awake is called on a NPC it will run as if the sleep timer ran out, and thus making the script continue. Sleep and sleep2 basically do the same, but the main difference is that sleep will not keep the rid, while sleep2 does. Also sleep2 will stop the script if there is no unit attached. Examples: sleep 10000; //pause the script for 10 seconds and ditch the RID (so no player is attached anymore) sleep2 5000; //pause the script for 5 seconds, and continue with the RID attached. awake "NPC"; //Cancels any running sleep timers on the NPC 'NPC'. *initnpctimer{ "<NPC name>" {, <Attach Flag>} } | { "<NPC name>" | <Attach Flag> }; *stopnpctimer{ "<NPC name>" {, <Detach Flag>} } | { "<NPC name>" | <Detach Flag> }; *startnpctimer{ "<NPC name>" {, <Attach Flag>} } | { "<NPC name>" | <Attach Flag> }; *setnpctimer <tick>{,"<NPC name>"}; *getnpctimer(<type of information>{,"<NPC name>"}) *attachnpctimer {"<character name>"}; *detachnpctimer {"<NPC name>"}; This set of commands and functions will create and manage an NPC-based timer. The NPC name may be omitted, in which case the calling NPC is used as target. Contrary to addtimer/deltimer commands which let you have many different timers referencing different labels in the same NPC, each with their own countdown, 'initnpctimer' can only have one per NPC object. But it can trigger many labels and let you know how many were triggered already and how many still remain. This timer is counting up from 0 in ticks of 1/1000ths of a second each. Upon creating this timer, the execution will not stop, but will happily continue onward. The timer will then invoke new execution threads at labels "OnTimer<time>:" in the NPC object it is attached to. To create the timer, use the 'initnpctimer', which will start it running. 'stopnpctimer' will pause the timer, without clearing the current tick, while 'startnpctimer' will let the paused timer continue. By default timers do not have a RID attached, which lets them continue even if the player that started them logs off. To attach a RID to a timer, you can either use the optional "attach flag" when using 'initnpctimer/startnpctimer', or do it manually by using 'attachnpctimer'. Likewise, the optional flag of stopnpctimer lets you detach any RID after stopping the timer, and by using 'detachnpctimer' you can detach a RID at any time. Normally there is only a single timer per NPC, but as an exception, as long as you attach a player to the timer, you can have multiple timers running at once, because these will get stored on the players instead of the NPC. NOTE: You need to attach the RID before the timer _before_ you start it to get a player-attached timer. Otherwise it'll stay a NPC timer (no effect). If the player that is attached to the npctimer logs out, the "OnTimerQuit:" event label of that NPC will be triggered, so you can do the appropriate cleanup (the player is still attached when this event is triggered). The 'setnpctimer' command will explicitly set the timer to a given tick. 'getnpctimer' provides timer information. Its parameter defines what type: 0 - Will return the current tick count of the timer. 1 - Will return 1 if there are remaining "OnTimer<ticks>:" labels in the specified NPC waiting for execution. 2 - Will return the number of times the timer has triggered and will trigger an "OnTimer<tick>:" label in the specified NPC. Example 1: <NPC Header> { // We need to use attachnpctimer because the mes command below needs RID attach attachnpctimer; initnpctimer; npctalk "I cant talk right now, give me 10 seconds"; end; OnTimer5000: npctalk "Ok 5 seconds more"; end; OnTimer6000: npctalk "4"; end; OnTimer7000: npctalk "3"; end; OnTimer8000: npctalk "2"; end; OnTimer9000: npctalk "1"; end; OnTimer10000: stopnpctimer; mes "[Man]"; mes "Ok we can talk now"; detachnpctimer; // and remember attachnpctimer and detachnpctimer can only use while the NPC timer is not running ! } Example 2: OnTimer15000: npctalk "Another 15 seconds have passed."; // You have to use 'initnpctimer' instead of 'setnpctimer 0'. // This is equal to 'setnpctimer 0' + 'startnpctimer'. // Alternatively, you can also insert another 'OnTimer15001' label so that the timer won't stop. */ initnpctimer; end; // This OnInit label will run when the script is loaded, so that the timer // is initialized immediately as the server starts. It is dropped back to 0 // every time the NPC says something, so it will cycle continuously. OnInit: initnpctimer; end; Example 3: mes "[Man]"; mes "I have been waiting " + (getnpctimer(0)/1000) + " seconds for you."; // We divide the timer returned by 1000 to convert milliseconds to seconds. close; Example 4: mes "[Man]"; mes "Ok, I will let you have 30 more seconds..."; close2; setnpctimer (getnpctimer(0)-30000); // Notice the 'close2'. If there were a 'next' there the timer would be // changed only after the player pressed the 'next' button. end; EDIT: And to the topic creator: Do you mean World Boss by Sehrentos spawned when that happens? And which monsters? Just random ones? You need to specify a little more.
  17. Okay, test this one. - script Extra_GearConf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Armor */ add_item(2301, 1, 111,10, 2303, 1, 111,25, 2305, 1, 111, 40, 2307, 1, 111, 65, 2311, 1, 111, 75, 2319, 1, 111,95, 2320, 1, 111,125); /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* Shield */ add_item(2101, 1, 111,30, 2103, 1, 111,45, 2105, 1, 111, 70); /* Robe */ add_item(2501, 1, 111,31, 2503, 1, 111,46, 2505, 1, 111, 71); /* Shoes */ add_item(2401, 1, 111,32, 2403, 1, 111,47, 2405, 1, 111, 72); /* Debug */ /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"ffffff", // % of evolution. "03fd20", // Wings evolving. "11f4cc"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], EQI_HAND_L, EQI_ARMOR, EQI_GARMENT, EQI_SHOES; //============================================= end; OnNPCKillEvent: if(@evolve_inuse) end; @evolve_inuse = true; .@size = getarraysize(.slots); while(.@slot < .@size) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1) { .@j = 0; .@has_item = false; while(.@j < .w2[.@i] && !.@has_item) { .@no_percent = false; .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@has_item = true; .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = getd("mobs_"+.@item_id) + 1; setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) .@no_percent = true; } else { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) .@no_percent = true; } if(!.@no_percent) { setd "mobs_"+.@item_id,0; setd "exp_"+.@item_id,0; specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto) { specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; if(!.@inventory) { getinventorylist; .@inventory = true; } .@k = inarray(@inventorylist_id,.@item_id); if(.@k != -1) { if(!@inventorylist_expire[.@k]) { setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k]; setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k]; setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k]; setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k]; .@bound = @inventorylist_bound[.@k]; } else { continue; } .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); if(getarraysize(.@val)){ delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; if(.@bound) getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par; else getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; } else { delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; if(.@bound) getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account; else getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; } equip .@evo_item; setd "evo_"+.@item_id,0; announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; } } } else if(.@item_id == .@item_evo) { .@has_item = true; } } } .@j++; } .@i++; } } @evolve_inuse = false; end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } }
  18. Annie put that one faster. Well, I put my version (not tested, again: I don't have a test server). This one supports random option and has a sell window (if it works, of course). I grabbed the getitemname2 function by AnnieRuru and F_RandOptDist by Stolao. Credits. //===== Hercules Script ===================================== //= [Function] getitemname2 //===== By: ================================================= //= AnnieRuru //===== Current Version: ==================================== //= 2.4 //===== Compatible With: ==================================== //= hercules 2015-11-27 //===== Description: ======================================== //= custom function to show item names just like in game //===== Topic: ============================================== //= http://herc.ws/board/topic/11275-getitemname2/ //===== Additional Comments: ================================ //= callfunc( "getitemname2", ItemID, Identify, Refine, Broken, Card1, Card2, Card3, Card4 {, Bound } ) //= it also creates a player array : @itemname2_info$ //= [0] = color //= ^000000 (black) = normal equipment/items //= ^999999 (gray) = unidentify equipment //= ^FF0000 (red) = broken equipment //= ^66CC00 (green) = enchanted equipment (1) //= ^0066CC (blue) = enchanted equipment (2) //= ^CC6600 (brown) = enchanted equipment (3) //= ^CC44CC (purple) = enchanted equipment (4) //= ^CCCC00 (yellow) = bounded equipment //= [1] = ID information //= Equipment = Char ID //= Pet egg = Pet ID //= [2] = return full item name if unidentified ( used in unidentified items only ) //= [3] = amount of star crumb used, return in number ( used in crafted item only ) //= [4] = weapon element, return in string ( used in crafted item only ) //= [5] = bound type, return in string //=========================================================== function script getitemname2 { freeloop true; deletearray @itemname2_info$; .@id = getarg(0); .@type = getiteminfo( .@id, 2 ); .@refine = getarg(2); .@card[0] = getarg(4); .@card[1] = getarg(5); .@card[2] = getarg(6); .@card[3] = getarg(7); .@bound = getarg(8,0); .@ref$ = ( .@refine )? "+"+ .@refine +" " : "" ; // I think no need refinement check for type 4 or 5, the source automatically convert refined etc items into no refinement .@slots$ = ( .@slot = getitemslots( .@id ) )? " ["+ .@slot +"]" : "" ; if ( .@bound ) { @itemname2_info$[0] = "^CCAA00"; // this condition always get overwritten ... if ( .@bound == 1 ) @itemname2_info$[5] = "Account"; else if ( .@bound == 2 ) @itemname2_info$[5] = "Guild"; else if ( .@bound == 3 ) @itemname2_info$[5] = "Party"; else if ( .@bound == 4 ) @itemname2_info$[5] = "Character"; } if ( .@type != IT_WEAPON && .@type != IT_ARMOR && .@card[0] != 254 ) { // non-equipable item that isn't signed .@pid = .@card[1] + ( ( .@card[1] >= 0 )? 0 : 1 << 16 ) + .@card[2] * ( 1 << 16 ); @itemname2_info$[1] = ( .@pid )? .@pid : ""; .@return$ = getitemname( .@id ); } else if ( ( .@type == IT_WEAPON || .@type == IT_ARMOR ) && !.@card[0] && !.@card[1] && !.@card[2] && !.@card[3] ) // equipment with no card, for reduce gotocount .@return$ = .@ref$ + getitemname( .@id ) + .@slots$; else if ( ( .@type == IT_WEAPON || .@type == IT_ARMOR ) && ( .@card[0] || .@card[1] || .@card[2] || .@card[3] ) && .@card[0] != 254 && .@card[0] != 255 ) { // equipment that has cards, but not a signed item .@string$ = "#"+ .@card[0] +"##"+ .@card[1] +"##"+ .@card[2] +"##"+ .@card[3] +"#"; .@i = 0; while ( .@i < 4 ) { if ( !compare( .@counted$, "#"+ .@card[.@i] +"#" ) ) { .@cnt[.@i] = countstr( .@string$, "#"+ .@card[.@i] +"#" ); .@counted$ = .@counted$ +"#"+ .@card[.@i] +"#"; } if ( getstrlen( $@cardprefix$[.@card[.@i]] ) && .@cnt[.@i] ) { if ( .@cnt[.@i] == 2 ) .@cnt$[.@i] = "Double"; else if ( .@cnt[.@i] == 3 ) .@cnt$[.@i] = "Triple"; else if ( .@cnt[.@i] == 4 ) .@cnt$[.@i] = "Quadruple"; if ( !compare( $@cardprefix$[.@card[.@i]], "of " ) ) .@prefix$ = .@prefix$ + .@cnt$[.@i] +( ( getstrlen(.@cnt$[.@i]) )? " ": "" )+ $@cardprefix$[.@card[.@i]] +" "; else .@postfix$ = .@postfix$ +" "+ $@cardprefix$[.@card[.@i]] +( ( getstrlen(.@cnt$[.@i]) )? " ": "" )+ .@cnt$[.@i]; } .@enchant = .@enchant + ( .@card[.@i] && .@i >= .@slot && ( .@card[.@i] /100 ) != 47 && ( .@card[.@i] /100 ) != 48 ); .@i++; } if ( .@enchant == 1 ) @itemname2_info$[0] = "^66CC00"; else if ( .@enchant == 2 ) @itemname2_info$[0] = "^0066CC"; else if ( .@enchant == 3 ) @itemname2_info$[0] = "^CC6600"; else if ( .@enchant == 4 ) @itemname2_info$[0] = "^CC44CC"; .@return$ = .@ref$ + .@prefix$ + getitemname( .@id ) + .@postfix$ + .@slots$; } else if ( .@card[0] == 254 || .@card[0] == 255 ) { // signed items .@cid = @itemname2_info$[1] = .@card[2] + ( ( .@card[2] >= 0 )? 0 : 1 << 16 ) + .@card[3] * ( 1 << 16 ); if ( !query_sql("select name from `char` where char_id = "+ .@cid, .@name$) ) .@name$ = "Unknown"; .@sc = .@card[1] / 10; if ( .@sc == 128 ) { .@sc$ = "Very Strong "; @itemname2_info$[3] = "1"; } else if ( .@sc == 256 ) { .@sc$ = "Very Very Strong "; @itemname2_info$[3] = "2"; } else if ( .@sc == 384 ) { .@sc$ = "Very Very Very Strong "; @itemname2_info$[3] = "3"; } .@ele = .@card[1] % 10; if ( .@ele == 1 ) .@ele$ = @itemname2_info$[4] = "Ice "; else if ( .@ele == 2 ) .@ele$ = @itemname2_info$[4] = "Earth "; else if ( .@ele == 3 ) .@ele$ = @itemname2_info$[4] = "Fire "; else if ( .@ele == 4 ) .@ele$ = @itemname2_info$[4] = "Wind "; .@return$ = .@ref$ + .@sc$ + .@name$ +"'s "+ .@ele$ + getitemname( .@id ); } // else if ( getarg(3) ) // broken equipment ... seems no longer show red // @itemname2_info$[0] = "^FF0000"; if ( !getstrlen( @itemname2_info$[0] ) ) @itemname2_info$[0] = "^000000"; return .@return$; } - script itemname2_prefix -1,{ OnInit: $@cardprefix$[4001] = "Lucky"; $@cardprefix$[4002] = "Vital"; $@cardprefix$[4003] = "Hard"; $@cardprefix$[4004] = "Dexterous"; $@cardprefix$[4005] = "Hallowed"; $@cardprefix$[4006] = "Lucky"; $@cardprefix$[4007] = "Beholder"; $@cardprefix$[4008] = "Extra"; $@cardprefix$[4009] = "Light"; $@cardprefix$[4010] = "Wise"; $@cardprefix$[4011] = "Dynamic"; $@cardprefix$[4012] = "Rigid"; $@cardprefix$[4013] = "Excellent"; $@cardprefix$[4014] = "of Champion"; $@cardprefix$[4015] = "Quick"; $@cardprefix$[4016] = "Speedy"; $@cardprefix$[4017] = "Stun"; $@cardprefix$[4018] = "Smart"; $@cardprefix$[4019] = "Martyr"; $@cardprefix$[4020] = "Blink"; $@cardprefix$[4021] = "Skillful"; $@cardprefix$[4022] = "of Spore"; $@cardprefix$[4023] = "of Desert"; $@cardprefix$[4024] = "Drowsy"; $@cardprefix$[4025] = "Keen"; $@cardprefix$[4026] = "Shrewd"; $@cardprefix$[4027] = "Athletic"; $@cardprefix$[4028] = "Double-forced"; $@cardprefix$[4029] = "Wolverine"; $@cardprefix$[4030] = "Windy"; $@cardprefix$[4031] = "of Ares"; $@cardprefix$[4032] = "of Athena"; $@cardprefix$[4033] = "Detoxication"; $@cardprefix$[4034] = "Clever"; $@cardprefix$[4035] = "Bloody"; $@cardprefix$[4036] = "Robust"; $@cardprefix$[4037] = "Untouchable"; $@cardprefix$[4038] = "of Health"; $@cardprefix$[4039] = "of Aristotle"; $@cardprefix$[4040] = "Teleport"; $@cardprefix$[4041] = "of Sandman"; $@cardprefix$[4042] = "of Heman"; $@cardprefix$[4043] = "Hurricane"; $@cardprefix$[4044] = "Hiding"; $@cardprefix$[4045] = "Heavy"; $@cardprefix$[4046] = "of Cleric"; $@cardprefix$[4047] = "Ghost"; $@cardprefix$[4048] = "Poison"; $@cardprefix$[4049] = "Flammable"; $@cardprefix$[4050] = "of Hermes"; $@cardprefix$[4051] = "of Flash"; $@cardprefix$[4052] = "Erudite"; $@cardprefix$[4053] = "Healing"; $@cardprefix$[4054] = "Holy"; $@cardprefix$[4055] = "Ice"; $@cardprefix$[4056] = "of Warmth"; $@cardprefix$[4057] = "Silence"; $@cardprefix$[4058] = "Cranial"; $@cardprefix$[4059] = "of Cadi"; $@cardprefix$[4060] = "Clamorous"; $@cardprefix$[4061] = "Immortal"; $@cardprefix$[4062] = "Envenom"; $@cardprefix$[4063] = "Insecticide"; $@cardprefix$[4064] = "Nimble"; $@cardprefix$[4065] = "Underneath"; $@cardprefix$[4066] = "Brutal"; $@cardprefix$[4067] = "Atomic"; $@cardprefix$[4068] = "Chemical"; $@cardprefix$[4069] = "Saharic"; $@cardprefix$[4070] = "of Witch"; $@cardprefix$[4071] = "Angelic"; $@cardprefix$[4072] = "Solid"; $@cardprefix$[4073] = "Discount"; $@cardprefix$[4074] = "of Gargantua"; $@cardprefix$[4075] = "Hypnotic"; $@cardprefix$[4076] = "Cursing"; $@cardprefix$[4077] = "Under a Cast"; $@cardprefix$[4078] = "of Recovery"; $@cardprefix$[4079] = "of Muscle"; $@cardprefix$[4080] = "Fisher"; $@cardprefix$[4081] = "Glorious"; $@cardprefix$[4082] = "Gigantic"; $@cardprefix$[4083] = "Homer's"; $@cardprefix$[4084] = "Blast"; $@cardprefix$[4085] = "Damned"; $@cardprefix$[4086] = "Critical"; $@cardprefix$[4087] = "Order"; $@cardprefix$[4088] = "Guard"; $@cardprefix$[4089] = "Aqua"; $@cardprefix$[4090] = "Amulet"; $@cardprefix$[4091] = "of Counter"; $@cardprefix$[4092] = "Boned"; $@cardprefix$[4093] = "Cure"; $@cardprefix$[4094] = "Kingbird"; $@cardprefix$[4095] = "Genie's"; $@cardprefix$[4096] = "Venomer's"; $@cardprefix$[4097] = "Green"; $@cardprefix$[4098] = "of Zephyrus"; $@cardprefix$[4099] = "of Ifrit"; $@cardprefix$[4100] = "Soul-Enchanted"; $@cardprefix$[4101] = "of Gnome"; $@cardprefix$[4102] = "Mocking"; $@cardprefix$[4103] = "Clairvoyant"; $@cardprefix$[4104] = "Chaos"; $@cardprefix$[4105] = "Unfrozen"; $@cardprefix$[4106] = "Ancient"; $@cardprefix$[4107] = "Fledged"; $@cardprefix$[4108] = "Innoxious"; $@cardprefix$[4109] = "Flameguard"; $@cardprefix$[4110] = "Viper's"; $@cardprefix$[4111] = "Decussate"; $@cardprefix$[4112] = "Peerless"; $@cardprefix$[4113] = "of Ghost"; $@cardprefix$[4114] = "Poisoning"; $@cardprefix$[4115] = "Malicious"; $@cardprefix$[4116] = "Divine"; $@cardprefix$[4117] = "Hybrid"; $@cardprefix$[4118] = "Dragoon"; $@cardprefix$[4119] = "Evil"; $@cardprefix$[4120] = "of Dragoon"; $@cardprefix$[4121] = "Perfect"; $@cardprefix$[4122] = "Adurate"; $@cardprefix$[4123] = "Bearer's"; $@cardprefix$[4124] = "Plasterer's"; $@cardprefix$[4125] = "Aqua"; $@cardprefix$[4126] = "Titan"; $@cardprefix$[4127] = "Insomniac"; $@cardprefix$[4128] = "of Deaf"; $@cardprefix$[4129] = "of Rogue"; $@cardprefix$[4130] = "Divine"; $@cardprefix$[4131] = "Hasty"; $@cardprefix$[4132] = "of Gemstone"; $@cardprefix$[4133] = "Immune"; $@cardprefix$[4134] = "Spiritual"; $@cardprefix$[4135] = "Mirror"; $@cardprefix$[4136] = "from Hell"; $@cardprefix$[4137] = "of Infinity"; $@cardprefix$[4138] = "Satanic"; $@cardprefix$[4139] = "of Moonlight"; $@cardprefix$[4140] = "Liberation"; $@cardprefix$[4141] = "Deadly"; $@cardprefix$[4142] = "of Berserk"; $@cardprefix$[4143] = "Neutral"; $@cardprefix$[4144] = "of Eternity"; $@cardprefix$[4145] = "of Bigmouth"; $@cardprefix$[4146] = "Reflect"; $@cardprefix$[4147] = "Scythe-like"; $@cardprefix$[4148] = "of Kirin"; $@cardprefix$[4149] = "of Serenity"; $@cardprefix$[4150] = "Spell-Proof"; $@cardprefix$[4151] = "Havoc Bringer's"; $@cardprefix$[4152] = "Sprightly"; $@cardprefix$[4153] = "of Cancer"; $@cardprefix$[4154] = "Sweet Scented"; $@cardprefix$[4155] = "Deadly Goblin's"; $@cardprefix$[4156] = "of Fatal Flame"; $@cardprefix$[4157] = "Piercing"; $@cardprefix$[4158] = "Slaughter"; $@cardprefix$[4159] = "Deluxe"; $@cardprefix$[4160] = "Superior"; $@cardprefix$[4161] = "Anti-Magic"; $@cardprefix$[4162] = "Sightless"; $@cardprefix$[4163] = "Wild"; $@cardprefix$[4164] = "Fisherman's"; $@cardprefix$[4165] = "of Insect Soul Eater"; $@cardprefix$[4166] = "of Jinx"; $@cardprefix$[4167] = "of Beast Soul Eater"; $@cardprefix$[4168] = "of Doom"; $@cardprefix$[4169] = "Spell Master's"; $@cardprefix$[4170] = "Solidifying"; $@cardprefix$[4171] = "Soul Draining"; $@cardprefix$[4172] = "Slicing"; $@cardprefix$[4173] = "Mesmerizing"; $@cardprefix$[4174] = "Deviant"; $@cardprefix$[4175] = "Shoving"; $@cardprefix$[4176] = "Fatal Serpentine"; $@cardprefix$[4177] = "Green Stone"; $@cardprefix$[4178] = "Bow-Master's"; $@cardprefix$[4179] = "of Highlight"; $@cardprefix$[4180] = "of Dragon Soul Eater"; $@cardprefix$[4181] = "Soundless"; $@cardprefix$[4182] = "of Demon Soul Eater"; $@cardprefix$[4183] = "Werewolf"; $@cardprefix$[4184] = "Crushing"; $@cardprefix$[4185] = "of Wisdom"; $@cardprefix$[4186] = "Strenuous"; $@cardprefix$[4187] = "of the Spooky Night"; $@cardprefix$[4188] = "Red Stone"; $@cardprefix$[4189] = "of Misfortune"; $@cardprefix$[4190] = "of Last Laugh"; $@cardprefix$[4191] = "of the Stix"; $@cardprefix$[4192] = "of Fatal Pisces"; $@cardprefix$[4193] = "of Patience"; $@cardprefix$[4194] = "Overpowering"; $@cardprefix$[4195] = "Blue Stone"; $@cardprefix$[4196] = "of Jellopy"; $@cardprefix$[4197] = "Lucky Streak"; $@cardprefix$[4198] = "of True Sight"; $@cardprefix$[4199] = "Dashing"; $@cardprefix$[4200] = "of Mystical Resistance"; $@cardprefix$[4201] = "Crippling"; $@cardprefix$[4202] = "of Exorcism"; $@cardprefix$[4203] = "Blazing"; $@cardprefix$[4204] = "Poacher's"; $@cardprefix$[4205] = "Blue Cubic"; $@cardprefix$[4206] = "Cubic"; $@cardprefix$[4207] = "Anti-Small"; $@cardprefix$[4208] = "Energetic"; $@cardprefix$[4209] = "Fiddler's"; $@cardprefix$[4210] = "Pressure"; $@cardprefix$[4211] = "Virtuoso's"; $@cardprefix$[4212] = "of Knock-Back"; $@cardprefix$[4213] = "of Reticence"; $@cardprefix$[4214] = "Man-Eater's"; $@cardprefix$[4215] = "Rationing"; $@cardprefix$[4216] = "Freezing"; $@cardprefix$[4217] = "Rejuvenating"; $@cardprefix$[4218] = "Nightmarish"; $@cardprefix$[4219] = "Magic Stone"; $@cardprefix$[4220] = "Faithful"; $@cardprefix$[4221] = "Insect Collector's"; $@cardprefix$[4222] = "of Sleep"; $@cardprefix$[4223] = "Stun-Proof"; $@cardprefix$[4224] = "Monsoon"; $@cardprefix$[4225] = "Slingshot"; $@cardprefix$[4226] = "Supreme"; $@cardprefix$[4227] = "Roast Scented"; $@cardprefix$[4228] = "of Siesta"; $@cardprefix$[4229] = "of Torment"; $@cardprefix$[4230] = "Coward's"; $@cardprefix$[4231] = "Charging"; $@cardprefix$[4232] = "Refreshing"; $@cardprefix$[4233] = "Lucky Fluke"; $@cardprefix$[4234] = "of Clarity"; $@cardprefix$[4235] = "Fallen Angel's"; $@cardprefix$[4236] = "Protective"; $@cardprefix$[4237] = "of Godly Wrath"; $@cardprefix$[4238] = "of Doubled Power"; $@cardprefix$[4239] = "Veteran Hunter's"; $@cardprefix$[4240] = "Magic-Proof"; $@cardprefix$[4241] = "Miraculous"; $@cardprefix$[4242] = "Prime"; $@cardprefix$[4243] = "of Escape"; $@cardprefix$[4244] = "Seeker's"; $@cardprefix$[4245] = "Assassinator's"; $@cardprefix$[4246] = "Killing"; $@cardprefix$[4247] = "Starfish's"; $@cardprefix$[4248] = "Shining Cross"; $@cardprefix$[4249] = "Witch Doctor's"; $@cardprefix$[4250] = "Anti-Large"; $@cardprefix$[4251] = "Invasion"; $@cardprefix$[4252] = "Four Leaf Clover"; $@cardprefix$[4253] = "of Royal Guard"; $@cardprefix$[4254] = "Anti-Medium"; $@cardprefix$[4255] = "Smashing"; $@cardprefix$[4256] = "Desirable"; $@cardprefix$[4257] = "Wing"; $@cardprefix$[4258] = "Prodigy"; $@cardprefix$[4259] = "of Nature"; $@cardprefix$[4260] = "Confusion Resistant"; $@cardprefix$[4261] = "Bleed Resistant"; $@cardprefix$[4262] = "Dark Sky"; $@cardprefix$[4263] = "Bloodlust"; $@cardprefix$[4264] = "Thunderbolt"; $@cardprefix$[4265] = "of Dawn"; $@cardprefix$[4266] = "Magic Resistant"; $@cardprefix$[4267] = "Dragon Slayer's"; $@cardprefix$[4268] = "Extending"; $@cardprefix$[4269] = "Fatasm"; $@cardprefix$[4270] = "of Venom"; $@cardprefix$[4271] = "Yellow Stone"; $@cardprefix$[4272] = "Swift"; $@cardprefix$[4273] = "Shell"; $@cardprefix$[4274] = "of Undead Soul Eater"; $@cardprefix$[4275] = "Undead Killer's"; $@cardprefix$[4276] = "Crucial"; $@cardprefix$[4277] = "Dominatrix"; $@cardprefix$[4278] = "of Magical Immunity"; $@cardprefix$[4279] = "Soul Collector's"; $@cardprefix$[4280] = "Blessed"; $@cardprefix$[4281] = "Diligent"; $@cardprefix$[4282] = "of Reservoir"; $@cardprefix$[4283] = "Mana Sphere"; $@cardprefix$[4284] = "of Caress"; $@cardprefix$[4285] = "Elven-Enchanted"; $@cardprefix$[4286] = "Terrorizing"; $@cardprefix$[4287] = "Magically Shielded"; $@cardprefix$[4288] = "Maestro"; $@cardprefix$[4289] = "of Plant Soul Eater"; $@cardprefix$[4290] = "Mirror"; $@cardprefix$[4291] = "Deadly Kobold's"; $@cardprefix$[4292] = "Deadly Plant's"; $@cardprefix$[4293] = "of Chance"; $@cardprefix$[4294] = "Sneaky"; $@cardprefix$[4295] = "of Blackout"; $@cardprefix$[4296] = "Greedy"; $@cardprefix$[4297] = "Poaching"; $@cardprefix$[4298] = "of Mayhem"; $@cardprefix$[4299] = "Guardian's"; $@cardprefix$[4300] = "Venomous Charge"; $@cardprefix$[4301] = "Traumatic"; $@cardprefix$[4302] = "High Risk"; $@cardprefix$[4303] = "Mystic"; $@cardprefix$[4304] = "Shield Master's"; $@cardprefix$[4305] = "Explosive"; $@cardprefix$[4306] = "King's"; $@cardprefix$[4307] = "of Marine Soul Eater"; $@cardprefix$[4308] = "Power Draining"; $@cardprefix$[4309] = "Reinforced"; $@cardprefix$[4310] = "Fatally Evil"; $@cardprefix$[4311] = "Anti-Evil"; $@cardprefix$[4312] = "of the Soul"; $@cardprefix$[4313] = "Bogie"; $@cardprefix$[4314] = "Fire-Proof"; $@cardprefix$[4315] = "of Stone Curse"; $@cardprefix$[4316] = "of Angel Soul Eater"; $@cardprefix$[4317] = "Aural"; $@cardprefix$[4318] = "Storm-Bringer's"; $@cardprefix$[4319] = "Sword-Master's"; $@cardprefix$[4320] = "Meteoric"; $@cardprefix$[4321] = "Polymorphic"; $@cardprefix$[4322] = "of Retaliation"; $@cardprefix$[4323] = "of Frost"; $@cardprefix$[4324] = "Arctic"; $@cardprefix$[4325] = "Vicious"; $@cardprefix$[4326] = "Ocean Scented"; $@cardprefix$[4327] = "Spell Flow"; $@cardprefix$[4328] = "Hyper"; $@cardprefix$[4329] = "Soul Gain"; $@cardprefix$[4330] = "Curse Lift"; $@cardprefix$[4331] = "Evasion"; $@cardprefix$[4332] = "of Talent"; $@cardprefix$[4333] = "of Chaotic Venom"; $@cardprefix$[4334] = "Anti-Sniping"; $@cardprefix$[4335] = "Gnome"; $@cardprefix$[4336] = "of Vitality"; $@cardprefix$[4337] = "of Wildcat"; $@cardprefix$[4338] = "of Vital Switching"; $@cardprefix$[4339] = "of Stone Wall"; $@cardprefix$[4340] = "of Requiem"; $@cardprefix$[4341] = "Disarm"; $@cardprefix$[4342] = "Mammoth"; $@cardprefix$[4343] = "of Creator"; $@cardprefix$[4344] = "of Value"; $@cardprefix$[4345] = "Sylph"; $@cardprefix$[4346] = "of Power Switching"; $@cardprefix$[4347] = "Stamina"; $@cardprefix$[4348] = "Gangster"; $@cardprefix$[4349] = "Anti-Arrow"; $@cardprefix$[4350] = "Undine"; $@cardprefix$[4351] = "Low Level"; $@cardprefix$[4352] = "of Regeneration"; $@cardprefix$[4353] = "of Rejuvenation"; $@cardprefix$[4354] = "of Stability"; $@cardprefix$[4355] = "Healthy"; $@cardprefix$[4356] = "Magic Cancel"; $@cardprefix$[4357] = "of Fury"; $@cardprefix$[4358] = "Lost-Power"; $@cardprefix$[4359] = "of Shadow"; $@cardprefix$[4360] = "Assassin"; $@cardprefix$[4361] = "of Hollgrehenn"; $@cardprefix$[4362] = "Heat"; $@cardprefix$[4363] = "Protection"; $@cardprefix$[4364] = "of Magic Sealing"; $@cardprefix$[4365] = "of Tempest"; $@cardprefix$[4366] = "of Caster"; $@cardprefix$[4367] = "of Squeezing"; $@cardprefix$[4368] = "Rapid"; $@cardprefix$[4369] = "of Luck Switching"; $@cardprefix$[4370] = "Weakening"; $@cardprefix$[4371] = "of Paladin"; $@cardprefix$[4372] = "Life Stream"; $@cardprefix$[4373] = "Cursed"; $@cardprefix$[4374] = "of Vision"; $@cardprefix$[4375] = "Extra High Level"; $@cardprefix$[4376] = "Manful"; $@cardprefix$[4377] = "Sweetie"; $@cardprefix$[4378] = "Low Level"; $@cardprefix$[4379] = "Low Level"; $@cardprefix$[4380] = "Salamander"; $@cardprefix$[4381] = "of Wanderer"; $@cardprefix$[4382] = "of Scholar"; $@cardprefix$[4383] = "Chaotic"; $@cardprefix$[4384] = "Magic Eater"; $@cardprefix$[4385] = "Drink"; $@cardprefix$[4386] = "of Magic Shelter"; $@cardprefix$[4387] = "of Agility Switching"; $@cardprefix$[4388] = "Soul"; $@cardprefix$[4389] = "Elemental"; $@cardprefix$[4390] = "Blooding"; $@cardprefix$[4391] = "Snack"; $@cardprefix$[4392] = "of Dexterity Switching"; $@cardprefix$[4393] = "of Intelligence Switching"; $@cardprefix$[4394] = "Divine Cross"; $@cardprefix$[4395] = "Slug"; $@cardprefix$[4396] = "Dull"; $@cardprefix$[4397] = "Stupidity"; $@cardprefix$[4398] = "Darkness"; $@cardprefix$[4399] = "Penetration"; $@cardprefix$[4400] = "of Temptation"; $@cardprefix$[4401] = "Swift"; $@cardprefix$[4402] = "Strange"; $@cardprefix$[4403] = "of Reload"; $@cardprefix$[4404] = "of Chaotic Bleeding"; $@cardprefix$[4405] = "of Magic Mirror"; $@cardprefix$[4406] = "Twinkle"; $@cardprefix$[4407] = "of Elimination"; $@cardprefix$[4408] = "Abyss"; $@cardprefix$[4409] = "Panic"; $@cardprefix$[4410] = "Madness"; $@cardprefix$[4411] = "Arta's"; $@cardprefix$[4412] = "Aria"; $@cardprefix$[4413] = "Resistance"; $@cardprefix$[4414] = "Gorgon's"; $@cardprefix$[4415] = "Sweet"; $@cardprefix$[4416] = "of Grain"; $@cardprefix$[4417] = "of Flow"; $@cardprefix$[4418] = "of Hail"; $@cardprefix$[4419] = "Jack Frost"; $@cardprefix$[4420] = "of Comfort"; $@cardprefix$[4421] = "of Chinook"; $@cardprefix$[4422] = "Breeze"; $@cardprefix$[4423] = "of Sharkia"; $@cardprefix$[4424] = "Stony"; $@cardprefix$[4425] = "Beast"; $@cardprefix$[4426] = "Exceeding"; $@cardprefix$[4427] = "of Force"; $@cardprefix$[4428] = "of Shaft"; $@cardprefix$[4429] = "Nessus's"; $@cardprefix$[4430] = "of Inferno"; $@cardprefix$[4431] = "Stygian"; $@cardprefix$[4432] = "Scorching"; $@cardprefix$[4433] = "of Ignis"; $@cardprefix$[4434] = "Miner's"; $@cardprefix$[4435] = "Outrageous"; $@cardprefix$[4436] = "Lunatic"; $@cardprefix$[4437] = "Rabid"; $@cardprefix$[4438] = "Mental"; $@cardprefix$[4439] = "of Anathema"; $@cardprefix$[4440] = "of Ignoring"; $@cardprefix$[4441] = "Arrogant"; $@cardprefix$[4442] = "of Basis"; $@cardprefix$[4443] = "of Underneath"; $@cardprefix$[4444] = "of Saharic"; $@cardprefix$[4445] = "of Windy"; $@cardprefix$[4447] = "of Envenom"; $@cardprefix$[4448] = "of Damned"; $@cardprefix$[4449] = "of Hallowed"; $@cardprefix$[4450] = "Surplus"; $@cardprefix$[4451] = "of Excess"; $@cardprefix$[4452] = "Magical"; $@cardprefix$[4453] = "Fierce"; $@cardprefix$[4454] = "Sorry"; $@cardprefix$[4455] = "Love"; $@cardprefix$[4457] = "Psychic"; $@cardprefix$[4458] = "of Illusion"; $@cardprefix$[4459] = "of Fast"; $@cardprefix$[4460] = "of Healing"; $@cardprefix$[4461] = "of Sharp"; $@cardprefix$[4462] = "Prime Defense"; $@cardprefix$[4463] = "Prime Attack"; $@cardprefix$[4464] = "Fatal"; $@cardprefix$[4465] = "Sweeping"; $@cardprefix$[4466] = "Straight Shooting"; $@cardprefix$[4467] = "Heavy"; $@cardprefix$[4468] = "Polution"; $@cardprefix$[4469] = "Marine"; $@cardprefix$[4470] = "Botany"; $@cardprefix$[4471] = "Draco"; $@cardprefix$[4472] = "Carnivore"; $@cardprefix$[4473] = "Undead"; $@cardprefix$[4474] = "Mortal"; $@cardprefix$[4475] = "Intangible"; $@cardprefix$[4476] = "Entomic"; $@cardprefix$[4477] = "Demonic"; $@cardprefix$[4480] = "Of Halfreload"; $@cardprefix$[4481] = "Half Jack Frost"; $@cardprefix$[4482] = "Of Half regeneration"; $@cardprefix$[4483] = "Half Spiritual"; $@cardprefix$[4484] = "Of Half Gemstone"; $@cardprefix$[4485] = "Half Abyss"; $@cardprefix$[4991] = "Carefree"; $@cardprefix$[4998] = "of Valor"; $@cardprefix$[4999] = "of Aegis"; $@cardprefix$[4505] = "of Mad Witch"; $@cardprefix$[4506] = "of Archer"; $@cardprefix$[4507] = "Scaraba"; $@cardprefix$[4508] = "of Mad Berserker"; $@cardprefix$[4509] = "Insectproof"; $@cardprefix$[4510] = "Black-out"; $@cardprefix$[4511] = "Silentium"; $@cardprefix$[4512] = "of Acolyte"; $@cardprefix$[4513] = "of Thief"; $@cardprefix$[4514] = "Exorcism"; $@cardprefix$[4515] = "Flora"; $@cardprefix$[4516] = "of Stone wall"; $@cardprefix$[4517] = "of Magician"; $@cardprefix$[4518] = "Burning"; $@cardprefix$[4519] = "Seraphim"; $@cardprefix$[4520] = "Screaming"; $@cardprefix$[4521] = "Mortal Blow"; $@cardprefix$[4522] = "Cold"; $@cardprefix$[4523] = "Aquarius"; $@cardprefix$[4524] = "of Swordman"; $@cardprefix$[4525] = "Sweeping"; $@cardprefix$[4526] = "of Magic Defense"; $@cardprefix$[4527] = "of Defense"; $@cardprefix$[4528] = "Spirit"; $@cardprefix$[4529] = "Physical"; $@cardprefix$[4530] = "of Merchant"; $@cardprefix$[4531] = "Under Curse"; $@cardprefix$[4532] = "Sprinting"; $@cardprefix$[4533] = "Blinding"; $@cardprefix$[4534] = "Water Bomb"; $@cardprefix$[4493] = "Half High Risk"; $@cardprefix$[4582] = "Endurance"; $@cardprefix$[4583] = "Of poisonous weeds"; $@cardprefix$[4584] = "Vampire"; $@cardprefix$[4585] = "Of Curse"; $@cardprefix$[4586] = "Wind"; $@cardprefix$[4587] = "Slasher"; $@cardprefix$[4588] = "Of Powerful"; $@cardprefix$[4589] = "Of Reach"; $@cardprefix$[4590] = "Of Lethargy"; $@cardprefix$[4591] = "Of Blood"; $@cardprefix$[4592] = "Of Chemical"; end; } //===== EinherjarRO Scripts ================================== //= F_RandOptDisp //===== By: ================================================== //= Stolao //===== Current Version: ===================================== //= 1.01 //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= //= Converts random option int values into human readable //===== Comments: ============================================ //= Optmize more? //===== Additional Comments: ================================= //= 1.00 Original Make //= 1.01 Added 'Blank' for 'missing' rndoptions client side //===== Contact Ifo: ========================================= //= [Stolao] //= Email: [email protected] //============================================================ function script F_RandOptDisp { // callfunc("F_RandOptDisp",id,value,paramater); setarray .@RNDOptions$[1],"Max Hp +"+getarg(1,0)+"","Max Sp +"+getarg(1,0)+"","Str +"+getarg(1,0)+"","Agi +"+getarg(1,0)+"","Vit +"+getarg(1,0)+"", "Int +"+getarg(1,0)+"","Dex +"+getarg(1,0)+"","Luk +"+getarg(1,0)+"","Max Hp +"+getarg(1,0)+"%","Max Sp +"+getarg(1,0)+"%", "Increases natural HP regeneration by "+getarg(1,0)+"%","Increases natural SP regeneration by "+getarg(1,0)+"%","ATK +"+getarg(1,0)+"%","MATK +"+getarg(1,0)+"%","ASPD +"+getarg(1,0)+"", "Increases attack speed (reduce delay after attack by "+getarg(1,0)+"%)","ATK +"+getarg(1,0)+"","HIT +"+getarg(1,0)+"","MATK +"+getarg(1,0)+"","DEF +"+getarg(1,0)+"", "MDEF +"+getarg(1,0)+"","FLEE +"+getarg(1,0)+"","Perfect dodge +"+getarg(1,0)+"","CRIT +"+getarg(1,0)+"","Resistance to Neutral "+getarg(1,0)+"%", "Resistance to Water "+getarg(1,0)+"%","Resistance to Earth "+getarg(1,0)+"%","Resistance to Fire "+getarg(1,0)+"%","Resistance to Wind "+getarg(1,0)+"%","Resistance to Poison "+getarg(1,0)+"%", "Resistance to Holy "+getarg(1,0)+"%","Resistance to Shadow "+getarg(1,0)+"%","Resistance to Ghost "+getarg(1,0)+"%","Resistance to Undead "+getarg(1,0)+"%","Resistance to all elements "+getarg(1,0)+"%", "Resistance to Neutral monster "+getarg(1,0)+"%","Physical damage to Neutral monsters "+getarg(1,0)+"%","Resistance to Water monsters "+getarg(1,0)+"%","Physical damage to Water monsters "+getarg(1,0)+"%","Resistance to Earth monsters "+getarg(1,0)+"%", "Physical damage to Earth monsters "+getarg(1,0)+"%","Resistance to Fire monsters "+getarg(1,0)+"%","Physical damage to Fire monsters "+getarg(1,0)+"%","Resistance to Wind monsters "+getarg(1,0)+"%","Physical damage to Wind monsters "+getarg(1,0)+"%", "Resistance to Poison monsters "+getarg(1,0)+"%","Physical damage to Poison monsters "+getarg(1,0)+"%","Resistance to Holy monsters "+getarg(1,0)+"%","Physical damage to Holy monsters "+getarg(1,0)+"%","Resistance to Shadow monsters "+getarg(1,0)+"%", "Physical damage to Shadow monsters "+getarg(1,0)+"%","Resistance to Ghost monsters "+getarg(1,0)+"%","Physical damage to Ghost monsters "+getarg(1,0)+"%","Resistance to Undead monsters "+getarg(1,0)+"%","Physical damage to Undead monsters "+getarg(1,0)+"%", "Magical recistance to Neutral monsters "+getarg(1,0)+"%","Magical damage to Neutral monsters "+getarg(1,0)+"%","Magical recistance to Water monsters "+getarg(1,0)+"%","Magical damage to Water monsters "+getarg(1,0)+"%","Magical recistance to Earth monsters "+getarg(1,0)+"%", "Magical damage to Earth monsters "+getarg(1,0)+"%","Magical recistance to Fire monsters "+getarg(1,0)+"%","Magical damage to Fire monsters "+getarg(1,0)+"%","Magical recistance to Wind monsters "+getarg(1,0)+"%","Magical damage to Wind monsters "+getarg(1,0)+"%", "Magical recistance to Poison monsters "+getarg(1,0)+"%","Magical damage to Poison monsters "+getarg(1,0)+"%","Magical recistance to Holy monsters "+getarg(1,0)+"%","Magical damage to Holy monsters "+getarg(1,0)+"%","Magical recistance to Shadow monsters "+getarg(1,0)+"%", "Magical damage to Shadow monsters "+getarg(1,0)+"%","Magical recistance to Ghost monsters "+getarg(1,0)+"%","Magical damage to Ghost monsters "+getarg(1,0)+"%","Magical recistance to Undead monsters "+getarg(1,0)+"%","Magical damage to Undead monsters "+getarg(1,0)+"%", "Enchants armor with Neutral property","Enchants armor with Water property","Enchants armor with Earth property","Enchants armor with Fire property","Enchants armor with Wind property", "Enchants armor with Poison property","Enchants armor with Holy property","Enchants armor with Shadow property","Enchants armor with Ghost property","Enchants armor with Undead property", "Blank", "Resistance to Formless monsters "+getarg(1,0)+"%","Resistance to Undead monsters "+getarg(1,0)+"%","Resistance to Brute monsters "+getarg(1,0)+"%","Resistance to Plant monsters "+getarg(1,0)+"%","Resistance to Insect monsters "+getarg(1,0)+"%", "Resistance to Fish monsters "+getarg(1,0)+"%","Resistance to Demon monsters "+getarg(1,0)+"%","Resistance to Demihuman monsters "+getarg(1,0)+"%","Resistance to Angel monsters "+getarg(1,0)+"%","Resistance to Dragon monsters "+getarg(1,0)+"%", "Physical damage to Formless monsters "+getarg(1,0)+"%","Physical damage to Undead monsters "+getarg(1,0)+"%","Physical damage to Brute monsters "+getarg(1,0)+"%","Physical damage to Plant monsters "+getarg(1,0)+"%","Physical damage to Insect monsters "+getarg(1,0)+"%", "Physical damage to Fish monsters "+getarg(1,0)+"%","Physical damage to Demon monsters "+getarg(1,0)+"%","Physical damage to Demihuman monsters "+getarg(1,0)+"%","Physical damage to Angel monsters "+getarg(1,0)+"%","Physical damage to Dragon monsters "+getarg(1,0)+"%", "Magical damage to Formless monsters "+getarg(1,0)+"%","Magical damage to Undead monsters "+getarg(1,0)+"%","Magical damage to Brute monsters "+getarg(1,0)+"%","Magical damage to Plant monsters "+getarg(1,0)+"%","Magical damage to Insect monsters "+getarg(1,0)+"%", "Magical damage to Fish monsters "+getarg(1,0)+"%","Magical damage to Devil monsters "+getarg(1,0)+"%","Magical damage to Demihuman monsters "+getarg(1,0)+"%","Magical damage to Angel monsters "+getarg(1,0)+"%","Magical damage to Dragon monsters "+getarg(1,0)+"%", "CRIT +"+getarg(1,0)+"/10 to Formless monsters","CRIT +"+getarg(1,0)+"/10 to Undead monsters","CRIT +"+getarg(1,0)+"/10 to Brute monsters","CRIT +"+getarg(1,0)+"/10 to Plant monsters","CRIT +"+getarg(1,0)+"/10 to Insect monsters", "CRIT +"+getarg(1,0)+"/10 to Fish monsters","CRIT +"+getarg(1,0)+"/10 to Demon monsters","CRIT +"+getarg(1,0)+"/10 to Demihuman monsters","CRIT +"+getarg(1,0)+"/10 to Angel monsters","CRIT +"+getarg(1,0)+"/10 to Dragon monsters", "Ignores "+getarg(1,0)+"% Def of Formless monster","Ignores "+getarg(1,0)+"% Def of Undead monster","Ignores "+getarg(1,0)+"% Def of Brute monster","Ignores "+getarg(1,0)+"% Def of Plant monster","Ignores "+getarg(1,0)+"% Def of Insect monster", "Ignores "+getarg(1,0)+"% Def of Fish monster","Ignores "+getarg(1,0)+"% Def of Demon monster","Ignores "+getarg(1,0)+"% Def of Demihuman monster","Ignores "+getarg(1,0)+"% Def of Angel monster","Ignores "+getarg(1,0)+"% Def of Dragon monster", "Ignores "+getarg(1,0)+"% Mdef of Formless monster","Ignores "+getarg(1,0)+"% Mdef of Undead monster","Ignores "+getarg(1,0)+"% Mdef of Brute monster","Ignores "+getarg(1,0)+"% Mdef of Plant monster","Ignores "+getarg(1,0)+"% Mdef of Insect monster", "Ignores "+getarg(1,0)+"% Mdef of Fish monster","Ignores "+getarg(1,0)+"% Mdef of Demon monster","Ignores "+getarg(1,0)+"% Mdef of Demihuman monster","Ignores "+getarg(1,0)+"% Mdef of Angel monster","Ignores "+getarg(1,0)+"% Mdef of Dragon monster", "Physical damage to Normal monsters "+getarg(1,0)+"%","Physical damage to Boss monsters "+getarg(1,0)+"%","Resistance to Normal monsters "+getarg(1,0)+"%","Resistance to Boss monsters "+getarg(1,0)+"%","Magical damage to Normal monsters "+getarg(1,0)+"%", "Magical damage to Boss monsters "+getarg(1,0)+"%","Ignores "+getarg(1,0)+"% Def of Normal monster","Ignores "+getarg(1,0)+"% Def of Boss monster","Ignores "+getarg(1,0)+"% Mdef of Normal monster","Ignores "+getarg(1,0)+"% Mdef of Boss monster", "Damage to Small size monsters "+getarg(1,0)+"%","Damage to Medium size monsters "+getarg(1,0)+"%","Damage to Large size monsters "+getarg(1,0)+"%","Resistance to Small size monsters "+getarg(1,0)+"%","Resistance to Medium size monsters "+getarg(1,0)+"%", "Resistance to Large size monsters "+getarg(1,0)+"%","Nullify weapon's damage size penalty","Increases critical damage by "+getarg(1,0)+"%","Decreases critical damage by "+getarg(1,0)+"%","Increases ranged physical damage "+getarg(1,0)+"%", "Decreases ranged physical damage "+getarg(1,0)+"%","Increases Healing skills by "+getarg(1,0)+"%","Increases Healing skills by "+getarg(1,0)+"%","Reduces cast time by "+getarg(1,0)+"%","Reduces cast delay by "+getarg(1,0)+"%", "Decreases SP consumption by "+getarg(1,0)+"%", "Blank","Blank", "Enchants weapon with Neutral property","Enchants weapon with Water property","Enchants weapon with Earth property","Enchants weapon with Fire property", "Enchants weapon with Wind property","Enchants weapon with Poison property","Enchants weapon with Holy property","Enchants weapon with Shadow property","Enchants weapon with Ghost property", "Enchants weapon with Undead property","Indestructible","Indestructible"; return .@RNDOptions$[getarg(0,0)]; } prontera,150,150,4 script Rolling in the Deep 100,{ if(!.status && getgmlevel() >= .gm_lvl) { mes "Do you want to start the raffle?"; if(select("No","Yes") == 2) { clear; mes "Sell me the items you want to give."; mes "Please don't put unidentified items."; close2; callshop "rolling_shop",2; end; } } else if(.status == 1) { if(.player_n < .players) { if(countitem(.coin_id) >= .fee) { .@i = inarray(.player_aid,getcharid(3)); if(.@i == -1) { mes "Do you want to join this game? Fee: "+.fee+" coins."; mes "Prize:"; .@size = getarraysize(.item_id); for(.@i = 0;.@i < .@size;.@i++) { .@has_option = false; mes @itemname2_info$ + getitemname2(.item_id[.@i],1,.item_ref[.@i],0,.item_card1[.@i],.item_card2[.@i],.item_card3[.@i],.item_card4[.@i]); for(.@j = 1;.@j <= 5;.@j++) { .@opt$ = F_RandOptDisp(getd(".item_opt"+.@j+"["+.@i+"]"),getd(".item_val"+.@j+"["+.@i+"]"),getd(".item_param"+.@j+"["+.@i+"]")); if(.@opt$ != "") { if(!.@has_option) { .@has_option = true; mes "^ff0000Item Options:^000000"; } mes .@opt$; } } } if(select("No","Yes") == 2) { if(countitem(.coin_id) >= .fee) { delitem .coin_id,.fee; .player_aid[++.player_n] = getcharid(3); .player_cid[.player_n - 1] = getcharid(0); .player_name$[.player_n - 1] = strcharinfo(0); if(.player_n >= .players) donpcevent strnpcinfo(0)+"::OnSpin"; } } } else { mes "You're already participating. Wait for the event to start."; } } else { mes "You need "+.fee+" coins to join this game."; } } else { mes "Everyone is registered."; } } else if(.status == 2) { mes "The game is spinning right now. Pay attention."; } else { mes "I'm sorry but this game isn't active right now."; } close; OnSellItem: disable_items; .@size = getarraysize(@sold_nameid); for(.@i = 0;.@i < .@size;.@i++) { if(!@sold_identify[.@i]) { deletearray @sold_nameid[.@i],1; deletearray @sold_quantity[.@i],1; deletearray @sold_refine[.@i],1; deletearray @sold_identify[.@i],1; for(.@j = 1;.@j <= 5;.@j++) { if(.@j < 5) deletearray getd("@sold_card"+.@j+"["+.@i+"]"),1; deletearray getd("@sold_opt"+.@j+"["+.@i+"]"),1; deletearray getd("@sold_val"+.@j+"["+.@i+"]"),1; deletearray getd("@sold_param"+.@j+"["+.@i+"]"),1; } .@size--; .@i--; } } if(.@size) { while(true) { clear; mes "What do you want to do?"; .@s = select("Set fee ("+max(1,.@option[0])+"z)","Set amount of players ("+max(5,.@option[1])+")","Ready") - 1; if(.@s < 2) { input .@option[.@s]; } else { mes "Do you want to continue or check if everything is correct?"; if(select("Check if everything is correct","Continue") == 2 && !.status) { .fee = max(1,.@option[0]); // default 1 fee. .players = max(5,.@option[1]); // default 5 players. .status = true; .player_aid[0] = getcharid(3); .o_player = getcharid(0); for(.@i = 0;.@i < .@size;.@i++) delitem @sold_nameid[.@i],@sold_quantity[.@i]; copyarray .item_id[0],@sold_nameid[0],.@size; copyarray .item_amt[0],@sold_quantity[0],.@size; copyarray .item_ref[0],@sold_refine[0],.@size; for(.@i = 1;.@i <= 5;.@i++) { if(.@i < 5) copyarray getd(".item_card"+.@i+"[0]"),getd("@sold_card"+.@i+"[0]"),.@size; copyarray getd(".item_opt"+.@i+"[0]"),getd("@sold_option_id"+.@i+"[0]"),.@size; copyarray getd(".item_val"+.@i+"[0]"),getd("@sold_option_id"+.@i+"[0]"),.@size; copyarray getd(".item_param"+.@i+"[0]"),getd("@sold_option_id"+.@i+"[0]"),.@size; } announce strcharinfo(0)+" is having a raffle for "+.fee+" coin per entry only "+.players+" people can join.",bc_all; if(.@size == 1) announce "The prize is "+@sold_quantity[0]+" "+getitemname2(@sold_nameid[0], @sold_identify[0], @sold_refine[0], @sold_attribute[0], @sold_card1[0], @sold_card2[0], @sold_card3[0], @sold_card4[0], @sold_bound[0])+".",bc_all; else announce "There're multiple prizes. Check them in the NPC!",bc_all; stopnpctimer; initnpctimer; break; } else if(.status) { mes "Sorry but someone started before you."; break; } } } } else { mes "You put no valid item."; } close; OnSpin: stopnpctimer; .status = 2; // We delete the player who started the event (we had him in the array to avoid joining him). deletearray .player_aid[0],1; .player_n--; while(.@rolls < 3) { mapannounce "prontera","Roll n°"+(.@rolls + 1)+".",bc_map; sleep 2000; specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2); sleep 2000; .@r = rand(.player_n--); if(.@rolls == 2) { mapannounce "prontera","And the winner is...",bc_map; sleep 2500; } mapannounce "prontera",.player_name$[.@r]+"...",bc_map; deletearray .player_aid[.@r],1; deletearray .player_cid[.@r],1; deletearray .player_name$[.@r],1; if(.@rolls < 2) sleep 5000; .@rolls++; } mail .player_cid[.@r],"Rolling in the Deep","Prize","Here's your prize from the game",0,.item_id,.item_amt,.item_card1,.item_card2,.item_card3,.item_card4,.item_opt1,.item_val1,.item_param1,.item_opt2,.item_val2,.item_param2,.item_opt3,.item_val3,.item_param3,.item_opt4,.item_val4,.item_param4,.item_opt5,.item_val5,.item_param5; setarray .@item_id[0],.coin_id; setarray .@item_amt[0],.players * .fee; mail .o_player,"Rolling in the Deep","Coins","Here's the coins",0,.@item_id,.@item_amt; // if 10 mins and nobody started the event. OnTimer600000: stopnpctimer; // we try to give the items back in this situation. if(!.@rolls) { if(isloggedin(.player_aid[0],.o_player)) mail .o_player,"Rolling in the Deep","Items back","No game was started and your items were given back",0,.item_id,.item_amt,.item_card1,.item_card2,.item_card3,.item_card4,.item_opt1,.item_val1,.item_param1,.item_opt2,.item_val2,.item_param2,.item_opt3,.item_val3,.item_param3,.item_opt4,.item_val4,.item_param4,.item_opt5,.item_val5,.item_param5; } .players_n = 0; .o_player = 0; deletearray .player_aid; deletearray .player_cid; deletearray .player_name$; deletearray .item_id; deletearray .item_amt; deletearray .item_ref; for(.@i = 1;.@i <= 5;.@i++) { if(.@i < 5) deletearray getd(".item_card"+.@i); deletearray getd(".item_opt"+.@i); deletearray getd(".item_val"+.@i); deletearray getd(".item_param"+.@i); } .fee = 0; .players = 0; .status = false; end; OnInit: .coin_id = 7539; // coin id. .gm_lvl = 0; npcshopattach "rolling_shop"; end; } - shop rolling_shop -1,512:-1 Edit: forgot to say you can add some checks if(!@sold_identify[.@i]) { to avoid "crap" items, like only an item with at least a card, or >= x refine, etc. Added a new config for that. Also tried to clean some things. Hope it works.
  19. I thought that wouldn't be a problem except when you're testing (most of the times the testings are with values as 1 or 2, so it's obviously the script will be triggering while evolving and such). Could it happen if you set it to something more realistic, like 50 or 100? I don't know. You can duplicate it, but I don't recommend it. You'll probably need to edit MAX_EVENT_QUEUE and I don't know if the labels are executed at the same time (pretty sure they don't?) so there'd be a queue anyways. You could test this though.
  20. I don't know if I undertstood well and I don't know if this will work (can't test) prontera,150,150,4 script Rolling in the Deep 100,{ if(!.status) { if(countitem(.item_id)) { disable_items; while(true) { clear; mes "What do you want to do?"; .@s = select("Set fee "+max(1,.@option[0])+"z","Set amount of players "+max(5,.@option[1]),"Ready") - 1; if(.@s < 2) { input .@option[.@s]; } else { mes "Do you want to continue or check if everything is correct?"; if(select("Check if everything is correct","Continue") == 2) { .fee = max(1,.@option[0]); // default 1 fee. .players = max(5,.@option[1]); // default 5 players. .status = true; .player_aid[0] = getcharid(3); .o_player = getcharid(0); delitem .item_id,1; break; } } } announce strcharinfo(0)+" is having a raffle for "+.fee+" coin per entry only "+.players+" people can join.",bc_all; stopnpctimer; initnpctimer; close; } else { mes "You need "+getitemname(.item_id)+" to talk to me."; } } else if(!.rolling) { if(.player_n < .players) { if(countitem(.coin_id) >= .fee) { .@i = inarray(.player_aid,getcharid(3)); if(.@i == -1) { mes "Do you want to join this game? Fee: "+.fee+" coins."; if(select("No","Yes") == 2) { if(countitem(.coin_id) >= .fee) { delitem .coin_id,.fee; .player_aid[++.player_n] = getcharid(3); .player_cid[.player_n - 1] = getcharid(0); if(.player_n >= .players) donpcevent strnpcinfo(0)+"::OnSpin"; } } } else { mes "You're already participating. Wait for the event to start."; } } else { mes "You need "+.fee+" coins to join this game."; } } else { mes "Everyone is registered."; } } else if(.rolling) { mes "The game is spinning right now. Pay attention."; } close; OnSpin: stopnpctimer; // We delete the player who started the event (we had him in the array to avoid joining him). deletearray .player_aid[0],1; .player_n--; while(.@rolls < 3) { mapannounce "prontera","Roll n°"+(.@rolls + 1)+".",bc_map; sleep 2000; specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2); sleep 2000; .@r = rand(.player_n--); if(.@rolls == 2) { mapannounce "prontera","And the winner is...",bc_map; sleep 2500; } mapannounce "prontera",rid2name(.player_aid[.@r])+"...",bc_map; deletearray .player_aid[.@r],1; if(.@rolls < 2) sleep 5000; .@rolls++; } mail .player_cid[.@r],"Rolling in the Deep","Prize","Here's your prize from the game",0,.prize_id,.prize_amt; setarray .@item_id[0],.coin_id; setarray .@item_amt[0],.players * .fee; mail .o_player,"Rolling in the Deep","Coins","Here's the coins",0,.@item_id,.@item_amt; // if 10 mins and nobody started the event. OnTimer600000: stopnpctimer; // we try to give the items back in this situation. if(!.@rolls) { if(isloggedin(.player_aid[0],.o_player)) getitem .item_id,1,.o_player; } .players_n = 0; .o_player = 0; deletearray .player_aid; deletearray .player_cid; .status = false; .rolling = false; end; OnInit: .item_id = 512; // item required to start. .coin_id = 7539; // coin id. // Prizes for the winner setarray .prize_id[0],513; setarray .prize_amt[0],5; end; }
  21. n0tttt

    Points SHOP

    Shop (Euphy's one which comes with rAthena) //===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6c //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.2 Added category support. //= 1.3 More options and fixes. //= 1.4 Added debug settings. //= 1.5 Replaced categories with shop IDs. //= 1.6 Added support for purchasing stackables. //= 1.6a Added support for previewing costumes and robes. //= 1.6b Added 'disable_items' command. //= 1.6c Replaced function 'A_An' with "F_InsertArticle". //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; // ADD YOUR NPC HERE //============================================================ prontera,164,203,6 script Quest Shop#1 998,{ callfunc "qshop"; } // prontera,165,203,6 script Quest Shop#2 998,{ callfunc "qshop",1,2; } // call the shop 1 and 2 defined below // etc.. Add your Shop NPCs 'Quest Shop#XXX' here //============================================================ // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!! //============================================================ - script quest_shop -1,{ function Add; function Chk; function Slot; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0], "#pvp_points", "PvP Points"; //===================================================================================== // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE -------------- //===================================================================================== // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1], "Headgears", // Shop Named 1 "Weapons", // Shop Named 2 "Other"; // Shop Named 3 // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- // Shop 1 Add(1,5022,1,0,10,7086,1,969,10,999,40,1003,50,984,2); Add(1,5032,1,0,20,1059,250,2221,1,2227,1,7063,600); Add(1,5027,1,0,30,2252,1,1036,400,7001,50,4052,1); Add(1,5045,1,0,40,2252,1,1054,450,943,1200); // Shop 2 Add(2,1224,1,0,50,7297,30,969,10,999,50,714,10); Add(2,1225,1,0,60,7292,30,969,10,999,50,714,10); // Shop 3 Add(3,531,1,3,70,512,1,713,1); Add(3,532,1,3,80,513,1,713,1); Add(3,533,1,3,90,514,1,713,1); Add(3,534,1,3,100,515,1,713,1); // ----------------------------------------------------------- //===================================================================================== // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED --------------------- //===================================================================================== freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) { set .menu$, .menu$+.Shops$[.@i]+":"; npcshopdelitem "qshop"+.@i,909; } end; OnMenu: set .@size, getarraysize(@i); if (!.@size) set @shop_index, select(.menu$); else if (.@size == 1) set @shop_index, @i[0]; else { for(set .@j,0; .@j<.@size; set .@j,.@j+1) set .@menu$, .@menu$+.Shops$[@i[.@j]]+":"; set @shop_index, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[@shop_index] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshop"+@shop_index,1; npcshopattach "qshop"+@shop_index; end; OnBuyItem: // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0])); set .@q[2],.@q[1]*.@q[3]; if (!.@q[2] || .@q[2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+"."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; disable_items; if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000"; if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000"; if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000"; next; setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11); if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT))) set .@preview,1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[2])) { mes "[Quest Shop]"; mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]); if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]); if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) delitem .@q[.@i],.@q[.@i+1]*.@q[1]; getitem .@q[0],.@q[2]; if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):callfunc("F_InsertArticle",getitemname(.@q[0])))+"!",0; specialeffect2 EF_FLOWERLEAF; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray .@j[0],getarg(2),getarg(3),getarg(4); for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) { if (getitemname(getarg(.@i)) == "null") { debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped)."; return; } else setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1); } copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set .@s$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return .@s$; case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]"; default: return .@s$; } } } function script qshop { deletearray @i[0],getarraysize(@i); for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set @i[.@i],getarg(.@i); doevent "quest_shop::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1 PvP Script: - script PvP_Points -1,{ OnPCKillEvent: .@map$ = strcharinfo(3); if(getmapflag(.@map$,mf_pvp) && killedrid != getcharid(3)) { if(++#pvp_points % 5 == 0) dispbottom "Current amount of PvP Points: "+#pvp_points; } end; }
  22. You can try this script by Sehrentos, it's one of the most configurable enchanters I've seen: //===== rAthena Script ======================================= //= Enchant NPC //===== By: ================================================== //= Sehrentos //===== Current Version: ===================================== //= 1.2 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= Enchant player's equipment. Support multiple enchants. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.1 Remove enchant option. //= 1.2 Added .max_enchant option. //============================================================ // shop/cashshop/itemshop/pointshop - shop enc_atk -1,501:300; - shop enc_def -1,501:300; - shop enc_stats -1,501:300; prt_in,65,68,4 script Enchant#prt1 4_M_MERCAT1,{ disable_items; switch(select("Attack:Defence:Stats:Remove")) { case 1: @shop_name$ = "enc_atk"; break; case 2: @shop_name$ = "enc_def"; break; case 3: @shop_name$ = "enc_stats"; break; case 4: callsub S_Remove; break; default: end; } callshop @shop_name$, 1; npcshopattach @shop_name$; end; OnInit: // Settings: shop names, currencies, items, prices .max_enchant = 2; // Max amount of enchants 0-4 setarray .shop_name$[0], "enc_atk", "enc_def", "enc_stats"; setarray .shop_currency$[0],"Zeny", "Zeny", "Zeny"; setarray .enc_atk_id[0], 4760, 4761, 4806, 4815, 4814, 4813, 4812, 4826, 4827, 4828, 4829, 4830, 4831, 4819, 4766, 4767,4764,4765, 4807, 4842, 4818, 4817, 4816, 4843, 4844, 4811, 4810, 4809, 4808, 4820, 4821, 4822, 4823, 4824, 4825, 4832, 4833, 4834, 4835, 4836, 4837, 4838, 4839, 4840, 4841; setarray .enc_atk_price[0],10000,20000,30000,10000,20000,30000,40000,50000,60000,70000,80000,90000,100000,10000,20000,30000,5000,7000,10000,20000,10000,20000,30000,40000,50000,10000,20000,30000,40000,50000,60000,70000,80000,90000,100000,10000,20000,30000,40000,50000,60000,70000,80000,90000,100000; setarray .enc_def_id[0], 4805, 4850, 4851, 4852,4762, 4763,4786,4787,4788,4789, 4790,4791,4792,4793, 4794,4795,4796,4797,4798,4799,4800,4801, 4802; setarray .enc_def_price[0],10000,20000,40000,60000,5000,12000,2000,4000,6000,8000,10000,3000,5000,9000,12000,1000,2000,3000,4000,5000,2500,5000,10000; setarray .enc_stats_id[0], 4700,4710,4720,4730,4740,4750, 4701,4711,4721,4731,4741,4751, 4702,4712,4722,4732,4742,4752, 4703,4713,4723,4733,4743,4753, 4704,4714,4724,4734,4744,4754, 4705,4715,4725,4735,4745,4755, 4706,4716,4726,4736,4746,4756, 4707,4717,4727,4737,4747,4757, 4708,4718,4728,4738,4748,4758, 4709, 4719, 4729, 4739, 4749, 4759; setarray .enc_stats_price[0],1500,1500,1500,1500,1500,1500, 2500,2500,2500,2500,2500,2500, 3500,3500,3500,3500,3500,3500, 4500,4500,4500,4500,4500,4500, 5500,5500,5500,5500,5500,5500, 6500,6500,6500,6500,6500,6500, 7500,7500,7500,7500,7500,7500, 8500,8500,8500,8500,8500,8500, 9500,9500,9500,9500,9500,9500, 10500,10500,10500,10500,10500,10500; // Load shop items for(.@i = 0; .@i < getarraysize(.shop_name$); .@i++) { .@npc$ = .shop_name$[.@i]; deletearray .@id[0],getarraysize(.@id); deletearray .@price[0],getarraysize(.@price); copyarray .@id[0], getd("."+.@npc$+"_id[0]"), getarraysize(getd("."+.@npc$+"_id")); copyarray .@price[0], getd("."+.@npc$+"_price[0]"), getarraysize(getd("."+.@npc$+"_price")); npcshopdelitem .@npc$,501;// Remove apple for(.@j = 0; .@j < getarraysize(.@id); .@j++) { npcshopadditem .@npc$, .@id[.@j], .@price[.@j]; } } end; OnSellItem: end; OnBuyItem: .@bought_count = getarraysize(@bought_nameid); if(.@bought_count < 1) end; // Get shop data by @shop_name$ .@shop_index = inarray(.shop_name$[0], @shop_name$); if(.@shop_index == -1 || getarraysize(.shop_name$) < 1) { message strcharinfo(0), "Shop was not found!"; debugmes "Incorrect shop array detected in '"+@shop_name$+"'! FIXME!"; end; } copyarray .@shop_id[0], getd("."+@shop_name$+"_id"), getarraysize(getd("."+@shop_name$+"_id")); copyarray .@shop_price[0], getd("."+@shop_name$+"_price"), getarraysize(getd("."+@shop_name$+"_price")); for(.@i = 0; .@i < .@bought_count; .@i++) { .@index = inarray(.@shop_id[0], @bought_nameid[.@i]); if(.@index == -1) { message strcharinfo(0), "Price was not found!"; debugmes "Incorrect price array detected in '"+@shop_name$+"'! FIXME!"; end; } setarray .@bought_cost[getarraysize(.@bought_cost)],.@shop_price[.@index]*@bought_quantity[.@i]; for (.@j = 0; .@j < @bought_quantity[.@i]; .@j++) { setarray .@enchant[getarraysize(.@enchant)],@bought_nameid[.@i]; } } // Count total cost for(.@i = 0; .@i < .@bought_count; .@i++) { .@total_cost = .@total_cost + .@bought_cost[.@i]; } // Currency check if(.shop_currency$[.@shop_index] == "Zeny" && Zeny < .@total_cost) { message strcharinfo(0), "("+.@total_cost+") Not enough "+.shop_currency$[.@shop_index]+"!"; end; } // Other currency checks... // Select equipment (EQI) mes "[ " + strnpcinfo(1) + " ]"; mes "Please select which equipment you want me to enchant."; .@position = callsub(S_SelectPosition); // Check if position has equipment if(!getequipisequiped(.@position)) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "You don't have anything equipped there!"; close; } .@item_id = getequipid(.@position); //Equipped item id .@refine = getequiprefinerycnt(.@position); //Equipped refine value .@slots = getitemslots(.@item_id); setarray .@cards[0], getequipcardid(.@position,0), getequipcardid(.@position,1), getequipcardid(.@position,2), getequipcardid(.@position,3); .@cards_count = getarraysize(.@cards); .@enchant_count = getarraysize(.@enchant); /*if(.@enchant_count > .max_enchant) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "This item has been crafted or produced and cannot be enchanted."; close; }*/ // Check for enabled refinement /*if(!getequipisenableref(.@position)) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "I don't think I can enchant this item at all."; mes "Sorry..."; close; }*/ // Add all card slots for(.@i = 0; .@i < .@slots; .@i++) { setarray .@item[getarraysize(.@item)], (.@cards[.@i] > 0 ? .@cards[.@i] : -1); } // Add previous enchants for(.@i = .@slots; .@i < .@cards_count; .@i++) { if(.@cards[.@i] > 0) { setarray .@item[getarraysize(.@item)], .@cards[.@i]; } } // Add new enchants for(.@i = 0; .@i < .@enchant_count; .@i++) { setarray .@item[getarraysize(.@item)], .@enchant[.@i]; } // Check for produced/crafted items 254,255 if(.@cards[0] == CARD0_FORGE || .@cards[0] == CARD0_CREATE) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "This item has been crafted or produced and cannot be enchanted."; close; } // Has card sockets 4 - slots if(.@enchant_count > (.max_enchant - .@slots)) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "This equipment can hold "+(.max_enchant - .@slots)+" enchant."; close; } // Has free sockets if((.@slots + .@enchant_count) > .max_enchant || getarraysize(.@item) > .max_enchant) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "This item does not have enough free sockets to enchant."; close; } // Confirm the setup clear; mes "[ " + strnpcinfo(1) + " ]^6E6E6E Setup^000000"; for(.@i = 0; .@i < .@enchant_count; .@i++) { mes "Enchant: "+ getitemname(.@enchant[.@i]); } mes "Equipment: "+ getitemname(getequipid(.@position)); mes "Cost: "+.@total_cost+" "+.shop_currency$[.@shop_index]+"."; if (select("Create enchant:Cancel") != 1) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "Farewell."; close; } // Create selected enchant clear; mes "[ " + strnpcinfo(1) + " ]^6E6E6E Done^000000"; mes "Here is your enchanted equipment!"; delequip(.@position); specialeffect2 154; if(.shop_currency$[.@shop_index] == "Zeny") { Zeny = Zeny - .@total_cost; } getitem2 .@item_id, 1, 1, .@refine, 0, (.@item[0] > 0 ? .@item[0] : 0), (.@item[1] > 0 ? .@item[1] : 0), (.@item[2] > 0 ? .@item[2] : 0), (.@item[3] > 0 ? .@item[3] : 0); close; S_Remove: // Select equipment (EQI) mes "[ " + strnpcinfo(1) + " ]"; mes "Please select which equipment you want me to work on."; .@position = callsub(S_SelectPosition); // Check if position has equipment if(!getequipisequiped(.@position)) { clear; mes "[ " + strnpcinfo(1) + " ]"; mes "You don't have anything equipped there!"; close; } .@item_id = getequipid(.@position); //Equipped item id .@refine = getequiprefinerycnt(.@position); //Equipped refine value .@slots = getitemslots(.@item_id); setarray .@cards[0], getequipcardid(.@position,0), getequipcardid(.@position,1), getequipcardid(.@position,2), getequipcardid(.@position,3); .@cards_count = getarraysize(.@cards); .@enchant_count = getarraysize(.@enchant); // Create selected item clear; mes "[ " + strnpcinfo(1) + " ]^6E6E6E Done^000000"; mes "Here is your equipment back!"; delequip(.@position); specialeffect2 169; getitem2 .@item_id, 1, 1, .@refine, 0,0,0,0,0; for(.@i=0; .@i<.@slots; .@i++) { if(.@cards[.@i] > 0) getitem .@cards[.@i], 1; } close; S_SelectPosition: setarray .@indices[1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R; setarray .@position$[1], "Top", "Mid", "Low", "Armor", "Left Hand", "Right Hand", "Garment", "Shoes", "Accessory L", "Accessory R"; setarray .@option[1], 1, 1, 1, 1, 1, 1, 1, 1, 1, 1; // 1=allow, 0=deny for(.@i=1; .@i<getarraysize(.@indices); .@i++) { if(.@option[.@i] && getequipisequiped(.@indices[.@i])) { .@menu$ = .@menu$ + .@position$[.@i] + "-[" + getequipname(.@indices[.@i]) + "]"; } .@menu$ = .@menu$ + ":"; } .@part = .@indices[select(.@menu$)]; return .@part; }
  23. Okay this is the first script but I only edited an "end" when an item reached its max evolution. It should continue looking for another item in your inventory to evolve. - script Extra_ItemConf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* 1HSword */ add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H /* 2HSword */ add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H /* 2HAxe */ add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H /* Maces */ add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H /* Arcos */ add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos /* Cajados */ add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados /* 1HSpear */ add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200); /* 2HSpear */ add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100); /* Knuckles */ add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100); /* Violin */ add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150); /* Whip */ add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100); /* Katar */ add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100); /* Debug */ add_item(2301, 1, 111, 1, 2302, 1, 111, 2); /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"ffffff", // % of evolution. "03fd20", // Wings evolving. "11f4cc"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], /*EQI_HAND_R,*/ EQI_HAND_L, EQI_ARMOR, EQI_SHOES, EQI_GARMENT; //============================================= end; OnNPCKillEvent: if(!@evolving) { // Cache. That old loop on every mob killed... if(@evo_var[0] && isequipped(@evo_var[0])) { .@has_item = true; .@item_id = @evo_var[0]; .@i = @evo_var[1] - 1; .@j = @evo_var[2] - 1; .@slot = @evo_var[3]; .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid != .@mob_id && .@mob_id > 1001) end; } else { .@size = getarraysize(.slots); while(.@slot < .@size && !.@has_item) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1 && !.@has_item) { .@j = 0; while(.@j < .w2[.@i] && !.@has_item) { .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { .@has_item = true; setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot; } } else if(.@item_id == .@item_evo) { .@j = .w2[.@i]; } if(!.@has_item) .@j++; } if(!.@has_item) .@i++; } } } if(.@has_item) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = getd("mobs_"+.@item_id) + 1; setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "mobs_"+.@item_id,0; } else { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end; setd "exp_"+.@item_id,0; } specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto && !@evolving) { @evolving = true; specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; getinventorylist; .@k = inarray(@inventorylist_id,.@item_id); if(.@k != -1) { if(!@inventorylist_expire[.@k]) { setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k]; setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k]; setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k]; setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k]; .@bound = @inventorylist_bound[.@k]; } else { @evolving = false; } if(@evolving) { .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); if(getarraysize(.@val)){ delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; if(.@bound) getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par; else getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; } else { delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; if(.@bound) getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account; else getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; } equip .@evo_item; setd "evo_"+.@item_id,0; deletearray @evo_var; announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; @evolving = false; } } } } } end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } } And now this is the second one. I only added a variable to prevent multiprocessing issues. - script Extra_ItemConf -1,{ function add_item; OnInit: /* add_item(id, evolution mode, monster id, amount, id...); If you want any monster, use 111. Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). */ /* Adaga */ add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga /* 1HSword */ add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H /* 2HSword */ add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H /* 2HAxe */ add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H /* Maces */ add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H /* Arcos */ add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos /* Cajados */ add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados /* 1HSpear */ add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200); /* 2HSpear */ add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100); /* Knuckles */ add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100); /* Violin */ add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150); /* Whip */ add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100); /* Katar */ add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100); /* Debug */ add_item(2301, 1, 111, 1, 2302, 1, 111, 2); /* 0 = Won't be evolved automatically. 1 = Will be evolved automatically */ .auto = 1; /* Color of the announces. */ setarray .c$[0],"ffffff", // % of evolution. "03fd20", // Wings evolving. "11f4cc"; // Wings evolved. /* slots to check. EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 */ setarray .slots[0], /*EQI_HAND_R,*/ EQI_HAND_L, EQI_ARMOR, EQI_SHOES, EQI_GARMENT; //============================================= end; OnNPCKillEvent: if(@evolve_inuse) end; @evolve_inuse = true; .@size = getarraysize(.slots); while(.@slot < .@size) { .@item_id = getequipid(.slots[.@slot]); .@slot++; if(.@item_id < 0) continue; .@i = 0; while(.@i < .w1) { .@j = 0; .@has_item = false; while(.@j < .w2[.@i] && !.@has_item) { .@item_evo = getd(".it_id_"+.@i+"_"+.@j); if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) { .@mob_id = getd(".it_mob_"+.@i+"_"+.@j); if(killedrid == .@mob_id || .@mob_id < 1001) { if(getd(".it_mode_"+.@i+"_"+.@j) == 1) { .@amount = getd("mobs_"+.@item_id) + 1; setd "mobs_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue; setd "mobs_"+.@item_id,0; } else { .@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid); setd "exp_"+.@item_id,.@amount; if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue; setd "exp_"+.@item_id,0; } specialeffect2 EF_BEGINSPELL6; sleep2 rand(190,280); specialeffect2 EF_ENERGYDRAIN3; .@percent = getd("evo_"+.@item_id); if(.@percent < 100) { setd "evo_"+.@item_id,++.@percent; announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0]; } if(.@percent >= 100 && .auto) { specialeffect2 EF_GUMGANG3; sleep2 500; specialeffect2 EF_BASH3D2; sleep2 300; specialeffect2 EF_BLUEBODY; sleep2 300; announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1]; .@k = 3; while(.@k--) { specialeffect2 EF_DOUBLECASTBODY; sleep2 900; } specialeffect2 EF_STORMKICK5; sleep2 200; specialeffect2 EF_BUBBLE_DROP; sleep2 500; if(!.@inventory) { getinventorylist; .@inventory = true; } .@k = inarray(@inventorylist_id,.@item_id); if(.@k != -1) { if(!@inventorylist_expire[.@k]) { setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k]; setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k]; setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k]; setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k]; .@bound = @inventorylist_bound[.@k]; } else { continue; } .@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1)); if(getarraysize(.@val)){ delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; if(.@bound) getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par; else getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par; } else { delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; if(.@bound) getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account; else getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5]; } equip .@evo_item; setd "evo_"+.@item_id,0; announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2]; } .@has_item = true; } else if(.@item_id == .@item_evo) { .@j = .w2[.@i]; } } } .@j++; } .@i++; } } @evolve_inuse = false; end; function add_item { for(.@args = getargcount();.@i < .@args;.@i+= 4) { .@j = .w2[.w1]++; setd ".it_id_"+.w1+"_"+.@j,getarg(.@i); // id. if(getarg(.@i + 4,0) != 0) { setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1); // mode. setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2); // mob id. setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3); // amount. } } .w1++; } }
×
×
  • Create New...