yuhsing

Untitled

Dec 24th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.54 KB | None | 0 0
  1.  
  2.  
  3. prontera,156,157,5 script Counting Game 437,{
  4. mes "This is a Monsters Counting Game";
  5. mes "I will summon some Monsters here, and you have to count the Correct Amount of Monsters i summoned.";
  6. mes "^FF0000Only Count for the Monsters i mentioned^000000";
  7. next;
  8. switch( select( "Information",
  9. ( getgmlevel() < .GMLevel || .Event )?"":"^FF0000[GM]^000000 Start Game",
  10. ( getgmlevel() < .GMLevel || !.Event )?"":"^FF0000[GM]^000000 End Game" )){
  11.  
  12. Case 1:
  13. mes "When the Event Start, i will summon some Monsters at a small area, and players have to count the amount of the flowers.";
  14. mes "Whoever tell me the correct amount of Monsters i mentioned, he/she win the game.";
  15. break;
  16.  
  17. Case 2:
  18. mes "Event will begin right now.";
  19. close2;
  20. donpcevent strnpcinfo(0)+"::OnStartGame";
  21. end;
  22.  
  23. Case 3:
  24. set .Event,0;
  25. set .Round,0;
  26. deletepset 1;
  27. delwaitingroom;
  28. set .Winner[0],0;
  29. set .Winner[1],0;
  30. npctalk "Counting Game Cancelled.";
  31. killmonster .Map$,"All";
  32. mes "Game Cancelled.";
  33. break;
  34. }
  35. close;
  36.  
  37. OnSpammed:
  38. set @Spam,0;
  39. end;
  40.  
  41. iSpam:
  42. if( getgmlevel() > 90 ) end;
  43. set @Spam,@Spam + 1;
  44. if( @Spam >= .Spam ){ // 3 Continuos Answer will trigger...
  45. set @SpamDelay,gettimetick(2) + .Spam;
  46. dispbottom "SPAM Detected, your answer within next "+.Spam+" Seconds will be Ignored.";
  47. }
  48. deltimer strnpcinfo(0)+"::OnSpammed";
  49. addtimer ( .Spam * 1000 ),strnpcinfo(0)+"::OnSpammed";
  50. end;
  51.  
  52. iRight:
  53. set @Spam,0;
  54. deltimer strnpcinfo(0)+"::OnSpammed";
  55. if( !.Event ){
  56. message strcharinfo(0),"Sorry, there is no Event right now.";
  57. }else if( @SpamDelay > gettimetick(2) ){
  58. message strcharinfo(0),"SPAM Protection : Remain "+( @SpamDelay - gettimetick(2) )+" seconds.";
  59. }else if( getcharid(0) == .Winner[0] && gettimetick(2) < .Winner[1] ){
  60. message strcharinfo(0),"Sorry, Winner Time Penalty : Remain "+( .Winner[1] - gettimetick(2) )+" seconds.";
  61. }else{
  62. delwaitingroom;
  63. set .Event,0;
  64. set .Round,.Round - 1;
  65. set .Winner[0],getcharid(0);
  66. set .Winner[1],gettimetick(2) + .Delay;
  67. npctalk "[ "+strcharinfo(0)+" ] , You're Correct.";
  68. killmonster .Map$,"All";
  69. deletepset 1;
  70. if( getarraysize( .Reward$ ) > 1 )
  71. for( set .@i,0; .@i < getarraysize( .Reward$ ) - 1; set .@i,.@i + 2 )
  72. if( getitemname( atoi( .Reward$[.@i] ) ) == "null" ){
  73. set getd( .Reward$[.@i] ),getd( .Reward$[.@i] ) + atoi( .Reward$[.@i+1] );
  74. dispbottom "Reward : "+.Reward$[.@i]+" + "+.Reward$[.@i+1];
  75. }else{
  76. getitem atoi( .Reward$[.@i] ),atoi( .Reward$[.@i+1] );
  77. dispbottom "Reward : "+getitemname( atoi( .Reward$[.@i] ) )+" x "+.Reward$[.@i+1];
  78. }
  79. if( .Round ) donpcevent strnpcinfo(0)+"::OnStartGame";
  80. }
  81. end;
  82.  
  83.  
  84. OnInit:
  85. // Min. GM Level to access GM Panel
  86. set .GMLevel,80;
  87. // Game Location
  88. set .Map$,"prontera";
  89. // Monster ID Lists
  90. setarray .MonsterList[0],1084,1085;
  91. // Winners Answer Delay ( Not advised for High Value )
  92. set .Delay,10;
  93. // Spam Prevention ( Not advised for High Value )
  94. set .Spam,3;
  95. // How many rounds
  96. set .MaxRound,10;
  97. // Area Coordination <x1>,<y1>,<x2>,<y2>;
  98. setarray .Coordinate,153,146,159,153;
  99. // Rewards ...
  100. setarray .Reward$[0],
  101. "#CASHPOINTS","100",
  102. "Zeny","100000",
  103. "7227","10",
  104. // "CustomVariable","100000",
  105. // "#CustomVariable","100000",
  106. "7539","100";
  107. end;
  108.  
  109.  
  110. OnMinute30:
  111. for( set .@i,60; .@i > 0; set .@i,.@i - 10 ){
  112. announce "Flower Counting Game : start within "+.@i+" Seconds in "+.Map$,0;
  113. sleep 10000;
  114. }
  115.  
  116. OnStartGame:
  117. if( !.Round ) set .Round,.MaxRound;
  118. announce "Counting Game has started in "+.Map$,0;
  119. deletearray .MobCount[0],getarraysize( .MobCount );
  120. for( set .@x,.Coordinate[0]; .@x <= .Coordinate[2]; set .@x,.@x + 1 )
  121. for( set .@y,.Coordinate[1]; .@y <= .Coordinate[3]; set .@y,.@y + 1 ){
  122. set .@Summon,rand( getarraysize( .MonsterList ) );
  123. monster .Map$,.@x,.@y,"Count Me",.MonsterList[.@Summon],1,strnpcinfo(0)+"::OnKilled";
  124. set .MobCount[.@Summon],.MobCount[.@Summon] + 1;
  125. sleep2 1;
  126. }
  127. set .@Target,rand( getarraysize( .MonsterList ) );
  128. deletepset 1;
  129. defpattern 1, "([^:]+): (\\|\\d{2})?"+.MobCount[.@Target]+ ".$", "iRight";
  130. // defpattern 1,"([^:]+): "+.MobCount[.@Target], "iRight";
  131. defpattern 1,"([^:]+):.*.*", "iSpam";
  132. activatepset 1;
  133. delwaitingroom;
  134. waitingroom getmonsterinfo( .MonsterList[.@Target],0 ),0;
  135. npctalk "Count for the Targeted Monster's Amount to Win the Game.";
  136. set .Event,1;
  137. end;
  138.  
  139. OnKilled:
  140. mes "You will be punished upon killing these Monsters and interupt the Game.";
  141. set @Spam,30;
  142. close2;
  143. npctalk "Round Restarted due to interruption.";
  144. donpcevent strnpcinfo(0)+"::OnStartGame";
  145. end;
  146. }
Advertisement
Add Comment
Please, Sign In to add comment