Advertisement
Guest User

Untitled

a guest
Aug 6th, 2014
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.05 KB | None | 0 0
  1. //===== rAthena Script ======================================================================
  2. //= Map Of The Week v4.4
  3. //===== Original By =========================================================================
  4. //= Kaushik
  5. //===== Current Version: ====================================================================
  6. //= 1.0 - Script Release.
  7. //= 1.1 - Added GM selection of Map Of The Week.
  8. //= 1.2 - Fixed Timer Selection of the Map is on Sunday @ 24:00 server time.
  9. //= 2.0 - Added Contract System.
  10. //= 2.1 - Fixed Contract Expiry (Set #MOTWC to 0 once contract is expired).
  11. //= 2.2 - Cleaned Script to remove some unneeded repertition and script. [ToastOfDoom]
  12. //= 2.3 - Added Bottle Grenade ingredients to the script as it was missed.
  13. //= 2.4 - Decreased the drop rate.
  14. //= 2.5 - Changed announce and dispbottom.
  15. //= 3.0 - Added Whisper Functions. (map, kills, contract, gm).
  16. //= 3.1 - Changed to dynamic Cost and Kills - @motwcost & @motwkill to your desired numbers.
  17. //= 3.2 - Added Menu To The NPC.
  18. //= 4.0 - Added GM commands to change random map, selected map & to Destroy all contracts.
  19. //= 4.1 - Removed SQL unwanted variable.
  20. //= 4.2 - Fixed script contract count variable.
  21. //= 4.3 - Fixed tweet to not give out contract if no map of the week is assigned.
  22. //= 4.4 - Fixed NPC Whisper
  23. //= 5.0 - Changed rewards to dynamic rewards [WIP].
  24. //===== Compatible With: ====================================================================
  25. //= Tested in SQL Revision 14435
  26. //===== Description: ========================================================================
  27. //= A Random Map Will be selected and edp, acid demo bottle ingredients are rewarded.
  28. //===========================================================================================
  29. prontera,164,169,4 script MOTW 903,{
  30. set @motwcost, 1000000; //The cost for the contract per @motwkill kills.
  31. set @motwkill, 10000; //Kills available while the contract is purchased for @motwcost Zeny.
  32.  
  33. mes "[Map Of The Week]";
  34. mes "What do you want to do";
  35. switch(select("^00FF00-^000000Check Map Of The Week","^00FF00-^000000Check Rewards","^00FF00-^000000Contract Status","^00FF00-^000000Sign a Contract","^00FF00-^000000Commands","^FF0000-^000000Nothing"))
  36. {
  37. case 1:
  38. next;
  39. if($MOTW$ == ""){
  40. mes "The Map Of The Week has not been assigned.";
  41. close;
  42. }
  43. mes "[Map Of The Week]";
  44. mes "The Map Of The Week Is ^FF0000"+$MOTW$+"^000000. Every mob on that map has a chance to drop Bronze Coins which you can change for PODS.";
  45. close;
  46. case 2:
  47. next;
  48. mes "[Map Of The Week]";
  49. mes "The reward is ^FF0000Bronze Coin^000000 per mob kill.";
  50. close;
  51. case 3:
  52. next;
  53. mes "[Map Of The Week]";
  54. mes "Please wait while we check your deeds if any.";
  55. progressbar "green",5;
  56. if(!#MOTWC) {
  57. next;
  58. mes "[Map Of The Week]";
  59. mes "You dont have a contract";
  60. close;
  61. }
  62. mes "Your Contract Expires on ^FF0000"+(@motwkill-#MOTWKI)+"^000000";
  63. close;
  64. case 4:
  65. next;
  66. mes "[Map Of The Week]";
  67. if($MOTW$ == ""){
  68. mes "The Map Of The Week has not been assigned. You cannot purchase a contract at this time.";
  69. close;
  70. }
  71. mes "Do you want to buy a contract?";
  72. if(select("Yes:NO")-1) {
  73. mes "[Map Of The Week]";
  74. mes "So Long Looser";
  75. atcommand "@die";
  76. close;
  77. }
  78. else {
  79. mes "[Map Of The Week]";
  80. mes "It Would Cost ^FF0000"+@motwcost+" Zeny^000000 for ^FF0000"+@motwkill+" kills^000000";
  81. if(select("Sure I Will Pay:No")-1) {
  82. mes "[Map Of The Week]";
  83. mes "So Long Looser";
  84. atcommand "@die";
  85. close;
  86. }
  87. else {
  88. if (Zeny < @motwcost) goto MO_NoZeny;
  89. set Zeny,Zeny-@motwcost;
  90. set #MOTWC, 1;
  91. set #MOTWKI, 0;
  92. next;
  93. mes "[Map Of The Week]";
  94. mes "Your contract has been signed";
  95. mes "You can renew your contract anywhere by calling the npc";
  96. mes "whisper ^FF0000NPC:MOTW^000000";
  97. close;
  98. }
  99. }
  100. case 5:
  101. next;
  102. mes "[Map Of The Week]";
  103. mes "Wisper ^FF0000NPC:MOTW^000000";
  104. mes "Available Keywords :";
  105. mes "^00FF00-^000000^FF0000kills^000000 : the no. of kills left";
  106. mes "^00FF00-^000000^FF0000contract^000000 : to renew or buy contract";
  107. mes "^00FF00-^000000^FF0000map^000000 : to know the Map Of The Week";
  108. close;
  109. case 6:
  110. next;
  111. mes "[Map Of The Week]";
  112. mes "Come Back When You are free again";
  113. close;
  114. }
  115.  
  116. OnWhisperGlobal:
  117. if(compare(@whispervar0$,"map")) {
  118. dispbottom "MOTW : The Map Of The Week is "+$MOTW$;
  119. end;
  120. }
  121.  
  122. if(compare(@whispervar0$,"kills")) {
  123. if(#MOTWC != 1) goto MO_NoContract;
  124. mes "[Map Of The Week]";
  125. mes "You can still kill ^FF0000"+(@motwkill-#MOTWKI)+"^000000 monsters.!!";
  126. close;
  127. end;
  128. }
  129.  
  130. if(compare(@whispervar0$,"contract")) {
  131. mes "[Map Of The Week]";
  132. mes "Do you want to buy a contract?";
  133. if(select("Yes:NO")-1) {
  134. mes "[Map Of The Week]";
  135. mes "So Long Looser";
  136. atcommand "@die";
  137. close;
  138. end;
  139. }
  140. else {
  141. mes "[Map Of The Week]";
  142. mes "It Would Cost ^FF0000"+@motwcost+" Zeny^000000 for ^FF0000"+@motwkill+" Kills^000000";
  143. if(select("Sure I Will Pay:No")-1) {
  144. mes "[Map Of The Week]";
  145. mes "So Long Looser";
  146. atcommand "@die";
  147. close;
  148. end;
  149. }
  150. else {
  151. if (Zeny < @motwcost) goto MO_NoZeny;
  152. set Zeny,Zeny-@motwcost;
  153. set #MOTWC, 1;
  154. set #MOTWKI, 0;
  155. mes "[Map Of The Week]";
  156. mes "Your contract has been signed";
  157. close;
  158. end;
  159. }
  160. }
  161. }
  162.  
  163. if(compare(@whispervar0$,"gm")) {
  164. if(getgmlevel() < 90) end;
  165. mes "[Map Of The Week]";
  166. mes "What do you want to do "+strcharinfo(0)+"?";
  167. switch(select("^00FF00-^000000Random MOTW","^00FF00-^000000Enter MOTW","^FF0000-^000000Destroy All Contracts","^FF0000-^000000Nothing"))
  168. {
  169. case 1:
  170. switch(rand(3)){
  171. case 0:
  172. set $@MOTWS, rand(1,11);
  173. set $mapotw$, "pay_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
  174. set $MOTW$, "Payon Forest "+$@MOTWS;
  175. break;
  176.  
  177. case 1:
  178. set $@MOTWS, rand(0,11);
  179. set $mapotw$, "prt_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
  180. set $MOTW$, "Prontera Field "+$@MOTWS;
  181. break;
  182.  
  183. case 2:
  184. set $@MOTWS, rand(1,22);
  185. set $mapotw$, "moc_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
  186. set $MOTW$, "Sograt Desert "+$@MOTWS;
  187. break;
  188. }
  189. announce "MOTW : The Map Of The Week is "+$MOTW$+"!! Every mob on that map has a chance to drop Bronze Coins which you can change for PODS.",0;
  190. next;
  191. mes "[Map Of The Week]";
  192. mes "The Map Of The Week is ^FF0000"+$MOTW$+"^000000!!!!";
  193. close;
  194. case 2:
  195. goto MOTW_Name;
  196. case 3:
  197. next;
  198. mes "[Map Of The Week]";
  199. mes "Destroyed All Contracts";
  200. query_sql "DELETE FROM global_reg_value where str = '#MOTWC'";
  201. query_sql "DELETE FROM global_reg_value where str = '#MOTWKI'";
  202. close;
  203. case 4:
  204. next;
  205. mes "[Map Of The Week]";
  206. mes "Come Back When You are free again";
  207. close;
  208. }
  209. }
  210.  
  211. MO_Nothing:
  212. mes "[Map Of The Week]";
  213. mes "Available Keywords :";
  214. mes "^0000FF-^000000^FF0000kills^000000 : the no. of kills left";
  215. mes "^0000FF-^000000^FF0000contract^000000 : to renew or buy contract";
  216. mes "^0000FF-^000000^FF0000map^000000 : to know the Map Of The Week";
  217. close;
  218. end;
  219.  
  220. MO_NoZeny:
  221. mes "[Map Of The Week]";
  222. mes "Come back when you have zeny";
  223. close;
  224. end;
  225.  
  226. MO_NoContract:
  227. mes "[Map Of The Week]";
  228. mes "You are not under a contract";
  229. close;
  230. end;
  231.  
  232. MO_ContractEnd:
  233. dispbottom "MOTW : Your contract is expired";
  234. set #MOTWC,0;
  235. end;
  236.  
  237. MO_NoContractk:
  238. dispbottom "MOTW : You are not under a contract";
  239. end;
  240.  
  241. MOTW_Name:
  242. mes "[Map Of The Week]";
  243. mes "Enter the map name";
  244. input $MOTWGM$;
  245. mes "The map you entered is ^FF0000"+$MOTWGM$+"^000000";
  246. mes "Is this the correct map";
  247. if(select("Yes:No")-1) {
  248. goto MOTW_Name;
  249. }
  250. else {
  251. set $mapotw$, $MOTWGM$;
  252. set $MOTW$, $MOTWGM$;
  253. announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!!",0;
  254. close;
  255. end;
  256. }
  257.  
  258.  
  259. OnClock2400:
  260. if(gettime(4)!=0) end;
  261. switch(rand(3)){
  262. case 0:
  263. set $@MOTWS, rand(1,11);
  264. set $mapotw$, "pay_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
  265. set $MOTW$, "Payon Forest "+$@MOTWS;
  266. break;
  267.  
  268. case 1:
  269. set $@MOTWS, rand(0,11);
  270. set $mapotw$, "prt_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
  271. set $MOTW$, "Prontera Field "+$@MOTWS;
  272. break;
  273.  
  274. case 2:
  275. set $@MOTWS, rand(1,22);
  276. set $mapotw$, "moc_fild" + (($@MOTWS < 10)?"0":"") + $@MOTWS;
  277. set $MOTW$, "Sograt Desert "+$@MOTWS;
  278. break;
  279. }
  280. announce "MOTW : The Map Of The Week is "+$MOTW$+"!!!",0;
  281. end;
  282.  
  283. OnNPCKillEvent:
  284. getmapxy(.@map$,.@x,.@y,0);
  285. if (.@map$ != $mapotw$) end;
  286. if (!#MOTWC) goto MO_NoContractk;
  287. if (#MOTWKI >= @motwkill) goto MO_ContractEnd;
  288. set #MOTWKI, #MOTWKI+1;
  289. switch(rand(10)){
  290. case 0:
  291. getitem 673,1;
  292. break;
  293. case 1:
  294. getitem 673,1;
  295. break;
  296. case 2:
  297. getitem 673,1;
  298. break;
  299. default:
  300. announce "MOTW : You Got Nothing HAHAH!!!",bc_yellow|bc_self;
  301. break;
  302. }
  303. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement