Jump to content

Question

Posted (edited)

Hi guys! I'm trying to create a run for your life event. Currently, I'm almost there. unfortunately it cause a MAP SERVER error. So basically, it shutdown my server after 30-40 minutes (after it run). trying to automate the script of annieruru

Basically, the bomb poring does not stop even after someone already won the game. Please check my script.

 

-	script	RFYL#disable	-1,{

OnInit:
disablenpc "RFYL Event";
end;

OnClock0030:
OnClock0230:
OnClock0430:
OnClock0630:
OnClock0830:
OnClock1030:
OnClock1230:
OnClock1430:
OnClock1630:
OnClock1830:
OnClock2030:
OnClock2230:
donpcevent "runordie::Onmanually";
end;
}



prontera,141,172,5	script	RFYL Event	100,{
	if ( getgmlevel() < 99 ) end;
	donpcevent "runordie::Onmanually";
	end;
}

prontera,156,170,5	script	Run Or Die	100,{
	set .@size, getarraysize( getvariableofnpc( .aid, "runordie" ) );
	if ( .@size >= 100 ) {
		mes "I'm sorry, the room is full";
		close;
	}
        if (Weight>0)
        {
	 mes "You cannot enter to this room with your items. I'll store them for you.";
	nude;
	atcommand "@storeall";
	dispbottom "All of your items and equipments has been stored on your own storage!";
        close;
        }
	percentheal 100, 100;
	sc_end SC_ALL;
	pvpoff "guild_vs5";
	gvgoff "guild_vs5";
	warp "guild_vs5", 0, 0;
	set getvariableofnpc( .aid[ .@size ], "runordie" ), getcharid(3);
	end;
}
-	script	runordie	-1,{
OnInit:
	disablenpc "Run Or Die";
	end;

OnWhisperGlobal:
	if ( getgmlevel() < 99 ) end;
	else if ( compare( @whispervar0$ , "debug" ) ) {
		dispbottom "Player left: "+ getarraysize(.aid);
		end;
	}
	else if ( compare( @whispervar0$, "on" ) == 0 ) end;
Onmanually:
	deletearray .aid;
	mapwarp "guild_vs5", "prontera", 142,170;
	killmonsterall "guild_vs5";
	set .stop, 1;
	disablenpc "RFYL Event";
	announce "Run Or Die!!!: Are you ready to join the Run Or Die Event?", 0;
	sleep 4000;
	announce "Run Or Die: For those who wants to join please go to the middle of Prontera", 0;
	sleep 6000;
	announce "Run Or Die: Registration NPC will disappear after 1 minute", 0;
	enablenpc "Run Or Die";
	sleep 20000;
	announce "Run Or Die: Last 30 second", 0;
	sleep 10000;
	announce "Run Or Die: Make it fast..", 0;
	sleep 10000;
	announce "Run Or Die: Last 10 seconds to register", 0;
	sleep 5000;
	announce "Run Or Die: 5", 0;
	sleep 1000;
	announce "Run Or Die: 4", 0;
	sleep 1000;
	announce "Run Or Die: 3", 0;
	sleep 1000;
	announce "Run Or Die: 2", 0;
	sleep 1000;
	announce "Run Or Die: 1", 0;
	sleep 1000;
	announce "Run Or Die: Time is up...I will come again 2 hour later..", 0;
	disablenpc "Run Or Die";
	mapannounce "guild_vs5", "Welcome to Run Or Die event", 0;
	sleep 3000;
	mapannounce "guild_vs5", "This is just an easy event", 0;
	sleep 3000;
	mapannounce "guild_vs5", "Just stay AWAY from the PORING BOMBS!!", 0;
	sleep 3000;
	mapannounce "guild_vs5", "Stay alive as long as YOU CAN!!!!", 0;
	sleep 3000;
	mapannounce "guild_vs5", "The LAST SURVIVOR will be the WINNER", 0;
	sleep 3000;
	mapannounce "guild_vs5", "event will start in 3", 0;
	sleep 1000;
	mapannounce "guild_vs5", "2...", 0;
	sleep 1000;
	mapannounce "guild_vs5", "1...", 0;
	sleep 1000;
	mapannounce "guild_vs5", "It's time to run !!", 0;
	donpcevent "runordie::Onstart";
	set .stop, 0;
	while ( .stop == 0 ) {
		set .@extra, .@extra + rand(1,2);
		set .@round, .@round +1;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@extra;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@extra;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@extra;
		sleep 5000;
	}
	end;
Onstart:
	while ( getarraysize(.aid) > 1 ) {
		sleep 500;
		for ( set .@i, 0; .@i < getarraysize(.aid); set .@i, .@i +1 ) {
			if ( isloggedin(.aid[.@i]) == 0 ) {
				deletearray .aid[.@i], 1;
				set .@i, .@i -1;
			}
			else {
				attachrid .aid[.@i];
				if ( strcharinfo(3) != "guild_vs5" || hp == 0 ) {
					deletearray .aid[.@i], 1;
					set .@i, .@i -1;
				}
			}
		}
	}
	detachrid;
	set .stop, 1;
	killmonsterall "guild_vs5";
	if ( getarraysize(.aid) == 1 ) {
		announce "Congratulations!!! The Winner is "+ rid2name(.aid), 0;
		sleep 5000;
		announce rid2name(.aid) +" Win 10 Raider Coin", 0;
		attachrid .aid;
		getitem 6480, 10; // winner prize
		warp "prontera", 156,180;
		deletearray .aid;
	}
	else {
		announce "Nobody WINS, too bad", 0;
	}
	disablenpc "RFYL Event";
	end;
}
guild_vs5	mapflag	nowarp
guild_vs5	mapflag	nowarpto
guild_vs5	mapflag	noteleport
guild_vs5	mapflag	nosave	SavePoint
guild_vs5	mapflag	noskill
guild_vs5	mapflag	nomemo
guild_vs5	mapflag	nopenalty

I think the problem is here:

 

	set .stop, 0;
	while ( .stop == 0 ) {
		set .@extra, .@extra + rand(1,2);
		set .@round, .@round +1;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@extra;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@extra;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@extra;
		sleep 5000;
	}
	end;

How do I fix this? I want to stop the bomb poring on spawning right after someone wins the game. I really appreciate your help guys!

 

Edited by geoffreypogi

1 answer to this question

Recommended Posts

  • 0
Posted
On 1/25/2017 at 9:03 PM, geoffreypogi said:

stop the bomb poring on spawning right after someone wins the game

.stop = 1;   // <-------------------- ADD THIS LINE
announce "Congratulations!!! The Winner is "+ rid2name(.aid), 0;

 

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...