Advertisement
akbare

Emper-test_ledder

Apr 20th, 2015
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.28 KB | None | 0 0
  1.  
  2. pvp_n_4-5 mapflag restricted 7
  3.  
  4. prontera,127,212,0 script Emperium Breaker Test 1288,{
  5.  
  6. set .@gm, getgmlevel();
  7. explode( .@b$, $empbrk_record$, "|" );
  8.  
  9. // Display records
  10. // ---------------
  11. mes "^FF0000~~ Emperium Breaker Test ~~^000000";
  12. mes "Breaker Top 5 :";
  13. if( !getarraysize( .@b$ ) )
  14. mes "^777777*empty*^000000";
  15. for( set .@i, 0; .@i < getarraysize( .@b$ ); set .@i, .@i + 1 )
  16. mes "^777777"+ ( .@i + 1 ) +"- ^5050A0"+ .@b$[ .@i ] +"^000000"+ callsub( L_time_, $empbrk_record[ .@i ] );
  17.  
  18. if( empbrk_record ) {
  19. mes "______________________________";
  20. set .@rec$, callsub( L_time_, empbrk_record );
  21. mes "Your Own Record:"+ .@rec$;
  22. }
  23. next;
  24.  
  25. mes "^FF0000~~ Emperium Breaker Test ~~^000000";
  26. mes "Would you like to try a new record?";
  27. if( empbrk_record ) {
  28. mes "______________________________";
  29. mes "Your Own Record:"+ .@rec$;
  30. }
  31. next;
  32.  
  33. menu "^777777~ Yes^000000", -, ( empbrk_record ? "^777777~ Reset my record^000000" : "" ), L_resc,
  34. ( .@gm > 98 && $empbrk_record$ != "" ? "^777777~ [ GM ] Reset all^000000" : "" ), L_reset, ( .@gm > 98 ? "^777777~ [ GM ] Reset Rooms^000000" : "" ), L_emptyrooms, "^777777~ Exit^000000", L_exit;
  35. deletearray .arena$;
  36.  
  37. // Area arena for getareausers
  38. // ---------------------------
  39. setarray .@A1, 94,128,105,139;
  40. setarray .@A2, 60,94,71,105;
  41. setarray .@A3, 94,60,105,71;
  42. setarray .@A4, 128,94,139,105;
  43.  
  44. mes "^FF0000~~ Emperium Breaker Test ~~^000000";
  45. for( set .@i, 1; .@i <= 4; set .@i, .@i + 1 ) {
  46. if ( getareausers("pvp_n_4-5", getd( ".@A"+ .@i +"[ 0 ]" ), getd( ".@A"+ .@i +"[ 1 ]" ), getd( ".@A"+ .@i +"[ 2 ]" ), getd( ".@A"+ .@i +"[ 3 ]" ) ) )
  47. mes "Emp nĀ° ^0000DF"+ .@i +" ^FF0000 <Busy>^000000";
  48. else {
  49. mes "Emp nĀ° ^0000DF"+ .@i +" ^00A000 <Free>^000000";
  50. set .arena$[ .@i -1 ],"^0000DFRoom nĀ°"+ .@i +"^000000";
  51. }
  52. }
  53. next;
  54.  
  55. getmapxy( @mpempbrk$, @empbrkx, @empbrky, 0 );
  56. // menu arena
  57. // ----------
  58. set .@a, select( .arena$[0], .arena$[1], .arena$[2], .arena$[3], "Quit" );
  59. if( .@a == 5 ) close;
  60.  
  61. // x, y for user warp / arena ; x1, y1, x2, y2...
  62. // ----------------------------------------------
  63. setarray .@xy[ 2 ], 99, 128, 68, 99, 100, 68, 130, 99;
  64.  
  65. // select arena is empty ?
  66. // -----------------------
  67. if ( !getareausers("pvp_n_4-5", getd( ".@A"+ .@a +"[ 0 ]" ), getd( ".@A"+ .@a +"[ 1 ]" ), getd( ".@A"+ .@a +"[ 2 ]" ), getd( ".@A"+ .@a +"[ 3 ]" ) ) ) {
  68. warp "pvp_n_4-5", .@xy[ .@a * 2 ], .@xy[ .@a * 2 + 1 ];
  69. killmonster "pvp_n_4-5","EmpBrk#"+ .@a +"::OnThisMobDeath";
  70. donpcevent "EmpBrk#"+ .@a +"::OnEmpBreak";
  71. sc_end SC_ALL;
  72. }
  73. else
  74. mes "Room is now BUSY";
  75. close;
  76.  
  77. // reset top 5
  78. // -----------
  79. L_reset:
  80. mes "^FF0000~~ Emperium Breaker Test ~~^000000";
  81. mes "Are you sure to reset official record ?";
  82.  
  83. if( select( "Yes", "No" ) -1 ) close;
  84. mes "All records had been reset.";
  85. set $empbrk_record, 0;
  86. set $empbrk_record$, "";
  87. close;
  88.  
  89. // reset your record ( + reset record if in top 5 )
  90. // ------------------------------------------------
  91. L_resc:
  92. mes "^FF0000~~ Emperium Breaker Test ~~^000000";
  93. mes "Are you sure to reset your record?";
  94. if( select( "Yes", "No" ) -1 ) close;
  95. if( $empbrk_record$ != "" ) {
  96. explode( .@b$, $empbrk_record$, "|" );
  97. for( set .@i, 0; .@i < getarraysize( .@b$ ); set .@i, .@i + 1 )
  98. if( .@b$[ .@i ] == strcharinfo(0) ) {
  99. deletearray .@b$[ .@i ], 1;
  100. deletearray $empbrk_record[ .@record ], 1;
  101. }
  102. set $empbrk_record$, implode( .@b$, "|" );
  103. }
  104. mes "Your record has been reset.";
  105. set empbrk_record, 0;
  106. close;
  107.  
  108. // warp all people out of arena
  109. // ----------------------------
  110. L_emptyrooms:
  111. mapwarp "pvp_n_4-5","prontera",0,0;
  112. L_exit:
  113. close;
  114.  
  115. // return time of record ( min sec ms )
  116. // ------------------------------------
  117. L_time_:
  118. set .@time, getarg(0);
  119. set .@m, .@time / 60000;
  120. set .@time, .@time - ( .@m * 60000 );
  121. set .@s, .@time /1000;
  122. set .@time, .@time - ( .@s * 1000 );
  123. set .@text$, " ^000080"+ .@m +"^000000m ^000080"+ .@s +"^000000s ^000080"+ .@time +"^000000ms";
  124. return .@text$;
  125. }
  126.  
  127.  
  128. pvp_n_4-5,99,125,0 script EmpBrk#1 -1,2,1,{
  129. OnTouch:
  130. killmonster "pvp_n_4-5", strnpcinfo(0) +"::OnThisMobDeath";
  131.  
  132. mes "^FF0000~~ Emperium Breaker Test ~~^000000";
  133. mes " ";
  134. mes "You cannot exit from small square.";
  135. close2;
  136. stopnpctimer;
  137. set getd( "$@someonegotin"+ strnpcinfo(2) ), 0;
  138. warp .map_npc$, .x_npc, .y_npc;
  139. end;
  140.  
  141. // Spawn emp
  142. // ---------
  143. OnEmpBreak:
  144. copyarray .@xy[ 0 ], getd( ".xy" + strnpcinfo(2) +"[ 0 ]" ), 6;
  145.  
  146. sleep 3000;
  147. if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end;
  148. areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"Let's ready to break the Emperium",0;
  149. sleep 5000;
  150. if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end;
  151. for( set .@i, 5; .@i > 0; set .@i, .@i - 1 ) {
  152. areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ], (.@i +""),0;
  153. sleep 1000;
  154. }
  155.  
  156. if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end;
  157. areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"GO!!!",0;
  158. monster "pvp_n_4-5", .@xy[ 4 ], .@xy[ 5 ],"Emperium",2500,1,"EmpBrk#"+ strnpcinfo(2) +"::OnThisMobDeath";
  159. initnpctimer;
  160. end;
  161.  
  162.  
  163. OnThisMobDeath:
  164. copyarray .@xy[ 0 ], getd( ".xy" + strnpcinfo(2) +"[ 0 ]" ), 6;
  165. stopnpctimer;
  166. set .@time, getnpctimer( 0,"EmpBrk#"+ strnpcinfo(2) );
  167.  
  168. if ( .@time < empbrk_record || !empbrk_record ) {
  169. areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"New Own Record!!!",0;
  170. set empbrk_record, .@time;
  171. }
  172.  
  173. // set top 5 record ; GM level > 50 excluded
  174. // -----------------------------------------
  175. if( getgmlevel() < 50 ) {
  176. if ( .@time < $empbrk_record[ 0 ] && !$empbrk_record[ 0 ] ) {
  177. areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"New Official Record!!!",0;
  178. announce strcharinfo(0)+" is now the NO. 1 Emperium Breaker!!",0;
  179. }
  180. explode( .@b$, $empbrk_record$, "|" );
  181. if( $empbrk_record$ == "" )
  182. set .@no_mark, 1;
  183. else {
  184. for( set .@i, 0; .@i < 5; set .@i, .@i + 1 ) {
  185. if( .@b$[ .@i ] == strcharinfo(0) ) {
  186. if( .@time < $empbrk_record[ .@i ] ) {
  187. deletearray .@b$[ .@i ], 1;
  188. deletearray $empbrk_record[ .@i ], 1;
  189. set .@no_mark, 1;
  190. }
  191. else
  192. set .@no_mark, 0;
  193. break;
  194. }
  195. else if( .@time < $empbrk_record[ .@i ] || !$empbrk_record[ .@i ] )
  196. set .@no_mark, 1;
  197. }
  198. }
  199. }
  200. if( .@no_mark ) {
  201. for( set .@i, 0; .@i < 5; set .@i, .@i + 1 )
  202. if ( .@time < $empbrk_record[ .@i ] || !$empbrk_record[ .@i ] ) {
  203. if( .@i != 4 ) {
  204. copyarray .@b$[ .@i+1 ], .@b$[ .@i ], 4 - .@i;
  205. copyarray $empbrk_record[ .@i+1 ], $empbrk_record[ .@i ], 4 - .@i;
  206. set .@b$[ .@i ], strcharinfo(0);
  207. set $empbrk_record[ .@i ], .@time;
  208. }
  209. else {
  210. set .@b$[ getarraysize( .@b$ ) -1 ], strcharinfo(0);
  211. set $empbrk_record[ getarraysize( .@b$ ) -1 ], .@time;
  212. }
  213. set $empbrk_record$, implode( .@b$, "|" );
  214. break;
  215. }
  216. }
  217. set .@m, .@time / 60000;
  218. set .@time, .@time - (.@m * 60000);
  219. set .@s, .@time /1000;
  220. set .@time, .@time - (.@s * 1000);
  221.  
  222. areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"Your time is "+ .@m +"m "+ .@s +"s "+ .@time +"ms",0;
  223. sleep 2000;
  224. // Debug : warp 20 min later if afk
  225. // --------------------------------
  226. OnTimer1200000:
  227. areawarp "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ], .map_npc$, .x_npc, .y_npc;
  228. stopnpctimer;
  229. end;
  230.  
  231. OnInit:
  232. getmapxy( .map_npc$, .x_npc, .y_npc, 1, "Emperium Breaker Test" );
  233. // set area for announce + x, y to spawn emp
  234. // -----------------------------------------
  235. switch( strnpcinfo(2) ) {
  236. case 1:
  237. setarray .xy1, 94, 128, 105, 139, 100, 134;
  238. break;
  239. case 2:
  240. setarray .xy2, 60, 94, 71, 105, 65, 99;
  241. break;
  242. case 3:
  243. setarray .xy3, 94, 60, 105, 71, 99, 65;
  244. break;
  245. case 4:
  246. setarray .xy4, 128, 94, 139, 105, 134, 99;
  247. }
  248. end;
  249. }
  250.  
  251. pvp_n_4-5,74,99,0 duplicate(EmpBrk#1) EmpBrk#2 -1,1,2
  252. pvp_n_4-5,100,74,0 duplicate(EmpBrk#1) EmpBrk#3 -1,1,2
  253. pvp_n_4-5,125,100,0 duplicate(EmpBrk#1) EmpBrk#4 -1,1,2
  254.  
  255.  
  256.  
  257.  
  258. db/mob_db.txt
  259. 2500,EMPELIUM,Emperium,Emperium,90,68430,0,0,0,1,60,71,40,50,1,17,80,50,26,20,10,12,0,8,26,0x120,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  260.  
  261. db/mob_avail.txt
  262. 2500,1288,0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement