Jump to content
  • 0

buildin_rid2name issue in a Bomb Poring Event Script


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Hi community, I found this script in the forum of hercules I tested it and I wonder sometimes its giving a specific error when there's a winner.

 

script :

//===== eAthena Script =====================================
//= Run or Die ( aka. Poring Bomb Event )
//===== By: ================================================
//= AnnieRuru
//===== Current Version: ===================================
//= 2.1
//===== Compatible With: ===================================
//= Hercules 2015-10-29
//===== Description: =======================================
//= Avoid the poring bomb at all cost !
//===== Topic ==============================================
//= http://herc.ws/board/topic/11010-
//===== Additional Comments: ===============================
//= another script that finally has a release topic for it
//==========================================================

mellina,38,66,7	script	Bomb Poring	98,{
	if ( ( .@size = getvariableofnpc( .aidtotal, "runordie" ) ) >= 100 ) { // 100 participant max
		mes "["+strnpcinfo(0)+"]";
		mes "I'm sorry, the room is full";
		close;
	}
	if(getvariableofnpc( .start, "runordie" )) {
	mes "["+strnpcinfo(0)+"]";
	mes "Hey would you like to join me?";
	next;
	if(select("Join Event!:Leave Event!") == 2) end;
	percentheal 100, 100;
	warp "guild_vs5", 0,0;
	set getvariableofnpc( .aid[ .@size ], "runordie" ), getcharid(3);
	set getvariableofnpc( .aidtotal, "runordie" ), getvariableofnpc( .aidtotal, "runordie" ) +1;
	end;
	} else {
	mes "["+strnpcinfo(0)+"]";
	mes "I am sorry event is currently off rigth now.";
	end;
	}
}

-	script	runordie	-1,{
OnInit:
	//disablenpc "Bomb Poring";
	//bindatcmd "runordie", strnpcinfo(0)+"::OnStart", 99,100;
	.onesec = 1000; // use for script debugging... set to 100 to make the announcement run faster
	end;
OnStart:
OnClock1000:
OnClock2100:
	deletearray .aid;
	.aidtotal = 0;
	mapwarp "guild_vs5", "mellina", 85,84;
	killmonsterall "guild_vs5";
	.start = 1;
	announce "Bomb Poring event is on!",bc_all,0xffccff;
	sleep 4 * .onesec;
	announce "To participate in this event (@je)!",bc_all,0xffccff;
	sleep 6 * .onesec;
	announce "You only have 1 minute to register on this event!",bc_all,0xffccff;
	sleep 20 * .onesec;
	announce "30 seconds left before registration is closed!",bc_all,0xffccff;
	sleep 10 * .onesec;
	announce "To participate in this event (@je)!",bc_all,0xffccff;
	sleep 10 * .onesec;
	announce "Last 10 seconds for registrations!",bc_all,0xffccff;
	sleep 5 * .onesec;
	announce "Bomb Poring : 5",bc_all,0xffccff;
	sleep 1000;
	announce "Bomb Poring : 4",bc_all,0xffccff;
	sleep 1000;
	announce "Bomb Poring : 3",bc_all,0xffccff;
	sleep 1000;
	announce "Bomb Poring : 2",bc_all,0xffccff;
	sleep 1000;
	announce "Bomb Poring : 1",bc_all,0xffccff;
	sleep 1000;
	announce "Event is now closed.",bc_all,0xffccff;
	if ( .aidtotal < 2 ) { // cannot start event if nobody joins(0) or just having (1) player
		announce "Bomb Poring is canceled not enough players to continue!",bc_all,0xffccff;
		mapwarp "guild_vs5", "mellina", 85,84;
		deletearray .aid;
		.aidtotal = 0;
		.start = 0;
		end;
	}

	mapannounce "guild_vs5", "Welcome Bomb Poring!",bc_map,0xffccff;
	sleep 3 * .onesec;
	mapannounce "guild_vs5", "To the players don't know this event, It its very simple!",bc_map,0xffccff;
	sleep 3 * .onesec;
	mapannounce "guild_vs5", "You just need to stay AWAY from anything that you think its DANGEROUS!!",bc_map,0xffccff;
	sleep 3 * .onesec;
	mapannounce "guild_vs5", "Stay alive no matter what!",bc_map,0xffccff;
	sleep 3 * .onesec;
	mapannounce "guild_vs5", "The LAST SURVIVOR will be the WINNER",bc_map,0xffccff;
	sleep 3 * .onesec;
	mapannounce "guild_vs5", "Event will start in 3....",bc_map,0xffccff;
	sleep 1 * .onesec;
	mapannounce "guild_vs5", "2...",bc_map,0xffccff;
	sleep 1 * .onesec;
	mapannounce "guild_vs5", "1..",bc_map,0xffccff;
	sleep 1 * .onesec;
	mapannounce "guild_vs5", "Start Running Now!",bc_map,0xffccff;
	while ( .start ) {
		.@more += rand(1,2);
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@more, "", 0;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@more, "", 1;
		monster "guild_vs5", 0,0, "Come On Baby!!!", 1904, 2 + .@more, "", 2;
		sleep 5000;
	}
	end;
OnPCDieEvent:
OnPCLogoutEvent:
	if ( strcharinfo(3) == "guild_vs5" && .start ) {
		if ( .aidtotal > 1 ) {
			for ( .@i = 0; .@i < .aidtotal; .@i++ ) {
				if ( getcharid(3) == .aid[.@i] ) {
					deletearray .aid[.@i], 1;
					.aidtotal--;
				}
			}
		}
		if ( .aidtotal == 1 ) {
			.start = 0;
			killmonsterall "guild_vs5";
			announce "Congratulations ~ the winner is "+ rid2name(.aid),bc_all,0xffccff;
			sleep 5000;
			if ( isloggedin( .aid ) ) {
				attachrid .aid;
				getitem 7539,10; // winner prize
				warp "mellina", 85,84;
			}
			deletearray .aid;
			.aidtotal = 0;
		}
	}
	end;
}
guild_vs5	mapflag	nowarp
guild_vs5	mapflag	noreturn
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
guild_vs5	mapflag	noicewall
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

try change

for ( .@i = 0; .@i < .aidtotal; .@i++ ) {

into this

for ( .@i = .aidtotal - 1; .@i >= 0; .@i-- ) {
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

 

try change

for ( .@i = 0; .@i < .aidtotal; .@i++ ) {

into this

for ( .@i = .aidtotal - 1; .@i >= 0; .@i-- ) {

 

Thanks! It looks like nothing is wrong with it anymore and working properly.

Link to comment
Share on other sites

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.

×
×
  • Create New...