viewing paste Treasure Box + Maze Event | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
prontera,155,181,5      script  Sample  757,{
if( countitem( .KeyID ) )
        warp "guild_vs5",0,0;
else
        npctalk "You need a KEY";
 
OnInit:
// Key ID
set .KeyID,7483;
 
// Time Limit
set .TimeLimit,10;
 
// Maps
setarray .Map$,"prtg_cas01";
 
// Monster Maps Location XY
set .MobMap$,"guild_vs5";
setarray .MobID,1002,1002,1001,1001,1005,1007;
setarray .MobX,1,2,3,4,5,6;
setarray .MobY,1,2,3,4,5,6;
 
// Hide Other NPC
hideonnpc "Sample1";
 
OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
OnMinute00:
set .Event,1;
set .Map$,rand( getarraysize( .Map$ ) );
for( set .@i,5; .@i > 0; set .@i,.@i - 1 ){
        announce "Event will start within "+.@i+" Minutes in "+.Map$[ .Map ],0;
        sleep2 ( 60 * 1000 );
}
announce "Event Start. find the key talk to NPC",0;
monster .Map$[.Map],0,0,"Event Treasure Box",3639,5,strnpcinfo(0)+"::OnKilled";
sleep2 ( .TimeLimit * 60 * 1000 );
if( .Event )
        announce "Event Cancelled due to no 1 able to finish it within "+.TimeLimit+" Minutes.",0;
else
        announce "Event END !!",0;
set .Event,0;
killmonster .Map$[.Map],"All";
killmonster .MobMap$,"All";
 
OnKilled:
hideoffnpc "Sample1";
// I use rent ..easy to remove upon Event End.
rentitem .KeyID,( .TimeLimit * 60 -  );
message strcharinfo(0),"Rush to the NPC";
}
 
guild_vs5,155,181       script  Sample1 757,{
if( getarraysize( .Winner$ ) < 3 ){
        if( getviableofnpc( .Event,"Sample" ) == 1 ){
                set .Winner[ getarraysize( .Winner$ ) ],strcharinfo(0);
                announce "[ "+getarraysize( .Winner$ )+"th Winner ]"+strcharinfo(0),0;
                getitem 501,1000;
        }else{
                awake "Sample";
                mes "You are Late...";
                close2;
        }
        warp "prontera",155,181;
}
 
}
Viewed 770 times, submitted by Emistry.