Hi, I hope there are still some scripter supports active here. I just want to ask what's wrong with this script? I customized Mabuhay's LMS and gave it a little twist. It works perfectly well on a Test Server but the minute I put it live and it starts, it will automatically jump to OnEndEvent after one player comes in which boggles me to no end. I've already rechecked the script multiple times and created a test server setup using my live server files but I still get the same results. Also, it seems that 4 instances start at the same time once the event starts on live server so I'm kinda wondering if I'm missing anything. It's been almost 20 years since I last worked on RO and that was back in eAthena so please pardon me for being rusty Thanks in advance!
// Original Script by Mabuhay - Customized by Reon====================================//
//=====================Chaos Last Man Standing =======================================//
1@tnm2,0,0,0 script Chaos_LMS -1,{
OnJoinEvent:
mes " [^D16002Chaos LMS^000000] ";
mes "Welcome to Chaos Last Man Standing Event!";
if ( !.clmsstart ) mes "Next schedule starts in ^FF0000"+ Time2Str(.chaosevent_time) +"^000000.";
if ( .clmsstart == 1 ) mes "Event is currently active. [ "+ getmapusers("1@tnm2") +" / 5 ]";
if ( .clmsstart == 2 ) mes "Event is currently on-going.";
next;
switch(select("Last Man Standing Event - "+ ((.clmsstart == 1) ? "^00ff00Join Event":((.clmsstart == 2) ? "^00ff00Event On-Going":"^ff0000Not Available"))+"^000000:Details:Prize")) {
case 1:
if ( !.clmsstart ) {
mes " [^D16002Chaos LMS^000000] ";
mes "Event is not available.";
close;
} else if ( .clmsstart == 2 ) {
mes " [^D16002Chaos LMS^000000] ";
mes "Event is on-going";
close;
} else if(getcharid(1)) {
mes " [^D16002Chaos LMS^000000] ";
mes "You are in a party, leave your party before joining.";
close;
} else if(BaseLevel < 255) {
mes " [^D16002Chaos LMS^000000] ";
mes "You're not strong enough. Come back when you're maxed out.";
close;
} else callsub Clms_start;
case 2:
mes " [^D16002Chaos LMS^000000] ";
mes "It's an all out PVP event among the strongest";
mes "players in our server with a twist!";
break;
case 3:
mes " [^D16002Chaos LMS^000000] ";
mes "Current prize for the Chaos LMS Champion";
mes "are 50 x [^0000FFBadge of Peerless Warrior^000000]";
mes "and 50 x [^0000FFReloaded Generosity Receipt^000000].";
next;
mes " [^D16002Chaos LMS^000000] ";
mes "The champion will also be endowed with a special [^FF0000aura^000000] and [^FF0000+20^000000] to all their stats.";
break;
default:
break;
Clms_start:
set lmschamp,0;
hateffect 27,false;
hateffect 16,false;
hateffect 92,false;
sc_end SC_INCALLSTATUS;
announce "Chaos LMS: Player ["+strcharinfo(0)+"] has registered to Chaos LMS!",bc_all,0x0ceedb;
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS|PCBLOCK_EQUIP, true;
set @fakename$, "Chaos Gladiator";
charcommand "#fakename \""+ strcharinfo(0) +"\""+(@fakename$);
disguise 1163;
warp "1@tnm2",0,0;
detachrid;
}
end;
OnStart: .@force = true;
OnMinute00: // runs hourly
.@time = gettimetick(2);
.@min = gettime(DT_MINUTE)*60;
.@sec = gettime(DT_SECOND);
if ( .chaosevent_time > .@time && !.@force || .clmsstart && !.@force ) end; // doesnt start if cd isn't done.
.chaosevent_time = (.@time - ( .@min + .@sec )) + .chaosevent_cd - 5;
.clmsstart = 1;
pvpoff "1@tnm2";
announce "Chaos LMS: Chaos Last Man Standing Event is about to begin!",0;
sleep 10000;
announce "Chaos LMS: For those who wants to join, type in @chaos",0;
sleep 10000;
announce "Chaos LMS: Minimum of 5 players is required to start the event.",0;
sleep 10000;
announce "Chaos LMS: Event registration ends after 1 minute.",0;
sleep 10000;
announce "Chaos LMS: So please if you want to join. use @chaos",0;
sleep 60000;
announce "Chaos LMS: The entry to the event is now closed.",bc_all,0x0ceedb;
// if ( getmapusers("1@tnm2") < 2 ) {
if ( getmapusers("1@tnm2") < 5 ) {
announce "Chaos LMS: Not enough participants, ending event now. See you after an hour!",bc_all,0x0ceedb;
.clmsstart = false;
sleep 2500;
addrid(1);
charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "" : "" );
undisguise;
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS|PCBLOCK_EQUIP, false;
warp "prontera",150,180;
detachrid;
end;
}
.clmsstart = 2;
sleep 3500;
mapannounce "1@tnm2","Chaos LMS: We're about to begin the event.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: Chat, emotions and @commands will be disabled.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: Beware of impostors lurking in the dark.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: Kill everyone on sight. Trust no one.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: The last player standing amidst this chaos, wins!",bc_map,0x0ceedb;
sleep 2000;
mapannounce "1@tnm2","Chaos LMS: Let's begin!",bc_map,0x0ceedb;
sleep 3000;
for (.@i = 10; .@i > 0; .@i--) {
mapannounce "1@tnm2", "Chaos LMS: -- "+.@i+" --",bc_map,0x0ceedb;
sleep 1000;
}
mapannounce "1@tnm2", "Chaos LMS: Fight! ",bc_map,0x0ceedb;
//Preparation
addrid(1);
set @fakename$, strcharinfo(0);
charcommand "#fakename \""+ strcharinfo(0) +"\""+(@fakename$);
undisguise;
set .@lmsclone, getcharid(0);
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
warp "1@tnm2",0,0;
detachrid;
pvpon "1@tnm2";
.clmstimer = 0;
initnpctimer;
end;
OnTimer5000: // check every 10 secs..
.clmstimer++;
callsub S_MapChecker;
if ( .clmstimer == 6) {
.clmstimer = 0;
mapannounce "1@tnm2", "Chaos LMS: We still have some players & shadows left..", bc_blue;
} else if ( getmapusers("1@tnm2") <= 1 && mobcount("1@tnm2",strnpcinfo(3)+"::OnNPCKillEvent") == 0)
donpcevent strnpcinfo(3)+"::OnEndEvent";
setnpctimer 0;
end;
OnEndEvent:
stopnpctimer;
killmonsterall "1@tnm2";
.clmsstart = false;
pvpoff "1@tnm2";
mapannounce "1@tnm2", "Chaos LMS: Chaos LMS event has ended!",bc_map,0x0ceedb;
sleep 5000;
.@sizelms = getmapunits(BL_PC,"1@tnm2",.@aid);
if ( .@sizelms == 0 ) {
announce "Chaos LMS: No winners.",0;
sleep 5000;
announce "Chaos LMS: See you guys again after an hour!",0;
sleep 5000;
end;
}
.@amt = getarraysize(.clmsitem);
attachrid .@aid;
announce "Chaos LMS: "+strcharinfo(0)+" has won the Chaos Last Man Standing Event. Thank you for joining!",bc_all,0x0ceedb;
for ( .@j = 0; .@j < .@amt; .@j += 2 )
getitem .clmsitem[.@j], .clmsitem[.@j+1];
undisguise;
charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "" : "" );
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS|PCBLOCK_EQUIP, false;
atcommand "@heal";
hateffect 27,true;
sc_start SC_INCALLSTATUS,INFINITE_TICK,20;
set @champ,getcharid(0);
query_sql( "DELETE FROM `char_reg_num` WHERE `value` !=@champ" );
set lmschamp,getcharid(0);
warp "prontera",rand(148,163),rand(167,186);
end;
OnNPCKillEvent:
callsub S_MapChecker;
mapannounce "1@tnm2","Chaos LMS: A shadow has been purified!",bc_map,0x0ceedb;
end;
OnPCDieEvent:
if ( .clmsstart && strcharinfo(3) == "1@tnm2" ) {
undisguise;
charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "" : "" );
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS, false;
warp "prontera",rand(148,163),rand(167,186);
atcommand "@heal";
mapannounce "1@tnm2","Chaos LMS: ["+ strcharinfo(0) +"] has fallen..",bc_map,0x0ceedb;
detachrid;
if ( getmapusers("1@tnm2") == 0) {
donpcevent strnpcinfo(3)+"::OnEndEvent";
} else
callsub S_MapChecker;
}
end;
OnPCLogoutEvent:
if ( .clmsstart && strcharinfo(3) == "1@tnm2" ) {
if ( getmapusers("1@tnm2") == 0) {
donpcevent strnpcinfo(3)+"::OnEndEvent";
} else
callsub S_MapChecker;
}
end;
S_MapChecker:
if ( getmapusers("1@tnm2") == 1 && mobcount("1@tnm2",strnpcinfo(3)+"::OnNPCKillEvent") == 0) {
donpcevent strnpcinfo(3)+"::OnEndEvent";
} else return;
OnInit:
// item reward
setarray .clmsitem,
22847, 50,
40500, 50;
// @lmsstart - gm manual start
bindatcmd "chaosstart", strnpcinfo(0)+"::OnStart",60,60;
// @lms - player join event
bindatcmd "chaos", strnpcinfo(0)+"::OnJoinEvent";
// @lms - player join event
bindatcmd "chaosend", strnpcinfo(0)+"::OnEndEvent",60,60;
// Event cooldown
.chaosevent_cd = 60 * 60 * 1; // 1hr
// Mapflags
setarray .@clmsmapflag,
mf_nowarp,
mf_nowarpto,
mf_noteleport,
mf_nomemo,
mf_nosave,
mf_nobranch,
mf_noreturn;
for ( .@i = 0; .@i < getarraysize(.@clmsmapflag); .@i++)
setmapflag "1@tnm2", .@clmsmapflag[.@i];
.@min = gettime(DT_MINUTE)*60;
.@sec = gettime(DT_SECOND);
.chaosevent_time = (gettimetick(2) - ( .@min + .@sec )) + .chaosevent_cd - 5;
end;
}
//CLMS Mapflags
1@tnm2 mapflag hidemobhpbar
1@tnm2 mapflag pvp_noguild
1@tnm2 mapflag noloot
1@tnm2 mapflag loadevent// Original Script by Mabuhay - Customized by Reon====================================//
//=====================Chaos Last Man Standing =======================================//
1@tnm2,0,0,0 script Chaos_LMS -1,{
OnJoinEvent:
mes " [^D16002Chaos LMS^000000] ";
mes "Welcome to Chaos Last Man Standing Event!";
if ( !.clmsstart ) mes "Next schedule starts in ^FF0000"+ Time2Str(.chaosevent_time) +"^000000.";
if ( .clmsstart == 1 ) mes "Event is currently active. [ "+ getmapusers("1@tnm2") +" / 5 ]";
if ( .clmsstart == 2 ) mes "Event is currently on-going.";
next;
switch(select("Last Man Standing Event - "+ ((.clmsstart == 1) ? "^00ff00Join Event":((.clmsstart == 2) ? "^00ff00Event On-Going":"^ff0000Not Available"))+"^000000:Details:Prize")) {
case 1:
if ( !.clmsstart ) {
mes " [^D16002Chaos LMS^000000] ";
mes "Event is not available.";
close;
} else if ( .clmsstart == 2 ) {
mes " [^D16002Chaos LMS^000000] ";
mes "Event is on-going";
close;
} else if(getcharid(1)) {
mes " [^D16002Chaos LMS^000000] ";
mes "You are in a party, leave your party before joining.";
close;
} else if(BaseLevel < 255) {
mes " [^D16002Chaos LMS^000000] ";
mes "You're not strong enough. Come back when you're maxed out.";
close;
} else callsub Clms_start;
case 2:
mes " [^D16002Chaos LMS^000000] ";
mes "It's an all out PVP event among the strongest";
mes "players in our server with a twist!";
break;
case 3:
mes " [^D16002Chaos LMS^000000] ";
mes "Current prize for the Chaos LMS Champion";
mes "are 50 x [^0000FFBadge of Peerless Warrior^000000]";
mes "and 50 x [^0000FFReloaded Generosity Receipt^000000].";
next;
mes " [^D16002Chaos LMS^000000] ";
mes "The champion will also be endowed with a special [^FF0000aura^000000] and [^FF0000+20^000000] to all their stats.";
break;
default:
break;
Clms_start:
set lmschamp,0;
hateffect 27,false;
hateffect 16,false;
hateffect 92,false;
sc_end SC_INCALLSTATUS;
announce "Chaos LMS: Player ["+strcharinfo(0)+"] has registered to Chaos LMS!",bc_all,0x0ceedb;
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS|PCBLOCK_EQUIP, true;
set @fakename$, "Chaos Gladiator";
charcommand "#fakename \""+ strcharinfo(0) +"\""+(@fakename$);
disguise 1163;
warp "1@tnm2",0,0;
detachrid;
}
end;
OnStart: .@force = true;
OnMinute00: // runs hourly
.@time = gettimetick(2);
.@min = gettime(DT_MINUTE)*60;
.@sec = gettime(DT_SECOND);
if ( .chaosevent_time > .@time && !.@force || .clmsstart && !.@force ) end; // doesnt start if cd isn't done.
.chaosevent_time = (.@time - ( .@min + .@sec )) + .chaosevent_cd - 5;
.clmsstart = 1;
pvpoff "1@tnm2";
announce "Chaos LMS: Chaos Last Man Standing Event is about to begin!",0;
sleep 10000;
announce "Chaos LMS: For those who wants to join, type in @chaos",0;
sleep 10000;
announce "Chaos LMS: Minimum of 5 players is required to start the event.",0;
sleep 10000;
announce "Chaos LMS: Event registration ends after 1 minute.",0;
sleep 10000;
announce "Chaos LMS: So please if you want to join. use @chaos",0;
sleep 60000;
announce "Chaos LMS: The entry to the event is now closed.",bc_all,0x0ceedb;
// if ( getmapusers("1@tnm2") < 2 ) {
if ( getmapusers("1@tnm2") < 5 ) {
announce "Chaos LMS: Not enough participants, ending event now. See you after an hour!",bc_all,0x0ceedb;
.clmsstart = false;
sleep 2500;
addrid(1);
charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "" : "" );
undisguise;
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS|PCBLOCK_EQUIP, false;
warp "prontera",150,180;
detachrid;
end;
}
.clmsstart = 2;
sleep 3500;
mapannounce "1@tnm2","Chaos LMS: We're about to begin the event.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: Chat, emotions and @commands will be disabled.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: Beware of impostors lurking in the dark.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: Kill everyone on sight. Trust no one.",bc_map,0x0ceedb;
sleep 2500;
mapannounce "1@tnm2","Chaos LMS: The last player standing amidst this chaos, wins!",bc_map,0x0ceedb;
sleep 2000;
mapannounce "1@tnm2","Chaos LMS: Let's begin!",bc_map,0x0ceedb;
sleep 3000;
for (.@i = 10; .@i > 0; .@i--) {
mapannounce "1@tnm2", "Chaos LMS: -- "+.@i+" --",bc_map,0x0ceedb;
sleep 1000;
}
mapannounce "1@tnm2", "Chaos LMS: Fight! ",bc_map,0x0ceedb;
//Preparation
addrid(1);
set @fakename$, strcharinfo(0);
charcommand "#fakename \""+ strcharinfo(0) +"\""+(@fakename$);
undisguise;
set .@lmsclone, getcharid(0);
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
clone "1@tnm2",0,0,"Chaos_LMS::OnNPCKillEvent",.@lmsclone;
warp "1@tnm2",0,0;
detachrid;
pvpon "1@tnm2";
.clmstimer = 0;
initnpctimer;
end;
OnTimer5000: // check every 10 secs..
.clmstimer++;
callsub S_MapChecker;
if ( .clmstimer == 6) {
.clmstimer = 0;
mapannounce "1@tnm2", "Chaos LMS: We still have some players & shadows left..", bc_blue;
} else if ( getmapusers("1@tnm2") <= 1 && mobcount("1@tnm2",strnpcinfo(3)+"::OnNPCKillEvent") == 0)
donpcevent strnpcinfo(3)+"::OnEndEvent";
setnpctimer 0;
end;
OnEndEvent:
stopnpctimer;
killmonsterall "1@tnm2";
.clmsstart = false;
pvpoff "1@tnm2";
mapannounce "1@tnm2", "Chaos LMS: Chaos LMS event has ended!",bc_map,0x0ceedb;
sleep 5000;
.@sizelms = getmapunits(BL_PC,"1@tnm2",.@aid);
if ( .@sizelms == 0 ) {
announce "Chaos LMS: No winners.",0;
sleep 5000;
announce "Chaos LMS: See you guys again after an hour!",0;
sleep 5000;
end;
}
.@amt = getarraysize(.clmsitem);
attachrid .@aid;
announce "Chaos LMS: "+strcharinfo(0)+" has won the Chaos Last Man Standing Event. Thank you for joining!",bc_all,0x0ceedb;
for ( .@j = 0; .@j < .@amt; .@j += 2 )
getitem .clmsitem[.@j], .clmsitem[.@j+1];
undisguise;
charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "" : "" );
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS|PCBLOCK_EQUIP, false;
atcommand "@heal";
hateffect 27,true;
sc_start SC_INCALLSTATUS,INFINITE_TICK,20;
set @champ,getcharid(0);
query_sql( "DELETE FROM `char_reg_num` WHERE `value` !=@champ" );
set lmschamp,getcharid(0);
warp "prontera",rand(148,163),rand(167,186);
end;
OnNPCKillEvent:
callsub S_MapChecker;
mapannounce "1@tnm2","Chaos LMS: A shadow has been purified!",bc_map,0x0ceedb;
end;
OnPCDieEvent:
if ( .clmsstart && strcharinfo(3) == "1@tnm2" ) {
undisguise;
charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "" : "" );
setpcblock PCBLOCK_CHAT|PCBLOCK_EMOTION|PCBLOCK_COMMANDS, false;
warp "prontera",rand(148,163),rand(167,186);
atcommand "@heal";
mapannounce "1@tnm2","Chaos LMS: ["+ strcharinfo(0) +"] has fallen..",bc_map,0x0ceedb;
detachrid;
if ( getmapusers("1@tnm2") == 0) {
donpcevent strnpcinfo(3)+"::OnEndEvent";
} else
callsub S_MapChecker;
}
end;
OnPCLogoutEvent:
if ( .clmsstart && strcharinfo(3) == "1@tnm2" ) {
if ( getmapusers("1@tnm2") == 0) {
donpcevent strnpcinfo(3)+"::OnEndEvent";
} else
callsub S_MapChecker;
}
end;
S_MapChecker:
if ( getmapusers("1@tnm2") == 1 && mobcount("1@tnm2",strnpcinfo(3)+"::OnNPCKillEvent") == 0) {
donpcevent strnpcinfo(3)+"::OnEndEvent";
} else return;
OnInit:
// item reward
setarray .clmsitem,
22847, 50,
40500, 50;
// @lmsstart - gm manual start
bindatcmd "chaosstart", strnpcinfo(0)+"::OnStart",60,60;
// @lms - player join event
bindatcmd "chaos", strnpcinfo(0)+"::OnJoinEvent";
// @lms - player join event
bindatcmd "chaosend", strnpcinfo(0)+"::OnEndEvent",60,60;
// Event cooldown
.chaosevent_cd = 60 * 60 * 1; // 1hr
// Mapflags
setarray .@clmsmapflag,
mf_nowarp,
mf_nowarpto,
mf_noteleport,
mf_nomemo,
mf_nosave,
mf_nobranch,
mf_noreturn;
for ( .@i = 0; .@i < getarraysize(.@clmsmapflag); .@i++)
setmapflag "1@tnm2", .@clmsmapflag[.@i];
.@min = gettime(DT_MINUTE)*60;
.@sec = gettime(DT_SECOND);
.chaosevent_time = (gettimetick(2) - ( .@min + .@sec )) + .chaosevent_cd - 5;
end;
}
//CLMS Mapflags
1@tnm2 mapflag hidemobhpbar
1@tnm2 mapflag pvp_noguild
1@tnm2 mapflag noloot
1@tnm2 mapflag loadevent