disguise.txt 7.7 KB

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