Advertisement
somer14

Whack-A-Mole

Mar 16th, 2021
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.00 KB | None | 0 0
  1. //==========================================================|
  2. //==========================================================|
  3. //==========================================================|
  4. // _ _ _ _ |
  5. // | | | | | | (_) |
  6. // | |__| |_ _ _ __ ___ ___| |__ _ _ __ ___ __ _ |
  7. // | __ | | | | '__/ _ \/ __| '_ \| | '_ ` _ \ / _` | |
  8. // | | | | |_| | | | (_) \__ \ | | | | | | | | | (_| | |
  9. // |_| |_|\__, |_| \___/|___/_| |_|_|_| |_| |_|\__,_| |
  10. // __/ |Scripter |
  11. // |___/ |
  12. //==========================================================|
  13. //==========================================================|
  14. //==========================================================|
  15. /* ------------------ SCRIPT INFO ------------------------- =
  16. Name: Whack-A-Mole =
  17. Ver : 1.0 =
  18. For: rAthena =
  19. Lang: English =
  20. Cred: Tio Akima (map creator) =
  21. Cred: Frost (guide add custom npc) =
  22. ---------------------------------------------------------- */
  23. //==========================================================|
  24. //==========================================================|
  25. //==========================================================|
  26. ama_fild01,70,128,5 script [GAME] Whack-A-Mole TOUPEIRA,{
  27.  
  28. mes ".::[ Whack-A-Mole ]::.";
  29. mes " ";
  30.  
  31. if(getgroupid() == 99)
  32. {
  33. if(select("Menu Admin:Menu Player")==1)
  34. {
  35. mes "Elija una opción del menú.";
  36. switch(select(""+($tCaca ? "On":"Off")+" NPC:Reset Manual:Exit"))
  37. {
  38. case 1:
  39. clear;
  40. mes ".::[ Whack-A-Mole ]::.";
  41. mes " ";
  42. mes "me gustaría "+($tCaca ? "activar":"desactivar")+" El npc Whack-A-Moles?";
  43. mes "Obs: Reiniciar el servidor no "+($tCaca ? "deshabilitará":"se activará")+" El npc!";
  44. if(select("Cancel:Confirm")==1) close;
  45.  
  46. announce "[Whack-A-Mole]: Es "+($tCaca ? "Activado de nuevo":"Temporalmente deshabilitado")+"!",bc_all;
  47. set $tCaca,($tCaca ? 0:1);
  48. close;
  49.  
  50. case 2:
  51. clear;
  52. mes ".::[ Whack-A-Mole ]::.";
  53. mes " ";
  54. mes "Al hacer el reinicio manual, el rango se eliminará y se convertirá en puntos.!";
  55. if(select("Cancel:Confirmar")==1) close;
  56.  
  57. query_sql "SELECT `account_id`,`name`,`total`,`games` FROM `caca_toupeira` ORDER BY `total` DESC LIMIT 100",.@accid,.@names$,.@points,.@runs;
  58.  
  59. if(!getarraysize(.@points))
  60. {
  61. clear;
  62. mes ".::[ Whack-A-Mole ]::.";
  63. mes " ";
  64. mes "^FF0000* No hay datos para procesar.!";
  65. close;
  66. }
  67.  
  68. for(set .@i,0; .@i<getarraysize(.@accid); set .@i,.@i+1)
  69. { query_sql "UPDATE `login` SET `tpoints`=`tpoints`+"+.@points[.@i]+" WHERE `account_id`="+.@accid[.@i]+""; }
  70.  
  71. query_sql "DELETE FROM `caca_toupeira`";
  72. announce "[Whack-A-Mole]: El rango se reinició y la puntuación se convirtió en puntos para los 100 mejores jugadores.!",bc_all;
  73.  
  74. mes "Listo!!";
  75. close;
  76.  
  77. case 3: close;
  78. }
  79. }
  80. }
  81.  
  82. mes "Tan aventurero, ¿estás listo para una caza divertida y emocionante??";
  83. switch(select("Vamos a cazar!:Ranking:Cómo funciona?:Shop"))
  84. {
  85. case 1:
  86. if($tCaca){ if(getgroupid() < 99){ dispbottom "El acceso está actualmente deshabilitado, sin embargo, GM 99 puede pasar!"; } else { mes "^FF0000 Lamentablemente, el acceso está actualmente deshabilitado!^000000"; close; } }
  87. if(!#ctGuia){ mes "^FF0000 Debes acceder a la guía (¿Cómo funciona?) Para estar informado sobre la operación!^000000"; close; }
  88. if(instance_id(IM_CHAR)){ mes"^FF0000* Ya estás vinculado a una instancia."; close; }
  89.  
  90. instance_create("Whack-A-Mole",IM_CHAR);
  91. set .@x,instance_info("Whack-A-Mole",IIT_ENTER_X);
  92. set .@y,instance_info("Whack-A-Mole",IIT_ENTER_Y);
  93. instance_enter("Whack-A-Mole",.@x,.@y,getcharid(0),instance_id(IM_CHAR));
  94. break;
  95.  
  96. case 2:
  97. clear;
  98. mes "           .::[ Whack-A-Mole ]::.";
  99. mes "^D8BFD8POS. ~ NICK ~ MATCHES ~ MOLES^000000";
  100. mes " ";
  101.  
  102. query_sql "SELECT `account_id`,`name`,`total`,`games` FROM `caca_toupeira` ORDER BY `total` DESC LIMIT 100",.@accid,.@names$,.@points,.@runs;
  103.  
  104. if(!getarraysize(.@points)){ mes "^FF0000* La lista sigue vacía ..."; close; }
  105.  
  106. for(set .@i,0; .@i<getarraysize(.@points); set .@i,.@i+1)
  107. {
  108. if(.@accid[.@i] != getcharid(3)) mes "[ "+(.@i+1)+"º ] "+.@names$[.@i]+": "+.@runs[.@i]+"x ~ "+.@points[.@i]+"x";
  109. else
  110. {
  111. mes "^3CB371[ "+(.@i+1)+"º ] "+.@names$[.@i]+": "+.@runs[.@i]+"x ~ "+.@points[.@i]+"x^000000";
  112. dispbottom ".::[ Whack-A-Mole ]::.",0xF0E68C;
  113. dispbottom "[ "+(.@i+1)+"º ] "+.@names$[.@i]+": "+.@runs[.@i]+"x ~ "+.@points[.@i]+"x",0xF0E68C;
  114. set .@r,1;
  115. }
  116. }
  117.  
  118. if(.@r) close;
  119. else if(select("Mi Ranking:Salir")==2) close;
  120.  
  121. query_sql "SELECT `account_id`,`name`,`total`,`games` FROM `caca_toupeira` ORDER BY `total` DESC",.@accid,.@names$,.@points,.@runs;
  122. set .@index,inarray(.@accid[0],getcharid(3));
  123.  
  124. if(.@index > -1)
  125. {
  126. clear;
  127. mes ".::[ Whack-A-Mole ]::.";
  128. mes " ";
  129. mes "^D8BFD8POSICIÓN:^000000 [ "+(.@index+1)+"º ]";
  130. mes "^D8BFD8NICK:^000000 "+.@names$[.@index]+"";
  131. mes "^D8BFD8MATCHES:^000000 "+.@runs[.@index]+"x Partidas";
  132. mes "^D8BFD8MOLES:^000000 "+.@points[.@index]+"x Toupeiras";
  133. }
  134. else
  135. {
  136. clear;
  137. mes ".::[ Whack-A-Mole ]::.";
  138. mes " ";
  139. mes "Aún no has jugado a Whack-A-Moles!!";
  140. }
  141. close;
  142.  
  143. case 3:
  144. clear;
  145. mes ".::[ Whack-A-Mole ]::.";
  146. mes "En primer lugar, debe desactivar el temblor del terreno, ya que esto afectará la jugabilidad debido al efecto del mazo, debe escribir ^4169E1/quake^000000 (tener estabilidad de la pantalla).";
  147. next;
  148.  
  149. mes ".::[ Whack-A-Mole ]::.";
  150. mes " ";
  151. mes "Luego de ingresar al mapa tendrás 10 segundos para prepararte, luego los topos comenzarán a aparecer, para golpearlos con la almádena solo debes hacer clic en el.";
  152. next;
  153.  
  154. mes ".::[ Whack-A-Mole ]::.";
  155. mes " ";
  156. mes "Con cada Topo que golpea obtienes puntos, los lunares aparecerán cada vez más rápido,";
  157. mes " en algún momento aparecerá un perro de caza y si lo golpeas contará como puntos de error, tendrás "+$ct_ten+" posibilidades";
  158. next;
  159.  
  160. mes ".::[ Whack-A-Mole ]::.";
  161. mes " ";
  162. mes "La puntuación final no será acumulativa, siempre que supere su límite de rango actual, se actualizará, pero nunca se resumirá.!";
  163. next;
  164.  
  165. mes ".::[ Whack-A-Mole ]::.";
  166. mes " ";
  167. mes "Los premios se hacen semanalmente (todos los domingos a las 12 p.m.), por lo que la puntuación de Whack-A-Moles se convertirá en puntos mole.";
  168. next;
  169.  
  170. mes ".::[ Whack-A-Mole ]::.";
  171. mes " ";
  172. mes "Estos puntos te servirán para comprar artículos exclusivos de la tienda accediendo a ella a través del menú de selección "+(.CtItem?" Y no se pueden pasar por comercio.":".")+"";
  173. set #ctGuia,1;
  174. close;
  175.  
  176. case 4:
  177. close2;
  178. query_sql "SELECT `tpoints` FROM `login` WHERE `account_id`="+getcharid(3)+"",.@tpoints;
  179. if(.@tpoints) dispbottom "[Whack-A-Mole]: Tienes "+.@tpoints+"x puntos de Whack-A-Mole";
  180. callshop "LojaT",1;
  181. break;
  182. }
  183. end;
  184.  
  185.  
  186. OnBuyItem:
  187.  
  188. set .@i,inarray(.tShop[0],@bought_nameid);
  189. mes ".::[ Mole Points ]::.";
  190. mes " ";
  191. mes "^551A8BName:^000000  ^9FB6CD"+getitemname(.tShop[.@i])+"^000000";
  192. mes "^551A8BQtt:^000000  ^9FB6CD"+.tShop[(.@i+1)]+"^000000";
  193. mes "^551A8BPoints:^000000  ^9FB6CD"+.tShop[(.@i+2)]+"^000000";
  194. if(select("Cancel:Comprar")==1) close;
  195.  
  196. query_sql "SELECT `tpoints` FROM `login` WHERE `account_id`="+getcharid(3)+"",.@tpoints;
  197. if(.@tpoints < .tShop[(.@i+2)]){ mes "^FF0000* No tienes suficientes puntos!"; close; }
  198. if(!checkweight(.tShop[.@i],.tShop[(.@i+1)])){ mes "^FF0000* Tienes tu inventario lleno!"; close; }
  199.  
  200. query_sql "UPDATE `login` SET `tpoints`=`tpoints`-"+.tShop[(.@i+2)]+" WHERE `account_id`="+getcharid(3)+"";
  201.  
  202. if(!.ctItem) getitem .tShop[.@i],.tShop[(.@i+1)]; else getitembound .tShop[.@i],.tShop[(.@i+1)],Bound_Account;
  203.  
  204. mes "Ready!!";
  205. dispbottom "[Whack-A-Mole]: Tienes "+(.@tpoints-.tShop[(.@i+2)])+"x puntos de Whack-A-Mole";
  206. close;
  207.  
  208.  
  209. OnHour12:
  210.  
  211. if(gettime(DT_DAYOFWEEK) == SUNDAY)
  212. {
  213. query_sql "SELECT `account_id`,`name`,`total`,`games` FROM `caca_toupeira` ORDER BY `total` DESC LIMIT 100",.@accid,.@names$,.@points,.@runs;
  214.  
  215. if(!getarraysize(.@points)) end;
  216.  
  217. for(set .@i,0; .@i<getarraysize(.@accid); set .@i,.@i+1)
  218. { query_sql "UPDATE `login` SET `tpoints`=`tpoints`+"+.@points[.@i]+" WHERE `account_id`="+.@accid[.@i]+""; }
  219.  
  220. query_sql "DELETE FROM `caca_toupeira`";
  221. announce "[Whack-A-Mole]: ¡Se reinició el rango y la puntuación se convirtió en puntos para los 100 mejores jugadores!",bc_all;
  222. }
  223. end;
  224.  
  225.  
  226.  
  227. OnInit:
  228.  
  229. //=== CONFIGURAÇÔES
  230. //====================
  231.  
  232. //Maximum failures the player can commit
  233. //==
  234. set $ct_ten,3;
  235.  
  236. //Chat balloon on top of npc (0 = Off, 1 = On)
  237. //==
  238. set .BalaoChat,1;
  239.  
  240.  
  241. //Item restriction (in-store purchased items)
  242. //-- 1 = You cannot trade.
  243. //-- 0 = without restriction.
  244. //==
  245. set .ctItem,1;
  246.  
  247. //Points of Moles Shop
  248. //-- item_id,amount,points
  249. //==
  250. setarray .tShop[0],
  251. 14154,1,10,
  252. 13989,10,10,
  253. 12913,10,10,
  254. 13759,2,10,
  255. 12034,20,10,
  256. 12028,50,20,
  257. 14216,5,50,
  258. 5137,1,80,
  259. 2254,1,15,
  260. 5776,1,50,
  261. 2279,1,40;
  262.  
  263. //====================
  264.  
  265. for(set .@i,1; .@i<25; set .@i,.@i+1)
  266. { hideonnpc "Mole#"+.@i; hideonnpc "Dog#"+.@i; }
  267.  
  268. query_sql "CREATE TABLE IF NOT EXISTS `caca_toupeira` (`id` int(11) NOT NULL AUTO_INCREMENT,`char_id` int(11) NOT NULL,`account_id` INT(11) NOT NULL,`name` varchar(30) NOT NULL,`total` smallint(3) NOT NULL,`games` SMALLINT(5) NOT NULL,PRIMARY KEY (`id`))";
  269. query_sql "SHOW COLUMNS FROM `login` LIKE 'tpoints'",.@rF$,.@rT,.@rN$,.@rK,.@rD,.@rE$;
  270.  
  271. if(!getarraysize(.@rF$))
  272. { query_sql "ALTER TABLE `login` ADD `tpoints` SMALLINT(5) NOT NULL DEFAULT '0'"; }
  273.  
  274. //Don't Change !!
  275. npcshopattach "LojaT",1;
  276. npcshopdelitem "LojaT",512;
  277.  
  278. for(set .@i,0; .@i<getarraysize(.tShop); set .@i,.@i+3)
  279. { npcshopadditem "LojaT",.tShop[.@i],1; }
  280.  
  281. if(.BalaoChat) waitingroom "[ Whack-A-Mole ]",0;
  282.  
  283. end;
  284. }
  285.  
  286. //loja atch
  287. //==
  288. - shop LojaT -1,512: -1
  289.  
  290. //Main Init
  291. //==
  292. mapslap,0,0,0 script sysMain HIDDEN_NPC,{ end;
  293.  
  294. OnInstanceDestroy:
  295. set 'start_game,0;
  296. end;
  297.  
  298. OnInstanceInit:
  299.  
  300. set 'start_game,1;
  301. set 'count,0;
  302. set 'fail,0;
  303. set 'prec,0;
  304. set 'precT,0;
  305. set 'precF,0;
  306. set 'cid,instance_live_info(ILI_OWNER);
  307. set 'accid,getcharid(3,strcharinfo(0,'cid));
  308.  
  309. for(set .@i,1; .@i<25; set .@i,.@i+1)
  310. {
  311. hideonnpc instance_npcname("Mole#"+.@i);
  312. hideonnpc instance_npcname("Dog#"+.@i);
  313. }
  314.  
  315. sleep 1000;
  316. for(set .@i,5; .@i>0; set .@i,.@i-1){ instance_announce instance_id(),"STARTS AT [ "+.@i+" ]",bc_map; sleep 1000; }
  317. sleep 500;
  318. instance_announce instance_id()," ",bc_map;
  319.  
  320. freeloop(1);
  321. while('start_game)
  322. {
  323. set 'cycle,'cycle+1;
  324.  
  325. switch(rand(1,24))
  326. {
  327. case 1: set .@ord$,('cycle < 10 ? "9,24":'cycle < 20 ? "6,17,9":'cycle < 40 ? "1,9,12,19":"3,9,18,24,5"); set .@st,1; break;
  328. case 2: set .@ord$,('cycle < 10 ? "6,20":'cycle < 20 ? "1,12,24":'cycle < 40 ? "3,7,10,21":"3,12,14,11,5"); set .@st,2; break;
  329. case 3: set .@ord$,('cycle < 10 ? "1,20":'cycle < 20 ? "5,17,22":'cycle < 40 ? "8,12,15,19":"9,12,16,19,24"); set .@st,3; break;
  330. case 4: set .@ord$,('cycle < 10 ? "20,8":'cycle < 20 ? "12,15,22":'cycle < 40 ? "5,11,19,24":"9,2,16,7,22"); set .@st,4; break;
  331. case 5: set .@ord$,('cycle < 10 ? "2,22":'cycle < 20 ? "9,2,20":'cycle < 40 ? "7,18,10,23":"24,23,20,18,12"); set .@st,5; break;
  332. case 6: set .@ord$,('cycle < 10 ? "24,5":'cycle < 20 ? "3,9,18":'cycle < 40 ? "22,1,13,17":"24,16,11,14,2"); set .@st,6; break;
  333. case 7: set .@ord$,('cycle < 10 ? "4,17":'cycle < 20 ? "2,8,5":'cycle < 40 ? "6,19,15,22":"2,14,9,1,8"); set .@st,7; break;
  334. case 8: set .@ord$,('cycle < 10 ? "5,19":'cycle < 20 ? "22,15,7":'cycle < 40 ? "16,9,12,8":"11,19,4,2,23"); set .@st,8; break;
  335. case 9: set .@ord$,('cycle < 10 ? "11,23":'cycle < 20 ? "6,1,9":'cycle < 40 ? "8,15,1,17":"7,17,24,1,20"); set .@st,9; break;
  336. case 10: set .@ord$,('cycle < 10 ? "20,22":'cycle < 20 ? "23,1,19":'cycle < 40 ? "18,5,11,7":"12,16,4,8,2"); set .@st,10; break;
  337. case 11: set .@ord$,('cycle < 10 ? "2,12":'cycle < 20 ? "15,6,3":'cycle < 40 ? "8,4,1,17":"3,19,14,18,22"); set .@st,11; break;
  338. case 12: set .@ord$,('cycle < 10 ? "6,24":'cycle < 20 ? "2,4,9":'cycle < 40 ? "6,12,14,16":"18,22,24,8,2"); set .@st,12; break;
  339. case 13: set .@ord$,('cycle < 10 ? "12,24":'cycle < 20 ? "3,5,22":'cycle < 40 ? "16,2,4,6":"8,3,14,17,22"); set .@st,13; break;
  340. case 14: set .@ord$,('cycle < 10 ? "2,9":'cycle < 20 ? "4,20,9":'cycle < 40 ? "13,22,9,7":"18,2,9,7,2"); set .@st,14; break;
  341. case 15: set .@ord$,('cycle < 10 ? "3,23":'cycle < 20 ? "2,7,21":'cycle < 40 ? "13,5,19,1":"8,1,23,20,12"); set .@st,15; break;
  342. case 16: set .@ord$,('cycle < 10 ? "10,5":'cycle < 20 ? "4,22,15":'cycle < 40 ? "13,24,8,1":"12,4,6,19,2"); set .@st,16; break;
  343. case 17: set .@ord$,('cycle < 10 ? "18,16":'cycle < 20 ? "12,2,7":'cycle < 40 ? "4,11,8,6":"3,7,6,22,12"); set .@st,17; break;
  344. case 18: set .@ord$,('cycle < 10 ? "24,23":'cycle < 20 ? "22,17,12":'cycle < 40 ? "5,1,14,7":"9,10,18,1,5"); set .@st,18; break;
  345. case 19: set .@ord$,('cycle < 10 ? "7,21":'cycle < 20 ? "15,1,19":'cycle < 40 ? "18,8,16,24":"2,1,8,12,21"); set .@st,19; break;
  346. case 20: set .@ord$,('cycle < 10 ? "1,4":'cycle < 20 ? "6,8,11":'cycle < 40 ? "14,18,16,23":"1,15,9,11,20"); set .@st,20; break;
  347. case 21: set .@ord$,('cycle < 10 ? "22,11":'cycle < 20 ? "16,7,21":'cycle < 40 ? "14,19,20,24":"8,5,10,21,2"); set .@st,21; break;
  348. case 22: set .@ord$,('cycle < 10 ? "1,2":'cycle < 20 ? "4,5,6":'cycle < 40 ? "7,8,9,10":"11,12,13,14,15"); set .@st,22; break;
  349. case 23: set .@ord$,('cycle < 10 ? "20,21":'cycle < 20 ? "18,19,23":'cycle < 40 ? "14,15,4,5":"1,2,9,10,11"); set .@st,23; break;
  350. case 24: set .@ord$,('cycle < 10 ? "3,13":'cycle < 20 ? "22,4,7":'cycle < 40 ? "9,5,14,23":"21,12,19,1,11"); set .@st,24; break;
  351. }
  352.  
  353. if(rand(1,2) == 1)
  354. {
  355. switch(.@st)
  356. {
  357. case 1: set .@pre$,('cycle < 10 ? "6,20":'cycle < 20 ? "8,12,16":'cycle < 40 ? "5,17,15,24":"4,15,23,1,10"); break;
  358. case 2: set .@pre$,('cycle < 10 ? "4,8":'cycle < 20 ? "5,6,19":'cycle < 40 ? "9,2,11,24":"6,9,17,24,2"); break;
  359. case 3: set .@pre$,('cycle < 10 ? "5,9,10":'cycle < 20 ? "20,2,9,8":'cycle < 40 ? "5,9,18,24,23":"10,2,4,8,1,15"); break;
  360. case 4: set .@pre$,('cycle < 10 ? "17,5,2,7":'cycle < 20 ? "10,2,24,21":'cycle < 40 ? "9,1,17,3":"8,5,11,6,24,21"); break;
  361. case 5: set .@pre$,('cycle < 10 ? "5,12":'cycle < 20 ? "8,6,24":'cycle < 40 ? "5,12,1,9":"4,3,11,14"); break;
  362. case 6: set .@pre$,('cycle < 10 ? "4,9,8":'cycle < 20 ? "12,17,22":'cycle < 40 ? "20,5,9,7":"22,12,3,4,9"); break;
  363. case 7: set .@pre$,('cycle < 10 ? "1,7":'cycle < 20 ? "12,18,15":'cycle < 40 ? "16,9,5,2":"12,4,19,11,18"); break;
  364. case 8: set .@pre$,('cycle < 10 ? "15,9":'cycle < 20 ? "6,9,18":'cycle < 40 ? "11,17,3,7":"8,9,14,15,24"); break;
  365. case 9: set .@pre$,('cycle < 10 ? "1,3,9":'cycle < 20 ? "15,19,24":'cycle < 40 ? "5,2,16,7":"18,8,4,9,22"); break;
  366. case 10: set .@pre$,('cycle < 10 ? "2,19":'cycle < 20 ? "24,2,20":'cycle < 40 ? "1,6,12,8":"11,17,3,9,5"); break;
  367. case 11: set .@pre$,('cycle < 10 ? "22,13,5":'cycle < 20 ? "8,2,9,22":'cycle < 40 ? "18,14,11,22,5":"13,9,4,8,2,1");break;
  368. case 12: set .@pre$,('cycle < 10 ? "7,2":'cycle < 20 ? "1,8,18":'cycle < 40 ? "3,19,4,22":"9,3,23,12,15"); break;
  369. case 13: set .@pre$,('cycle < 10 ? "19,4":'cycle < 20 ? "13,15,14":'cycle < 40 ? "15,22,13,3":"18,23,4,7,12"); break;
  370. case 14: set .@pre$,('cycle < 10 ? "8,1":'cycle < 20 ? "14,2,23":'cycle < 40 ? "3,5,19,24":"8,22,11,17,3"); break;
  371. case 15: set .@pre$,('cycle < 10 ? "13,17":'cycle < 20 ? "15,9,10":'cycle < 40 ? "12,11,14,2":"9,2,24,19,11"); break;
  372. case 16: set .@pre$,('cycle < 10 ? "9,6,11":'cycle < 20 ? "5,21,16,3":'cycle < 40 ? "12,23,7,2,11":"11,5,3,17,1,8");break;
  373. case 17: set .@pre$,('cycle < 10 ? "8,14":'cycle < 20 ? "18,4,11":'cycle < 40 ? "9,10,7,5":"9,17,2,5,13"); break;
  374. case 18: set .@pre$,('cycle < 10 ? "7,21":'cycle < 20 ? "9,13,11":'cycle < 40 ? "4,3,19,23":"11,15,3,14,24"); break;
  375. case 19: set .@pre$,('cycle < 10 ? "5,24":'cycle < 20 ? "5,16,9":'cycle < 40 ? "1,17,6,4":"22,11,18,13,23"); break;
  376. case 20: set .@pre$,('cycle < 10 ? "3,5":'cycle < 20 ? "9,2,19":'cycle < 40 ? "17,22,1,24":"10,5,19,12,21"); break;
  377. case 21: set .@pre$,('cycle < 10 ? "20,12":'cycle < 20 ? "15,6,24":'cycle < 40 ? "10,18,2,12":"18,24,1,20,6"); break;
  378. case 22: set .@pre$,('cycle < 10 ? "3,4":'cycle < 20 ? "7,8,9":'cycle < 40 ? "11,12,13,14":"16,17,18,19,20"); break;
  379. case 23: set .@pre$,('cycle < 10 ? "10,11":'cycle < 20 ? "9,11,16":'cycle < 40 ? "6,7,21,22":"14,22,19,20,7"); break;
  380. case 24: set .@pre$,('cycle < 10 ? "9,23":'cycle < 20 ? "12,14,21":'cycle < 40 ? "19,15,24,13":"2,22,9,24,23"); break;
  381. }
  382. }
  383.  
  384. set .@rst1,explode(.@npc1$,.@ord$,",");
  385. if(.@pre$ != "") set .@rst2,explode(.@npc2$,.@pre$,",");
  386. if(.@pre$ != "") for(set .@i,0; .@i<getarraysize(.@npc2$); set .@i,.@i+1){ hideoffnpc instance_npcname("Dog#"+.@npc2$[.@i]+""); sleep 50; }
  387. for(set .@i,0; .@i<getarraysize(.@npc1$); set .@i,.@i+1){ hideoffnpc instance_npcname("Mole#"+.@npc1$[.@i]+""); sleep 100; }
  388.  
  389. sleep ('cycle < 10 ? 2000:'cycle < 25 ? 1500:'cycle < 50 ? 1300:1000);
  390.  
  391. for(set .@i,0; .@i<getarraysize(.@npc1$); set .@i,.@i+1){ hideonnpc instance_npcname("Mole#"+.@npc1$[.@i])+""; }
  392. if(.@pre$ != "") for(set .@i,0; .@i<getarraysize(.@npc2$); set .@i,.@i+1){ hideonnpc instance_npcname("Dog#"+.@npc2$[.@i]+""); }
  393.  
  394. if('prec >= 'precT)
  395. {
  396. specialeffect 610,AREA,instance_npcname("#p4_arct");
  397. }
  398. else
  399. {
  400. if('fail < $ct_ten) set 'fail,'fail+1;
  401. specialeffect 611,AREA,instance_npcname("#p4_arct");
  402. if('fail >= $ct_ten) set 'start_game,0;
  403. }
  404.  
  405. set .@st,0;
  406. set .@ord$,"";
  407. set .@pre$,"";
  408. set 'prec,0;
  409. deletearray .@npc1$[0],getarraysize(.@npc1$);
  410. deletearray .@npc2$[0],getarraysize(.@npc2$);
  411. }
  412. freeloop(0);
  413.  
  414. if('count)
  415. {
  416. query_sql "SELECT `account_id`,`total` FROM `caca_toupeira` WHERE `account_id`="+'accid+"",.@accid,.@total;
  417. if(!.@accid) query_sql "INSERT INTO `caca_toupeira` VALUES (null,"+'cid+","+'accid+",'"+strcharinfo(0,'cid)+"',0,0)";
  418. query_sql "UPDATE `caca_toupeira` SET `games`=`games`+1 WHERE `account_id`="+'accid+"";
  419. }
  420.  
  421. if('count > .@total)
  422. {
  423. query_sql "UPDATE `caca_toupeira` SET `total`="+'count+" WHERE `account_id`="+'accid+"";
  424. query_sql "SELECT `account_id` FROM `caca_toupeira` ORDER BY `total` DESC LIMIT 100",.@rankpos;
  425. set .@rank,inarray(.@rankpos[0],'accid)+1;
  426. instance_announce instance_id(),"Veo que eres un cazador dedicado!",bc_map,0x00BFFF;
  427. instance_announce instance_id(),"Su récord actual es [ "+'count+"x ] moles",bc_map,0x00BFFF;
  428. instance_announce instance_id(),"Tu posición de rango es [ "+.@rank+"º ]",bc_map,0x00BFFF;
  429. }
  430. else if('count)
  431. {
  432. query_sql "SELECT `account_id`,`total` FROM `caca_toupeira` ORDER BY `total` DESC LIMIT 100",.@rankpos,.@total;
  433. set .@rank,inarray(.@rankpos[0],'accid)+1;
  434. set .@record,.@total[(.@rank-1)];
  435. instance_announce instance_id(),"Sigue jugando y entrenando para ascender en la clasificación semanal",bc_map,0x00BFFF;
  436. instance_announce instance_id(),"Su registro / rango actual es [ "+'count+"x / "+.@record+"x ] topos y su posición en el rango actual es [ "+.@rank+"º ]",bc_map,0x00BFFF;
  437. }
  438. else
  439. { instance_announce instance_id(),"El cazador se perdió...",bc_map,0x00BFFF; }
  440.  
  441. sleep 2000;
  442. instance_destroy;
  443. end;
  444. }
  445.  
  446.  
  447. //FUNC CT_Controle
  448. //==
  449. function script ct_func {
  450.  
  451. switch(getarg(0))
  452. {
  453. case 1:
  454. set 'count,'count+1;
  455. set 'prec,'prec+1;
  456. specialeffect 4,AREA,instance_npcname(getarg(1));
  457. specialeffect 102,AREA,instance_npcname(getarg(1));
  458. specialeffect 100,AREA,instance_npcname(getarg(1));
  459. specialeffect 610,AREA,instance_npcname(getarg(1));
  460. hideonnpc instance_npcname(getarg(1));
  461. break;
  462.  
  463. case 2:
  464. if('fail < $ct_ten) set 'fail,'fail+1;
  465. specialeffect 4,AREA,instance_npcname(getarg(1));
  466. specialeffect 102,AREA,instance_npcname(getarg(1));
  467. specialeffect 100,AREA,instance_npcname(getarg(1));
  468. specialeffect 611,AREA,instance_npcname(getarg(1));
  469. hideonnpc instance_npcname(getarg(1));
  470. break;
  471. }
  472.  
  473. return;
  474. }
  475.  
  476. //Conta Toupeiras
  477. //==
  478. mapslap,7,18,5 script #p1_count 4_DOG01,{ end;
  479.  
  480. OnInstanceInit:
  481.  
  482. freeloop(1);
  483. while('start_game)
  484. {
  485. waitingroom "Moles [ "+'count+" ]",0;
  486. sleep 199;
  487. delwaitingroom;
  488. }
  489. waitingroom "Moles [ "+'count+" ]",0;
  490. freeloop(0);
  491. end;
  492.  
  493. OnInit:
  494. hideonnpc strnpcinfo(3);
  495. end;
  496. }
  497.  
  498. //Conta Falhas
  499. //==
  500. mapslap,11,11,5 script #p2_fail 4_BOARD3,{ end;
  501.  
  502. OnInstanceInit:
  503.  
  504. freeloop(1);
  505. while('start_game)
  506. {
  507. waitingroom "Failures [ "+'fail+" / "+$ct_ten+" ]",0;
  508. sleep 199;
  509. delwaitingroom;
  510. }
  511. waitingroom "Failures [ "+'fail+" / "+$ct_ten+" ]",0;
  512. freeloop(0);
  513. end;
  514.  
  515. OnInit:
  516. hideonnpc strnpcinfo(3);
  517. end;
  518. }
  519.  
  520. //Conta Ciclos
  521. //==
  522. mapslap,32,18,5 script #3_ciclo 4_BOARD3,{ end;
  523.  
  524. OnInstanceInit:
  525.  
  526. freeloop(1);
  527. while('start_game)
  528. {
  529. waitingroom "Cycles [ "+'cycle+" ]",0;
  530. sleep 299;
  531. delwaitingroom;
  532. }
  533. waitingroom "Cycles [ "+'cycle+" ]",0;
  534. freeloop(0);
  535. end;
  536.  
  537. OnInit:
  538. hideonnpc strnpcinfo(3);
  539. end;
  540. }
  541.  
  542. //Conta Acertos
  543. //==
  544. mapslap,28,11,5 script #p4_arct 4_BOARD3,{ end;
  545.  
  546. OnInstanceInit:
  547.  
  548. freeloop(1);
  549. while('start_game)
  550. {
  551. set 'precT,('cycle < 10 ? 1:'cycle < 20 ? 2:'cycle < 40 ? 3:4);
  552. waitingroom "Hit(s) [ "+'prec+" / "+'precT+" ]",0;
  553. sleep 200;
  554. delwaitingroom;
  555. }
  556. waitingroom "Hit(s) [ "+'prec+" / "+'precT+" ]",0;
  557. freeloop(0);
  558. end;
  559.  
  560. OnInit:
  561. hideonnpc strnpcinfo(3);
  562. end;
  563. }
  564.  
  565.  
  566. //Success
  567. //==
  568. mapslap,12,26,5 script Mole#1 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  569. mapslap,15,26,5 script Mole#2 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  570. mapslap,18,26,5 script Mole#3 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  571. mapslap,21,26,5 script Mole#4 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  572. mapslap,24,26,5 script Mole#5 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  573. mapslap,27,26,5 script Mole#6 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  574.  
  575. mapslap,12,23,5 script Mole#7 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  576. mapslap,15,23,5 script Mole#8 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  577. mapslap,18,23,5 script Mole#9 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  578. mapslap,21,23,5 script Mole#10 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  579. mapslap,24,23,5 script Mole#11 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  580. mapslap,27,23,5 script Mole#12 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  581.  
  582. mapslap,12,20,5 script Mole#13 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  583. mapslap,15,20,5 script Mole#14 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  584. mapslap,18,20,5 script Mole#15 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  585. mapslap,21,20,5 script Mole#16 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  586. mapslap,24,20,5 script Mole#17 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  587. mapslap,27,20,5 script Mole#18 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  588.  
  589. mapslap,12,17,5 script Mole#19 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  590. mapslap,15,17,5 script Mole#20 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  591. mapslap,18,17,5 script Mole#21 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  592. mapslap,21,17,5 script Mole#22 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  593. mapslap,24,17,5 script Mole#23 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  594. mapslap,27,17,5 script Mole#24 TOUPEIRA,{ callfunc "ct_func",1,strnpcinfo(0); }
  595.  
  596. //Failure
  597. //==
  598. mapslap,12,26,5 script Dog#1 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  599. mapslap,15,26,5 script Dog#2 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  600. mapslap,18,26,5 script Dog#3 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  601. mapslap,21,26,5 script Dog#4 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  602. mapslap,24,26,5 script Dog#5 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  603. mapslap,27,26,5 script Dog#6 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  604.  
  605. mapslap,12,23,5 script Dog#7 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  606. mapslap,15,23,5 script Dog#8 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  607. mapslap,18,23,5 script Dog#9 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  608. mapslap,21,23,5 script Dog#10 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  609. mapslap,24,23,5 script Dog#11 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  610. mapslap,27,23,5 script Dog#12 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  611.  
  612. mapslap,12,20,5 script Dog#13 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  613. mapslap,15,20,5 script Dog#14 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  614. mapslap,18,20,5 script Dog#15 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  615. mapslap,21,20,5 script Dog#16 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  616. mapslap,24,20,5 script Dog#17 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  617. mapslap,27,20,5 script Dog#18 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  618.  
  619. mapslap,12,17,5 script Dog#19 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  620. mapslap,15,17,5 script Dog#20 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  621. mapslap,18,17,5 script Dog#21 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  622. mapslap,21,17,5 script Dog#22 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  623. mapslap,24,17,5 script Dog#23 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  624. mapslap,27,17,5 script Dog#24 4_DOG01,{ callfunc "ct_func",2,strnpcinfo(0); }
  625.  
  626. //mapflags
  627. //==
  628. mapslap mapflag noteleport
  629. mapslap mapflag nowarp
  630.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement