prontera,147,190,5 script Last Man Standing 100,{
if ( !.start ) {
mes "You can register later after i announce.";
mes "Thanks :)";
close;
}
if ( .start == 2 ) {
mes "event is running";
close;
}
if ( .register_count >= .register_limit ) {
mes "this event has reach the maximum player participations";
close;
}
percentheal 100,100;
warp "pvp_n_1-3", 0,0;
.register_aid[ .register_count ] = getcharid(3);
.register_count+++;
end;
OnWhisperGlobal:
if ( getgmlevel() < 60 ) end;
OnMinute00:
OnMinute60:
if ( .start == 2 )
callsub L_resetmap;
else if ( .start == 1 )
end;
announce "LMS event registration start", 0;
.start = 1;
sleep 10000; // registration timer here
announce "LMS event registration close", 0;
.start = 2;
sleep 3000;
mapannounce "pvp_n_1-3", "THIS IS SPARTA !!!!!", 0;
if ( .register_count < .register_min ) {
announce "not enough participants for LMS event", 0;
mapwarp "pvp_n_1-3", .map$, .x, .y;
callsub L_resetmap;
end;
}
pvpon "pvp_n_1-3";
end;
OnPCDieEvent:
OnPCLogoutEvent:
if ( .start != 2 || strcharinfo(3) != "pvp_n_1-3" ) end;
while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;
deletearray .register_aid[.@i], 1;
.register_count--;
warp "SavePoint", 0,0;
if ( .register_count > 1 ) end;
killmonsterall "pvp_n_1-3";
announce "congratulations ~ the winner of LMS event is "+ rid2name( .register_aid ), 0;
getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize
warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) );
callsub L_reset;
end;
L_resetmap:
mapwarp "pvp_n_1-3", .map$, .x, .y;
L_reset:
.start = 0;
deletearray .register_aid;
.register_count = 0;
pvpoff "pvp_n_1-3";
return;
OnInit:
getmapxy .map$, .x, .y, 1;
.register_min = 2; // minimum amount of players to start this event, or else it auto-abort
.register_limit = 100; // maximum amount of players able to participate in this event
.reward_item_id = 7248;
.reward_item_amount = 30;
end;
}
pvp_n_1-3 mapflag nosave SavePoint
pvp_n_1-3 mapflag nowarp
pvp_n_1-3 mapflag nowarpto
pvp_n_1-3 mapflag noteleport
pvp_n_1-3 mapflag nomemo
pvp_n_1-3 mapflag nopenalty
//pvp_n_1-3 mapflag nobranch
pvp_n_1-3 mapflag noicewall
pvp_n_1-3 mapflag pvp_noparty
pvp_n_1-3 mapflag pvp_noguild