Advertisement
Capuche

Clean_poring_race

May 8th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. // Capuche cleaning Base on the poring race by Zell_ff8, xianz, Neko, for fun
  2.  
  3. prontera,139,184,5 script Poring Race 882,{
  4.  
  5. if( .access_Prace == 0 ) {
  6. mes "[Poring Race Staff]";
  7. mes "Poring Race has ended.";
  8. close;
  9. }
  10. mes "[Poring Race Staff]";
  11. mes "Do you want to participate on Poring Race?";
  12. if( select( "Yes","No" ) -1 ) {
  13. next;
  14. mes "[Poring Race Staff]";
  15. mes "See you again next time!";
  16. close;
  17. }
  18. if( .access_Prace == 0 ) {
  19. next;
  20. mes "[Poring Race Staff]";
  21. mes "...";
  22. mes "...";
  23. mes "Cheater!!~~";
  24. close;
  25. }
  26. close2;
  27. @prace_winner$ = "";
  28. warp "p_track01",52,41;
  29. end;
  30. // OnInit:
  31. OnMinute20:
  32. if( gettime(3)%2 ) end;
  33. set .access_Prace, 1;
  34. announce "Poring Race is now open!",0,0xFFAB54;
  35. setnpctimer 100000,"Bidder#prace0";
  36. startnpctimer "Bidder#prace0";
  37. end;
  38. OnPraceEnd:
  39. set .access_Prace, 0;
  40. announce "Poring Race is over!",0,0xFFAB54;
  41. end;
  42. }
  43.  
  44.  
  45. p_track01,58,41,3 script Bidder#prace0 877,{
  46. function checkevent;
  47.  
  48. mes "[Bidder]";
  49. if( getstrlen( @prace_winner$ ) ) {
  50. mes "You have choose ^00bb00"+ @prace_winner$ +"^000000";
  51. close;
  52. }
  53. else if ( checkevent() || .start ) {
  54. mes "There is a race in progress...";
  55. close;
  56. }
  57. else if( !getvariableofnpc( .access_Prace,"Poring Race" ) ) {
  58. mes "There is no race.";
  59. close;
  60. }
  61. mes "Choose the poring you want to bet:";
  62. mes "It will cost "+ .zeny_req +" Zeny.";
  63.  
  64. .@s = select( .menu_$ );
  65. if( .@s == 7 ) {
  66. next;
  67. mes "[Bidder]";
  68. mes "Goodbye.";
  69. close;
  70. }
  71. .@c$ = .monst_$[ .@s -1 ];
  72.  
  73. if ( checkevent() ) {
  74. next;
  75. mes "[Bidder]";
  76. mes "...";
  77. mes "...";
  78. mes "Cheater!!~~";
  79. close;
  80. }
  81. else if( Zeny < .zeny_req ) {
  82. next;
  83. mes "[Bidder]";
  84. mes "You don't have enough Zeny.";
  85. close;
  86. }
  87. Zeny -= .zeny_req;
  88. @prace_winner$ = .@c$;
  89. .prace_bidders[ .prace_bets ] = getcharid(3);
  90. .prace_bets++;
  91.  
  92. next;
  93. mes "[Bidder]";
  94. mes "I have "+ .prace_bets +" bets.";
  95. initnpctimer;
  96. npctalk "I got "+ strcharinfo(0) +" bet!";
  97. close;
  98. OnTimer60000:
  99. npctalk "I got "+ .prace_bets +" bets. Anyone else?";
  100. end;
  101. OnTimer80000:
  102. npctalk "The race will start soon. Last chance.";
  103. end;
  104. OnTimer90000:
  105. stopnpctimer;
  106. .start = 1;
  107. mapannounce "p_track01","Porings, on your marks...",1,0xFFAB54;
  108. sleep 2500;
  109. for( .@i = 3; .@i > 0; .@i-- ) {
  110. mapannounce "p_track01","..."+ .@i +"...",1,0xFFAB54;
  111. sleep 1000;
  112. }
  113. donpcevent strnpcinfo(0) +"::OnStartRace";
  114. sleep 1000;
  115. mapannounce "p_track01","Gooo!!!",1,0xFFAB54;
  116. end;
  117. OnTimer320000:
  118. mapwarp "p_track01","prontera",142,170;
  119. donpcevent "Poring Race::OnPraceEnd";
  120. .prace_winner$ = "";
  121. .start = .prace_bets = 0;
  122. donpcevent strnpcinfo(0) +"::OnReturnRace";
  123. end;
  124.  
  125. OnStartRace:
  126. callsub L_label, "OnRace";
  127. OnStopRace:
  128. callsub L_label, "OnStop";
  129. OnReturnRace:
  130. callsub L_label, "OnReturn";
  131. L_label:
  132. donpcevent "Metaling#prace3::"+ getarg(0);
  133. donpcevent "Poring#prace1::"+ getarg(0);
  134. donpcevent "Poporing#prace6::"+ getarg(0);
  135. donpcevent "Angeling#prace2::"+ getarg(0);
  136. donpcevent "Santa Poring#prace5::"+ getarg(0);
  137. donpcevent "Deviling#prace4::"+ getarg(0);
  138. if( getarg(0) == "OnStop" && .prace_winner$ != "" )
  139. callsub L_WinRace;
  140. end;
  141. L_WinRace:
  142. mapannounce "p_track01", "The winner is "+ .prace_winner$,1,0xFFAB54;
  143. donpcevent strnpcinfo(0) +"::OnChequeo";
  144. sleep 3000;
  145. donpcevent strnpcinfo(0) +"::OnReturnRace";
  146. sleep 10000;
  147. mapwarp "p_track01","prontera",142,170;
  148. donpcevent "Poring Race::OnPraceEnd";
  149. .prace_winner$ = "";
  150. .start = .prace_bets = 0;
  151. end;
  152. OnChequeo:
  153. for( .@i = 0 ; .@i < getarraysize( .prace_bidders ); .@i++ ) {
  154. if( attachrid( .prace_bidders[.@i] ) && getstrlen( @prace_winner$ ) ) {
  155. dispbottom "The winner is "+ .prace_winner$ +" and you have bet for "+ @prace_winner$ +".";
  156. if( @prace_winner$ == .prace_winner$ ) {
  157. dispbottom "You have won!";
  158. mapannounce "p_track01"," Congratulations! "+ strcharinfo(0) +" has won!",1,0xFFAB54;
  159. getitem .item_gained, .item_num_gain;
  160. emotion 21,1;
  161. }
  162. else {
  163. dispbottom "You have lost.";
  164. emotion 28,1;
  165. }
  166. @prace_winner$ = "";
  167. }
  168. }
  169. deletearray .prace_bidders;
  170. end;
  171. OnInit:
  172. .zeny_req = 3500;
  173. .item_gained = 7199;
  174. .item_num_gain = 2;
  175. setarray .monst_$,"Poring","Angeling","Metaling","Deviling","Santa Poring","Poporing","None";
  176. .menu_$ = implode( .monst_$, ":" );
  177. end;
  178.  
  179. function checkevent {
  180. getmapxy .@mapname$, .@x1, .@y, 1, "Poring#prace1";
  181. getmapxy .@mapname$, .@x2, .@y, 1, "Angeling#prace2";
  182. getmapxy .@mapname$, .@x3, .@y, 1, "Metaling#prace3";
  183. getmapxy .@mapname$, .@x4, .@y, 1, "Deviling#prace4";
  184. getmapxy .@mapname$, .@x5, .@y, 1, "Santa Poring#prace5";
  185. getmapxy .@mapname$, .@x6, .@y, 1, "Poporing#prace6";
  186. .@t = ( .@x1 + .@x2 + .@x3 + .@x4 + .@x5 + .@x6 ) != 58 * 6;
  187. return .@t;
  188. }
  189. }
  190. //-----------------------------------
  191. // Racer NPC's
  192. //-----------------------------------
  193.  
  194. - script pori_race -1,{
  195. OnRace:
  196. initnpctimer;
  197. end;
  198. OnStop:
  199. stopnpctimer;
  200. end;
  201. OnReturn:
  202. sleep 1000;
  203. while( strnpcinfo(1) != .monst$[ .@i ] ) .@i++;
  204. movenpc strnpcinfo(3), 58, .walk_t[.@i];
  205. end;
  206. OnTimer1100:
  207. getmapxy .@mapname$,.@x,.@y,1, strnpcinfo(3);
  208. if( rand(100) < .prace_random )
  209. npcwalkto .@x-1, .@y;
  210. .@r = rand( .prace_random2 );
  211. if ( .@x -1 == 29 ) {
  212. while( strnpcinfo(1) != .monst$[ .@i ] ) .@i++;
  213. set getvariableofnpc( .prace_winner$, "Bidder#prace0" ), .monst$[ .@i ];
  214. emotion 29;
  215. donpcevent "Bidder#prace0::OnStopRace";
  216. end;
  217. }
  218. stopnpctimer;
  219. setnpctimer .@r;
  220. startnpctimer;
  221. end;
  222. OnInit:
  223. deletearray .walk_t;
  224. deletearray .monst$;
  225. setarray .walk_t, 38, 36, 34, 32, 30, 28;
  226. setarray .monst$, "Poring", "Angeling", "Metaling", "Deviling", "Santa Poring", "Poporing";
  227. .prace_random = 70;
  228. .prace_random2 = 600;
  229. end;
  230. }
  231.  
  232. p_track01,58,38,2 duplicate(pori_race) Poring#prace1 1002
  233. p_track01,58,36,2 duplicate(pori_race) Angeling#prace2 1096
  234. p_track01,58,34,2 duplicate(pori_race) Metaling#prace3 1613
  235. p_track01,58,32,2 duplicate(pori_race) Deviling#prace4 1582
  236. p_track01,58,30,2 duplicate(pori_race) Santa Poring#prace5 1062
  237. p_track01,58,28,2 duplicate(pori_race) Poporing#prace6 1031
  238.  
  239. p_track01,78,42,0 warp p_track002 1,3,prontera,142,170
  240.  
  241. p_track01 mapflag nobranch
  242. p_track01 mapflag noicewall
  243. p_track01 mapflag nomemo
  244. p_track01 mapflag noreturn
  245. p_track01 mapflag noteleport
  246. p_track01 mapflag nowarpto
  247. p_track01 mapflag nowarp
  248. p_track01 mapflag pvp off
  249. p_track01 mapflag nosave
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement