prontera,156,157,5 script Flower Counting 437,{ mes "This is a Flower Counting Game"; mes "I will summon some Flower here, and you have to count the Correct Amount of Flower i summoned."; mes "^FF0000Only Count for the Flower i mentioned^000000"; next; switch( select( "Information", ( getgmlevel() < .GMLevel || .Event )?"":"^FF0000[GM]^000000 Start Game", ( getgmlevel() < .GMLevel || !.Event )?"":"^FF0000[GM]^000000 End Game" )){ Case 1: mes "When the Event Start, i will summon some Flowers at a small area, and players have to count the amount of the flowers."; mes "Whoever tell me the correct amount of flower i mentioned, he/she win the game."; break; Case 2: mes "Event will begin right now."; close2; donpcevent strnpcinfo(0)+"::OnStartGame"; end; Case 3: set .Event,0; set .Round,0; deletepset 1; delwaitingroom; set .Winner[0],0; set .Winner[1],0; npctalk "Flower Counting Game Cancelled."; killmonster .Map$,"All"; mes "Game Cancelled."; break; } close; OnSpammed: set @Spam,0; end; iSpam: set @Spam,@Spam + 1; if( @Spam >= 3 ){ // 3 Continuos Answer will trigger... set @SpamDelay,gettimetick(2) + .Spam; dispbottom "SPAM Detected, your answer within next "+.Spam+" Seconds will be Ignored."; } deltimer strnpcinfo(0)+"::OnSpammed"; addtimer ( .Spam * 1000 ),strnpcinfo(0)+"::OnSpammed"; end; iRight: if( !.Event ){ message strcharinfo(0),"Sorry, there is no Event right now."; }else if( @SpamDelay > gettimetick(2) ){ message strcharinfo(0),"SPAM Protection : Remain "+( @SpamDelay - gettimetick(2) )+" seconds."; }else if( getcharid(0) == .Winner[0] && gettimetick(2) < .Winner[1] ){ message strcharinfo(0),"Sorry, Winner Time Penalty : Remain "+( .Winner[1] - gettimetick(2) )+" seconds."; }else{ delwaitingroom; set .Event,0; set .Round,.Round - 1; set .Winner[0],getcharid(0); set .Winner[1],gettimetick(2) + .Delay; npctalk "[ "+strcharinfo(0)+" ] , You're Correct."; killmonster .Map$,"All"; deletepset 1; if( getarraysize( .Reward$ ) > 1 ) for( set .@i,0; .@i < getarraysize( .Reward$ ) - 1; set .@i,.@i + 2 ) if( getitemname( atoi( .Reward$[.@i] ) ) == "null" ){ set getd( .Reward$[.@i] ),getd( .Reward$[.@i] ) + atoi( .Reward$[.@i+1] ); dispbottom "Reward : "+.Reward$[.@i]+" + "+.Reward$[.@i+1]; }else{ getitem atoi( .Reward$[.@i] ),atoi( .Reward$[.@i+1] ); dispbottom "Reward : "+getitemname( atoi( .Reward$[.@i] ) )+" x "+.Reward$[.@i+1]; } if( .Round ) donpcevent strnpcinfo(0)+"::OnStartGame"; } end; OnInit: // Min. GM Level to access GM Panel set .GMLevel,80; // Game Location set .Map$,"prontera"; // Monster ID Lists setarray .MonsterList[0],1084,1085; // Winners Answer Delay ( Not advised for High Value ) set .Delay,10; // Spam Prevention ( Not advised for High Value ) set .Spam,3; // How many rounds set .MaxRound,10; // Area Coordination ,,,; setarray .Coordinate,153,146,159,153; // Rewards ... setarray .Reward$[0], "#CASHPOINTS","100", "Zeny","100000", "7227","10", // "CustomVariable","100000", // "#CustomVariable","100000", "7539","100"; end; OnClock0100: OnClock0500: OnMinute30: for( set .@i,0; .@i < 60; set .@i,.@i + 10 ){ announce "Flower Counting Game : start within "+.@i+" Seconds in "+.Map$,0; sleep 10000; } OnStartGame: if( !.Round ) set .Round,.MaxRound; announce "Flower Counting Game has started in "+.Map$,0; deletearray .MobCount[0],getarraysize( .MobCount ); for( set .@x,.Coordinate[0]; .@x <= .Coordinate[2]; set .@x,.@x + 1 ) for( set .@y,.Coordinate[1]; .@y <= .Coordinate[3]; set .@y,.@y + 1 ){ set .@Summon,rand( getarraysize( .MonsterList ) ); monster .Map$,.@x,.@y,"Flower",.MonsterList[.@Summon],1,strnpcinfo(0)+"::OnFlower"; set .MobCount[.@Summon],.MobCount[.@Summon] + 1; sleep2 5; } set .@Target,rand( getarraysize( .MonsterList ) ); deletepset 1; defpattern 1,"([^:]+):.*"+.MobCount[.@Target]+".*", "iRight"; defpattern 1,"([^:]+):.*.*", "iSpam"; activatepset 1; delwaitingroom; waitingroom getmonsterinfo( .MonsterList[.@Target],0 ),0; npctalk "Count for the Targeted Monster's Amount to Win the Game."; set .Event,1; end; }