Jump to content

darking123

Members
  • Posts

    931
  • Joined

  • Last visited

Everything posted by darking123

  1. for example my website vote for points is www.google.com/voteforpoints, and in my control panel when i click a button. what if i want to change it to www.google.com/vote when i click the button? where can i change this thank you
  2. when a players logins the server will check if his job level is above 120 if it's above 120 then it will revert his job level to 120.
  3. bump!
  4. why is there is castle drop in arug_cas03? but other castles have //===== Hercules Script ====================================== //= Euphy's WOE Controller //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.5 //===== 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,163,194,4 script WOE Information 2_BOARD1,{ doevent "WOE_CONTROL::OnMenu"; end; OnAgitStart: while(agitcheck()) { misceffect 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],14001,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(4) == $WOE_CONTROL[.@i] && gettime(3) == $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(4) == $WOE_CONTROL[.@i] && gettime(3) >= $WOE_CONTROL[.@i+1] && gettime(3) < $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); 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) { 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[0]+","+.Reward[1]+",0,"+.Reward[2]+",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])) { for(set .@k,0; .@k<getarraysize(.Reward); 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(4) == $WOE_CONTROL[.@i] && gettime(3) >= $WOE_CONTROL[.@i+1] && gettime(3) < $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(4) == $WOE_CONTROL[.@i] && gettime(3) <= $WOE_CONTROL[.@i+1]) || gettime(4) < $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; } } } //===== Hercules Script ====================================== //= War of Emperium SE - Template File //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.4a //===== Description: ========================================= //= Like agit_main, this file is required //= for SE castles to function. //===== Additional Comments: ================================= //= 0.x Previous authors: L0ne_W0lf, Zephyrus, Brian. //= 1.0 If anything breaks, blame Maki. [Euphy] //= 1.1 Fixed an incorrect label execution. [Euphy] //= 1.2 Hopefully fixed a processing error. [Euphy] //= 1.3 Fixed barricade issue in schg_cas02. [Cookie] //= 1.4 Added OnGuildBreak event and a spawn check. [Euphy] //= 1.4a Fixed Guardian Stone respawns. [Euphy] //============================================================ // Core, triggers all other events //============================================================ - script Manager#template -1,{ OnAgitInit2: OnRecvCastle2: if (strnpcinfo(2) == "template") end; if (!getcastledata(strnpcinfo(2),1)) { donpcevent strnpcinfo(0)+"::OnStart"; // Monster spawns are identical for all castles. monster strnpcinfo(2),0,0,"Evil Druid",1117,10; monster strnpcinfo(2),0,0,"Khalitzburg",1132,4; monster strnpcinfo(2),0,0,"Abysmal Knight",1219,3; monster strnpcinfo(2),0,0,"Executioner",1205,1; monster strnpcinfo(2),0,0,"Penomena",1216,10; monster strnpcinfo(2),0,0,"Alarm",1193,18; monster strnpcinfo(2),0,0,"Clock",1269,9; monster strnpcinfo(2),0,0,"Raydric Archer",1276,12; monster strnpcinfo(2),0,0,"Wanderer",1208,3; monster strnpcinfo(2),0,0,"Alice",1275,1; monster strnpcinfo(2),0,0,"Bloody Knight",1268,2; monster strnpcinfo(2),0,0,"Dark Lord",1272,2; monster strnpcinfo(2),0,0,"Tower Keeper",1270,4; } if (getcastledata(strnpcinfo(2),9) < 1) disablenpc "Kafra Employee#"+substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); end; OnAgitStart2: if (strnpcinfo(2) == "template") end; if (agitcheck2()) { maprespawnguildid strnpcinfo(2),getcastledata(strnpcinfo(2),1),2; gvgon strnpcinfo(2); donpcevent strnpcinfo(0)+"::OnStart"; } else for(set .@i,0; .@i<4; set .@i,.@i+1) donpcevent "RL"+.@i+"#"+strnpcinfo(2)+"::OnDisable"; end; OnAgitEnd2: if (strnpcinfo(2) == "template") end; gvgoff strnpcinfo(2); // If the castle has no owner at the end of WoE, do not kill Emperium. donpcevent "Treasure#"+strnpcinfo(2)+"::OnSpawnTreasure"; if (getcastledata(strnpcinfo(2),1)) { set .@str$,substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); killmonster strnpcinfo(2),"Steward#"+.@str$+"::OnStartArena"; donpcevent strnpcinfo(0)+"::OnReset"; donpcevent "Steward#"+.@str$+"::OnStop"; } end; OnGuildBreak: if (strnpcinfo(2) == "template") end; killmonster strnpcinfo(2),"gard1#"+strnpcinfo(2)+"::OnGuardianDied"; killmonster strnpcinfo(2),"gard2#"+strnpcinfo(2)+"::OnGuardianDied"; disablenpc "Kafra Employee#"+substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); setcastledata strnpcinfo(2),1,0; sleep 7000; announce "Guild Base ["+getcastlename(strnpcinfo(2))+"] has been abandoned.",0; donpcevent strnpcinfo(0)+"::OnRecvCastle2"; end; OnStart: // $agit_ar0x[] - $agit_sc0x[] // 1st Guardian stone, 2nd Guardian stone, Barrier 1, Barrier 2, Barrier 3, Summon Guardians // Settings for all but Summon Guardians: 0 = Okay | 1 = Destroyed | 2 = Repairing // Summon Guardians: 0 = Do not Summon | 1 = Summon if (getcastledata(strnpcinfo(2),1)) { setarray getd("$agit_"+substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9)+"[0]"),0,0,0,0,0,0; donpcevent "df1#"+strnpcinfo(2)+"::OnEnable"; donpcevent "df2#"+strnpcinfo(2)+"::OnEnable"; for(set .@i,0; .@i<4; set .@i,.@i+1) donpcevent "RL"+.@i+"#"+strnpcinfo(2)+"::OnEnable"; } OnEmpSpawn: set .@str$, substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); if (mobcount(strnpcinfo(2),"Steward#"+.@str$+"::OnStartArena")) end; if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") setarray .@i[0],87,219; else if (strnpcinfo(2) == "arug_cas02") setarray .@i[0],89,256; else setarray .@i[0],141,293; // Castles 3,4,5 are identical. } else { if (strnpcinfo(2) == "schg_cas02") setarray .@i[0],162,193; else if (strnpcinfo(2) == "schg_cas03") setarray .@i[0],338,202; else setarray .@i[0],120,272; // Castles 1,4,5 are identical. } monster strnpcinfo(2),.@i[0],.@i[1],"Emperium",1288,1,"Steward#"+.@str$+"::OnStartArena"; end; OnReset: set .@str$, substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); donpcevent "df1#"+strnpcinfo(2)+"::OnDisable"; donpcevent "df2#"+strnpcinfo(2)+"::OnDisable"; donpcevent "gard1#"+strnpcinfo(2)+"::OnReset"; donpcevent "gard2#"+strnpcinfo(2)+"::OnReset"; donpcevent "1st Guardian Stone#"+.@str$+"::OnDisable"; donpcevent "2nd Guardian Stone#"+.@str$+"::OnDisable"; for(set .@i,1; .@i<4; set .@i,.@i+1) donpcevent "Control Device0"+.@i+"#"+.@str$+"::OnDisable"; for(set .@i,0; .@i<4; set .@i,.@i+1) donpcevent "RL"+.@i+"#"+strnpcinfo(2)+"::OnDisable"; if (agitcheck2()) setarray getd("$agit_"+substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9)+"[0]"),0,0,1,1,1,0; end; OnChange: set .@str$, substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); setarray getd("$agit_"+.@str$+"[0]"),2,2,1,1,2,0; donpcevent strnpcinfo(0)+"::OnEmpSpawn"; donpcevent "Control Device03#"+.@str$+"::OnEnable"; donpcevent "1st Guardian Stone#"+.@str$+"::OnEnable"; donpcevent "2nd Guardian Stone#"+.@str$+"::OnEnable"; end; OnSpawnTreasure: OnClock0001: // Spawn Treasure Chests based on castle economy. if (strnpcinfo(2) == "template") end; if (!getcastledata(strnpcinfo(2),1)) end; killmonster strnpcinfo(2),strnpcinfo(0)+"::OnTreasureDied"; if (getcastledata(strnpcinfo(2),4)) { set .@Economy,getcastledata(strnpcinfo(2),2); setcastledata strnpcinfo(2),2,.@Economy+getcastledata(strnpcinfo(2),4)+(rand(2) && getgdskilllv(getcastledata(strnpcinfo(2),1),10014)); if (getcastledata(strnpcinfo(2),2) > 100) setcastledata strnpcinfo(2),2,100; setcastledata strnpcinfo(2),4,0; } if (getcastledata(strnpcinfo(2),5)) { set .@defence,getcastledata(strnpcinfo(2),3); setcastledata strnpcinfo(2),3,.@defence+getcastledata(strnpcinfo(2),5); if (getcastledata(strnpcinfo(2),3) > 100) setcastledata strnpcinfo(2),3,100; setcastledata strnpcinfo(2),5,0; } set .@Treasure,getcastledata(strnpcinfo(2),2)/5+4; if (!.@Treasure) end; freeloop(1); if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") { set .@treasurebox,1943; setarray .@treasurex[0],251,252,253,254,255,256,257,258,251,252,253,254,255,256,257,258,251,252,253,254,255,256,257,258; setarray .@treasurey[0],369,369,369,369,368,368,368,368,367,367,367,367,366,366,366,366,365,365,365,365,364,364,364,364; } else if (strnpcinfo(2) == "arug_cas02") { set .@treasurebox,1944; setarray .@treasurex[0],382,383,384,385,386,387,384,385,386,387,388,389,382,383,384,385,386,387,384,385,386,387,388,389; setarray .@treasurey[0],231,231,231,231,231,231,230,230,230,230,230,230,225,225,225,225,225,225,224,224,224,224,224,224; } else { // Castles 3,4,5 are identical, except 4's treasure. set .@treasurebox,(strnpcinfo(2) == "arug_cas04")?1946:1945; setarray .@treasurex[0],291,292,293,294,295,296,293,294,295,296,297,298,291,292,293,294,295,296,293,294,295,296,297,298; setarray .@treasurey[0],276,276,276,276,276,276,274,274,274,274,274,274,272,272,272,272,272,272,269,269,269,269,269,269; } } else { if (strnpcinfo(2) == "schg_cas02") { set .@treasurebox,1939; setarray .@treasurex[0],249,250,251,252,253,246,247,248,249,250,250,251,252,253,246,247,248,249,250,249,250,251,252,253; setarray .@treasurey[0],378,378,378,378,378,376,376,376,376,376,374,374,374,374,372,372,372,372,372,370,370,370,370,370; } else if (strnpcinfo(2) == "schg_cas03") { set .@treasurebox,1940; setarray .@treasurex[0],189,190,191,192,193,194,189,190,191,192,193,194,189,190,191,192,193,194,189,190,191,192,193,194; setarray .@treasurey[0], 21, 21, 21, 21, 21, 21, 19, 19, 19, 19, 19, 19, 17, 17, 17, 17, 17, 17, 15, 15, 15, 15, 15, 15; } else { // Castles 1,4,5 are identical, except treasures. if (strnpcinfo(2) == "schg_cas01") set .@treasurebox,1938; else if (strnpcinfo(2) == "schg_cas04") set .@treasurebox,1941; else set .@treasurebox,1942; setarray .@treasurex[0],388,388,388,387,386,385,384,384,384,384,384,384,385,386,387,388,389,390,390,390,389,388,387,386; setarray .@treasurey[0],388,389,390,390,390,390,389,388,387,386,385,384,384,384,384,384,384,384,385,386,386,386,386,386; } } for(set .@i,0; .@i<4; set .@i,.@i+1) monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Treasure Chest",(.@i%2)?.@treasurebox:1324,1,strnpcinfo(0)+"::OnTreasureDied"; for(set .@i,4; .@i<24; set .@i,.@i+1) { if (.@Treasure < .@i+1) break; monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Treasure Chest",(.@i%2)?.@treasurebox:1324,1,strnpcinfo(0)+"::OnTreasureDied"; } freeloop(0); end; OnTreasureDied: end; } // Guild Manager //============================================================ - script Steward#template -1,{ set .@GID, getcastledata(strnpcinfo(4),1); if (!.@GID) { mes "[ Steward ]"; mes "I await for the master"; mes "whom destiny will choose"; mes "for me. Do you think you"; mes "have to courage and strength"; mes "to conquer this stronghold?"; close; } if (getcharid(2) != .@GID || strcharinfo(0) != getguildmaster(.@GID)) { mes "[ Steward ]"; mes "Hmpf. Your threats don't"; mes "scare me! Guardians, drive"; mes "this infidel away from here!"; mes "I will always be loyal to the"; mes "master of this stronghold,"; mes "the one and only ^FF0000"+getguildmaster(.@GID)+"^000000."; close; } mes "[ Steward ]"; mes "Ah, Master ^FF0000"+getguildmaster(.@GID)+"^000000..."; mes "How shall I serve you today?"; mes "Was there an aspect of this"; mes "stronghold's maintenance"; mes "you wanted to discuss?"; next; switch(select("Stronghold Briefing:Invest in Commercial Growth:Invest in Defense growth:Hire/Fire Storage Staff:Go to Master's room")) { case 1: mes "[ Steward ]"; mes "The Commercial Growth"; mes "Level of the stronghold is ^0000ff"+getcastledata(strnpcinfo(4),2)+"."; if (getcastledata(strnpcinfo(4),4) > 0) { mes "Last time, you invested in"; mes "Commercial Growth "+getcastledata(strnpcinfo(4),4)+"."; } next; mes "[ Steward ]"; mes "Our stronghold's"; mes "safeguard level is "+getcastledata(strnpcinfo(4),3)+"."; if (getcastledata(strnpcinfo(4),5) > 0) { mes "Last time, you invested"; mes "in defense "+getcastledata(strnpcinfo(4),5)+" times."; } mes " "; mes "That is all, master."; close; case 2: set .@Economy,getcastledata(strnpcinfo(4),2); setarray .@cost[0],5000,10000,20000,35000,55000,80000,110000,145000,185000,230000,280000,335000,395000,460000,530000,605000,685000,770000,860000,955000; set .@j,0; for(set .@i,6; .@i<101; set .@i,.@i+5) { if (.@Economy < .@i) { set .@eco_invest,.@cost[.@j]; break; } set .@j, .@j+1; } // Quadruple the cost of investing if you've already invested once. if (getcastledata(strnpcinfo(4),4)) set .@eco_invest,.@eco_invest*4; mes "[ Steward ]"; mes "Raising the stronghold's"; mes "commercial growth will"; mes "increase the quantity of"; mes "goods produced for the guild."; mes "Investing in commercial growth"; mes "will help the guild's future."; next; mes "[ Steward ]"; mes "You can make one investment"; mes "each day, but if you can make"; mes "two investments if you pay"; mes "more Zeny: this will speed"; mes "up commercial development,"; mes "but can be quite expensive."; next; if (.@Economy == 100) { mes "[ Steward ]"; mes "However, our stronghold's"; mes "commerical growth level is"; mes "at 100%. It's not possible to"; mes "develop commercial growth"; mes "any further than that."; close; } if (getcastledata(strnpcinfo(4),4) >= 2) { mes "[ Steward ]"; mes "You've already made two"; mes "investments today, so you'll"; mes "have to wait until tomorrow"; mes "to make another investment."; close; } if (getcastledata(strnpcinfo(4),4) == 0) { mes "[ Steward ]"; mes "You must pay ^FF0000"+.@eco_invest+"^000000 Zeny"; mes "to make an investment"; mes "Will you invest in this"; mes "stronghold's commerical"; mes "development now?"; } else { mes "[ Steward ]"; mes "You must pay ^FF0000"+.@eco_invest+"^000000"; mes "more Zeny to make a second"; mes "investment today. Will you"; mes "invest one more time?"; } next; switch(select("Invest in Commercial Growth:Cancel")) { case 1: if (getcastledata(strnpcinfo(4),4) >= 2) { mes "[ Steward ]"; mes "You've already made two"; mes "investments today, so you'll"; mes "have to wait until tomorrow"; mes "to make another investment."; close; } if (Zeny < .@eco_invest) { mes "[ Steward ]"; mes "I'm sorry, Master, but"; mes "you do not have enough"; mes "Zeny to make an investment"; mes "for the guild today."; close; } Zeny -= .@eco_invest; setcastledata strnpcinfo(4),4,getcastledata(strnpcinfo(4),4)+1; mes "[ Steward ]"; mes "A wise use of the guild's"; mes "funds, Master. We can expect"; mes "to see the results of this"; mes "investment by tomorrow."; close; case 2: mes "[ Steward ]"; mes "As you command, Master."; close; } case 3: set .@defence,getcastledata(strnpcinfo(4),3); setarray .@cost[0],10000,20000,40000,70000,110000,160000,220000,290000,370000,460000,560000,670000,790000,920000,1060000,1210000,1370000,1540000,1720000,1910000; set .@j,0; for(set .@i,6; .@i<101; set .@i,.@i+5) { if (.@defence < .@i) { set .@def_invest,.@cost[.@j]; break; } set .@j, .@j+1; } // Quadruple the cost of investing if you've already invested once. if (getcastledata(strnpcinfo(4),5)) set .@def_invest,.@def_invest*4; mes "[ Steward ]"; mes "Investing in our stronghold's"; mes "defense will enhance the"; mes "durability of our Guardians"; mes "and the Emperium. We'll need"; mes "every advantage to protect"; mes "ourselves from our enemies."; next; mes "[ Steward ]"; mes "You can invest in defense"; mes "once per day, but if you pay"; mes "more Zeny, you can invest"; mes "a maximum of two times daily."; next; mes "[ Steward ]"; if (getcastledata(strnpcinfo(4),3) == 100) { mes "The Defense Level of this"; mes "stronghold is 100%, and"; mes "cannot be increased further."; close; } if (getcastledata(strnpcinfo(4),5) >= 2) { mes "Master, you've already"; mes "invested in Defense twice"; mes "today. You'll need to wait"; mes "until tomorrow if you really"; mes "want to increase our defenses."; close; } if (getcastledata(strnpcinfo(4),5) == 0) { mes "We need ^FF0000"+.@def_invest+"^000000"; mes "Zeny to invest in our"; mes "stronghold's defenses."; mes "Will you invest now?"; } else { mes "We need ^FF0000"+.@def_invest+"^000000"; mes "Zeny to invest in our"; mes "stronghold's defenses"; mes "a second time today."; mes "Will you invest now?"; } next; switch(select("Invest in Defense:Cancel")) { case 1: if (getcastledata(strnpcinfo(4),5) >= 2) { mes "[ Steward ]"; mes "Master, you've already"; mes "invested in Defense twice"; mes "today. You'll need to wait"; mes "until tomorrow if you really"; mes "want to increase our defenses."; close; } if (Zeny < .@def_invest) { mes "[ Steward ]"; mes "I'm sorry, Master, but"; mes "you do not have enough"; mes "Zeny to make an investment"; mes "for the guild today."; close; } Zeny -= .@def_invest; setcastledata strnpcinfo(4),5,getcastledata(strnpcinfo(4),5)+1; mes "[ Steward ]"; mes "A wise use of the guild's"; mes "funds, Master. Increasing"; mes "the frequency of treasure"; mes "procured by the guild will"; mes "definitely help us all."; close; case 2: mes "[ Steward ]"; mes "As you command, Master."; close; } case 4: if (getcastledata(strnpcinfo(4),9) == 1) { mes "[ Steward ]"; mes "Do you wish to dismiss"; mes "the Kafra Employee that"; mes "we've hired for the guild?"; next; switch(select("Dismiss:Cancel")) { case 1: cutin "kafra_01",2; mes "[ Hired Kafra Employee ]"; mes "Master, please reconsider!"; mes "I've been working very hard"; mes "for the success of the guild!"; mes "I'll try harder to serve the"; mes "guild members of this"; mes "stronghold, I promise!"; next; switch(select("Dismiss:Cancel")) { case 1: mes "[ Hired Kafra Employee ]"; mes "Why?! What have I done"; mes "to deserve this? Waaah~!"; next; cutin "kafra_01",255; break; case 2: mes "[ Hired Kafra Employee ]"; mes "Thank you, Master!"; mes "I'll obey your every"; mes "command as best I can!"; mes "You won't regret this!"; close; } break; case 2: mes "[ Steward ]"; mes "She works very hard,"; mes "in my opinion. It was in"; mes "all of our best interests to"; mes "allow her to stay with us."; close; } disablenpc "Kafra Employee#"+strnpcinfo(2); setcastledata strnpcinfo(4),9,0; mes "[ Steward ]"; mes "That Kafra Employee"; mes "has been dismissed."; mes "Were really dissatisfied"; mes "by the quality of her service?"; close; } else { mes "[ Steward ]"; mes "Will you hire a"; mes "Kafra Employee to serve"; mes "our stronghold? You must"; mes "pay ^FF000010,000 Zeny^000000 to hire one."; next; switch(select("Hire:Cancel")) { case 1: if (getgdskilllv(.@GID,10001) == 0) { mes "[ Steward ]"; mes "Master, we cannot hire a"; mes "Kafra Employee because"; mes "you have not yet attained"; mes "the ^FF0000Contract with Kafra^000000"; mes "guild skill."; close; } if (Zeny < 10000) { mes "[ Steward ]"; mes "Master, we cannot hire a"; mes "Kafra Employee because"; mes "we do not have enough"; mes "funds to pay the contract fee."; close; } Zeny -= 10000; enablenpc "Kafra Employee#"+strnpcinfo(2); setcastledata strnpcinfo(4),9,1; mes "[ Steward ]"; mes "Very well. We have formed"; mes "a contract with the Kafra"; mes "Head Office, and hired a"; mes "Kafra Employee for our"; mes "stronghold. Here she is~"; next; cutin "kafra_01",2; mes "[ Hired Kafra Employee ]"; mes "How do you do? I've"; mes "been dispatched by the"; mes "Kafra Head Office to"; mes "serve your guild's needs."; mes "I'll do my best to follow"; mes "your every command, Master."; next; cutin "kafra_01",255; mes "[ Steward ]"; mes "Our contract will expire"; mes "after one month, so we must"; mes "pay additional fees to keep"; mes "this Kafra Employee in"; mes "the service of our guild."; close; case 2: mes "[ Steward ]"; mes "As you command, Master."; mes "However, I suggest hiring"; mes "a Kafra Employee as soon"; mes "as possible since our guild"; mes "would greatly benefit from"; mes "the convenient Kafra services."; close; } } case 5: mes "[ Steward ]"; mes "Do you wish to enter the"; mes "Guild Treasure Room?"; mes "Only you, the Guild Master,"; mes "are permitted to enter."; next; mes "[ Steward ]"; mes "Please remember to open"; mes "the Treasure Boxes at the"; mes "proper time. Otherwise, the"; mes "treasure may disappear if"; mes "something unexpected happens."; next; switch(select("Go to Treasure Room:Cancel")) { case 1: mes "[ Steward ]"; mes "Allow me to guide you"; mes "on the secret path to"; mes "the Treasure Room."; mes "Press the secret switch"; mes "when you wish to return here."; close2; if (compare(strnpcinfo(4),"arug")) { if (strnpcinfo(4) == "arug_cas01") setarray .@i[0],250,363; else if (strnpcinfo(4) == "arug_cas02") setarray .@i[0],382,227; else setarray .@i[0],292,266; // Castles 3,4,5 are identical. } else { if (strnpcinfo(4) == "schg_cas02") setarray .@i[0],249,373; else if (strnpcinfo(4) == "schg_cas03") setarray .@i[0],190,16; else setarray .@i[0],381,381; // Castles 1,4,5 are identical. } warp strnpcinfo(4),.@i[0],.@i[1]; end; case 2: mes "[ Steward ]"; mes "Items in the Treasure Room"; mes "are produced once each day."; mes "Therefore, you must obtain"; mes "the treasure items everyday."; mes "For the sake of the guild,"; mes "prioritize treasure harvesting!"; close; } } OnStop: awake strnpcinfo(0); end; OnStartArena: set .@GID,getcharid(2); set .@region$, (compare(strnpcinfo(4),"arug"))?"Valfreyja":"Nithafjoll"; // Lower castle Economy set .@Economy,getcastledata(strnpcinfo(4),2)-5; if (.@Economy < 0) set .@Economy, 0; setcastledata strnpcinfo(4),2,.@Economy; // Lower Castle Defence set .@defence,getcastledata(strnpcinfo(4),3)-5; if (.@defence < 0) set .@defence, 0; setcastledata strnpcinfo(4),3,.@defence; // Set new owner setcastledata strnpcinfo(4),1,.@GID; // Clear castle's data. for(set .@i,4; .@i<10; set .@i,.@i+1) setcastledata strnpcinfo(4),.@i,0; // Disable Kafra disablenpc "Kafra Employee#"+strnpcinfo(2); announce "The ["+getguildname(.@GID)+"] guild conquered the ["+.@region$+" "+charat(strnpcinfo(2),3)+"] stronghold of "+getcastlename(strnpcinfo(4))+"!",bc_all|bc_woe; mapannounce strnpcinfo(4),"The emperium has been shattered!",bc_map,"0x00FF00",FW_NORMAL,20,0,40; donpcevent "Manager#"+strnpcinfo(4)+"::OnReset"; maprespawnguildid strnpcinfo(4),getcastledata(strnpcinfo(4),1),2; donpcevent "Manager#"+strnpcinfo(4)+"::OnRecvCastle2"; donpcevent "::OnRecvCastle"+strnpcinfo(2); sleep 10000; if (agitcheck2()) { donpcevent "Manager#"+strnpcinfo(4)+"::OnChange"; mapannounce strnpcinfo(4),"Rebuild this stronghold's Guardian Stones and Fortress Gates to secure your guild's new aquisition!",bc_map,"0x00FF00",FW_NORMAL,20,0,40; } end; } // Castle Guardians //============================================================ - script Guardian#template -1,{ set .@GID, getcastledata(strnpcinfo(4),1); set .@n$, "["+strnpcinfo(1)+"]"; if (!.@GID) { mes .@n$; mes "Great job. Now, all you"; mes "need to do is destroy this"; mes "Emperium to gain ownership"; mes "over this stronghold."; close; } if (getcharid(2) == .@GID) { if (strcharinfo(0) != getguildmaster(.@GID)) { mes .@n$; mes "As guardian of this"; mes "stronghold, I answer only"; mes "to the master of the guild"; mes "that controls this place."; close; } else { if (!agitcheck2()) { mes .@n$; mes "I am "+strnpcinfo(1)+", guardian of"; mes "this stronghold. For now,"; mes "all is quiet in this place."; next; switch(select("Converse:Cancel")) { case 1: mes .@n$; mes "Do you have any questions"; mes "about this stronghold?"; next; switch(select("Guardian Stones:Fortress Gates:Link Flags:Battle Strategy:Cancel")) { case 1: mes .@n$; mes "There is one Emperium"; mes "and two Guardian Stones in"; mes "each fortress. These stones"; mes "are the first line of defense,"; mes "and must be destroyed before"; mes "enemies can even enter."; next; mes .@n$; mes "The stones are located in"; mes "^4D4DFFGate Houses^000000 which must be"; mes "protected to prevent enemies"; mes "from reaching the Emperium."; mes "Guardian Stones can ^4D4DFFrecall"; mes "your Guardians^000000 for protection."; next; mes .@n$; mes "Fortresses with higher levels"; mes "of defense can summon more"; mes "Guardians: this is why it is"; mes "so important for guilds to"; mes "invest in Defense Growth."; next; mes .@n$; mes "Guardian Stones that have"; mes "been destroyed can be revived"; mes "after a certain time, but one of^FFFFFF ^000000 the guild members must give"; mes "me the order. I can also report^FFFFFF ^000000 the status of the Guardian Stones."; close; case 2: mes .@n$; mes "^4D4DFFFortress Gates^000000 are the second ^FFFFFF ^000000 line of guild stronghold defense,"; mes "and are protected by extra barricades activated by the Guardian Stones."; mes "These gates are located in three different parts of the fortress."; next; mes .@n$; mes "Barricades are protected by"; mes "Guardian Stones, and are"; mes "restored when the Guardian"; mes "Stones are retrieved. However,"; mes "it is not as easy to restore"; mes "destroyed Fortress Gates."; next; mes .@n$; mes "Fortress Gates can only be"; mes "restored when the ^4D4DFFguild"; mes "master of a stronghold"; mes "changes^000000, or if ^4D4DFFrestoration"; mes "is requested by the guild"; mes "master of the stronghold^000000."; close; case 3: mes .@n$; mes "Strongholds have many"; mes "Link Flags that allow you"; mes "to access vital areas within"; mes "restrictions placed by the"; mes "Barricades. Usually, ^4D4DFFFlag 1"; mes "links to the Gate House^000000."; next; mes .@n$; mes "Many flags link directly to"; mes "the flag near the Emperium."; mes "The final numbered flag is"; mes "linked to the Convenience"; mes "Facility of the stronghold's"; mes "owner. Keep this in mind."; close; case 4: mes .@n$; mes "Strategy? It would be better"; mes "to develop your battle plan to"; mes "exploit your guild's advantages"; mes "and your enemies' weaknesses."; mes "Use the Gate Houses and Barricades, and rebuild as quickly as you can!"; close; case 5: mes .@n$; mes "You have no questions"; mes "to ask of me? Well, I'm"; mes "here to serve your needs."; close; } case 2: mes .@n$; mes "I'm always here, so"; mes "feel free to request my"; mes "assistance whenever"; mes "the need arises."; close; } } else { mes .@n$; mes "Greetings, "+strcharinfo(0)+"."; mes "What are your orders?"; next; switch(select("Increase Stronghold Defense:Situational Briefing:Cancel")) { case 1: if (!getd("$agit_"+strnpcinfo(2)+"[5]")) { if (getgdskilllv(.@GID,10002) == 0) { mes .@n$; mes "I'm sorry, but the Guardian"; mes "Stones aren't powerful enough"; mes "to summon Guardians yet. We"; mes "need to accumulate more"; mes "knowledge before they can"; mes "summon any Guardians."; close; } else { mes .@n$; mes "I shall endeavor to summon"; mes "a Guardian through a Guardian"; mes "Stone. However, keep in mind"; mes "that this will not work if the"; mes "Guardian Stone is destroyed."; setd "$agit_"+strnpcinfo(2)+"[5]",1; if (!getd("$agit_"+strnpcinfo(2)+"[0]")) donpcevent "gard1#"+strnpcinfo(4)+"::OnEnable"; if (!getd("$agit_"+strnpcinfo(2)+"[1]")) donpcevent "gard2#"+strnpcinfo(4)+"::OnEnable"; close; } } else { mes .@n$; mes "You've already commanded"; mes "me to summon a Guardian"; mes "to defend the stronghold."; close; } case 2: mes .@n$; mes "Our defense status is..."; setarray .@status$[0],"^4D4DFFOperational","^FF0000Destroyed","^008000Repairing"; mes "1st Guardian Stone: "+.@status$[getd("$agit_"+strnpcinfo(2)+"[0]")]+"^000000"; mes "2nd Guardian Stone: "+.@status$[getd("$agit_"+strnpcinfo(2)+"[1]")]+"^000000"; mes "1st Fortress Gate: "+.@status$[getd("$agit_"+strnpcinfo(2)+"[2]")]+"^000000"; mes "2nd Fortress Gate: "+.@status$[getd("$agit_"+strnpcinfo(2)+"[3]")]+"^000000"; mes "3rd Fortress Gate: "+.@status$[getd("$agit_"+strnpcinfo(2)+"[4]")]+"^000000"; close; case 3: mes .@n$; mes "I'll be standing by,"; mes "awaiting your orders."; close; } } } } else { mes .@n$; mes "Who are you? Scoundrel!"; mes "Leave this stronghold now!"; close; } OnInit: setarray getd("$agit_"+strnpcinfo(2)+"[0]"),0,0,0,0,0,0; end; } // Guild Kafras //============================================================ - script Kafra#template -1,{ cutin "kafra_01",2; set .@GID, getcastledata(strnpcinfo(4),1); if (getcharid(2) == .@GID && getgdskilllv(.@GID,10001)) { mes "[Kafra Employee]"; mes "Welcome, proud member"; mes "of the ^FF0000"+getguildname(.@GID)+"^000000 Guild!"; mes "The Kafra Corporation is ready"; mes "to assist you wherever you go!"; next; switch(select("Use Storage:Use Warp Service:Rent Pushcart:Cancel")) { case 1: if (basicskillcheck() && getskilllv("NV_BASIC") < 6) { mes "[Kafra Employee]"; mes "I'm so sorry, but you must"; mes "have at least Novice Skill"; mes "Lv.6 to use the Storage."; } else openstorage; break; case 2: mes "[Kafra Employee]"; mes "Please tell me your"; mes "Warp destination."; next; switch(select("Rachel -> 200 z:Cancel")) { case 1: if (Zeny < 200) { mes "[Kafra Employee]"; mes "I'm sorry, but you don't"; mes "have enough Zeny to pay"; mes "the warp fee. Would you"; mes "please check your funds again?"; close2; cutin "kafra_01",255; end; } Zeny -= 200; warp "rachel",115,125; end; case 2: cutin "kafra_01",255; break; } break; case 3: if (BaseClass != Job_Merchant) { mes "[Kafra Employee]"; mes "I'm sorry, but the Pushcart"; mes "rental service can only be"; mes "used by Merchant, Blacksmith,"; mes "and Alchemist class characters."; } else if (checkcart() == 1) { mes "[Kafra Employee]"; mes "Hm? You've already"; mes "rented a Pushcart."; } else { mes "[Kafra Employee]"; mes "The Pushcart rental fee"; mes "is 800 Zeny. Would you"; mes "like to rent a Pushcart?"; next; switch(select("Rent Pushcart:Cancel")) { case 1: if (Zeny < 800) { mes "[Kafra Employee]"; mes "I'm sorry, but you don't"; mes "have enough Zeny to rent"; mes "one of our Pushcarts."; close2; cutin "kafra_01",255; end; } Zeny -= 800; setcart; break; case 2: break; } } break; case 4: mes "[Kafra Employee]"; mes "Thank you for using the"; mes "Kafra Service. Wherever"; mes "you go, Kafra will be"; mes "there to support you!"; close2; cutin "kafra_01",255; end; } close2; cutin "kafra_01",255; end; } else { mes "[Kafra Employee]"; mes "I'm sorry, but I've been"; mes "exclusively contracted"; mes "to the members of the"; mes "^FF0000"+getguildname(.@GID)+"^000000 Guild."; mes "You'll have to ask another"; mes "Kafra Employee to help you..."; close2; cutin "kafra_01",255; end; } } // Guardian Stones (2) //============================================================ - script Guardian Stone#template -1,{ set .@GID, getcastledata(strnpcinfo(4),1); set .@num, atoi(charat(strnpcinfo(1),0)); set .@var$,"$agit_"+strnpcinfo(2); if (getcharid(2) == .@GID) { mes "^3355FFYou will need the"; mes "following materials to"; mes "rebuild a destroyed"; mes "Guardian Stone.^000000"; next; mes "1 Oridecon"; mes "1 Elunium"; mes "30 Stones"; mes "5 Blue Gemstones"; mes "5 Yellow Gemstones"; mes "5 Red Gemstones"; next; mes "^3355FFDo you want to continue?^000000"; next; if(select("No:Continue") == 1) { mes "^3355FFWork canceled.^000000"; close; } if ((countitem(984) > 0) && (countitem(985) > 0) && (countitem(7049) > 29) && (countitem(717) > 4) && (countitem(715) > 4) && (countitem(716) > 4)) { mes "^3355FFArrange Stones, Elunium, and"; mes "Oridecon, in that order, in the"; mes "center. Then you must arrange"; mes "the enchanted Gemstones to"; mes "rebuild the Guardian Stone.^000000"; next; setarray .@stone$[0],"Elunium","Oridecon","Stones"; set .@i, select("Elunium:Oridecon:Stone")-1; if (.@i == 2) set .@nice,.@nice+10; mes "^3355FF"+.@stone$[.@i]+" has been"; mes "placed in the center.^000000"; next; set .@i, select("Elunium:Oridecon:Stone")-1; if (.@i == 0) set .@nice,.@nice+10; mes "^3355FFYou have lined the"; mes "outside of the center"; mes "with some "+.@stone$[.@i]+".^000000"; next; set .@i, select("Elunium:Oridecon:Stone")-1; if (.@i == 1) set .@nice,.@nice+10; mes "^3355FFYou covered the"; mes "rest of the materials"; mes "with some "+.@stone$[.@i]+".^000000"; next; mes "^3355FFNow you need to arrange"; mes "the enchanted Gemstones"; mes "accordingly. You can identify"; mes "their Magic properties by"; mes "their casting effect.^000000"; next; setarray .@effect[0],56,54,225; setarray .@color$[0],"Red","Yellow","Blue"; while(1) { if (.@roof0 > 7) break; set .@i, rand(3); specialeffect .@effect[.@i]; mes "^3355FFThe Gemstones must"; mes "be arranged in the correct"; mes "order according to their"; mes "magic properties and power.^000000"; next; set .@j, select("Red Gemstone:Yellow Gemstone:Blue Gemstone")-1; mes "^3355FFYou placed the "+.@color$[.@j]+" Gemstone.^000000"; if (.@i == .@j) { mes "^3355FFHowever, the Guardian Stone"; mes "Repair System failed because"; mes "of a magic power conflict.^000000"; close; } set .@nice,.@nice+10; set .@roof0,.@roof0+1; specialeffect EF_STEAL; next; } if (.@nice > 90) { if (!getd(.@var$+"["+(.@num-1)+"]")) { mes "^3355FFThe Guardian Stone"; mes "Repair System has"; mes "already completed.^000000"; close; } else { if (!agitcheck2()) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; mes "Emperium is not present.^000000"; close; } else { mes "^3355FFThe Gemstones have been"; mes "arranged, and the Guardian"; mes "Stone is successfully repaired.^000000"; delitem 984,1; //Oridecon delitem 985,1; //Elunium delitem 7049,30; //Stone delitem 717,5; //Blue_Gemstone delitem 715,5; //Yellow_Gemstone delitem 716,5; //Red_Gemstone close2; donpcevent "df"+.@num+"#"+strnpcinfo(4)+"::OnEnable"; specialeffect EF_ICECRASH; disablenpc strnpcinfo(0); setd .@var$+"["+(.@num-1)+"]",0; set .@df_all,getd(.@var$+"[0]")+getd(.@var$+"[1]"); if (!.@df_all) { mapannounce strnpcinfo(4),"Both Guardian Stones have been erected, bolstering this stronghold's defenses!",bc_map,"0x00ff00"; donpcevent "RL0#"+strnpcinfo(4)+"::OnEnable"; } else mapannounce strnpcinfo(4),"The "+strnpcinfo(1)+" has been repaired successfully.",bc_map,"0x00ff00"; if (getd(.@var$+"[5]") == 1) donpcevent "gard"+.@num+"#"+strnpcinfo(4)+"::OnEnable"; end; } } } else { mes "^3355FFAfter all of that work..."; mes "It looks like you failed"; mes "to fix the Guardian Stone,"; mes "and lost some materials.^000000"; delitem 7049,10; //Stone delitem 717,2; //Blue_Gemstone delitem 715,2; //Yellow_Gemstone delitem 716,2; //Red_Gemstone close; } } else { mes "^3355FFYou don't have enough"; mes "materials to repair"; mes "the Guardian Stone.^000000"; close; } } end; OnInit: OnDisable: disablenpc strnpcinfo(0); end; OnEnable: enablenpc strnpcinfo(0); specialeffect EF_MAPPILLAR2; end; } // Control Devices (3) //============================================================ - script Control#template -1,{ set .@GID, getcastledata(strnpcinfo(4),1); set .@num, atoi(charat(strnpcinfo(1),15)); set .@var$,"$agit_"+strnpcinfo(2); if (getcharid(2) == .@GID) { if (strcharinfo(0) == getguildmaster(.@GID)) { if (getd(.@var$+"["+(.@num+1)+"]") == 2) { mes "^3355FFDemolished Fortress"; mes "Gates can be repaired,"; mes "but you will need to gather"; mes "the following materials.^000000"; next; mes "^4D4DFF10 Steel^000000,"; mes "^4D4DFF30 Trunks^000000,"; mes "^4D4DFF5 Oridecon^000000, and"; mes "^4D4DFF10 Emveretarcon^000000."; next; select("Continue"); if ((countitem(1019) > 29) && (countitem(999) > 9) && (countitem(1011) > 9) && (countitem(984) > 4)) { mes "^3355FFYou will need Trunks to"; mes "repair the support frame,"; mes "Oridecon to enhance the"; mes "gate's endurance, and"; mes "Emveretarcon to basically"; mes "hold everything together.^000000"; next; set .@ro_of01,rand(10,15); while(1) { if (.@ro_of02 == .@ro_of01) break; else { switch(rand(1,4)) { case 1: mes "^3355FFThe support frame"; mes "is badly damaged:"; mes "fixing this part"; mes "is a top priority.^000000"; next; switch(select("Trunk:Steel:Emveretarcon:Oridecon")) { case 1: mes "^3355FFThe frame has been"; mes "reinforced with wood.^000000"; set .@rp_temp,.@rp_temp+1; set .@ro_of02,.@ro_of02+1; specialeffect2 EF_REPAIRWEAPON; next; break; case 2: mes "^3355FFYou tried using steel,"; mes "but it's not working very"; mes "well. You'll have to try"; mes "something else.^000000"; close; case 3: mes "^3355FFYou tried using emveretarcon"; mes "to reinforce the gate, but it's"; mes "not working well at all."; mes "You'll have to start over.^000000"; close; case 4: mes "^3355FFYou tried using oridecon,"; mes "but it's not working very"; mes "well. You'll have to try"; mes "something else.^000000"; close; } break; case 2: mes "^3355FFIt looks like the gate's"; mes "overall endurance needs to"; mes "be reinforced with something.^000000"; next; switch(select("Trunk:Steel:Emveretarcon:Oridecon")) { case 1: mes "^3355FFYou tried using wood"; mes "to reinforce the gate.^000000"; set .@ro_of02,.@ro_of02+1; next; break; case 2: mes "^3355FFYou tried using steel"; mes "to reinforce the gate, but"; mes "it's not working well at all."; mes "You'll have to start over.^000000"; close; case 3: mes "^3355FFYou tried using emveretarcon"; mes "to reinforce the gate, but it's"; mes "not working well at all."; mes "You'll have to start over.^000000"; close; case 4: mes "^3355FFYou hammered the"; mes "oridecon: it looks"; mes "like this will work.^000000"; set .@rp_temp,.@rp_temp+1; set .@ro_of02,.@ro_of02+1; specialeffect2 EF_REPAIRWEAPON; next; break; } break; case 3: mes "^3355FFThe damage to the gate"; mes "has caused all these"; mes "cracks. You'll have to"; mes "weld them solid somehow.^000000"; next; switch(select("Trunk:Steel:Emveretarcon:Oridecon")) { case 1: mes "^3355FFYou tried using wood to fix"; mes "this problem, but it seems"; mes "to have made it worse."; mes "You'll have to start all over.^000000"; close; case 2: mes "^3355FFYou used steel to weld"; mes "all the cracks: the gate is"; mes "is starting to look more solid.^000000"; set .@rp_temp,.@rp_temp+1; set .@ro_of02,.@ro_of02+1; specialeffect2 EF_REPAIRWEAPON; next; break; case 3: mes "^3355FFYou tried using emveretarcon"; mes "to reinforce the gate, but it's"; mes "not working well at all."; mes "You'll have to start over.^000000"; close; case 4: mes "^3355FFYou tried using oridecon,"; mes "but it's not working very"; mes "well. You'll have to try"; mes "something else.^000000"; close; } break; case 4: mes "^3355FFNow you need to make"; mes "sure that the gate is held"; mes "together pretty solidly.^000000"; next; switch(select("Trunk:Steel:Emveretarcon:Oridecon")) { case 1: mes "^3355FFYou tried using wood to fix"; mes "this problem, but it seems"; mes "to have made it worse."; mes "You'll have to start all over.^000000"; close; case 2: mes "^3355FFYou tried using steel,"; mes "but it's not working very"; mes "well. You'll have to try"; mes "something else.^000000"; close; case 3: mes "^3355FFYou successfully used"; mes "the emveretarcon to repair"; mes "much of the gate's damage.^000000"; set .@rp_temp,.@rp_temp+1; set .@ro_of02,.@ro_of02+1; specialeffect2 EF_REPAIRWEAPON; next; break; case 4: mes "^3355FFYou tried using oridecon,"; mes "but it's not working very"; mes "well. You'll have to try"; mes "something else.^000000"; close; } } } } mes "^3355FFWell, it looks like"; mes "you're just about done"; mes "with repairing the gate.^000000"; next; if (!agitcheck2()) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; close; } else { if (.@rp_temp == .@ro_of01) { mes "^3355FFThe Fortress Gate has"; mes "been successfully repaired!^000000"; delitem 1019,30; //Wooden_Block delitem 999,10; //Steel delitem 1011,10; //Emveretarcon delitem 984,5; //Oridecon close2; donpcevent "RL"+.@num+"#"+strnpcinfo(4)+"::OnEnable"; disablenpc strnpcinfo(0); if (.@num == 1) set .@str$,"1st"; else if (.@num == 2) set .@str$,"2nd"; else if (.@num == 3) set .@str$,"3rd"; mapannounce strnpcinfo(4),"The "+.@str$+" Fortress Gate has been reconstructed!",bc_map,"0x00ff00"; if (.@num == 1) setd .@var$+"[2]",0; else { setarray getd(.@var$+"["+.@num+"]"),2,0; donpcevent "Control Device0"+(.@num-1)+"#"+strnpcinfo(2)+"::OnEnable"; } end; } else { mes "^3355FFThe wall has been breached,"; mes "and the attempt to repair the"; mes "Fortress Gate has failed."; mes "You lost some of your"; mes "repair resources...^000000"; delitem 984,2; //Oridecon delitem 999,4; //Steel delitem 1019,14; //Wooden_Block delitem 1011,3; //Emveretarcon close; } } } else { mes "^3355FFYou can't attempt to repair"; mes "the Fortress Gate if you don't"; mes "have all the needed materials.^000000"; close; } } } } end; OnInit: OnDisable: disablenpc strnpcinfo(0); end; OnEnable: enablenpc strnpcinfo(0); end; } // Guardian Summoners (2) //============================================================ - script gard#template -1,{ OnEnable: // .@x[i],.@y[i]: Normal coordinates, #0-21. // .@w[x],.@w[y]: Special coordinates if 'defence' is under 11. if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") { setarray .@w[0],195,250,292,188; setarray .x[0],233,252,232,201,224,196,269,252,201,224,222, 294,256,240,246,235,235,246,240,256,254,242; setarray .y[0], 83, 81,108,130,168,137, 89, 81,130,168,129, 210,203,133, 92,132,132, 92,133,203, 95,151; } else if (strnpcinfo(2) == "arug_cas02") { setarray .@w[0],20,169,268,169; setarray .x[0],104,67,67,113,122,67, 90, 91,122, 20,67, 175,204,211,209,161,186,183,150,161,209,211; setarray .y[0], 32,36,85, 87,112,60,167,119,112,169,85, 31, 32, 63, 88, 91,170,121,110, 91, 88, 63; } else { // Castles 3,4,5 are identical. setarray .@w[0],66,157,211,159; setarray .x[0],130,128,128,128,110,91,65, 65,110,128,128, 156,172,154,156,155,187,212,211,155,156,172; setarray .y[0], 60, 77, 90,100, 96,53,71,103, 96,100, 77, 101, 95, 90, 77, 60, 54, 67,105, 60, 77, 95; } } else { if (strnpcinfo(2) == "schg_cas02") { setarray .@w[0],337,95,307,222; setarray .x[0],326,337,334,296,285,236,285,296,334,337,334, 359,300,337,317,307,300,337,317,307,359,236; setarray .y[0], 83, 95,119, 82, 40, 41, 40, 82,119, 95,119, 85,119,154,183,222,119,154,183,222, 85, 41; } else if (strnpcinfo(2) == "schg_cas03") { setarray .@w[0],306,325,364,305; setarray .x[0],323,273,288,306,323,323,273,288,306,273,273, 338,364,365,317,338,338,364,365,317,364,329; setarray .y[0],308,309,306,326,308,308,309,306,325,309,309, 309,305,261,318,310,309,305,261,318,305,314; } else { // Castles 1,4,5 are identical. setarray .@w[0],108,32,128,42,187,15; // Contains an extra pair, for whatever reason. setarray .x[0],111,109,65,110,88,64,47,109,111,112,120, 130,129,151,187,128,152,187,128,130,130,151; setarray .y[0], 18, 44,22, 40,20,40,43, 48, 18, 32, 37, 22, 47, 18, 15, 42, 43, 15, 42, 22, 28, 18; } } if (charat(strnpcinfo(1),4) == "2") set .@z,11; freeloop(1); set .@defence,getcastledata(strnpcinfo(2),3); callsub OnSummon,.@z; if (.@defence > 70) set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),5; else if (.@defence > 50) set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),4; else if (.@defence > 30) set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),3; else if (.@defence > 10) set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),2; if (.@w[4] && .@z) guardian strnpcinfo(2),.@w[4],.@w[5],"Guardian Soldier",1899,strnpcinfo(0)+"::OnGuardianDied"; else if (.@defence < 11) { set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),2; set .@i,(.@z)?2:0; guardian strnpcinfo(2),.@w[.@i],.@w[.@i+1],"Guardian Soldier",1899,strnpcinfo(0)+"::OnGuardianDied"; } else for(set .@i,1; .@i<getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)); set .@i,.@i+1) callsub OnSummon,.@i+.@z; freeloop(0); copyarray getd(".x_"+strnpcinfo(2)+"[0]"),.@x[0],22; copyarray getd(".y_"+strnpcinfo(2)+"[0]"),.@y[0],22; setd ".timer_"+charat(strnpcinfo(1),4)+strnpcinfo(2),4+.@z; setarray .count$[5],"1st","2nd","3rd","4th","5th"; initnpctimer; end; OnTimer300000: OnTimer900000: OnTimer1800000: OnTimer2700000: OnTimer3600000: if (charat(strnpcinfo(1),4) == "2") end; set .@var$,".timer_"+charat(strnpcinfo(1),4)+strnpcinfo(2); setd .@var$, getd(.@var$)+1; set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2))+1; callsub OnSummon,getd(.@var$); setarray .count$[5],"1st","2nd","3rd","4th","5th"; mapannounce strnpcinfo(2),"The "+.count$[getd(.@var$)]+" Guardian has been summoned from the Gate House.",bc_map,"0xff4500"; if (getd(.@var$) == 9) { setd .@var$,0; stopnpctimer; } end; OnTimer600000: OnTimer1200000: OnTimer2100000: OnTimer3000000: OnTimer3900000: if (!(charat(strnpcinfo(1),4) == "2")) end; set .@var$,".timer_"+charat(strnpcinfo(1),4)+strnpcinfo(2); setd .@var$, getd(.@var$)+1; set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2))+1; callsub OnSummon,getd(.@var$); if (getd(.@var$) == 20) { setd .@var$,0; stopnpctimer; } end; OnSummon: guardian strnpcinfo(2),getd(".x_"+strnpcinfo(2)+"["+getarg(0)+"]"),getd(".y_"+strnpcinfo(2)+"["+getarg(0)+"]"),"Guardian Soldier",1899,strnpcinfo(0)+"::OnGuardianDied"; return; OnGuardianDied: if (charat(strnpcinfo(1),4) == "2") set .@z,11; set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2))-1; if (getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)) < 2) { set getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2)),getd(".MyMobCount_"+charat(strnpcinfo(1),4)+strnpcinfo(2))+1; callsub OnSummon,10+.@z; } end; OnReset: stopnpctimer; killmonster strnpcinfo(2),strnpcinfo(0)+"::OnGuardianDied"; deletearray getd(".x_"+strnpcinfo(2)+"[0]"),22; deletearray getd(".y_"+strnpcinfo(2)+"[0]"),22; end; } // Guardian Stone Summoners (2) //============================================================ - script df#template -1,{ OnEnable: if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") setarray .@i[0],210,234,308,189; else if (strnpcinfo(2) == "arug_cas02") setarray .@i[0],33,168,245,168; else setarray .@i[0],65,171,212,149; // Castles 3,4,5 are identical. } else { if (strnpcinfo(2) == "schg_cas02") setarray .@i[0],231,58,335,230; else if (strnpcinfo(2) == "schg_cas03") setarray .@i[0],242,309,376,251; else setarray .@i[0],27,35,207,75; // Castles 1,4,5 are identical. } set .@num, atoi(charat(strnpcinfo(1),2)); set .@j,(.@num == 1)?0:2; guardian strnpcinfo(2),.@i[.@j],.@i[.@j+1],((.@num == 1)?"1st":"2nd")+" Guardian Stone",1906+.@num,strnpcinfo(0)+"::OnGuardianStoneDied"; end; OnDisable: killmonster strnpcinfo(2),strnpcinfo(0)+"::OnGuardianStoneDied"; setd "$agit_"+substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9)+"["+(atoi(charat(strnpcinfo(1),2))-1)+"]",1; stopnpctimer; end; OnGuardianStoneDied: set .@num, atoi(charat(strnpcinfo(1),2)); set .@var$,"$agit_"+substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); setd .@var$+"["+(.@num-1)+"]",1; if (getd(.@var$+"[0]") == 1 || getd(.@var$+"[0]") == 2) set .@destroyed, .@destroyed+1; if (getd(.@var$+"[1]") == 1 || getd(.@var$+"[1]") == 2) set .@destroyed, .@destroyed+1; if (.@destroyed == 2) { mapannounce strnpcinfo(2),"All of the Guardian Stones have been destroyed!",bc_map,"0x00ff00"; donpcevent "RL0#"+strnpcinfo(2)+"::OnDisable"; } else mapannounce strnpcinfo(2),"The "+((.@num == 1)?"1st":"2nd")+" Guardian Stone has been destroyed!",bc_map,"0x00ff00"; donpcevent "gard"+.@num+"#"+strnpcinfo(2)+"::OnReset"; initnpctimer; end; OnTimer300000: set .@num, atoi(charat(strnpcinfo(1),2)); set .@str$,substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); donpcevent ((.@num == 1)?"1st":"2nd")+" Guardian Stone#"+.@str$+"::OnEnable"; setd "$agit_"+.@str$+"["+(atoi(charat(strnpcinfo(1),2))-1)+"]",2; stopnpctimer; end; } // Barrier Summoners (4) //============================================================ - script RL#template -1,{ OnEnable: set .@num, atoi(charat(strnpcinfo(1),2)); if (.@num == 0) { if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") { setarray .@wall[0],238,74,8,6,0; setarray .@x[0],239,241,243,245; setarray .@y[0], 73, 73, 73, 73; } else if (strnpcinfo(2) == "arug_cas02") { setarray .@wall[0],136,136,8,6,0; setarray .@x[0],137,139,141,143; setarray .@y[0],137,137,137,137; } else { // Castles 3,4,5 are identical. setarray .@wall[0],138,110,8,6,0; setarray .@x[0],139,141,143,145; setarray .@y[0],111,111,111,111; } } else { if (strnpcinfo(2) == "schg_cas02") { setarray .@wall[0],290,98,8,0,0; setarray .@x[0],289,289,289,289; setarray .@y[0], 98,100,102,104; } else if (strnpcinfo(2) == "schg_cas03") { setarray .@wall[0],326,301,6,6,0; setarray .@x[0],326,328,330; setarray .@y[0],300,300,300; } else { // Castles 1,4,5 are identical. setarray .@wall[0],114,48,13,6,0; setarray .@x[0],115,117,119,121,123,125; setarray .@y[0], 49, 49, 49, 49, 49, 49; } } } else if (.@num == 1) { if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") { setarray .@wall[0],239,53,8,6,1; setarray .@x[0],239,241,243,240,242,244; setarray .@y[0], 55, 55, 55, 54, 54, 54; } else if (strnpcinfo(2) == "arug_cas02") { setarray .@wall[0],150,223,12,6,1; setarray .@x[0],151,153,155,157,159,161; setarray .@y[0],222,222,222,222,222,222; } else { // Castles 3,4,5 are identical. setarray .@wall[0],139,158,6,6,1; setarray .@x[0],140,142,144,139,141,143; setarray .@y[0],157,157,157,156,156,156; } } else { if (strnpcinfo(2) == "schg_cas02") { setarray .@wall[0],279,98,8,0,1; setarray .@x[0],280,280,280,281,281,281; setarray .@y[0], 98,100,102, 99,101,103; } else if (strnpcinfo(2) == "schg_cas03") { setarray .@wall[0],325,277,8,6,1; setarray .@x[0],326,328,330,327,329,331; setarray .@y[0],278,278,278,279,279,279; } else { // Castles 1,4,5 are identical. setarray .@wall[0],114,51,13,6,1; setarray .@x[0],115,117,119,121,123,125; setarray .@y[0], 50, 50, 50, 50, 50, 50; } } } else if (.@num == 2) { if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") { setarray .@wall[0],107,124,6,6,1; setarray .@x[0],107,109,111,108,110,112; setarray .@y[0],122,122,122,123,123,123; } else if (strnpcinfo(2) == "arug_cas02") { setarray .@wall[0],125,342,8,0,1; setarray .@x[0],126,126,126,127,127,127; setarray .@y[0],343,345,347,344,346,348; } else { // Castles 3,4,5 are identical. setarray .@wall[0],138,210,8,6,1; setarray .@x[0],140,142,144,139,141,143; setarray .@y[0],209,209,209,208,208,208; } } else { if (strnpcinfo(2) == "schg_cas02") { setarray .@wall[0],230,213,6,0,1; setarray .@x[0],231,231,231,232,232,232; setarray .@y[0],213,215,217,213,215,217; } else if (strnpcinfo(2) == "schg_cas03") { setarray .@wall[0],200,230,8,0,1; setarray .@x[0],201,201,201,202,202,202; setarray .@y[0],231,233,235,232,234,236; } else { // Castles 1,4,5 are identical. setarray .@wall[0],114,154,13,6,1; setarray .@x[0],115,117,119,121,123,125; setarray .@y[0],153,153,153,153,153,153; } } } else { if (compare(strnpcinfo(2),"arug")) { if (strnpcinfo(2) == "arug_cas01") { setarray .@wall[0],84,171,8,6,1; setarray .@x[0], 84, 86, 88, 90; setarray .@y[0],170,170,170,170; } else if (strnpcinfo(2) == "arug_cas02") { setarray .@wall[0],38,314,12,6,1; setarray .@x[0], 40, 42, 44, 46; setarray .@y[0],315,315,315,315; } else { // Castles 3,4,5 are identical. setarray .@wall[0],138,263,8,6,1; setarray .@x[0],139,141,143,145; setarray .@y[0],262,262,262,262; } } else { if (strnpcinfo(2) == "schg_cas02") { setarray .@wall[0],160,141,6,6,1; setarray .@x[0],160,162,164,166; setarray .@y[0],140,140,140,140; } else if (strnpcinfo(2) == "schg_cas03") { setarray .@wall[0],285,198,8,0,1; setarray .@x[0],284,284,284,284; setarray .@y[0],199,201,203,205; } else { // Castles 1,4,5 are identical. setarray .@wall[0],116,241,11,6,1; setarray .@x[0],116,118,120,122; setarray .@y[0],240,240,240,240; } } } if (.@num == 3) set getd(".MyMobCount_"+.@num+strnpcinfo(2)),4; else if (.@num) set getd(".MyMobCount_"+.@num+strnpcinfo(2)),6; setwall strnpcinfo(2),.@wall[0],.@wall[1],.@wall[2],.@wall[3],.@wall[4],substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9)+"_"+strnpcinfo(1); set .@j,(getd(".MyMobCount_"+.@num+strnpcinfo(2)))?getd(".MyMobCount_"+.@num+strnpcinfo(2)):getarraysize(.@x); for(set .@i,0; .@i<.@j; set .@i,.@i+1) guardian strnpcinfo(2),.@x[.@i],.@y[.@i]," ",1905,strnpcinfo(0)+"::OnBarrierDestroyed"; end; OnBarrierDestroyed: set .@num, atoi(charat(strnpcinfo(1),2)); if (!.@num) end; set getd(".MyMobCount_"+.@num+strnpcinfo(2)),getd(".MyMobCount_"+.@num+strnpcinfo(2))-1; if (getd(".MyMobCount_"+.@num+strnpcinfo(2)) == 0) { set .@var$,substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9); setd "$agit_"+.@var$+"["+(.@num+1)+"]",1; setarray .@count$[0],"1st","2nd","3rd"; mapannounce strnpcinfo(2),"The "+.@count$[.@num-1]+" Fortress Gate is destroyed.",bc_map,"0x00ff00"; delwall .@var$+"_"+strnpcinfo(1); } end; OnDisable: delwall substr(strnpcinfo(2),0,1)+substr(strnpcinfo(2),8,9)+"_"+strnpcinfo(1); killmonster strnpcinfo(2),strnpcinfo(0)+"::OnBarrierDestroyed"; end; } // Link Flags (function) //============================================================ function script LinkFlag { if (!getcharid(2) || getcharid(2) != getcastledata(strnpcinfo(4),1)) end; if (getarg(0) == "Convenience Facility") { mes "^3355FFThis is the Stronghold"; mes "Teleport Service. Would"; mes "you like to teleport to the"; mes "Convenience Facility for"; mes "guild members?^000000"; if(select("Go to Convenience Facility:Cancel") == 1) warp strnpcinfo(4),getarg(1),getarg(2); close; } if (getarg(0) == "Emperium Center") { mes "^3355FFThis is the Stronghold"; mes "Teleport Service. Would"; mes "you like to teleport to"; mes "the Emperium Center?^000000"; if(select("Teleport:Cancel") == 1) warp strnpcinfo(4),getarg(1),getarg(2); close; } mes "^3355FFThis is the Stronghold"; mes "Teleport Service. Please"; mes "choose a destination"; mes "within the stronghold.^000000"; for(set .@i,0; .@i<getargcount(); set .@i,.@i+3) set .@menu$, .@menu$+getarg(.@i)+":"; set .@menu$, .@menu$+"Cancel"; set .@i, select(.@menu$)-1; if (.@i != getargcount()/3) warp strnpcinfo(4),getarg(.@i*3+1),getarg(.@i*3+2); close; } // Return Flags (function) //============================================================ function script ReturnFlag { set .@str$, (compare(strnpcinfo(4),"aru"))?"Arunafeltz":"Schwaltzvalt"; set .@GID, getcastledata(getarg(0),1); if (!.@GID) { mes "[ "+.@str$+" Royal Edict ]"; mes "The Holy Kingdom of"; mes .@str$+" declares that"; mes "one has yet to claim lordship"; mes "over this stronghold. The one"; mes "that breaks the Emperium will"; mes "be recognized as its new owner."; close; } if (getcharid(2) == .@GID && getarg(1,0)) { mes "[ Ringing Voice ]"; mes "Courageous one,"; mes "do you wish to return"; mes "to your stronghold?"; next; if(select("Return to the Stronghold:Cancel") == 1 && getcharid(2) == getcastledata(getarg(0),1)) { if (compare(getarg(0),"arug")) { if (getarg(0) == "arug_cas01") setarray .@i[0],67,193; else if (getarg(0) == "arug_cas02") setarray .@i[0],43,256; else setarray .@i[0],121,318; // Castles 3,4,5 are identical. } else { if (getarg(0) == "schg_cas02") setarray .@i[0],136,188; else if (getarg(0) == "schg_cas03") setarray .@i[0],308,202; else setarray .@i[0],120,290; // Castles 1,4,5 are identical. } warp getarg(0),.@i[0],.@i[1]; } close; } mes "[ "+.@str$+" Royal Edict ]"; mes "The Holy Kingdom of"; mes .@str$+" decrees that"; mes "this stronghold is owned"; mes "by the ^FF0000"+getguildname(.@GID)+"^000000 Guild."; next; mes "[ "+.@str$+" Royal Edict ]"; mes "^FF0000"+getguildmaster(.@GID)+"^000000 is"; mes "Guild Master of ^FF0000"+getguildname(.@GID)+"^000000."; mes "Any that object must claim this"; mes "stronghold through strength of"; mes "steel and magic during the"; mes "appointed Guild Siege times."; close; } // Treasure Room Switches //============================================================ - script Switch#template -1,{ mes " "; mes "^3355FFWill you pull"; mes "this small lever?^000000"; next; if(select("Pull Lever:Cancel") == 2) close; if (compare(strnpcinfo(4),"arug")) { if (strnpcinfo(4) == "arug_cas01") setarray .@i[0],121,357; else if (strnpcinfo(4) == "arug_cas02") setarray .@i[0],387,323; else setarray .@i[0],321,57; // Castles 3,4,5 are identical. } else { if (strnpcinfo(4) == "schg_cas02") setarray .@i[0],339,79; else if (strnpcinfo(4) == "schg_cas03") setarray .@i[0],57,13; else setarray .@i[0],275,244; // Castles 1,4,5 are identical. } warp strnpcinfo(4),.@i[0],.@i[1]; close; } // Guild Dungeon Warps //============================================================ - script Sunflower#template -1,{ if (getcharid(2) == getcastledata(strnpcinfo(4),1)) { mes "- It's an amazingly huge sunflower; as big as a human! ... You feel something mysterious emanating from the flower. -"; next; switch(select("Hold the stem.:Do nothing.")) { case 1: if (compare(strnpcinfo(4),"arug")) { set .@map$,"arug_dun01"; setarray .@mapx[0],350,350,50, 50,200; setarray .@mapy[0],350, 50,50,350,386; } else { set .@map$,"schg_dun01"; setarray .@mapx[0],262, 94, 79,212,322; setarray .@mapy[0],314,284,140, 70,166; } set .@i, atoi(charat(strnpcinfo(4),9))-1; warp .@map$,.@mapx[.@i],.@mapy[.@i]; close; case 2: mes "It's too scary to touch unknown things."; close; } } }
  5. my character is already 255 and i still don't have aura but if i am level 99 i have aura // Maximum allowed 'level' value that can be sent in unit packets. // Use together with the aura_lv setting to tell when exactly to show the aura. // NOTE: You also need to adjust the client if you want this to work. // NOTE: Default is 99. Values above 127 will probably behave incorrectly. // NOTE: If you don't know what this does, don't change it!!! max_lv: 99 // Level required to display an aura. // NOTE: This assumes that sending max_lv to the client will display the aura. // NOTE: aura_lv must not be less than max_lv. // Example: If max_lv is 99 and aura_lv is 150, characters with level 99~149 // will be sent as being all level 98, and only characters with level // 150 or more will be reported as having level 99 and show an aura. aura_lv: 255 // Units types affected by max_lv and aura_lv settings. (Note 3) // Note: If an unit type, which normally does not show an aura, is // set it will obtain an aura when it meets the level requirement. // Default: 0 (none) client_limit_unit_lv: 0 i don't see any enable aura above 99 in 3 patchers that i tried to use i'm using 2013-08-07 client custom aura sprites is disabled in diffing
  6. thanks you
  7. when i try to close the vote poll this is the message from the server [Error]: run_script: infinity loop ! [Debug]: Source (NPC): Poll (invisible/not on a map) here is my code // -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\ // Poll System 1.1 \\ // For eAthena TXT/SQL \\ // (c) 2007, by Myzter (Raff - Pow4Ever.com) \\ // -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\ // - CHANGELOG \\ // -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\ // Ver. 1.0 [09-15-2007]: First public version \\ // Ver. 1.1 [09-20-2007]: Added tables to save results on eAthena MySQL \\ // Automatic TXT / SQL detection [with table creation] \\ // Show/hide results before voting [Lupus suggestion] \\ // -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\ - script PollInternal -1,{ OnInit: // Text for Add Option menu - don't remove color set $@NewOption$, "^1010FF<Add Option>^000000"; // MySQL Parameters - Only for eAthena MySQL Servers set $@PollPageSize, 3; // Paging Size (max: 125) set $@TimeFormat$, "%M %d, %Y %k:%i"; // September 20, 2007 14:20 // Other formats: [%m/%d/%Y %k:%i = 09/20/2007 14:20] [%d/%m/%Y %k:%i = 20/09/2007 14:20] // MySQL Auto-Detection set .MyExist, query_sql("select version()"); if (.MyExist < 0) { set $@UseMySQL,0; debugmes "Poll System working on TXT Mode"; } else { set $@UseMySQL,1; debugmes "Poll System working on SQL Mode"; } // First Time Initialization if (!$LastPollID && !$PollID) { cleararray $PollData$[0],"",128; set $PollData$[1],$@NewOption$; } // Table checking / creation if ($@UseMySQL == 1) { if ($@PollPageSize > 125) set $@PollPageSize, 125; set $@UseMySQL,2; // Don't ask why i'm doing this query_sql "show tables like 'poll_main'",.PollTable$; if (.PollTable$[0] == "") { debugmes "Poll System - Creating table `poll_main`"; query_sql "CREATE TABLE `poll_main` (`poll_id` int(11) unsigned NOT NULL,`poll_creator` int(11) unsigned NOT NULL,`poll_title` varchar(70) NOT NULL,`poll_started` datetime NOT NULL,`poll_finished` datetime default NULL,`poll_status` tinyint(1) unsigned default '0', PRIMARY KEY (`poll_id`)) ENGINE=MyISAM;"; } deletearray .PollTable$[0],1; query_sql "show tables like 'poll_options'",.PollTable$; if (.PollTable$[0] == "") { debugmes "Poll System - Creating table `poll_options`"; query_sql "CREATE TABLE `poll_options` ( `poll_id` int(11) unsigned NOT NULL default '0',`poll_text` varchar(70) NOT NULL, `poll_votes` int(11) default '0' ) ENGINE=MyISAM;"; } } // The script will continue on OnTimerXXXXX to start the timer OnTimer30000: // Check every 30 seconds initnpctimer; if (!$PollID || !$PollDuration) end; // Static Counter - VERY HELPFUL (Current Time - Started Time >= Wanted Time) if ($PollDurationType) if ((gettimetick(2) - $PollStartDate) / 60 >= $PollDuration) callfunc "AutoClosePoll",1; else if ((gettimetick(2) - $PollStartDate) / 3600 >= $PollDuration) callfunc "AutoClosePoll,1"; end; } - script Poll -1,{ if ($@NewOption$ == "") goto OnInit; mes "[^930781Tokumitsu^000000]"; if (!$PollID && !$LastPollID) { mes "Hi " + strcharinfo(0) + ", this is a nice day to play RO."; close; } if ($@UseMySQL) set @ViewHistoryPolls$,"^626200View Old Polls^000000"; else set @ViewHistoryPolls$,"View Previows Poll"; if ($PollID) { if (#LastPollID != $PollID) { if (($PollMinLevel && BaseLevel < $PollMinLevel) || ($PollMaxLevel && BaseLevel > $PollMaxLevel)) { mes "Sorry " + strcharinfo(0) + ", your character don't meet the requirements for voting."; mes " "; if ($PollMinLevel) mes "> ^FF0000Minimum level: ^FF0000" + $PollMinLevel + "^000000"; if ($PollMaxLevel) mes "> ^FF0000Maximum level: ^FF0000" + $PollMaxLevel + "^000000"; close; } mes "Hi " + strcharinfo(0) + ", please vote."; switch ($PollPrizeType) { case 1: mes "> Prize: ^FF0000+" + $PollPrizeAmount + "%^000000 Base Level"; mes "> Chance: ^FF0000" + $PollPrizeProb + "%^000000"; break; case 2: mes "> Prize: ^FF0000+" + $PollPrizeAmount + "%^000000 Job Level"; mes "> Chance: ^FF0000" + $PollPrizeProb + "%^000000"; break; case 3: mes "> Prize: ^FF0000" + $PollPrizeAmount + "z^000000"; mes "> Chance: ^FF0000" + $PollPrizeProb + "%^000000"; } mes " "; mes " (1 vote x account)"; if ($LastPollID) set @MainMenu$, "^0000F0Vote^000000:" + @ViewHistoryPolls$ + ":^FF0000Exit^000000"; else set @MainMenu$, "^0000F0Vote^000000::^FF0000Exit^000000"; } else { mes "Hi " + strcharinfo(0) + ", may i help you?"; if ($LastPollID) set @MainMenu$, "^F00000View Current Poll^000000:" + @ViewHistoryPolls$ + ":^FF0000Exit^000000"; else set @MainMenu$, "^F00000View Current Poll^000000::^FF0000Exit^000000"; } } else { mes "Hi " + strcharinfo(0) + ", may i help you?"; set @MainMenu$, ":" + @ViewHistoryPolls$ + ":^FF0000Exit^000000"; } emotion e_no1; next; switch (select(@MainMenu$)) { case 1: goto L_Poll; case 2: if ($@UseMySQL) goto L_OldPolls; else { callfunc "DrawLastPoll"; close; } } L_Exit: mes "[^930781Tokumitsu^000000]"; mes "I hope to see you again ^^"; close; L_PollClosed: mes "[^930781Tokumitsu^000000]"; mes "Oh sorry, the Poll is closed."; close; L_Poll: if (!$PollID) goto L_PollClosed; set @TotPollOpts, callfunc("CountPollOpts"); set @TotPollVotes, callfunc("CountPollVotes"); mes "^0000FF" + $PollData$[0] + "^000000"; mes " ^25B54C(Total Votes: " + @TotPollVotes + ")^000000"; if ($PollShowBeforeVote || #LastPollID == $PollID) { mes "^C0C0C0×××××××××××××××××××××××××××××××^000000"; callfunc "DrawPollOption"; } if (#LastPollID != $PollID) { next; set @opc,select($PollData$[1],$PollData$[3],$PollData$[5],$PollData$[7],$PollData$[9],$PollData$[11],$PollData$[13],$PollData$[15], $PollData$[17],$PollData$[19],$PollData$[21],$PollData$[23],$PollData$[25],$PollData$[27],$PollData$[29],$PollData$[31], $PollData$[33],$PollData$[35],$PollData$[37],$PollData$[39],"^FF0000Exit^000000"); if (@opc == 21) goto L_Exit; mes "[^930781Tokumitsu^000000]"; mes "Selected Option:"; mes " >^0000FF" + $PollData$[@opc * 2 - 1] + "^000000 <"; next; if (select("^0000FFConfirm!^000000","^FF0000Change Option^000000") == 2) goto L_Poll; if (!$PollID) goto L_PollClosed; set #LastPollID,$PollID; set @PollVotes, atoi($PollData$[@opc * 2]) + 1; set $PollData$[@opc * 2], @PollVotes; mes "[^930781Tokumitsu^000000]"; if ($PollPrizeType) { if ($PollPrizeProb < 100) { mes "Please, press <Next> to check your prize:"; mes " "; mes "^FF0000I hope you win!^000000"; next; mes "[^930781Tokumitsu^000000]"; } if (rand(100) <= $PollPrizeProb) { soundeffect "tming_success.wav",0; specialeffect2 610; emotion e_grat; mes "Congratulations!!!"; switch ($PollPrizeType) { case 1: set BaseExp, BaseExp + ((NextBaseExp / 100) * $PollPrizeAmount / 100) * 100; mes "You Win: ^FF0000+" + $PollPrizeAmount + "%^000000 Base Level"; break; case 2: set JobExp, JobExp + ((NextJobExp / 100) * $PollPrizeAmount / 100) * 100; mes "You Win: ^FF0000+" + $PollPrizeAmount + "%^000000 Job Level"; break; default: set Zeny, Zeny + $PollPrizeAmount; mes "You Win: ^FF0000+" + $PollPrizeAmount + "z^000000"; } } else { soundeffect "goat_die.wav",0; specialeffect2 611; emotion e_sry; mes "Sorry " + strcharinfo(0) + ", i hope you win the next time!"; mes " "; mes "Thank's for your Vote."; } } else { mes "Thanks for your vote " + strcharinfo(0) + "!"; } if (!$PollShowBeforeVote) { next; mes "^0000FF" + $PollData$[0] + "^000000"; mes " ^25B54C(Total Votes: " + (@TotPollVotes + 1) + ")^000000"; if ($PollShowBeforeVote || #LastPollID == $PollID) { mes "^C0C0C0×××××××××××××××××××××××××××××××^000000"; callfunc "DrawPollOption"; } } } if ($PollMaxVotes && @PollVotes >= $PollMaxVotes) callfunc "AutoClosePoll",1; close; L_OldPolls: deletearray @pollcount[0],128; query_sql "select count(*) from poll_main where poll_status = 1",@pollcount; if (!@pollcount[0]) { mes "[^930781Poll History^000000]"; mes "Sorry, there are not Old Polls to view."; close; } set @ototpages, (@pollcount[0] - 1) / $@PollPageSize; set @opage, 1; while (1) { cleararray @opollid[0],0,128; cleararray @opolltit$[0],"",128; cleararray @opollstart$[0],0,128; cleararray @opollfinish$[0],0,128; cleararray @opolltot[0],0,128; set @pindex, @opage * $@PollPageSize - $@PollPageSize; set @cnt, query_sql("select a.poll_id, poll_title, date_format(poll_started,'" + $@TimeFormat$ + "'), date_format(poll_finished,'" + $@TimeFormat$ + "'), (select sum(poll_votes) from poll_options b where b.poll_id = a.poll_id) from poll_main a where poll_status = 1 order by poll_title limit " + @pindex + "," + $@PollPageSize,@opollid,@opolltit$,@opollstart$,@opollfinish$,@opolltot); mes "[^930781Old Polls Page " + @opage + "^000000]"; mes "Select a Poll to view the details."; next; if (@ototpages > 0 && @opage < @ototpages + 1) set @EndMenu$, "^0000FF> Next Page^000000:"; else set @EndMenu$, ":"; if (@opage > 1) set @EndMenu$, @EndMenu$ + "^0000FF< Previows Page^000000:^FF0000Exit^000000"; else set @EndMenu$, @EndMenu$ + ":^FF0000Exit^000000"; set @opc, select( @opolltit$[0], @opolltit$[1], @opolltit$[2], @opolltit$[3], @opolltit$[4], @opolltit$[5], @opolltit$[6], @opolltit$[7], @opolltit$[8], @opolltit$[9], @opolltit$[10], @opolltit$[11], @opolltit$[12], @opolltit$[13], @opolltit$[14], @opolltit$[15], @opolltit$[16], @opolltit$[17], @opolltit$[18], @opolltit$[19], @opolltit$[20], @opolltit$[21], @opolltit$[22], @opolltit$[23], @opolltit$[24], @opolltit$[25], @opolltit$[26], @opolltit$[27], @opolltit$[28], @opolltit$[29], @opolltit$[30], @opolltit$[31], @opolltit$[32], @opolltit$[33], @opolltit$[34], @opolltit$[35], @opolltit$[36], @opolltit$[37], @opolltit$[38], @opolltit$[39], @opolltit$[40], @opolltit$[41], @opolltit$[42], @opolltit$[43], @opolltit$[44], @opolltit$[45], @opolltit$[46], @opolltit$[47], @opolltit$[48], @opolltit$[49], @opolltit$[50], @opolltit$[51], @opolltit$[52], @opolltit$[53], @opolltit$[54], @opolltit$[55], @opolltit$[56], @opolltit$[57], @opolltit$[58], @opolltit$[59], @opolltit$[60], @opolltit$[61], @opolltit$[62], @opolltit$[63], @opolltit$[64], @opolltit$[65], @opolltit$[66], @opolltit$[67], @opolltit$[68], @opolltit$[69], @opolltit$[70], @opolltit$[71], @opolltit$[72], @opolltit$[73], @opolltit$[74], @opolltit$[75], @opolltit$[76], @opolltit$[77], @opolltit$[78], @opolltit$[79], @opolltit$[80], @opolltit$[81], @opolltit$[82], @opolltit$[83], @opolltit$[84], @opolltit$[85], @opolltit$[86], @opolltit$[87], @opolltit$[88], @opolltit$[89], @opolltit$[90], @opolltit$[91], @opolltit$[92], @opolltit$[93], @opolltit$[94], @opolltit$[95], @opolltit$[96], @opolltit$[97], @opolltit$[98], @opolltit$[99],@opolltit$[100],@opolltit$[101],@opolltit$[102],@opolltit$[103],@opolltit$[104], @opolltit$[105],@opolltit$[106],@opolltit$[107],@opolltit$[108],@opolltit$[109],@opolltit$[110],@opolltit$[111], @opolltit$[112],@opolltit$[113],@opolltit$[114],@opolltit$[115],@opolltit$[116],@opolltit$[117],@opolltit$[118], @opolltit$[119],@opolltit$[120],@opolltit$[121],@opolltit$[122],@opolltit$[123],@opolltit$[124],@EndMenu$); if (@opc < 126) { callfunc "ShowOldPoll",@opollid[@opc - 1],@opolltit$[@opc - 1],@opollstart$[@opc - 1],@opollfinish$[@opc - 1],@opolltot[@opc - 1]; if (select("Back","^FF0000Exit^000000") == 2) goto L_Exit; } else { switch (@opc) { case 126: set @opage, @opage + 1; break; case 127: set @opage, @opage - 1; break; case 128: goto L_Exit; } } } OnTouch: if (($PollID && #LastPollID != $PollID) && (($PollMinLevel && BaseLevel >= $PollMinLevel) || !$PollMinLevel) && (($PollMaxLevel && BaseLevel <= $PollMaxLevel) || !$PollMaxLevel) && !rand(5)) { emotion e_com; npctalk "Hi " + strcharinfo(0) + ", can you help me please?, it's free!"; } end; OnWhisperGlobal: if (getgmlevel() < 99) end; if (@whispervar0$ == "reset") { set #LastPollID,0; dispbottom "Now you can vote again in this Poll."; end; } mes "[^930781Tokumitsu^000000]"; mes "Hi Master, what can i do for you?"; next; if ($PollID) set @MainMenu$,"::Close Poll:^FF0000Exit^000000"; else set @MainMenu$,"Configure Poll:Publish Poll::^FF0000Exit^000000"; switch(select(@MainMenu$)) { case 1: L_PollConfig: mes "[^930781Tokumitsu^000000]"; if ($PollID) { mes "I'm sorry, you must close the current Poll before try to edit them or create a new one."; next; goto OnWhisperGlobal; } mes "Configure your Poll:"; next; L_PollConfig2: set @TotPollOpts, callfunc("CountPollOpts"); if ($PollMinLevel) set @MinLvL$,"Level " + $PollMinLevel; else set @MinLvL$,"no limit"; if ($PollMaxLevel) set @MaxLvL$,"Level " + $PollMaxLevel; else set @MaxLvL$,"no limit"; switch ($PollPrizeType) { case 1: set @PollPrize$,"Base Level (" + $PollPrizeAmount + "%/" + $PollPrizeProb + "%)";break; case 2: set @PollPrize$,"Job Level (" + $PollPrizeAmount + "%/" + $PollPrizeProb + "%)";break; case 3: set @PollPrize$,"Zeny (" + $PollPrizeAmount + "z/" + $PollPrizeProb + "%)";break; default: set @PollPrize$,"none"; } if ($PollDuration) { if ($PollDurationType) set @MenuDuration$, $PollDuration + " min(s)"; else set @MenuDuration$, $PollDuration + " hr(s)"; } else set @MenuDuration$, "no limit"; if ($PollMaxVotes) set @MenuMaxVotes$, $PollMaxVotes + ""; else set @MenuMaxVotes$, "unlimited"; if ($PollShowBeforeVote) set @ViewBeforeVote$, "Show Results Before Vote [^0000FFYes^000000]"; else set @ViewBeforeVote$, "Show Results Before Vote [^FF0000No^000000]"; switch (select("Title [^0000FF" + $PollData$[0] + "^000000]","Options [^FF0000" + @TotPollOpts + "^000000]","Duration [^FF0000" + @MenuDuration$ + "^000000]","Prize [^FF0000" + @PollPrize$ + "^000000]","Min. Lvl [^FF0000" + @MinLvL$ + "^000000]","Max. Lvl [^FF0000" + @MaxLvL$ + "^000000]","Max. Global Votes [^FF0000" + @MenuMaxVotes$ + "^000000]",@ViewBeforeVote$,"^FF0000Reset^000000","Back")) { case 1: L_PollQuestion: mes "[^930781Tokumitsu^000000]"; mes "Please input the Poll Title:"; if ($PollData$[0] != "") mes "> Current Title: ^0000FF" + $PollData$[0] + "^000000"; mes " (1 to 70 characters)"; next; input @PollQuestion$; if (getstrlen(@PollQuestion$) > 70) { mes "[^930781Tokumitsu^000000]"; mes "The max length is 70 characters."; next; goto L_PollQuestion; } if (compare(@PollQuestion$,":")) { mes "[^930781Tokumitsu^000000]"; mes "Invalid character detected [ ^FF0000:^000000 ]"; next; goto L_PollQuestion; } if (compare(@PollQuestion$,"^")) { mes "[^930781Tokumitsu^000000]"; mes "Invalid character detected [ ^FF0000^^000000 ]"; next; goto L_PollQuestion; } mes "[^930781Tokumitsu^000000]"; mes "> ^FF0000" + @PollQuestion$ + "^000000 <"; next; if (select("Confirm","Back") == 2) goto L_PollConfig; set $PollData$[0],@PollQuestion$; goto L_PollConfig; case 2: L_PollOptions: mes "[^930781Tokumitsu^000000]"; mes "Select a option to edit / create:"; next; L_PollOptions2: set @TotPollOpts, callfunc("CountPollOpts"); if (@TotPollOpts > 1) set @RAO$,"^B13D05Remove All Options^000000"; else set @RAO$,""; set @opc,select($PollData$[1],$PollData$[3],$PollData$[5],$PollData$[7],$PollData$[9],$PollData$[11],$PollData$[13],$PollData$[15], $PollData$[17],$PollData$[19],$PollData$[21],$PollData$[23],$PollData$[25],$PollData$[27],$PollData$[29],$PollData$[31], $PollData$[33],$PollData$[35],$PollData$[37],$PollData$[39],@RAO$,"^FF0000Back^000000"); switch (@opc) { case 21: mes "[^930781Tokumitsu^000000]"; mes "Are you sure that you want to clear all Options?"; next; if (select("No","Yes") == 1) goto L_PollOptions; cleararray $PollData$[1],"",48; setarray $PollData$[1],$@NewOption$; goto L_PollOptions; case 22: goto L_PollConfig; } L_PollOptions3: set @pidx, @opc * 2 - 1; if ($PollData$[@pidx] != $@NewOption$) { switch (select("^F00000* Back^000000","^0000FF* Edit^000000 (" + $PollData$[@pidx] + ")","^800000* Move Up^000000","^8000E0* Move Down^000000","^FF0000* Delete^000000")) { case 1: goto L_PollOptions2; case 2: mes "[^930781Tokumitsu^000000]"; mes "Current Option:"; mes "> ^0000FF" + $PollData$[@pidx] + "^000000 <"; break; case 3: if (@pidx > 1) { set @NewOption$, $PollData$[@pidx]; set $PollData$[@pidx],$PollData$[@pidx - 2]; set $PollData$[@pidx - 2],@NewOption$; } goto L_PollOptions2; case 4: if (@pidx < @TotPollOpts * 2 - 1) { set @NewOption$, $PollData$[@pidx]; set $PollData$[@pidx],$PollData$[@pidx + 2]; set $PollData$[@pidx + 2],@NewOption$; } goto L_PollOptions2; case 5: set @px,@pidx; set @mopt,@TotPollOpts * 2; while (@px < @mopt) { set $PollData$[@px],$PollData$[@px + 2]; set @px, @px + 2; } if ($PollData$[@px - 2] != $@NewOption$) set $PollData$[@px], $@NewOption$; else if ($PollData$[@px] == $@NewOption$) set $PollData$[@px], ""; goto L_PollOptions2; } } else { mes "[^930781Tokumitsu^000000]"; mes "Please input this Option:"; } next; input @NewOption$; if (compare(@NewOption$,":")) { mes "[^930781Tokumitsu^000000]"; mes "Invalid character detected [ ^FF0000:^000000 ]"; next; goto L_PollOptions3; } if (compare(@NewOption$,"^")) { mes "[^930781Tokumitsu^000000]"; mes "Invalid character detected [ ^FF0000^^000000 ]"; next; goto L_PollOptions3; } set @pollidx, callfunc("SearchOption",@NewOption$); if (@pollidx == @opc) goto L_PollOptions; if (@pollidx) { mes "[^930781Tokumitsu^000000]"; mes ">> ^FF0000Duplicate option!^000000 <<"; mes "That option already exist in the position #^FF0000" + @pollidx + "^000000."; next; goto L_PollOptions3; } mes "[^930781Tokumitsu^000000]"; if ($PollData$[@pidx] != $@NewOption$) mes "Previows Option: ^0000FF" + $PollData$[@pidx] + "^000000"; mes "New Option: ^FF0000" + @NewOption$ + "^000000"; next; if (select("Confirm","Back") == 2) goto L_PollOptions; set $PollData$[@pidx],@NewOption$; if ($PollData$[@pidx + 2] == "") { set $PollData$[@pidx + 2],$@NewOption$; set $PollData$[@pidx + 3],"0"; } goto L_PollOptions; case 3: L_PollDuration: mes "[^930781Tokumitsu^000000]"; mes "Select the time unit:"; next; switch(select("Minutes","Hours","Back")) { case 1: set @PollDurationType,1;break; case 2: set @PollDurationType,0;break; default: goto L_PollConfig; } mes "[^930781Tokumitsu^000000]"; if ($PollDurationType) mes "Input the duration of the Poll (minutes):"; else mes "Input the duration of the Poll (hours):"; mes "(0: unlimited)"; next; input @PollDuration; if (@PollDuration < 1) { mes "[^930781Tokumitsu^000000]"; mes "Do you want to set unlimited time to this Poll?"; next; menu "Unlimited Time",-,"Change",L_PollDuration,"Back",L_PollConfig; set $PollDuration,0; set $PollDurationType,0; } else { mes "[^930781Tokumitsu^000000]"; if (@PollDurationType) mes "Poll duration: " + @PollDuration + " minute(s)"; else mes "Poll duration: " + @PollDuration + " hour(s)"; next; menu "Confirm",-,"Change",L_PollDuration,"Back",L_PollConfig; set $PollDuration,@PollDuration; set $PollDurationType,@PollDurationType; } goto L_PollConfig; case 4: L_PollPrizes: mes "[^930781Tokumitsu^000000]"; mes "Please, select the prize for this Poll:"; next; set @pprize, select("Base Exp","Job Exp","Zeny","^FF0000No Prizes^000000","^FF0000Back^000000"); if (@pprize == 4) goto L_PollConfig; switch(@pprize) { case 1: L_BLR: mes "[^930781Tokumitsu^000000]"; mes "Please, input the Base Level Rate for this prize:"; mes " (1-100%, 0: Cancel)"; next; input @pbl; if (!@pbl) goto L_PollPrizes; if (@pbl > 100) { mes "[^930781Tokumitsu^000000]"; mes "The max amount of Base Level for a Poll Prize is 100%"; next; goto L_BLR; } break; case 2: L_JLR: mes "[^930781Tokumitsu^000000]"; mes "Please, input the Job Level Rate for this prize:"; mes " (1-100%, 0: Cancel)"; next; input @pbl; if (!@pbl) goto L_PollPrizes; if (@pbl > 100) { mes "[^930781Tokumitsu^000000]"; mes "The max amount of Job Level for a Poll Prize is 100%"; next; goto L_JLR; } break; case 3: L_ZEN: mes "[^930781Tokumitsu^000000]"; mes "Please, input the amount of Zeny for this prize:"; mes " (100-100000, 0: Cancel)"; next; input @pbl; if (!@pbl) goto L_PollPrizes; if (@pbl > 100000) { mes "[^930781Tokumitsu^000000]"; mes "The max amount of Zeny for a Poll Prize is 100,000z"; next; goto L_ZEN; } break; case 4: set $PollPrizeType,@pprize; set $PollPrizeAmount,@pbl; set $PollPrizeProb,@pbp; mes "[^930781Tokumitsu^000000]"; mes "Poll Prize removed!"; next; default: goto L_PollConfig; } mes "[^930781Tokumitsu^000000]"; switch(@pprize) { case 1: mes "Prize: ^FF0000" + @pbl + "% of Base Level";break; case 2: mes "Prize: ^FF0000" + @pbl + "% of Job Level";break; case 3: mes "Prize: ^FF0000" + @pbl + " of Zeny";break; } mes "^000000Please, input the probabilities to win:"; mes "(1-100%, 0: Cancel)"; next; input @pbp; if (!@pbp) goto L_PollPrizes; if (@pbp > 100) set @pbp, 100; mes "[^930781Tokumitsu^000000]"; switch(@pprize) { case 1: mes "Prize: ^FF0000" + @pbl + "%^000000 of Base Level";break; case 2: mes "Prize: ^FF0000" + @pbl + "%^000000 of Job Level";break; case 3: mes "Prize: ^FF0000" + @pbl + "^000000 of Zeny";break; } mes "Probabilities: ^FF0000" + @pbp + "%^000000"; next; if (select("Confirm","Back") == 2) goto L_PollConfig; set $PollPrizeType,@pprize; set $PollPrizeAmount,@pbl; set $PollPrizeProb,@pbp; goto L_PollConfig; case 5: mes "[^930781Tokumitsu^000000]"; mes "Please, input the minimum Base Level required for Vote:"; mes "(0: All)"; next; input @minlvl; mes "[^930781Tokumitsu^000000]"; mes "Minimum level required for Vote: ^FF0000" + @minlvl + "^000000"; next; if (select("Confirm","Back") == 2) goto L_PollConfig; set $PollMinLevel,@minlvl; if ($PollMinLevel && $PollMaxLevel && $PollMinLevel > $PollMaxLevel) { set @maxlvl,$PollMinLevel; set $PollMinLevel, $PollMaxLevel; set $PollMaxLevel, @maxlvl; } goto L_PollConfig; case 6: mes "[^930781Tokumitsu^000000]"; mes "Please, input the maximum Base Level required for Vote:"; mes "(0: no limit)"; next; input @maxlvl; mes "[^930781Tokumitsu^000000]"; mes "Maximum level required for Vote: ^FF0000" + @maxlvl + "^000000"; next; if (select("Confirm","Back") == 2) goto L_PollConfig; set $PollMaxLevel,@maxlvl; if ($PollMinLevel && $PollMaxLevel && $PollMinLevel > $PollMaxLevel) { set @maxlvl,$PollMinLevel; set $PollMinLevel, $PollMaxLevel; set $PollMaxLevel, @maxlvl; } goto L_PollConfig; case 7: L_PollMaxVotes: mes "[^930781Tokumitsu^000000]"; mes "Please, input the total votes to count before close the Poll:"; mes "(0: no limit)"; next; input @PollMaxV; if (@PollMaxV < 1) { set @PollMaxV,0; goto L_PollConfig; } mes "[^930781Tokumitsu^000000]"; mes "The Poll will be closed after count " + @PollMaxV + " vote(s)"; next; menu "Confirm",-,"Change",L_PollMaxVotes,"Back",L_PollConfig; set $PollMaxVotes,@PollMaxV; goto L_PollConfig; case 8: if ($PollShowBeforeVote) set $PollShowBeforeVote,0; else set $PollShowBeforeVote, 1; goto L_PollConfig2; case 9: mes "[^930781Tokumitsu^000000]"; mes "Are you sure that you want to delete the current Poll configuration?"; next; if (select("Yes","No") == 1) callfunc "ClearPollData",0; goto L_PollConfig; default: goto OnWhisperGlobal; } case 2: mes "[^930781Tokumitsu^000000]"; if ($PollID) { mes "The Poll is already published."; next; goto OnWhisperGlobal; } if ($PollData$[0] == "") { mes "Sorry, you must define the Poll Title with 2 or more options."; next; goto OnWhisperGlobal; } set @TotPollOpts, callfunc("CountPollOpts"); if (@TotPollOpts < 2) { mes "Sorry, before publish this Poll create at least 2 options to vote."; next; goto OnWhisperGlobal; } for (set @px,1; @px < 42; set @px,@px + 2) { if ($PollData$[@px] == $@NewOption$) set $PollData$[@px],""; } if ($PollDuration) { if ($PollDurationType) set @MenuDuration$, $PollDuration + " min(s)"; else set @MenuDuration$, $PollDuration + " hr(s)"; } else set @MenuDuration$, "sin límite"; mes "Title: ^0000FF" + $PollData$[0] + "^000000"; mes "> Duration: ^0000FF" + @MenuDuration$ + "^000000"; mes "^C0C0C0×××××××××××××××××××××××××××××××^000000"; callfunc "DrawPollOption"; next; if (select("Publish Poll","Back") == 2) goto OnWhisperGlobal; set $PollInternalID, $PollInternalID + 1; set $PollID, $PollInternalID; if ($@UseMySQL) query_sql "insert into poll_main (poll_id,poll_creator,poll_title,poll_started) values (" + $PollID + "," + getcharid(3) + ",'" + escape_sql($PollData$[0]) + "', now())"; set $PollStartDate, gettimetick(2); announce "New Poll: [" + $PollData$[0] + "], Please Vote!",bc_all; mes "[^930781Tokumitsu^000000]"; mes "It's done, waiting players votes!"; close; case 3: mes "[^930781Tokumitsu^000000]"; if (!$PollID) { mes "Sorry, there are not a active Poll right now."; next; goto OnWhisperGlobal; } mes "Title: " + $PollData$[0] + "^000000"; callfunc "DrawPollOption"; next; if (select("Close Poll","Back") == 2) goto OnWhisperGlobal; mes "[^930781Tokumitsu^000000]"; mes "Are you sure that you want to close this Poll?"; next; if (select("No","Yes") == 1) goto OnWhisperGlobal; if (!$@UseMySQL) { mes "[^930781Tokumitsu^000000]"; mes "Save the results in the option '^0000FFView Previows Poll^000000'?"; mes " "; mes "(^FF0000replace Last Poll information^000000)"; next; switch (select("Save","Don't Save","Back")) { case 1:callfunc "AutoClosePoll",1;break; case 2:callfunc "AutoClosePoll",0;break; default:goto OnWhisperGlobal; } } else { callfunc "AutoClosePoll",0; } mes "[^930781Tokumitsu^000000]"; mes "The Poll was Closed!"; next; goto OnWhisperGlobal; } goto L_Exit; } function script CountPollOpts { set @TotPollOpts,0; for (set @cpox,1; @cpox < 41; set @cpox,@cpox + 2) { if ($PollData$[@cpox] != "" && $PollData$[@cpox] != $@NewOption$) set @TotPollOpts,@TotPollOpts + 1; } return @TotPollOpts; } function script CountPollVotes { set @TotPollOpts,0; for (set @cpvx,2; @cpvx < 42; set @cpvx,@cpvx + 2) { if ($PollData$[@cpvx] != "") set @TotPollOpts,@TotPollOpts + atoi($PollData$[@cpvx]); } return @TotPollOpts; } function script CountOldPollOpts { set @TotPollOpts,0; for (set @copox,51; @copox < 91; set @copox,@copox + 2) { if ($PollData$[@copox] != "" && $PollData$[@cpox] != $@NewOption$) set @TotPollOpts,@TotPollOpts + 1; } return @TotPollOpts; } function script CountOldPollVotes { set @TotPollOpts,0; for (set @copvx,52; @copvx < 92; set @copvx,@copvx + 2) { if ($PollData$[@copvx] != "") set @TotPollOpts,@TotPollOpts + atoi($PollData$[@copvx]); } return @TotPollOpts; } function script SearchOption { for (set @so,1; @so < 42; set @so,@so + 2) { if ($PollData$[@so] == getarg(0)) return @so / 2 + 1; } return 0; } function script ClearPollData { set $PollID, 0; if (getarg(0)) announce "The Poll [" + $PollData$[0] + "] was closed, thanks for your feedback!",bc_all; cleararray $PollData$[0],"",49; setarray $PollData$[1],$@NewOption$; set $PollDuration,0; set $PollMinLevel,0; set $PollMaxLevel,0; set $PollPrizeType,0; set $PollPrizeAmount,0; set $PollPrizeProb,0; set $PollMaxVotes,0; return; } function script DrawPollOption { set @TotPollVotes, callfunc("CountPollVotes"); for (set @dpox,1; @dpox < 42; set @dpox,@dpox + 2) { if ($PollData$[@dpox] != "") { set @DPVotes,atoi($PollData$[@dpox + 1]); mes (@dpox / 2 + 1) + ". ^FF9C01" + $PollData$[@dpox]; if (@DPVotes) set @pct,21 * (@DPVotes * 100 / @TotPollVotes) / 100; else set @pct,0; set @DPOLine$,"^FF0000"; for (set @DPO,0; @DPO < 21; set @DPO, @DPO + 1) { if (@DPO < @pct) { set @DPOLine$,@DPOLine$ + "¤"; } else { if (@DPO - 1 < @pct) set @DPOLine$,@DPOLine$ + "^DCDCDC"; set @DPOLine$,@DPOLine$ + "¤"; } } mes @DPOLine$ + "^000000 ^DC883E[" + @DPVotes + " vote(s)]^000000"; } } return; } function script DrawLastPoll { set @TotPollVotes, callfunc("CountOldPollVotes"); mes "^0000FF" + $PollData$[50] + "^000000"; mes " ^25B54C(Total Votes: " + @TotPollVotes + ")^000000"; mes " (^FF0000Closed^000000)"; mes "^C0C0C0×××××××××××××××××××××××××××××××^000000"; for (set @dlpx,51; @dlpx < 90; set @dlpx,@dlpx + 2) { if ($PollData$[@dlpx] != "") { set @DPVotes,atoi($PollData$[@dlpx + 1]); mes ((@dlpx - 50) / 2 + 1) + ". ^FF9C01" + $PollData$[@dlpx]; if (@DPVotes) set @pct,21 * (@DPVotes * 100 / @TotPollVotes) / 100; else set @pct,0; set @DPOLine$,"^F0AF00"; for (set @DPO,0; @DPO < 21; set @DPO, @DPO + 1) { if (@DPO < @pct) { set @DPOLine$,@DPOLine$ + "¤"; } else { if (@DPO - 1 < @pct) set @DPOLine$,@DPOLine$ + "^DCDCDC"; set @DPOLine$,@DPOLine$ + "¤"; } } mes @DPOLine$ + "^000000 ^DC883E[" + @DPVotes + " votes]^000000"; } } return; } function script AutoClosePoll { cleararray $PollData$[50],"",77; if ($@UseMySQL) { for (set .acpx,1; .acpx < 42; set .acpx,.acpx + 2) { if ($PollData$[.acpx] != "") query_sql "insert into `poll_options` (`poll_id`,`poll_text`,`poll_votes`) values (" + $PollID + ",'" + escape_sql($PollData$[.acpx]) + "'," + atoi($PollData$[.acpx + 1]) + ")"; } query_sql "update `poll_main` set `poll_finished` = now(), `poll_status` = 1"; } if (getarg(0)) { for (set .acpx,0; .acpx < 42; set .acpx,.acpx + 1) { set $PollData$[.acpx + 50],$PollData$[.acpx]; } set $LastPollID,$PollID; } callfunc "ClearPollData",1; return; } function script ShowOldPoll { deletearray .@polltext$[0],128; deletearray .@pollvotes[0],128; mes "[^0000FFPoll Details^000000]"; mes "Title: ^0000FF" + getarg(1) + "^000000"; mes "> Total Votes: ^FF0000" + getarg(4) + "^000000"; mes "> ^930781" + getarg(2) + " to " + getarg(3) + "^000000"; mes "(^FF0000sorted by votes^000000)"; mes "^C0C0C0×××××××××××××××××××××××××××××××^000000"; set .@totopts, query_sql("select `poll_text`, `poll_votes` from `poll_options` where `poll_id` = " + getarg(0) + " order by `poll_votes` desc",.@polltext$,.@pollvotes); for (set .@x,0; .@x < .@totopts; set .@x, .@x + 1) { mes (.@x + 1) + ". ^0000FF" + .@polltext$[.@x] + "^000000"; if (.@pollvotes[.@x]) set @pct,21 * (.@pollvotes[.@x] * 100 / getarg(4)) / 100; else set @pct,0; set @SOPLine$,"^F0AF00"; for (set @SOP,0; @SOP < 21; set @SOP, @SOP + 1) { if (@SOP < @pct) { set @SOPLine$,@SOPLine$ + "¤"; } else { if (@SOP - 1 < @pct) set @SOPLine$,@SOPLine$ + "^DCDCDC"; set @SOPLine$,@SOPLine$ + "¤"; } } mes @SOPLine$ + "^000000 ^DC883E[" + .@pollvotes[.@x] + " votes]^000000"; } next; return; } // Duplicates prontera,155,176,4 duplicate(Poll) Please Vote#1 831,7,7
  8. how to increase there additional damage example the right hand mastery of sinx gives +100 attack% at level 5. i want it to give 200% instead of 100%
  9. I am requesting for mail npc rather than the official one. but the mail will only contain messages. it won't contain zeny or items. just pure message. The player that received the mail will be notified via popup window that he received a messaged.
  10. bump!
  11. box of thunder additional movement speed is little only. how to make it more to have faster movement speed
  12. how to revert renewal matk to pre-renewal. because i already have 255 int and my matk is still 300+. same applies with atk please give me other way rather than disabling #define RENEWAL
  13. my aspd doesn't increase if i use one of them what should i do? #ifndef DISABLE_RENEWAL /// game renewal server mode /// (disable by commenting the line) /// /// leave this line to enable renewal specific support such as renewal formulas #define RENEWAL /// renewal cast time /// (disable by commenting the line) /// /// leave this line to enable renewal casting time algorithms /// cast time is decreased by DEX * 2 + INT while 20% of the cast time is not reduced by stats. /// example: /// on a skill whos cast time is 10s, only 8s may be reduced. the other 2s are part of a /// "fixed cast time" which can only be reduced by specialist items and skills //#define RENEWAL_CAST /// renewal drop rate algorithms /// (disable by commenting the line) /// /// leave this line to enable renewal item drop rate algorithms /// while enabled a special modified based on the difference between the player and monster level is applied /// based on the http://irowiki.org/wiki/Drop_System#Level_Factor table //#define RENEWAL_DROP /// renewal exp rate algorithms /// (disable by commenting the line) /// /// leave this line to enable renewal item exp rate algorithms /// while enabled a special modified based on the difference between the player and monster level is applied #define RENEWAL_EXP /// renewal level modifier on damage /// (disable by commenting the line) /// // leave this line to enable renewal base level modifier on skill damage (selected skills only) #define RENEWAL_LVDMG /// renewal enchant deadly poison algorithm /// /// leave this line to enable the renewed EDP algorithm /// under renewal mode: /// - damage is NOT increased by 400% /// - it does NOT affect grimtooth /// - weapon and status ATK are increased #define RENEWAL_EDP /// renewal ASPD [malufett] /// (disable by commenting the line) /// /// leave this line to enable renewal ASPD /// - shield penalty is applied /// - AGI has a greater factor in ASPD increase /// - there is a change in how skills/items give ASPD /// - some skill/item ASPD bonuses won't stack #define RENEWAL_ASPD #endif // DISABLE_RENEWAL #endif // _CONFIG_RENEWAL_H_
  14. already tried it sir. didn't work
  15. any idea besides changing the client?
  16. is there a way to make it not goes upside down?
  17. if a monster debuffed or buffed with me with illusion my screen turns up side down. how to fix this? 2013-08-07 client user here
  18. what is the best 2012 client
  19. i can't seems to download the texture pack from this link http://rathena.org/board/files/file/3083-pretty-lights-christmaswinter-prontera/ can anyone reupload it for me? http://www.gamefront.com/files/23922379/winter.rar thank you and merry christmas
  20. if i changed it to 0. then all the skills won't after cooldown. what will i do?
  21. what shall i do inorder to make soul breaker cooldown to 0?
  22. i set a after skill delay(cooldown) to my server. but i want a specific skill to be no after skill delay(cooldown) i'm currently using renewal for example i want that the soul breaker cooldown will be 0. but still after casting soul breaker there is still a cooldown //-- ASC_BREAKER 379,250,1000:1200:1400:1600:1800:2000:2200:2400:2600:2800,0,0,0,0,250 this is my skill.conf //-------------------------------------------------------------- // Hercules Battle Configuration File // Originally Translated by Peter Kieser <[email protected]> // Made in to plainer English by Ancyker //-------------------------------------------------------------- // Note 1: Value is a config switch (on/off, yes/no or 1/0) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, // assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) //-------------------------------------------------------------- // The rate of time it takes to cast a spell (Note 2, 0 = No casting time) casting_rate: 100 // Delay time after casting (Note 2) delay_rate: 40 // Does the delay time depend on the caster's DEX and/or AGI? (Note 1) // Note: On Official servers, neither Dex nor Agi affect delay time delay_dependon_dex: no delay_dependon_agi: no // Minimum allowed delay for ANY skills after casting (in milliseconds) (Note 1) // Note: Setting this to anything above 0 can stop speedhacks. min_skill_delay_limit: 100 // This delay is the min 'can't walk delay' of all skills. // NOTE: Do not set this too low, if a character starts moving too soon after // doing a skill, the client will not update this, and the player/mob will // appear to "teleport" afterwards. default_walk_delay: 300 //Completely disable skill delay of the following types (Note 3) //NOTE: By default mobs don't have the skill delay as specified in the skill // database, but follow their own 'reuse' skill delay which is specified on // the mob skill db. When set, the delay for all skills become // min_skill_delay_limit. no_skill_delay: 2 // At what dex does the cast time become zero (instacast)? castrate_dex_scale: 150 // How much (dex*2+int) does variable cast turns zero? vcast_stat_scale: 150 // What level of leniency should the skill system give for skills when // accounting attack motion (ASPD) for casting skills (Note 2, between 0 and 300) // // NOTE: Setting this to 100% may cause some issues with valid skills not being cast. // The time difference between client and server varies so allowing 90% leniency // should be enough to forgive very small margins of error. skill_amotion_leniency: 90 // Will normal attacks be able to ignore the delay after skills? (Note 1) skill_delay_attack_enable: yes // Range added to skills after their cast time finishes. // Decides how far away the target can walk away after the skill began casting before the skill fails. // 0 disables this range checking (default) skill_add_range: 0 // If the target moves out of range while casting, do we take the items and SP for the skill anyway? (Note 1) skill_out_range_consume: no // Does the distance between caster and target define if the skill is a ranged skill? (Note 3) // If set, when the distance between caster and target is greater than 3 the skill is considered long-range, otherwise it's a melee range. // If not set, then the range is determined by the skill's range (if it is above 5, the skill is ranged). // Default 14 (mobs + pets + homun) skillrange_by_distance: 14 // Should the equipped weapon's range override the skill's range defined in the skill_db for most weapon-based skills? (Note 3) // NOTE: Skills affected by this option are those whose range in the skill_db are negative. Note that unless monster_ai&0x400 is // set, the range of all skills is 9 for monsters. skillrange_from_weapon: 30 // Should a check on the caster's status be performed in all skill attacks? // When set to yes, meteors, storm gust and any other ground skills will have // no effect while the caster is unable to fight (eg: stunned). skill_caster_check: yes // Should ground placed skills be removed as soon as the caster dies? (Note 3) clear_skills_on_death: 0 // Should ground placed skills be removed when the caster changes maps? (Note 3) clear_skills_on_warp: 15 //Setting this to YES will override the target mode of ground-based skills with the flag 0x01 to "No Enemies" //The two skills affected by default are Pneuma and Safety Wall (if set to yes, those two skills will not protect everyone, but only allies) //See db/skill_unit_db.txt for more info. defunit_not_enemy: no // Do skills do at least 'hits' damage when they don't miss/are blocked? //(for example, will firebolts always do "number of bolts" damage versus plants?) //Values (add as appropriate): 1 for weapon-based attacks, 2 for magic attacks, 4 for misc attacks. skill_min_damage: 6 // The delay rate of monk's combo (Note 2) combo_delay_rate: 100 // Use alternate auto Counter Attack Skill Type? (Note 3) // For those characters on which it is set, 100% Critical, // Otherwise it disregard DEF and HIT+20, CRI*2 auto_counter_type: 15 // Can ground skills be placed on top of each other? (Note 3) // By default, skills with UF_NOREITERATION set cannot be stacked on top of // other skills, this setting will override that. (skill_unit_db) skill_reiteration: 0 // Can ground skills NOT be placed underneath/near players/monsters? (Note 3) // If set, only skills with UF_NOFOOTSET set will be affected (skill_unit_db) skill_nofootset: 1 // Should traps (hunter traps + quagmire) change their target to "all" inside gvg/pvp grounds? (Note 3) // Default on official servers: yes for player-traps gvg_traps_target_all: 1 // Some traps settings (add as necessary): // 1: Traps are invisible to those who come into view of it. When unset, all traps are visible at all times. // (Invisible traps can be revealed through Hunter's Detecting skill) traps_setting: 0 // Restrictions applied to the Alchemist's Summon Flora skill (add as necessary) // 1: Enable players to damage the floras outside of versus grounds. // 2: Disable having different types out at the same time // (eg: forbid summoning anything except hydras when there's already // one hydra out) summon_flora_setting: 3 // Whether placed down skills will check walls (Note 1) // (Makes it so that Storm Gust/Lord of Vermillion/etc when cast next to a wall, won't hit on the other side) skill_wall_check: yes // When cloaking, Whether the wall is checked or not. (Note 1) // Note: When the skill does not checks for walls, you will always be considered // as if you had a wall-next to you (you always get the wall-based speed). // Add the settings as required, being hit always uncloaks you. // // 0 = doesn't check for walls // 1 = Check for walls // 2 = Cloaking is not cancelled when attacking. // 4 = Cloaking is not cancelled when using skills player_cloak_check_type: 1 monster_cloak_check_type: 4 // Can't place unlimited land skills at the same time (Note 3) land_skill_limit: 9 //Determines which kind of skill-failed messages should be sent: // 1 - Disable all skill-failed messages. // 2 - Disable skill-failed messages due to can-act delays. // 4 - Disable failed message from Snatcher // 8 - Disable failed message from Envenom display_skill_fail: 2 // Can a player in chat room (in-game), be warped by a warp portal? (Note 1) chat_warpportal: no // What should the wizard's "Sense" skill display on the defense fields? // 0: Do not show defense // 1: Base defense [RE default] // 2: Vit/Int defense // 3: Both (the addition of both) sense_type: 1 // Which finger offensive style will be used? // 0 = Aegis style (single multi-hit attack) // 1 = Athena style (multiple consecutive attacks) finger_offensive_type: 0 // Grandcross Settings (Don't mess with these) // If set to no, hit interval is increased based on the amount of mobs standing on the same cell // (means that when there's stacked mobs in the same cell, they won't receive all hits) gx_allhit: no // Grandcross display type (Default 1) // 0: Yellow character // 1: White character gx_disptype: 1 // Max Level Difference for Devotion devotion_level_difference: 10 // If no than you can use the ensemble skills alone. (Note 1) player_skill_partner_check: yes // Remove trap type // 0 = Aegis system : Returns 1 'Trap' item // 1 = Athena system : Returns all items used to deploy the trap skill_removetrap_type: 0 // Does using bow to do a backstab give a 50% damage penalty? (Note 1) backstab_bow_penalty: yes // How many times you could try to steal from a mob. // Note: It helps to avoid stealing exploit on monsters with few rare items // Use 0 to disable (max allowed value is 255) skill_steal_max_tries: 0 // Can Rogues plagiarize advanced job skills // 0 = no restriction // 1 = only stalker may plagiarize advanced skills // 2 = advanced skills cannot be plagiarized by anyone // Official servers setting: 2 copyskill_restrict: 2 // Does Berserk/Frenzy cancel other self-buffs when used? berserk_cancels_buffs: no // Level and Strength of "MVP heal". When someone casts a heal of this level or // above, the heal formula is bypassed and this value is used instead. max_heal: 9999 max_heal_lv: 11 // Emergency Recall Guild Skill setting (add as appropriate). // Note that for the skill to be usable at all, // you need at least one of 1/2 and 4/8 // 1: Skill is usable outside of woe. // 2: Skill is usable during woe. // 4: Skill is usable outside of GvG grounds // 8: Skill is usable on GvG grounds //16: Disable skill from "nowarpto" maps // (it will work on GVG castles even if they are set to nowarpto, though) emergency_call: 11 // Guild Aura Skills setting (add as appropriate). // (This affects GD_LEADERSHIP, GD_GLORYWOUNDS, GD_SOULCOLD and GD_HAWKEYES) // Note that for the skill to be usable at all, // you need at least one of 1/2 and 4/8 // 1: Skill works outside of woe. // 2: Skill works during woe. // 4: Skill works outside of GvG grounds // 8: Skill works on GvG grounds //16: Disable skill from affecting Guild Master guild_aura: 31 // Allows players to skip menu when casting Teleport level 1 // Menu contains two options. "Random" and "Cancel" skip_teleport_lv1_menu: no // Allow use of SG skills without proper day (Sun/Moon/Star) ? allow_skill_without_day: no // Allow use of ES-type magic on players? allow_es_magic_player: no // Miracle of the Sun, Moon and Stars skill ratio (100% = 10000) sg_miracle_skill_ratio: 2 // Miracle of the Sun, Moon and Stars skill duration in milliseconds sg_miracle_skill_duration: 3600000 // Angel of the Sun, Moon and Stars skill ratio (100% = 10000) sg_angel_skill_ratio: 10 // Skills that bHealPower has effect on // 1: Heal, 2: Sanctuary, 4: Potion Pitcher, 8: Slim Pitcher, 16: Apple of Idun skill_add_heal_rate: 7 // Whether the damage of EarthQuake with a single target on screen is able to be reflected. // Note: On official server, EQ is reflectable when there is only one target on the screen, // which might be an exploit to hunt the MVPs. eq_single_target_reflectable: yes // On official server, you will receive damage from Reflection and some Tarot Card even in invincible status. // When this setting is enabled, it allows you to immune to all kinds of damage, including those stated previous. // (The number will show but no actual damage will be done) invincible.nodamage: no // Dancing Weapon Switch // On official server, a fix is in place that prevents the switching of weapons to cancel songs. // Default: yes dancing_weaponswitch_fix: yes // Skill Trap Type (GvG) // 0: (official) Traps in GvG only make player stop moving after its walk path is complete, and it activates other traps on the way. // 1: Traps in GvG make player stop moving right when stepping over it. skill_trap_type: 0 // Max Possible Level of Monster skills // Note: If your MVPs are too tough, reduce it to 10. mob_max_skilllvl: 100
  23. i attached a screenshot 3ceam svn here
  24. how can i backup my database package without exporting them?
  25. fixed what is the cause of this problem sir?
×
×
  • Create New...