Guest User

Untitled

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