prontera,155,179,4 script Zombie 1015,{
OnInit:
// item reward
setarray .item,
501, 10,
502, 5;
// @bombstart - gm manual start
bindatcmd "zombiestart", strnpcinfo(0)+"::OnStart",60,60;
// @bomb - player join event
bindatcmd "zombie", strnpcinfo(0)+"::OnJoinEvent";
// Mapflags
setarray .@mapflag,
mf_nowarp,
mf_nowarpto,
mf_noskill,
mf_noteleport,
mf_nomemo,
mf_nosave,
mf_noicewall,
mf_nobranch,
mf_noreturn;
for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
setmapflag "quiz_02", .@mapflag[.@i];
end;
OnJoinEvent:
mes " [ Event Status ] ";
switch ( .start ) {
case 1: .@status$ = "active"; break;
case 2: .@status$ = "on-going"; break;
default: .@status$ = "not active"; break;
}
mes "Event is currently ^ff0000"+ .@status$ +"^000000";
next;
switch(select(
"Zombie Apocalypse Event - "+ ((.start == 1) ? "^0000ffJoin Event":((.start == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000" )) {
case 1:
if ( !.start ) {
mes "Event is not available.";
close;
} else if ( .start == 2 ) {
mes "Event is on-going";
close;
}
sc_end SC_ALL;
sc_start SC_DECREASEAGI,600000,10;
percentheal 100,100;
warp "quiz_02",59,345;
}
end;
OnStart:
// Add your clock timers here.
OnClock2332: // 12 MN
OnClock0300: // 3 AM
OnClock0600: // 6 AM
OnClock1700: // 5 PM
if ( .start ) end;
.start = 1;
.round = 0;
killmonsterall "quiz_02";
announce "Zombie Apocalypse: We are going to have a Zombie Apocalypse event.",0;
sleep 10000;
announce "Zombie Apocalypse: For those who wants to join, use @zombie",0;
sleep 10000;
announce "Zombie Apocalypse: Register time will be closing after 1 minute", 0;
sleep 20000;
announce "Zombie Apocalypse: Last 30 second", 0;
sleep 10000;
announce "Zombie Apocalypse: Rush type in '@warp prontera 144,188' to join", 0;
sleep 10000;
announce "Zombie Apocalypse Last 10 second to register", 0;
sleep 5000;
announce "Zombie Apocalypse: 5", 0;
sleep 1000;
announce "Zombie Apocalypse: 4", 0;
sleep 1000;
announce "Zombie Apocalypse: 3", 0;
sleep 1000;
announce "Zombie Apocalypse: 2", 0;
sleep 1000;
announce "Zombie Apocalypse: 1", 0;
sleep 800;
announce "Zombie: The entry to the event is now closed.",0;
if ( getmapusers("quiz_02") < 1 ) {
announce "Zombie: Not enough participants.",0;
.start = false;
mapwarp "quiz_02", "prontera", 150, 180; // warp out.
end;
}
.start = 2;
sleep 3500;
mapannounce "quiz_02","We're about to begin the event.",bc_map,0;
sleep 2500;
mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
sleep 2000;
mapannounce "quiz_02","Event will run for 30 seconds for 5 total rounds.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "quiz_02","All you have to do is avoid Zombie and stay alive for 30 seconds.",bc_map,0x0ceedb;
sleep 2000;
mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
sleep 3000;
while ( .round < 5 ) {
.@count = getmapusers("quiz_02");
.round++;
mapannounce "quiz_02","Round "+.round,bc_map,0x0ceedb;
areamonster "quiz_02",48,334,71,357,"Zombies!! Run for you life!",1015, 5 * .@count * .round;
sleep 10000 - ( 1000*.round );
}
.@count = getmapusers("quiz_02");
if ( !.@count )
announce "Zombie: No one survived the Zombies.",bc_all,0x0ceedb;
else if ( .@count ) {
.@size = getmapunits(BL_PC,"quiz_02",.@aid);
.@amt = getarraysize(.item);
if ( .@size > 1 ) announce "A lot players has won the Zombie Event.",bc_all,0x0ceedb;
for ( .@i = 0; .@i < getarraysize(.@aid); .@i++) {
attachrid .@aid[.@i];
if ( .@size == 1 ) announce strcharinfo(0)+" has won the Zombie Event.",bc_all,0x0ceedb;
for ( .@j = 0; .@j < .@amt; .@j += 2 )
getitem .item[.@j], .item[.@j+1];
}
detachrid;
}
.start = false;
sleep 5000;
mapwarp "quiz_02","prontera",rand(148,163),rand(167,186);
end;
OnPCDieEvent:
if ( .start && strcharinfo(3) == "quiz_02" )
warp "prontera",rand(148,163),rand(167,186);
end;
}