//===== eAthena Script ====================================================================== //= Map Of The Week v4.1 //===== Original By ========================================================================= //= Kaushik //===== Current Version: ==================================================================== //= 1.0 - Script Release. //= 1.1 - Added GM selection of Map Of The Week. //= 1.2 - Fixed Timer Selection of the Map is on Sunday @ 24:00 server time. //= 2.0 - Added Contract System. //= 2.1 - Fixed Contract Expiry (Set #MOTWC to 0 once contract is expired). //= 2.2 - Cleaned Script to remove some unneeded repertition and script. [ToastOfDoom] //= 2.3 - Added Bottle Grenade ingredients to the script as it was missed. //= 2.4 - Decreased the drop rate. //= 2.5 - Changed announce and dispbottom. //= 3.0 - Added Whisper Functions. (map, kills, contract, gm). //= 3.1 - Changed to dynamic Cost and Kills - @motwcost & @motwkill to your desired numbers. //= 3.2 - Added Menu To The NPC. //= 4.0 - Added GM commands to change random map, selected map & to Destroy all contracts. //= 4.1 - Removed SQL unwanted variable. //= 5.0 - Changed rewards to dynamic rewards [WIP]. //===== Compatible With: ==================================================================== //= Tested in SQL Revision 14435 //===== Description: ======================================================================== //= A Random Map Will be selected and edp, acid demo bottle ingredients are rewarded. //=========================================================================================== prontera,170,110,1 script MOTW 411,{ set @motwcost, 200000; //The cost for the contract per @motwkill kills. set @motwkill, 10000; //Kills available while the contract is purchased for @motwcost Zeny. mes "[Map Of The Week]"; mes "What do you want to do"; switch(select("^00FF00ï^000000Check Map Of The Week","^00FF00ï^000000Check Rewards","^00FF00ï^000000Contract Status","^00FF00ï^000000Sign a Contract","^00FF00ï^000000Commands","^FF0000ï^000000Nothing")) { case 1: next; mes "[Map Of The Week]"; mes "The Map Of The Week Is ^FF0000"+$MOTW$+"^000000."; close; case 2: next; mes "[Map Of The Week]"; mes "The rewards are ^FF0000Poison Bottles, Acid Bottles, Grenade Bottles^000000 Ingredients."; close; case 3: next; mes "[Map Of The Week]"; mes "Please wait while we check your deeds if any."; progressbar "green",5; if(!#MOTWC) { next; mes "[Map Of The Week]"; mes "You dont have a contract"; close; } mes "Your Contract Expires on ^FF0000"+(@motwkill-#MOTWKI)+"^000000"; close; case 4: next; mes "[Map Of The Week]"; mes "Do you want to buy a contract?"; if(select("Yes:NO")-1) { mes "[Map Of The Week]"; mes "So Long Looser"; atcommand "@die"; close; } else { mes "[Map Of The Week]"; mes "It Would Cost ^FF0000"+@motwcost+" Zeny^000000 for ^FF0000"+@motwkill+" kills^000000"; if(select("Sure I Will Pay:No")-1) { mes "[Map Of The Week]"; mes "So Long Looser"; atcommand "@die"; close; } else { if (Zeny < @motwcost) goto MO_NoZeny; set Zeny,Zeny-@motwcost; set #MOTWC, 1; set #MOTWKI, 0; next; mes "[Map Of The Week]"; mes "Your contract has been signed"; mes "You can renew your contract anywhere by calling the npc"; mes "whisper ^FF0000NPC:MOTW^000000"; close; } } case 5: next; mes "[Map Of The Week]"; mes "Wisper ^FF0000NPC:MOTW^000000"; mes "Available Keywords :"; mes "^00FF00ï^000000^FF0000kills^000000 : the no. of kills left"; mes "^00FF00ï^000000^FF0000contract^000000 : to renew or buy contract"; mes "^00FF00ï^000000^FF0000map^000000 : to know the Map Of The Week"; close; case 6: next; mes "[Map Of The Week]"; mes "Come Back When You are free again"; close; } OnWhisperGlobal: if(compare(@whispervar0$,"map")) { dispbottom "MOTW : The Map Of The Week is "+$MOTW$; end; } if(compare(@whispervar0$,"kills")) { if(#MOTWC != 1) goto MO_NoContract; mes "[Map Of The Week]"; mes "You can still kill ^FF0000"+(@motwkill-#MOTWKI)+"^000000 monsters.!!"; close; } if(compare(@whispervar0$,"contract")) { mes "[Map Of The Week]"; mes "Do you want to buy a contract?"; if(select("Yes:NO")-1) { mes "[Map Of The Week]"; mes "So Long Looser"; atcommand "@die"; close; } else { mes "[Map Of The Week]"; mes "It Would Cost ^FF0000"+@motwcost+" Zeny^000000 for ^FF0000"+@motwkill+" Kills^000000"; if(select("Sure I Will Pay:No")-1) { mes "[Map Of The Week]"; mes "So Long Looser"; atcommand "@die"; close; } else { if (Zeny < @motwcost) goto MO_NoZeny; set Zeny,Zeny-@motwcost; set #MOTWC, 1; set #MOTWKI, 0; mes "[Map Of The Week]"; mes "Your contract has been signed"; close; } } } if(compare(@whispervar0$,"gm")) { if(getgmlevel() < 90) end; mes "[Map Of The Week]"; mes "What do you want to do "+strcharinfo(0)+"?"; switch(select("^00FF00ï^000000Random MOTW","^00FF00ï^000000Enter MOTW","^FF0000ï^000000Destroy All Contracts","^FF0000ï^000000Nothing")) { case 1: switch(rand(3)){ case 0: set $@MOTWS, rand(1,11); set $mapotw$, "pay_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS; set $MOTW$, "Payon Forest "+$@MOTWS; break; case 1: set $@MOTWS, rand(0,11); set $mapotw$, "prt_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS; set $MOTW$, "Prontera Field "+$@MOTWS; break; case 2: set $@MOTWS, rand(1,22); set $mapotw$, "moc_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS; set $MOTW$, "Sograt Desert "+$@MOTWS; break; } announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0; next; mes "[Map Of The Week]"; mes "The Map Of The Week is ^FF0000"+$MOTW$+"^000000!!!!"; close; case 2: goto MOTW_Name; case 3: next; mes "[Map Of The Week]"; mes "Destroyed All Contracts"; query_sql "DELETE FROM global_reg_value where str = '#MOTWC'"; query_sql "DELETE FROM global_reg_value where str = '#MOTWKI'"; close; case 4: next; mes "[Map Of The Week]"; mes "Come Back When You are free again"; close; } } MO_Nothing: mes "[Map Of The Week]"; mes "Available Keywords :"; mes "^0000FFï^000000^FF0000kills^000000 : the no. of kills left"; mes "^0000FFï^000000^FF0000contract^000000 : to renew or buy contract"; mes "^0000FFï^000000^FF0000map^000000 : to know the Map Of The Week"; close; MO_NoZeny: next; mes "[Map Of The Week]"; mes "Come back when you have zeny"; close; MO_NoContract: next; mes "[Map Of The Week]"; mes "You are not under a contract"; close; MO_ContractEnd: dispbottom "MOTW : Your contract is expired"; set #MOTWC,0; end; MO_NoContractk: dispbottom "MOTW : You are not under a contract"; end; MOTW_Name: mes "[Map Of The Week]"; mes "Enter the map name"; input $MOTWGM$; mes "The map you entered is ^FF0000"+$MOTWGM$+"^000000"; mes "Is this the correct map"; if(select("Yes:No")-1) { goto MOTW_Name; } else { set $mapotw$, $MOTWGM$; set $MOTW$, $MOTWGM$; announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0; close; } OnClock2400: if(gettime(4)!=0) end; switch(rand(3)){ case 0: set $@MOTWS, rand(1,11); set $mapotw$, "pay_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS; set $MOTW$, "Payon Forest "+$@MOTWS; break; case 1: set $@MOTWS, rand(0,11); set $mapotw$, "prt_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS; set $MOTW$, "Prontera Field "+$@MOTWS; break; case 2: set $@MOTWS, rand(1,22); set $mapotw$, "moc_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS; set $MOTW$, "Sograt Desert "+$@MOTWS; break; } announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0; end; OnNPCKillEvent: getmapxy(.@map$,.@x,.@y,0); if (.@map$ != $mapotw$) end; if (!#MOTWC) goto MO_NoContractk; if (#MOTWKI >= 10000) goto MO_ContractEnd; set #MOTWKI, #MOTWKI+1; switch(rand(10)){ case 0: getitem 937,1; getitem 939,1; getitem 952,1; getitem 972,1; getitem 7033,1; break; case 1: getitem 929,1; break; case 2: getitem 970,1; getitem 1059,1; break; default: announce "MOTW : You Got Nothing HAHAH!!!",bc_yellow|bc_self; break; } }