disguise.txt 7.6 KB

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