Advertisement
Guest User

Untitled

a guest
Jan 17th, 2013
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.52 KB | None | 0 0
  1. // ------------------------------------------------------------------------------------------
  2. // ------ rAthena Script Release
  3. // Title: Simple 4 vs 4 PVP Gateway
  4. // Author: jTynne - justin@justintynne.com
  5. // Version: 0.1 (Beta)
  6. // Modification: paopao - escober.paolo@yahoo.com
  7. // ------------------------------------------------------------------------------------------
  8.  
  9. prontera,161,190,4 script pao 91,{
  10. set .@n$,"[^FF0000Party Battle Royale Manager^000000]";
  11. set .@charid,getcharid(0);
  12. mes .@n$;
  13. mes "Would you like to register to the Party Battle Royale Tournament?";
  14. next;
  15. menu "Yes",-,"No",L_cancel;
  16. if(getmapusers("bat_b02") > 0)
  17. {
  18. mes .@n$; mes "There appears to be a match currently in session. Check back momentarily."; close;
  19. end;
  20. }
  21. mes .@n$;
  22. mes "Which side of the arena would you like to join?";
  23. next;
  24. menu "Odin ("+$pvp4nA+"/2)",L_odinparty,"Freya ("+$pvp4nB+"/2)",L_freyaparty,"Cancel",L_cancel,"CLEAR",L_clear;
  25.  
  26. L_odinparty:
  27. if (getcharid(1) == 0)
  28. {
  29. mes "You must be a member of a party to register.";
  30. close;
  31. end;
  32. }
  33. if ($pvp4nA == 0)
  34. {
  35. set $partyid1,getcharid(1);
  36. mes "You have registered " + getpartyname($partyid1) + " for this tournament session.";
  37. mes " ";
  38. goto L_odin;
  39. }
  40. if (getcharid(1) != $partyid1)
  41. {
  42. mes "Team " + getpartyname($partyid1) + " has already registered for this match. Please wait until the match is over or renewed.";
  43. close;
  44. end;
  45. }
  46. if ($pvp4nA > 0)
  47. {
  48. goto L_odin;
  49. }
  50.  
  51.  
  52. L_freyaparty:
  53. if (getcharid(1) == 0)
  54. {
  55. mes "You must be a member of a party to register.";
  56. close;
  57. end;
  58. }
  59. if ($pvp4nB == 0)
  60. {
  61. set $partyid2,getcharid(1);
  62. mes "You have registered " + getpartyname($partyid2) + " for this tournament session.";
  63. mes " ";
  64. goto L_freya;
  65. }
  66. if (getcharid(1) != $partyid2)
  67. {
  68. mes "Team " + getpartyname($partyid2) + " has already registered for this match. Please wait until the match is over or renewed.";
  69. close;
  70. end;
  71. }
  72. if ($pvp4nB > 0)
  73. {
  74. goto L_freya;
  75. }
  76.  
  77.  
  78. L_odin:
  79. if(.@charid == $pvp4nAchar1 || .@charid == $pvp4nAchar2 || .@charid == $pvp4nBchar1 || .@charid == $pvp4nBchar2)
  80. { mes "Registration Cancelled! You may only register once per round."; close; end; }
  81.  
  82. if($pvp4nA < 2) {
  83. set $pvp4nA,$pvp4nA+1;
  84. if($pvp4nA == 1) { set $pvp4nAchar1,getcharid(0); set $regidA1,getcharid(3); }
  85. if($pvp4nA == 2) { set $pvp4nAchar2,getcharid(0); set $regidA2,getcharid(3);}
  86.  
  87. if($pvp4nA == 1 || $pvp4nB == 1)
  88. { if($pvp4timer == 0 )
  89. { initnpctimer; }
  90. else
  91. {set $pvp4timer,1; }
  92. }
  93.  
  94. mes "You've joined the selected team. Once the other four teams have filled up, you'll automatically be transferred into the PVP arena. If all four teams do not fill up within the next 30 seconds, this session will be cleared.";
  95. npctalk strcharinfo(0)+" has entered the round on the West side.";
  96. if($pvp4nA == 2 && $pvp4nB == 2) { stopnpctimer; goto L_begin;}
  97. close;
  98. end;
  99. }
  100.  
  101. goto L_full;
  102.  
  103. L_freya:
  104. if(.@charid == $pvp4nAchar1 || .@charid == $pvp4nAchar2 || .@charid == $pvp4nBchar1 || .@charid == $pvp4nBchar2)
  105. { mes "Registration Cancelled! You may only register once per round."; close; end; }
  106.  
  107. if($pvp4nB < 2) {
  108. set $pvp4nB,$pvp4nB+1;
  109. if($pvp4nB == 1) { set $pvp4nBchar1,getcharid(0); set $regidB1,getcharid(3); }
  110. if($pvp4nB == 2) { set $pvp4nBchar2,getcharid(0); set $regidB2,getcharid(3); }
  111.  
  112. if($pvp4nA == 1 || $pvp4nB == 1)
  113. { if($pvp4timer == 0 )
  114. { initnpctimer; }
  115. else
  116. {set $pvp4timer,1; }
  117. }
  118.  
  119. mes "You've joined the selected team. Once the other four teams have filled up, you'll automatically be transferred into the PVP arena. If all four teams do not fill up within the next 30 seconds, this session will be cleared.";
  120. npctalk strcharinfo(0)+" has entered the round on the East side.";
  121. if($pvp4nA == 2 && $pvp4nB == 2) { stopnpctimer; goto L_begin;}
  122. close;
  123. end;
  124. }
  125.  
  126. goto L_full;
  127.  
  128. L_full:
  129. mes .@n$;
  130. mes "Sorry, but this team is full. Try another team, please.";
  131. close;
  132. end;
  133.  
  134. L_begin:
  135. pvpon "bat_b02";
  136. gvgoff "bat_b02";
  137. npctalk "All four teams have been filled. All participants currently logged in will be transferred to the arena in ten seconds.";
  138. sleep2 10000;
  139. set .@x,0;
  140. L_warploop:
  141. while (.@x < 5) {
  142. if (.@x == 0)
  143. { warpchar "bat_b02",59,149,$pvp4nAchar1; }
  144. else if (.@x == 1)
  145. { warpchar "bat_b02",59,149,$pvp4nAchar2; }
  146. else if (.@x == 2)
  147. { warpchar "bat_b02",331,149,$pvp4nBchar1; }
  148. else if (.@x == 3)
  149. { warpchar "bat_b02",331,149,$pvp4nBchar2; }
  150.  
  151. else
  152. {
  153. npctalk "A round is now in session.";
  154. announce "[Party Battle Royale] Battle Royale match has started.",bc_all,0xD6A4E6;
  155. goto L_startround;
  156. }
  157. set .@x, .@x + 1;
  158. }
  159. goto L_warploop;
  160. end;
  161.  
  162. L_cancel:
  163. mes .@n$;
  164. mes "Do come back if you change your mind.";
  165. close;
  166. end;
  167.  
  168. OnTimer10000:
  169. announce "[Party Battle Royale] Entry to the Battle Royale ends in 20 seconds.",bc_all,0xD6A4E6;
  170. npctalk "Ten seconds have passed. Entry to the round ends in 20 seconds.";
  171. end;
  172.  
  173. OnTimer20000:
  174. announce "[Party Battle Royale] Entry to the Battle Royale ends in 10 seconds.",bc_all,0xD6A4E6;
  175. npctalk "Twenty seconds have passed. Entry to the round ends in 10 seconds.";
  176. end;
  177.  
  178. OnTimer30000:
  179. announce "[Party Battle Royale] Battle Royale registration has ended and renewed.",bc_all,0xD6A4E6;
  180. npctalk "Thirty seconds have passed and thus I have canceled the round.";
  181. stopnpctimer;
  182. goto L_clear;
  183.  
  184. L_clear:
  185. set $pvp4timer,0;
  186. set $pvp4nA,0;
  187. set $pvp4nB,0;
  188. set $pvp4nAchar1,0;
  189. set $pvp4nAchar2,0;
  190. set $pvp4nBchar1,0;
  191. set $pvp4nBchar2,0;
  192. end;
  193.  
  194. L_startround:
  195. end;
  196. }
  197.  
  198. - script paonpc -1,{
  199. OnPCDieEvent:
  200. getmapxy (.@map$, .@x, .@y, 0);
  201. if(.@map$ == "bat_b02")
  202. {
  203.  
  204. }
  205. end;
  206.  
  207. OnPCKillEvent:
  208. getmapxy (.@map$, .@x, .@y, 0);
  209. if( .@map$ == "bat_b02")
  210. {
  211. set .@tempn1$,strcharinfo(0);
  212. set .@tempnid,killedrid;
  213. set .@tempn2$,rid2name(killedrid);
  214. mapannounce "bat_b02",""+.@tempn1$+" has killed "+.@tempn2$+".",1,0xD6A4E6;}
  215. getitem 7829,5;
  216. mapannounce "bat_b02",""+killedrid+" "+$pvp4nAchar1+""+$pvp4nAchar2+"",1,0xD6A4E6;
  217. mapannounce "bat_b02",""+killedrid+" "+$pvp4nBchar1+""+$pvp4nBchar2+"",1,0xD6A4E6;
  218. mapannounce "bat_b02",""+$pvp4nA+""+$pvp4nB+"",1,0xD6A4E6;
  219. if ($regidA1 == .@tempnid || $regidA2 == .@tempnid)
  220. {set $pvp4nA, $pvp4nA - 1;}
  221. if ($regidB1 == .@tempnid || $regidB2 == .@tempnid)
  222. {set $pvp4nB, $pvp4nB - 1;}
  223. if ($pvp4nA == 0 || $pvp4nB == 0)
  224. {
  225. set $pvp4nA, 0;
  226. set $pvp4nB, 0;
  227. set $pvp4nAchar1,0;
  228. set $pvp4nAchar2,0;
  229. set $pvp4nBchar1,0;
  230. set $pvp4nBchar2,0;
  231. announce "[Party Battle Royale] Battle Royale match has ended.",bc_all,0xD6A4E6;
  232. mapwarp "bat_b02","prontera",156,185;
  233. }
  234.  
  235. end;
  236. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement