brendorox

Untitled

Sep 1st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.93 KB | None | 0 0
  1. //===== Cronus Script ========================================
  2. //= Poring Race System
  3. //===== Description: =========================================
  4. //= Poring Race
  5. //===== Mapflags: =============================================
  6. p_track02 mapflag nobranch
  7. p_track02 mapflag noicewall
  8. p_track02 mapflag nomemo
  9. p_track02 mapflag noreturn
  10. p_track02 mapflag noteleport
  11. p_track02 mapflag nowarpto
  12. p_track02 mapflag nowarp
  13. p_track02 mapflag pvp off
  14. p_track02 mapflag nosave
  15. //====== Teleporte: ============================================
  16. prontera,147,175,6 script Poring Race#prace0 882,{
  17.  
  18. if($prace_gate == 0){
  19. mes "[Warper]";
  20. mes "Desculpe, mas a Corrida dos Porings está fechada.";
  21. close;
  22. }
  23. mes "[Warper]";
  24. mes "Olá "+StrCharInfo(0)+", você quer ir";
  25. mes "para a Corrida dos Porings?";
  26. if(select("Sim, claro.:Não, obrigado.") == 2) close;
  27. close2; warp "p_track02",55,41; end;
  28. }
  29. //====== Warps: ================================================
  30. hugel,45,57,0 warp p_track001 2,2,p_track02,75,42
  31. p_track02,78,42,0 warp p_track002 1,3,hugel,48,60
  32. //====== Checker: ==============================================
  33. p_track02,44,41,0 script Checker#prace0 -1,{
  34. end;
  35.  
  36. OnChequeo:
  37. set .@prace_prize, 607; // ID do prêmio para quem vencer.[Padrão: ????]
  38. set .@prace_prize_quantity, 1; // Quantidade do prêmio. [Padrão: 1]
  39.  
  40. set $prace_gate,0;
  41. for(set .@i,0; .@i < (getarraysize($prace_bidders)); set .@i, .@i + 1){
  42. if(attachrid($prace_bidders[.@i])){
  43. if (@prace_playing!=1) end;
  44. set @z, rand(150000,400000);
  45. dispbottom "O vencedor é o "+$prace_winner$+" e você apostou em "+@prace_winner$+".";
  46. if (@prace_winner$==$prace_winner$ && @prace_winner$!=""){
  47. dispbottom "Você venceu! Prêmio: 1 "+getitemname(@id); mapannounce "p_track02"," Parabéns! "+strcharinfo(0)+" venceu!",1,0xFFAB54;
  48. getitem .@prace_prize,1; emotion 21,1; warp "prontera",150,170;
  49. } else { dispbottom "Você perdeu."; emotion 28,1; warp "prontera",150,170; }
  50. @atcommand "@undisguise";
  51. end;
  52. set @prace_winner$,"";set @prace_playing,0;
  53. } //else { announce .@i+" || "+$prace_bidders[.@i],bc_all; } //debug
  54. }
  55. for(set .@i,0; .@i < (getarraysize($prace_bidders)); set .@i, .@i + 1) set $prace_bidders[.@i],0;
  56. }
  57.  
  58. - script Timers#prace0 -1,{
  59.  
  60. OnClock0000: callsub OnCalll;
  61. OnClock0200: callsub OnCalll;
  62. OnClock0400: callsub OnCalll;
  63. OnClock0600: callsub OnCalll;
  64. OnClock0800: callsub OnCalll;
  65. OnClock1000: callsub OnCalll;
  66. OnClock1200: callsub OnCalll;
  67. OnClock1400: callsub OnCalll;
  68. OnClock1600: callsub OnCalll;
  69. OnClock1800: callsub OnCalll;
  70. OnClock2000: callsub OnCalll;
  71. OnClock2200: callsub OnCalll;
  72.  
  73. OnCalll:
  74. set $prace_gate,1;
  75. announce "A 'Corrida dos Porings' irá começar em breve, façam suas apostas!",bc_all|bc_yellow;
  76. end;
  77. }
  78. //====== Principal: ============================================
  79. p_track02,58,41,2 script Bidder#prace0 765,{
  80.  
  81. set .@prace_zeny,3000; // Preço para apostar. [Padrão: 3500]
  82.  
  83. if ($prace_random < 1) callsub OnInit;
  84. if (@prace_playing==1) callsub AlreadyPlaying;
  85.  
  86. if($prace_gate == 0){ mes "[Bidder]"; mes "Uma corrida está em andamento..."; close; }
  87.  
  88. getmapxy(.@mapname$,.@x1,.@y,1,"Poring#prace1");
  89. getmapxy(.@mapname$,.@x2,.@y,1,"Angeling#prace2");
  90. getmapxy(.@mapname$,.@x3,.@y,1,"Metaling#prace3");
  91. getmapxy(.@mapname$,.@x4,.@y,1,"Deviling#prace4");
  92. getmapxy(.@mapname$,.@x5,.@y,1,"Poring Noel#prace5");
  93. getmapxy(.@mapname$,.@x6,.@y,1,"Poporing#prace6");
  94. if (.@x1 != 58 || .@x2 != 58 || .@x3 != 58 || .@x4 != 58 || .@x5 != 58 || .@x6 != 58){
  95. mes "[Bidder]"; mes "Uma corrida está em andamento..."; close;
  96. }
  97. mes "[Bidder]"; mes "Escolha o poring em que deseja apostar:";mes "Irá custar "+.@prace_zeny+" Zeny.";next;
  98. switch(select("Poring","Angeling","Metaling","Deviling","Poring Noel","Poporing")){
  99. case 1: atcommand "@disguise 1002"; callfunc "OnBid","Poring";
  100. case 2: atcommand "@disguise 1096"; callfunc "OnBid","Angeling";
  101. case 3: atcommand "@disguise 1613"; callfunc "OnBid","Metaling";
  102. case 4: atcommand "@disguise 1582"; callfunc "OnBid","Deviling";
  103. case 5: atcommand "@disguise 1062"; callfunc "OnBid","Poring Noel";
  104. case 6: atcommand "@disguise 1031"; callfunc "OnBid","Poporing";
  105. }
  106.  
  107. OnReady:
  108. set $prace_bets,$prace_bets+1;
  109. set $prace_bidders[$prace_bets],getcharid(3);
  110. set @prace_playing,1;
  111. mes "[Bidder]";
  112. mes "Eu tenho "+$prace_bets+" apostas.";
  113. setnpctimer 60000; startnpctimer;
  114. npctalk strcharinfo(0)+" fez sua aposta!";
  115. close;
  116.  
  117. Start1: setnpctimer 0; startnpctimer; end;
  118. AlreadyPlaying: mes "[Bidder]"; mes "Você apostou em ^00bb00"+@prace_winner$+"^000000."; close;
  119.  
  120. StartRace:
  121. donpcevent "Metaling#prace3::OnRace";
  122. donpcevent "Poring#prace1::OnRace";
  123. donpcevent "Poporing#prace6::OnRace";
  124. donpcevent "Angeling#prace2::OnRace";
  125. donpcevent "Poring Noel#prace5::OnRace";
  126. donpcevent "Deviling#prace4::OnRace";
  127. end;
  128.  
  129. onstopRace:
  130. donpcevent "Poring#prace1::onstop";
  131. donpcevent "Angeling#prace2::onstop";
  132. donpcevent "Metaling#prace3::onstop";
  133. donpcevent "Deviling#prace4::onstop";
  134. donpcevent "Poring Noel#prace5::onstop";
  135. donpcevent "Poporing#prace6::onstop";
  136. if ($prace_winner$!="") callsub WinRace;
  137. end;
  138.  
  139. ReturnRace:
  140. donpcevent "Poring#prace1::OnReturn";
  141. donpcevent "Angeling#prace2::OnReturn";
  142. donpcevent "Metaling#prace3::OnReturn";
  143. donpcevent "Deviling#prace4::OnReturn";
  144. donpcevent "Poring Noel#prace5::OnReturn";
  145. donpcevent "Poporing#prace6::OnReturn";
  146. end;
  147.  
  148. WinRace:
  149. set $prace_gate,0;
  150. mapannounce "p_track02","O vencedor é o "+$prace_winner$+".",1,0xFFAB54;
  151. donpcevent "Checker#prace0::OnChequeo";
  152. setnpctimer 30000;startnpctimer;
  153. end;
  154.  
  155. OnInit:
  156. set $prace_random,70;
  157. set $prace_random2,600;
  158. set $prace_winner$,"";
  159. set $prace_bets,0;
  160. set $prace_bidders,0;
  161. end;
  162.  
  163. OnTimer500: mapannounce "p_track02","Porings, em suas marcas...",1,0xFFAB54; end;
  164. OnTimer3000: mapannounce "p_track02","...3...",1,0xFFAB54; end;
  165. OnTimer4000: mapannounce "p_track02","...2...",1,0xFFAB54; end;
  166. OnTimer5000: mapannounce "p_track02","...1...",1,0xFFAB54; callsub StartRace; end;
  167. OnTimer6000: stopnpctimer; mapannounce "p_track02","Gooo!!!",1,0xFFAB54; end;
  168. OnTimer35000: set $prace_winner$,""; set $prace_bets,0; stopnpctimer; callsub ReturnRace;
  169. OnTimer90000: npctalk "Eu tenho "+$prace_bets+" aposta(s). Alguém mais?"; end;
  170. OnTimer110000: npctalk "A corrida irá começar em breve. Última chance."; end;
  171. OnTimer120000: callsub Start1;
  172. }
  173.  
  174. //====== Função Apostar: =======================================
  175. function script OnBid {
  176.  
  177. getmapxy(.@mapname$,.@x1,.@y,1,"Poring#prace1");
  178. getmapxy(.@mapname$,.@x2,.@y,1,"Angeling#prace2");
  179. getmapxy(.@mapname$,.@x3,.@y,1,"Metaling#prace3");
  180. getmapxy(.@mapname$,.@x4,.@y,1,"Deviling#prace4");
  181. getmapxy(.@mapname$,.@x5,.@y,1,"Poring Noel#prace5");
  182. getmapxy(.@mapname$,.@x6,.@y,1,"Poporing#prace6");
  183. if (.@x1 == 58 || .@x2 == 58 || .@x3 == 58 || .@x4 == 58 || .@x5 == 58 || .@x6 == 58){
  184. if (Zeny < .@prace_zeny) { callsub OnZeny; } else { set Zeny,Zeny-.@prace_zeny; }
  185. set @prace_winner$,getarg(0); callsub OnReady;
  186. }
  187. mes "[Bidder]"; mes "Uma corrida está em andamento..."; close;
  188.  
  189. OnZeny: set @prace_winner$,""; mes "[Bidder]"; mes "Você não tem Zeny suficiente."; close;
  190.  
  191. OnReady: set $prace_bets,$prace_bets+1; set $prace_bidders[$prace_bets],getcharid(3);
  192. set @prace_playing,1; mes "[Bidder]"; mes "Eu tenho "+$prace_bets+" apostas.";
  193. setnpctimer 60000; startnpctimer; npctalk strcharinfo(0)+" fez sua aposta!"; close;
  194. }
  195. //====== Monstros: ==============================================
  196. p_track02,58,38,2 script Poring#prace1 1002,{
  197. end;
  198. OnRace: initnpctimer; startnpctimer; end;
  199. onstop: stopnpctimer; end;
  200. OnReturn: npcwalkto 58,38; end;
  201. OnTimer1100:
  202. getmapxy(.@mapname$,.@x,.@y,1,"Poring#prace1");
  203. if(rand(100) < $prace_random) npcwalkto .@x-1,.@y;
  204. setnpctimer rand($prace_random2); startnpctimer;
  205. if ((.@x-1) == 29) { set $prace_winner$,"Poring"; emotion 29; donpcevent "Bidder#prace0::onstopRace"; }
  206. }
  207. p_track02,58,36,2 script Angeling#prace2 1096,{
  208. end;
  209. OnRace: initnpctimer; startnpctimer; end;
  210. onstop: stopnpctimer; end;
  211. OnReturn: npcwalkto 58,36; end;
  212. OnTimer1100:
  213. getmapxy(.@mapname$,.@x,.@y,1,"Angeling#prace2");
  214. if(rand(100) < $prace_random) npcwalkto .@x-1,.@y;
  215. setnpctimer rand($prace_random2); startnpctimer;
  216. if ((.@x-1) == 29) { set $prace_winner$,"Angeling"; emotion 29; donpcevent "Bidder#prace0::onstopRace"; }
  217. }
  218. p_track02,58,34,2 script Metaling#prace3 1613,{
  219. end;
  220. OnRace: initnpctimer; startnpctimer; end;
  221. onstop: stopnpctimer; end;
  222. OnReturn: npcwalkto 58,34; end;
  223. OnTimer1100:
  224. getmapxy(.@mapname$,.@x,.@y,1,"Metaling#prace3");
  225. if(rand(100) < $prace_random) npcwalkto .@x-1,.@y;
  226. setnpctimer rand($prace_random2); startnpctimer;
  227. if ((.@x-1) == 29) { set $prace_winner$,"Metaling"; emotion 29; donpcevent "Bidder#prace0::onstopRace"; }
  228. }
  229. p_track02,58,32,2 script Deviling#prace4 1582,{
  230. end;
  231. OnRace: initnpctimer; startnpctimer; end;
  232. onstop: stopnpctimer; end;
  233. OnReturn: npcwalkto 58,32; end;
  234. OnTimer1100:
  235. getmapxy(.@mapname$,.@x,.@y,1,"Deviling#prace4");
  236. if(rand(100) < $prace_random) npcwalkto .@x-1,.@y;
  237. setnpctimer rand($prace_random2); startnpctimer;
  238. if ((.@x-1) == 29) { set $prace_winner$,"Deviling"; emotion 29; donpcevent "Bidder#prace0::onstopRace"; }
  239. }
  240. p_track02,58,30,2 script Poring Noel#prace5 1062,{
  241. end;
  242. OnRace: initnpctimer; startnpctimer; end;
  243. onstop: stopnpctimer; end;
  244. OnReturn: npcwalkto 58,30; end;
  245. OnTimer1100:
  246. getmapxy(.@mapname$,.@x,.@y,1,"Poring Noel#prace5");
  247. if(rand(100) < $prace_random) npcwalkto .@x-1,.@y;
  248. setnpctimer rand($prace_random2); startnpctimer;
  249. if ((.@x-1) == 29) { set $prace_winner$,"Poring Noel"; emotion 29; donpcevent "Bidder#prace0::onstopRace"; }
  250. }
  251. p_track02,58,28,2 script Poporing#prace6 1031,{
  252. end;
  253. OnRace: initnpctimer; startnpctimer; end;
  254. onstop: stopnpctimer; end;
  255. OnReturn: npcwalkto 58,28; end;
  256. OnTimer1100:
  257. getmapxy(.@mapname$,.@x,.@y,1,"Poporing#prace6");
  258. if(rand(100) < $prace_random) npcwalkto .@x-1,.@y;
  259. setnpctimer rand($prace_random2); startnpctimer;
  260. if ((.@x-1) == 29) { set $prace_winner$,"Poporing"; emotion 29; donpcevent "Bidder#prace0::onstopRace"; }
  261. }
Advertisement
Add Comment
Please, Sign In to add comment