06guild_01,50,50,3 script Man Hunt Gamekeeper 831,{
function StartHunt;
function EndHunt;
mes getarraysize($in$) +" Player inside: ";
for(.@i = 0; .@i < getarraysize($in$); .@i++){
mes (.@i +1) + ". " + $in$[.@i];
}
close;
OnGMStart:
OnClock1300:
set $hstart, 1;
announce "It's time for the Man-Hunt Event!",0;
sleep2 10000;
announce "Mechanics: A player will be chosen as a target per round and you must kill him!",0;
announce "If you're able to kill the target, you'll get points. Otherwise, much higher points shall be granted to him! Points can later be redeemed as SPECs.",0;
announce "Minimum players to start the event is 10. To join, click the Man-Hunt Warden in Prontera now!",0;
sleep2 60000;
announce "The Man Event will start in 60 seconds..",0;
sleep2 60000;
announce "The Man Hunt Event starts now!",0;
set $hstart, 2;
StartHunt;
end;
StartHunt:
if(getmapusers("06guild_01")< .min_player) EndHunt;
set .target, rand(0,getarraysize($in$)-1);
//announce .target,0;
set .rounds, .rounds + 1;
mapannounce "06guild_01", "[Round " + .rounds + "] Our target is "+$in$[.target]+"!",0;
atcommand "#killable "+$in$[.target]+"";
atcommand "#size \""+$in$[.target]+"\" 2";
initnpctimer;
end;
OnTimer30000:
mapannounce "06guild_01", "The Target has survived! The Round has ended!",0 ;
set #MHPoint, #MHPoint + 3;
dispbottom "You got +3 Points.";
atcommand "#killable "+$in$[.target]+"";
atcommand "#size \""+$in$[.target]+"\" 0";
atcommand "#item "+$in$[.target]+" 607, 3";
stopnpctimer;
if(.rounds >= 5) EndHunt;
mapannounce "06guild_01", "Next Round in 10 seconds..",0;
sleep2 10000;
StartHunt;
end;
OnPCDieEvent:
if( strcharinfo(3) == "06guild_01"){
if( strcharinfo(0) == $in$[.Target] ){
atcommand "#killable "+$in$[.Target]+"";
atcommand "#size \""+$in$[.Target]+"\" 0";
atcommand "#alive "+$in$[.Target]+"";
mapannounce "06guild_01", strcharinfo(0)+" was killed",0;
set #MHPoint, #MHPoint + 1;
dispbottom "You got +1 Points.";
if(attachrid(killerrid)) {
mapannounce "06guild_01", strcharinfo(0)+" got a kill: " + $in$[.Target],0;
set #MHPoint, #MHPoint + 3;
dispbottom "You got +3 Points.";
stopnpctimer;
sleep2 500;
}
}
if(.rounds >= 5) EndHunt;
mapannounce "06guild_01", "Next Round in 10 seconds..",0;
sleep2 10000;
StartHunt;
}
end;
EndHunt:
announce "The Man Hunt Event is over!",0;
mapannounce "06guild_01", "All players will be warped to Prontera in 2 seconds. Thanks for participating!",0;
mapwarp "06guild_01", "prontera",150,151;
deletearray $in$, getarraysize($in$);
set $hstart, 0;
set .rounds, 0;
donpcevent "Man Hunt Warden::OnEnd";
end;
OnPCLogOutEvent:
if(strcharinfo(3) == "06guild_01"){
if($hstart == 2){
announce "Oops! "+strcharinfo(0)+" withdrew from the game!",0;
set .left$, strcharinfo(0);
warp "SavePoint", 0, 0;
for(.@i = 0; .@i < getarraysize($in$); .@i++){
if($in$[.@i] == .left$){
set $in$[.@i],"";
deletearray $in$[.@i], 1;
}
}
mapannounce "06guild_01", "A Player left the game. The game is going to Restart!",0;
if(.rounds != 0){
set .rounds, .rounds -1;
}
StartHunt;
}
end;
}
OnInit:
set .rounds, 0;
set .min_player, 5;
end;
}
06guild_01 mapflag nowarp
06guild_01 mapflag nowarpto
06guild_01 mapflag noteleport
06guild_01 mapflag nosave SavePoint
06guild_01 mapflag nomemo
06guild_01 mapflag nobranch
06guild_01 mapflag nopenalty
06guild_01 mapflag noicewall
06guild_01 mapflag item_noequip