Jump to content
  • 0

Problem with starting Bombring


hardelite

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  44
  • Reputation:   2
  • Joined:  01/09/18
  • Last Seen:  

Hey, community friends, how are you ?!

Please could someone help me fix this script?

His problem is as follows:

The first time the event starts, everything happens normally, ok!

But the next time the event occurs (2nd time), the player simply receives the direct prize, and no bombring is summoned.

The event ends before it starts and everyone gets the prize.

Script

Spoiler

// Original script by Unknown
// Edit by Mabuhay
// Removed my timer cool downs and stuff.
// Adjust to your time you wish for it to start.

-	script	Event_Bombring	-1,{
OnInit:
	// item reward
	setarray .item,
		501, 10,
		502, 5;

	// @bombstart - gm manual start
	bindatcmd "bombstart", strnpcinfo(0)+"::OnStart",60,60;
	
	// @bomb - player join event
	bindatcmd "bomb", strnpcinfo(0)+"::OnJoinEvent";
	
	// Mapflags
	setarray .@mapflag,
		mf_nowarp,
		mf_nowarpto,
		mf_noskill,
		mf_noteleport,
		mf_nomemo,
		mf_nosave,
		mf_noicewall,
		mf_nobranch,
		mf_noreturn,
		mf_nocommand;
		
	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
		setmapflag "quiz_02", .@mapflag[.@i];
	end;
	
OnJoinEvent:
	mes " [ Event Status ] ";
	switch ( .start ) {
		case 1: .@status$ = "active"; break;
		case 2: .@status$ = "on-going"; break;
		default: .@status$ = "not active"; break;
	}
	mes "Event is currently ^ff0000"+ .@status$ +"^000000";
	next;
	switch(select(
		"Bombring Event - "+ ((.start == 1) ? "^0000ffJoin Event":((.start == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000" )) {
	case 1:
		if ( !.start ) {
			mes "Event is not available.";
			close;
		} else if ( .start == 2 ) {
			mes "Event is on-going";
			close;
		}
		sc_end SC_ALL;
		sc_start SC_DECREASEAGI,600000,10;
		percentheal 100,100;
		warp "quiz_02",59,345;
	}
	end;

OnStart:
// Add your clock timers here.
OnClock0000: // 12 MN
OnClock0300: // 3 AM
OnClock0600: // 6 AM
OnClock1700: // 5 PM
	if ( .start ) end;
	.start = 1;
	killmonsterall "quiz_02";
	announce "Bombring: We are going to have a Bombring event.",0;
	sleep 10000;
	announce "Bombring: For those who wants to join, use @bomb",0;
	sleep 10000;
	announce "Bombring: After 1 Minute Event will close.",0;
	sleep 10000;
	announce "Bombring: So please if you want to join. use @bomb",0;
	sleep 60000;
	announce "Bombring: The entry to the event is now closed.",bc_all,0x0ceedb;
	if ( getmapusers("quiz_02") < 1 ) {
		announce "Bombring: Not enough participants.",bc_all,0x0ceedb;
		.start = false;
		mapwarp "quiz_02", "prontera", 150, 180; // warp out.
		end;
	}
	.start = 2;
	sleep 3500;
	mapannounce "quiz_02","We're about to begin the event.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "quiz_02","Event will run for 30 seconds for 5 total rounds.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "quiz_02","All you have to do is avoid Bombrings and stay alive for 30 seconds.",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
	sleep 3000;
	while ( .round < 5 ) {
		.@count = getmapusers("quiz_02");
		.round++;
		mapannounce "quiz_02","Round "+.round,bc_map,0x0ceedb;
		areamonster "quiz_02",48,334,71,357,"Run for you life!",1904, 5 * .@count * .round;
		sleep 10000 - ( 1000*.round );
	}
	.@count = getmapusers("quiz_02");
	if ( !.@count )
		announce "Bombring: No one survived the bombrings.",bc_all,0x0ceedb;
	else if ( .@count ) {
		.@size = getmapunits(BL_PC,"quiz_02",.@aid);
		.@amt = getarraysize(.item);
		if ( .@size > 1 ) announce "A lot players has won the Bombring Event.",bc_all,0x0ceedb;
		for ( .@i = 0; .@i < getarraysize(.@aid); .@i++) {
			attachrid .@aid[.@i];
			if ( .@size == 1 ) announce strcharinfo(0)+" has won the Bombring Event.",bc_all,0x0ceedb;
			for ( .@j = 0; .@j < .@amt; .@j += 2 )
				getitem .item[.@j], .item[.@j+1];
		}
		detachrid;
	}
	.start = false;
	sleep 5000;
	mapwarp "quiz_02","prontera",rand(148,163),rand(167,186);
	end;
	
OnPCDieEvent:
	if ( .start && strcharinfo(3) == "quiz_02" )
		warp "prontera",rand(148,163),rand(167,186);
	end;
}

 

Best regards, thank you very much!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   39
  • Joined:  01/13/12
  • Last Seen:  

The problem is '.round' variable, your script don't reset the value when executes the first time.

Try this one I changed:

Spoiler

// Original script by Unknown
// Edit by Mabuhay
// Removed my timer cool downs and stuff.
// Adjust to your time you wish for it to start.

-	script	Event_Bombring	-1,{
OnInit:
	// item reward
	setarray .item,
		501, 10,
		502, 5;

	// @bombstart - gm manual start
	bindatcmd "bombstart", strnpcinfo(0)+"::OnStart",60,60;
	
	// @bomb - player join event
	bindatcmd "bomb", strnpcinfo(0)+"::OnJoinEvent";
	
	// Mapflags
	setarray .@mapflag,
		mf_nowarp,
		mf_nowarpto,
		mf_noskill,
		mf_noteleport,
		mf_nomemo,
		mf_nosave,
		mf_noicewall,
		mf_nobranch,
		mf_noreturn,
		mf_nocommand;
		
	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
		setmapflag "quiz_02", .@mapflag[.@i];
	end;
	
OnJoinEvent:
	mes " [ Event Status ] ";
	switch ( .start ) {
		case 1: .@status$ = "active"; break;
		case 2: .@status$ = "on-going"; break;
		default: .@status$ = "not active"; break;
	}
	mes "Event is currently ^ff0000"+ .@status$ +"^000000";
	next;
	switch(select(
		"Bombring Event - "+ ((.start == 1) ? "^0000ffJoin Event":((.start == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000" )) {
	case 1:
		if ( !.start ) {
			mes "Event is not available.";
			close;
		} else if ( .start == 2 ) {
			mes "Event is on-going";
			close;
		}
		sc_end SC_ALL;
		sc_start SC_DECREASEAGI,600000,10;
		percentheal 100,100;
		warp "quiz_02",59,345;
	}
	end;

OnStart:
// Add your clock timers here.
OnClock0000: // 12 MN
OnClock0300: // 3 AM
OnClock0600: // 6 AM
OnClock1700: // 5 PM
	if ( .start ) end;
	.start = 1;
	.round = 0;
	killmonsterall "quiz_02";
	announce "Bombring: We are going to have a Bombring event.",0;
	sleep 10000;
	announce "Bombring: For those who wants to join, use @bomb",0;
	sleep 10000;
	announce "Bombring: After 1 Minute Event will close.",0;
	sleep 10000;
	announce "Bombring: So please if you want to join. use @bomb",0;
	sleep 60000;
	announce "Bombring: The entry to the event is now closed.",bc_all,0x0ceedb;
	if ( getmapusers("quiz_02") < 1 ) {
		announce "Bombring: Not enough participants.",bc_all,0x0ceedb;
		.start = false;
		.round = 0;
		mapwarp "quiz_02", "prontera", 150, 180; // warp out.
		end;
	}
	.start = 2;
	sleep 3500;
	mapannounce "quiz_02","We're about to begin the event.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "quiz_02","Event will run for 30 seconds for 5 total rounds.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "quiz_02","All you have to do is avoid Bombrings and stay alive for 30 seconds.",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
	sleep 3000;
	while ( .round < 5 ) {
		.@count = getmapusers("quiz_02");
		.round++;
		mapannounce "quiz_02","Round "+.round,bc_map,0x0ceedb;
		areamonster "quiz_02",48,334,71,357,"Run for you life!",1904, 5 * .@count * .round;
		sleep 10000 - ( 1000*.round );
	}
	.@count = getmapusers("quiz_02");
	if ( !.@count )
		announce "Bombring: No one survived the bombrings.",bc_all,0x0ceedb;
	else if ( .@count ) {
		.@size = getmapunits(BL_PC,"quiz_02",.@aid);
		.@amt = getarraysize(.item);
		if ( .@size > 1 ) announce "A lot players has won the Bombring Event.",bc_all,0x0ceedb;
		for ( .@i = 0; .@i < getarraysize(.@aid); .@i++) {
			attachrid .@aid[.@i];
			if ( .@size == 1 ) announce strcharinfo(0)+" has won the Bombring Event.",bc_all,0x0ceedb;
			for ( .@j = 0; .@j < .@amt; .@j += 2 )
				getitem .item[.@j], .item[.@j+1];
		}
		detachrid;
	}
	.start = false;
	.round = 0;
	sleep 5000;
	mapwarp "quiz_02","prontera",rand(148,163),rand(167,186);
	end;
	
OnPCDieEvent:
	if ( .start && strcharinfo(3) == "quiz_02" )
		warp "prontera",rand(148,163),rand(167,186);
	end;
}

 

I not tested, but I think will work.

Good luck. ?

Edited by Cretino
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

28 minutes ago, hardelite said:

Hey, community friends, how are you ?!

Please could someone help me fix this script?

His problem is as follows:

The first time the event starts, everything happens normally, ok!

But the next time the event occurs (2nd time), the player simply receives the direct prize, and no bombring is summoned.

The event ends before it starts and everyone gets the prize.

Script

  Hide contents


// Original script by Unknown
// Edit by Mabuhay
// Removed my timer cool downs and stuff.
// Adjust to your time you wish for it to start.

-	script	Event_Bombring	-1,{
OnInit:
	// item reward
	setarray .item,
		501, 10,
		502, 5;

	// @bombstart - gm manual start
	bindatcmd "bombstart", strnpcinfo(0)+"::OnStart",60,60;
	
	// @bomb - player join event
	bindatcmd "bomb", strnpcinfo(0)+"::OnJoinEvent";
	
	// Mapflags
	setarray .@mapflag,
		mf_nowarp,
		mf_nowarpto,
		mf_noskill,
		mf_noteleport,
		mf_nomemo,
		mf_nosave,
		mf_noicewall,
		mf_nobranch,
		mf_noreturn,
		mf_nocommand;
		
	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
		setmapflag "quiz_02", .@mapflag[.@i];
	end;
	
OnJoinEvent:
	mes " [ Event Status ] ";
	switch ( .start ) {
		case 1: .@status$ = "active"; break;
		case 2: .@status$ = "on-going"; break;
		default: .@status$ = "not active"; break;
	}
	mes "Event is currently ^ff0000"+ .@status$ +"^000000";
	next;
	switch(select(
		"Bombring Event - "+ ((.start == 1) ? "^0000ffJoin Event":((.start == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000" )) {
	case 1:
		if ( !.start ) {
			mes "Event is not available.";
			close;
		} else if ( .start == 2 ) {
			mes "Event is on-going";
			close;
		}
		sc_end SC_ALL;
		sc_start SC_DECREASEAGI,600000,10;
		percentheal 100,100;
		warp "quiz_02",59,345;
	}
	end;

OnStart:
// Add your clock timers here.
OnClock0000: // 12 MN
OnClock0300: // 3 AM
OnClock0600: // 6 AM
OnClock1700: // 5 PM
	if ( .start ) end;
	.start = 1;
	killmonsterall "quiz_02";
	announce "Bombring: We are going to have a Bombring event.",0;
	sleep 10000;
	announce "Bombring: For those who wants to join, use @bomb",0;
	sleep 10000;
	announce "Bombring: After 1 Minute Event will close.",0;
	sleep 10000;
	announce "Bombring: So please if you want to join. use @bomb",0;
	sleep 60000;
	announce "Bombring: The entry to the event is now closed.",bc_all,0x0ceedb;
	if ( getmapusers("quiz_02") < 1 ) {
		announce "Bombring: Not enough participants.",bc_all,0x0ceedb;
		.start = false;
		mapwarp "quiz_02", "prontera", 150, 180; // warp out.
		end;
	}
	.start = 2;
	sleep 3500;
	mapannounce "quiz_02","We're about to begin the event.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "quiz_02","Event will run for 30 seconds for 5 total rounds.",bc_map,0x0ceedb;
	sleep 2500;
	mapannounce "quiz_02","All you have to do is avoid Bombrings and stay alive for 30 seconds.",bc_map,0x0ceedb;
	sleep 2000;
	mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
	sleep 3000;
	while ( .round < 5 ) {
		.@count = getmapusers("quiz_02");
		.round++;
		mapannounce "quiz_02","Round "+.round,bc_map,0x0ceedb;
		areamonster "quiz_02",48,334,71,357,"Run for you life!",1904, 5 * .@count * .round;
		sleep 10000 - ( 1000*.round );
	}
	.@count = getmapusers("quiz_02");
	if ( !.@count )
		announce "Bombring: No one survived the bombrings.",bc_all,0x0ceedb;
	else if ( .@count ) {
		.@size = getmapunits(BL_PC,"quiz_02",.@aid);
		.@amt = getarraysize(.item);
		if ( .@size > 1 ) announce "A lot players has won the Bombring Event.",bc_all,0x0ceedb;
		for ( .@i = 0; .@i < getarraysize(.@aid); .@i++) {
			attachrid .@aid[.@i];
			if ( .@size == 1 ) announce strcharinfo(0)+" has won the Bombring Event.",bc_all,0x0ceedb;
			for ( .@j = 0; .@j < .@amt; .@j += 2 )
				getitem .item[.@j], .item[.@j+1];
		}
		detachrid;
	}
	.start = false;
	sleep 5000;
	mapwarp "quiz_02","prontera",rand(148,163),rand(167,186);
	end;
	
OnPCDieEvent:
	if ( .start && strcharinfo(3) == "quiz_02" )
		warp "prontera",rand(148,163),rand(167,186);
	end;
}

 

Best regards, thank you very much!

I already have fixed this on latest version of event manager. To fix, find for..  .start = false;

Then replace to

.start = .round = false;

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  44
  • Reputation:   2
  • Joined:  01/09/18
  • Last Seen:  

@Cretino, Thanks for the explanation of the error itself. With every script problem, I've been learning and understanding more thanks to people like you.

@Mabuhay, thanks for the attention my friend! If you can update the script fix on the original link, I will be grateful.

Link: 

 

@Problem solved!

  • Upvote 1
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...