prontera,0,0,0 script LMS 123,{
mes .n$;
mes "Hello there "+strcharinfo(0)+", what do you want to do?";
mes "How may I help you?";
next;
if(getgmlevel() >= .gml){
menu "GM Menu",GM_Menu,"Player Menu",-;
}
switch(select("- Join LMS:- Redeem Reward:- Exit")){
case 1:
if(!.LMS_Reg){
mes "I'm Sorry"+strcharinfo(0)+"but the registration isn't opened yet";
close;
}
if(.limit && getmapusers(.map$) >= .limit) {
mes "I'm sorry but the event room for LMS is already full";
close;
}
mes "Are you sure in joining Last Man Standing Event?";
next;
if(select("- Yes! I would like to participate!:- Wrong move, EXIT") - 1){
mes .n$;
mes "See you again, when you are ready.";
close;
}
mes .n$;
mes "That's the spirit!!!";
mes "I will warp you know to the map where the event will be hold.";
close2;
set .p_ct,.p_ct + 1;
set @lms,1;
setarray .lms_ppl$[getarraysize(.lms_ppl$)],strcharinfo(0);
warp .map$,0,0;
if(.intra) sc_start SC_Intravision,.dur,1;
end;
case 2:
mes .n$;
if(!@lms)
{
mes "I'm sorry, but you are not qualified to recieve an reward.";
close;
}
mes "Congratulation in surviving Last Man Standing, here is your reward.";
close2;
getitem .rew_id,.rew_am;
end;
case 3:
close;
}
GM_Menu:
mes .n$;
mes "The event is currently "+( (.LMS_Eve)?"^00FF00Online":"^FF0000Offline")+"^000000.";
mes "What do you want to do?";
if(select("- Start/Stop Event:- Nevermind") - 1) close;
next;
mes .n$;
mes "Do you really want to "+( (.LMS_Eve)?"^00FF00start":"^FF0000stop")+"^000000 the event?";
if(select("- Yes:- No") - 1) close;
next;
if(.LMS_Eve) donpcevent strnpcinfo(3)+"::OnDisable"; else donpcevent strnpcinfo(3)+"::OnStart";
mes .n$;
mes "The event has been "+( (.LMS_Eve)?"^00FF00started":"^FF0000stopped")+"^000000.";
mes "See ya.";
close;
OnStart:
announce .n$+": The event, Last Man Standing, will be started shortly.",bc_all;
sleep 10000;
announce .n$+": The maximum players which can join "+ ( (.limit)?"are "+.limit:"is Unlimited")+".",bc_all;
sleep 10000;
announce .n$+": I will open the registration for 2 minutes.",bc_all;
sleep 10000;
announce .n$+": I just need to finish the preparations!",bc_all;
if(getmapusers(.map$) > 0) {
mapannounce .map$,n$+": You all will be warped in 10 seconds back to prontera,since this map will be used for an event, Last Man Standing.",bc_map;
sleep 10000;
mapwarp .map$,"prontera.gat",150,180;
}
sleep 10000;
set .LMS_Reg,1; // Registration enabled
announce .n$+": Registration is now opened, please hurry!!!",bc_all;
initnpctimer;
end;
OnTimer:
switch(getnpctimer(0)) {
case 60000:
announce .n$+": Registration will last for 1 minute, please hurry!!!",bc_all;
end;
case 120000:
stopnpctimer;
set .LMS_Reg,0;
announce .n$+": Registration has been closed!!!",bc_all;
sleep 10000;
if(.p_ct < 2) {
announce .n$+": But it seems too less have registered, so I have to cancel it!!!",bc_all;
goto OnDisable;
}
announce .n$+": "+.p_ct+" players have registered!!!",bc_all;
sleep 10000;
announce .n$+": The event will last "+(.dur/60000)+" minutes.",bc_all;
setmapflag .map$,mf_nowarpto;
setmapflag .map$,mf_nowarp;
setmapflag .map$,mf_nosave;
setmapflag .map$,mf_nomemo;
setmapflag .map$,mf_nomemo;
setmapflag .map$,mf_pvp;
setmapflag .map$,mf_partylock;
setmapflag .map$,mf_pvp_noparty;
set .LMS_Eve,1; // Event started
startnpctimer;
end;
default:
if(getnpctimer(0) < ((.dur/2)+120000) || getnpctimer(0) < (.dur+120000)) break;
stopnpctimer;
if(getnpctimer(0) == ((.dur/2)+120000) ) {
mapannounce .map$,.n$+: "+(.dur/60000)/2+" Minutes has passed!!!",bc_map;
if(getmapusers(.map$) == 0 && .LMS_Eve)
announce .n$+": It seems like that all users have left the event mapm therefore I won't be able to declare the winner!!!",bc_map;
} else if(getnpctimer(0) == (.dur+120000) )
mapannounce .map$,.n$+: +(.dur/60000)+" Minutes has passed, I will now end the event!!!",bc_all;
break;
}
OnDisable:
if(!.LMS_Eve) end; // No need to continue if the event hasn't even started
removemapflag .map$,mf_nowarpto;
removemapflag .map$,mf_nowarp;
removemapflag .map$,mf_nomemo;
removemapflag .map$,mf_nomemo;
removemapflag .map$,mf_pvp;
removemapflag .map$,mf_partylock;
removemapflag .map$,mf_pvp_noparty;
deletearray .lms_ppl$[0],128;
set .LMS_Eve,0;
set .p_ct,0; // Reseting Player Counter
announce .n$+": The event, Last Man Standing, has ended!!!",bc_all;
mapannounce .map$,.n$+": You all will be warped in 10 seconds back to prontera.",bc_all;
sleep 10000;
mapwarp .map$,"prontera.gat",150,180;
end;
OnPCDieEvent:
if(!.LMS_Eve) end;
if(strcharinfo(3) != .map$) end;
if(killerrid != getcharid(3)) dispbottom .n$+": You have been killed by "+rid2name(killerrid)+"!!";
set @lms,0;
warp "prontera",150,180;
sleep2 2000; // Slowing down the script
if(getmapusers(.map$) == 2) mapannounce .map$,.n$+": Wuhu!! Only 2 players remain, let's see who is the better player!!";
else if(getmapusers(.map$) == 1) {
announce .n$+": The winner of the Last Man Standing event is "+ rid2name(killerrid)+".",bc_all;
goto OnDisable;
} else if(getmapusers(.map$) == 0) goto OnDisable;
set .p_ct,.p_ct - 1;
for ( set .@b,0; .@b < getarraysize(.lms_ppl$); set .@b,.@b + 1)
if(strcharinfo(0) == .lms_ppl$[.@b]) deletearray .lms_ppl$[.@b],1;
end;
OnPCLogoutEvent:
if(!.LMS_Eve) end;
if(strcharinfo(3) != .map$) end;
for ( set .@b,0; .@b < getarraysize(.lms_ppl$); set .@b,.@b + 1)
if(strcharinfo(0) == .lms_ppl$[.@b]) deletearray .lms_ppl$[.@b],1;
set .p_ct,.p_ct - 1;
end;
OnInit:
set .n$,"["+strnpcinfo(1)+"]";
set .gm,60; // GM Access
set .init,0;
set .dur,1800000;
// Intravision (Maya Purple Card Effect - Able to see hidden player)
// This effect is to prevent players to cheat by using "Cloaking" and similiar skills
// 0 = Off
// 1 = On
set .intra,1;
set .rew_am,100; // Reward Amount
set .rew_id,512; // Item ID
// Player Limit:
// 0 == Unlimited
set .limit,30;
// Map on which LMS will be executed
set .map$,"force_3-1";
end;
}