Advertisement
Guest User

Untitled

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