Advertisement
Guest User

Untitled

a guest
May 4th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Disguise Event
  3. //===== By: ==================================================
  4. //= GmOcean
  5. //===== Current Version: =====================================
  6. //= 5.1
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Additional Comments: =================================
  10. //= Note: This script requires PCRE to run properly.
  11. //= 5.0 Last update by GmOcean.
  12. //= 5.1 Cleaned and standardized, mostly. [Euphy]
  13. //============================================================
  14.  
  15. prontera,160,155,4 script Disguise Event 795,{
  16.  
  17. // Currently set to run every two hours.
  18. // To change times, edit the OnClock labels below.
  19.  
  20. set .@GMLevel,60; // GM level required to access NPC.
  21. set .@n$,"[^0000FFDisguise NPC^000000]";
  22.  
  23. if (getgmlevel()>=.@GMLevel) {
  24. mes .@n$;
  25. mes "Select an option.";
  26. next;
  27. switch(select("Turn ON/OFF Event:Event Settings")) {
  28. case 1:
  29. mes .@n$;
  30. if (.EventON) {
  31. mes "The Event is currently: [^0000FFON^000000]";
  32. mes "Would you like to turn it OFF?";
  33. } else {
  34. mes "The Event is currently: [^FF0000OFF^000000]";
  35. mes "Would you like to turn it ON?";
  36. }
  37. if(select("Yes:No")==2) close;
  38. if (.EventON) {
  39. set .EventON,0; set .Timer,0;
  40. setnpctimer 0; stopnpctimer;
  41. announce "A GM has decided to turn the Disguise Event off. As a result no further prizes will be given.",bc_map | bc_blue;
  42. deletepset 1;
  43. setnpcdisplay "Disguise Event",795;
  44. close;
  45. }
  46. set .EventON,1; set .Timer,1; setnpctimer 0; initnpctimer;
  47. set .ResetCounter,.ResetCounter+1;
  48. announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue;
  49. announce "The Event is being held in Prontera.",bc_all | bc_blue;
  50. close;
  51. case 2:
  52. mes .@n$;
  53. mes "Pick a setting to modify.";
  54. next;
  55. switch(select("Monster Display:Number of Rounds:Prize Settings")) {
  56. case 1:
  57. setarray .@r$[0],"Disguise as all monsters.","Disguise as MVPs only.";
  58. mes .@n$;
  59. mes "Choose a disguise rule.";
  60. next;
  61. set .Rule, select(implode(.@r$,":"));
  62. mes .@n$;
  63. mes "The Disguise Rule has been set:";
  64. mes " > ^0055FF"+.@r$[.Rule-1]+"^000000";
  65. close;
  66. case 2:
  67. mes .@n$;
  68. mes "Input the number of rounds you want the event to last.";
  69. mes "Current number: [^0000FF"+.Rounds+"^000000]";
  70. next;
  71. input .@Rounds;
  72. set .Rounds,.@Rounds;
  73. mes .@n$;
  74. mes "The number of rounds has been changed to "+.Rounds+".";
  75. close;
  76. case 3:
  77. mes .@n$;
  78. mes "Input the Item ID of the prize given each round.";
  79. mes "Current item: [^0000FF"+getitemname(.Prize)+"^000000] (ID #"+.Prize+")";
  80. next;
  81. input .@Prize;
  82. mes .@n$;
  83. if (getitemname(.@Prize)=="" || getitemname(.@Prize)=="null") {
  84. mes "That item does not exist. Please try again.";
  85. close;
  86. }
  87. set .Prize,.@Prize;
  88. mes "Input the amount to be given.";
  89. next;
  90. input .@amount;
  91. mes .@n$;
  92. if (.@amount<=0 || .@amount>=10000) {
  93. mes "That amount is invalid. Using default ammount of 1.";
  94. set .@amount,1;
  95. next;
  96. mes .@n$;
  97. }
  98. set .PrizeAmt,.@amount;
  99. mes "The Prize has been changed successfully.";
  100. mes "Prize: "+.PrizeAmt+"x [^0000FF"+getitemname(.Prize)+"^000000]";
  101. close;
  102. }
  103. }
  104. }
  105. if (.EventON) end;
  106. mes .@n$;
  107. mes "Welcome.";
  108. mes "How may I be of assistance?";
  109. if(select("Information:Nothing, just passing through.")==2) close;
  110. next;
  111. mes .@n$;
  112. mes "This event is quite simple.";
  113. mes "At the start of the event, I will";
  114. mes "disguise myself as a random";
  115. mes "monster. You have to shout";
  116. mes "that monter's name out loud.";
  117. next;
  118. mes "If you are correct, you will receive";
  119. mes "a prize. If not, keep trying!";
  120. mes "That's all that there is to this event.";
  121. close;
  122.  
  123. OnInit:
  124. set .EventON,0;
  125. set .Wait,0;
  126. set .Winner,0;
  127. set .ResetCounter,0;
  128. set .Rounds,10;
  129. set .Prize,512;
  130. set .PrizeAmt,1;
  131. set .Rule,1;
  132. setarray .MVP[0],1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373,
  133. 1389,1399,1418,1492,1502,1511,1583,1623,1630,1646,1647,1648,1649,1650,1651,1658,1685,1688,
  134. 1708,1719,1734,1751,1768,1779,1785,1802,1832,1871,1874,1885,1917,1980,2022,2068,2087,2131,
  135. 2156,2165;
  136. set .BlackList$, "1003,1006,1017,1021,1022,1027,1043,1075,1136,1137,1168," +
  137. "1171,1172,1173,1181,1187,1210,1217,1218,1222,1223,1224,1225,1226,1227,1228," +
  138. "1233,1284,1407,1411,1414,1495,1501,1900,1996,2000,2001,2002,2003,2004," +
  139. "2005,2006,2007,2011,2012,2025,2028,2029,2030,2031,2032,2033,2034,2035," +
  140. "2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049," +
  141. "2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063," +
  142. "2064,2065,2066,2067,2075,2076,2077,2078,2079,2080,2081,2083,2084,2085," +
  143. "2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099," +
  144. "2100,2101,2012,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113," +
  145. "2114,2115,2116,2117,2118,2119,2120,2121,2123,2124,2125,1496,";
  146. end;
  147. OnClock0000:
  148. OnClock0200:
  149. OnClock0400:
  150. OnClock0600:
  151. OnClock0800:
  152. OnClock1000:
  153. OnClock1200:
  154. OnClock1400:
  155. OnClock1600:
  156. OnClock1680:
  157. OnClock1800:
  158. OnClock2000:
  159. OnClock2200:
  160. set .ResetCounter,.ResetCounter+1;
  161. set .EventON,1;
  162. set .Timer,1;
  163. set .Wait,1;
  164. announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue;
  165. announce "The Event is being held in Prontera.",bc_all | bc_blue;
  166. setnpctimer 0;
  167. initnpctimer;
  168. end;
  169. OnTimer10000:
  170. if (.Timer || .Change) end;
  171. set .Wait,0;
  172. goto iDisguise;
  173. end;
  174. OnTimer30000:
  175. if (.Timer) end;
  176. set .Change,0;
  177. setnpcdisplay "Disguise Event",795;
  178. npctalk "You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
  179. specialeffect 725;
  180. set $MonsterName$,"";
  181. deletepset 1;
  182. stopnpctimer;
  183. setnpctimer 0;
  184. initnpctimer;
  185. end;
  186. OnTimer60000:
  187. if (.Timer!=1) end;
  188. announce "The Disguise Event will begin in 2 minutes.",bc_all | bc_blue;
  189. announce "The Event is being held in Prontera.",bc_all | bc_blue;
  190. end;
  191. OnTimer120000:
  192. if (.Timer!=1) end;
  193. announce "The Disguise Event will begin 1 minute.",bc_all | bc_blue;
  194. announce "The Event is being held in Prontera.",bc_all | bc_blue;
  195. end;
  196. OnTimer180000:
  197. if (.Timer!=1) end;
  198. announce "The Disguise Event has begun!",bc_all | bc_blue;
  199. announce "The Event is being held in Prontera.",bc_all | bc_blue;
  200. set .Timer,0; stopnpctimer;
  201. setnpctimer 0; initnpctimer;
  202. iDisguise:
  203. if (.Rule==1) {
  204. set .Winner,0;
  205. set .Monster,1000+rand(1,995);
  206. if (compare(","+.BlackList$+"," , ","+.Monster+",")) goto iDisguise;
  207. if (.Monster==.LastMonster) goto iDisguise;
  208. set .LastMonster,.Monster;
  209. set $MonsterName$,getmonsterinfo(.Monster,0);
  210. }
  211. if (.Rule==2) {
  212. set .Winner,0;
  213. set .Monster,rand(49);
  214. set $MonsterName$,getmonsterinfo(.MVP[.Monster],0);
  215. }
  216. deletepset 1;
  217. defpattern 1,"([^:]+):.\\s*"+$MonsterName$+".*", "iCorrect";
  218. activatepset 1;
  219. if (.Rule==1) setnpcdisplay "Disguise Event",.Monster;
  220. if (.Rule==2) setnpcdisplay "Disguise Event",.MVP[.Monster];
  221. set .Change,1;
  222. setnpctimer 0;
  223. end;
  224. iCorrect:
  225. if (.Winner) {
  226. dispbottom "Someone has already won this round.";
  227. end;
  228. }
  229. set .Winner,1;
  230. set .RoundCount,.RoundCount+1;
  231. deletepset 1;
  232. activatepset 1;
  233. getitem .Prize,.PrizeAmt;
  234. announce strcharinfo(0)+" is correct! I was disguised as: "+$MonsterName$+"",bc_map | bc_blue;
  235. if (.RoundCount>=.Rounds) {
  236. setnpcdisplay "Disguise Event",795;
  237. set .RoundCount,0; set .Change,0; set .EventON,0;
  238. setnpctimer 0; stopnpctimer;
  239. npctalk "Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
  240. end;
  241. }
  242. setnpcdisplay "Disguise Event",795;
  243. set .Change,0;
  244. setnpctimer 0;
  245. end;
  246. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement