Jump to content
  • 0

Bombring Event!


Myth

Question


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

what's wrong with this script every time someone died the prize giver always unhide and the event is still on going.

-	script	Bombring	-1,{
OnInit:
	set .eventstarted, 1;
	set $bombring_reward,7179;
	bindatcmd "enablebombring","Bombring::OnGMStart";
	bindatcmd "disablebombring","Bombring::OnGMStop";
	hideonnpc "The Baaam#qz";
	hideonnpc "The Baaam#prt";
	end;
	
OnGMStart:
	if (getgroupid() < 99){
		dispbottom "You are not eligible for this command.", RED;
		end;
	}
	set .eventstarted, 1;
OnEventStart:
	initnpctimer;
	hideonnpc "The Baaam#qz";
	hideoffnpc "The Baaam#prt";
	set .x, 5;
OnTimer0000:
	if (.eventstarted == 2) 
		end;
	announce "The Baaam: The bombring event has started!",bc_all;
	announce "The Baaam: Prize will be 1 POD!",bc_all;
	announce "The Baaam: Come to prontera and talk to me to join!",bc_all;
	announce "The Baaam: "+.x+" minutes remaining before it starts!",bc_all;
	set .x, .x - 1;
	end;
OnTimer60000:
OnTimer120000:
OnTimer180000:
OnTimer240000:
	if (.eventstarted == 2) 
		end;
	announce "The Baaam: "+.x+" minutes remaining before the bombring event starts!",bc_all;
	set .x, .x - 1;
	end;
OnTimer290000:
	if (.eventstarted == 2) 
		end;
	announce "The Baaam: 10 seconds before the bombring event starts!",bc_all;
	end;
OnTimer300000:
	if (.eventstarted == 2) 
		end;
	set .totalplayers, getmapusers ("quiz_02");
	announce "The Baaam: "+.totalplayers+" players joined!",bc_all;
	announce "The Baaam: The bombring even has started! Ciao!",bc_all;
	hideonnpc "The Baaam#prt";
	stopnpctimer;
	callsub OnEventStart1;
	end;
	
OnEventStart1:
	set .totalplayers, getmapusers ("quiz_02");
	mapannounce "quiz_02","The Baaam: Okay listen up, this is how it works.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","The Baaam: Bombrings will run rampant in this area.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","The Baaam: and all of them will go booooooom!",bc_all;
	sleep 2000;
	mapannounce "quiz_02","The Baaam: all you have to do is avoid them and stay alive :P",bc_all;
	sleep 2000;
	mapannounce "quiz_02","The Baaam: This will run for 30 seconds for 5 total rounds.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","The Baaam: Sooooooooooo, ready or not here they come!!!", bc_all;
	
	for (set .round,1;.round <= 5;set .round, .round + 1) {
		set .totalplayers, getmapusers ("quiz_02");
		callsub OnBombringSummon;
		sleep 10000;
	}

	if (.round > 5 && getmapusers("quiz_02") > 0){
		hideoffnpc "The Baaam#qz";
		mapannounce "quiz_02","The Baaam: Wooooow! That's rare! People won! :D",bc_all;
	}
	end;
		
OnBombringSummon:
	mapannounce "quiz_02","The Baaam: Round "+.round+"!!",bc_all;
	set .eventstarted, 2;
	initnpctimer;
	while (.eventstarted == 2) {
		if ( (3 * .totalplayers) <= 60)
			areamonster "quiz_02",48,334,71,357,"Run for you life!",1904,3 * .totalplayers;
		else
			areamonster "quiz_02",48,334,71,357,"Run for you life!",1904,60;
		
		if(.round == 1) {
			sleep 4000;
		} else if (.round == 2) {
			sleep 3000;
		} else if (.round == 3) {
			sleep 2000;
		} else if (.round == 4) {
			sleep 1500;
		} else if (.round == 5) {
			sleep 1000;
		}
	}
	if (.eventstarted == 2)
		mapannounce "quiz_02","The Baaam: Round "+.round+" has finished!!",bc_all;
	if (.round < 5)
		mapannounce "quiz_02","The Baaam: Next round in 10 seconds.",bc_all;
	return;
	
OnTimer31000:
	if (.eventstarted == 1)
		end;
	else
		set .eventstarted, 1;
		killmonsterall "quiz_02";
		cleanmap "quiz_02";
	stopnpctimer;
	end;
	
OnPCDieEvent:
	if (strcharinfo(3) == "quiz_02") {
		mapannounce "quiz_02","The Baaam: "+strcharinfo(0)+" has been blown up!!",bc_all;
		warp "prontera",156,191;
		if (getmapusers("quiz_02") > 1) {
			stopnpctimer;
			set .eventstarted, 1;
			killmonsterall "quiz_02";
			cleanmap "quiz_02";
			hideoffnpc "The Baaam#qz";
			mapannounce "quiz_02","The Baaam: Alright! We have a winner!!",bc_all;
		} 	
	}
	end;
	
OnGMStop:
	set .eventstarted, 1;
	killmonsterall "quiz_02";
	cleanmap "quiz_02";
	announce "The Baaam: The bombring event has been stop!",bc_all;
	hideonnpc "The Baaam#qz";
	hideonnpc "The Baaam#prt";	
	end;
}

quiz_02,59,345,5	script	The Baaam#qz	856,{
mes "[The Baaam]";
mes "Ha! You were really good back there!";
mes "Here's a token for entertaining me.";
next;
mes "You have received ^00FF00"+getitemname($bombring_reward)+"^000000!";
getitem $bombring_reward,1;
next;
mes "[The Baaam]";
mes "Now get out of here before I make you explode!";
next;
atcommand "@go 0";
hideonnpc "The Baaam#qz";
end;
}

prontera,155,178,5	script	The Baaam#prt	879,{
mes "[The Baaam]";
mes "Hi! Wanna join the Bombring event?";
Switch(Select("Yes!:What is it about?:Nah, not interested.")) {
	case 1:
		mes "[The Baaam]";
		mes "Alright! Get ready!";
		next;
		sc_end SC_ALL;
		atcommand strcharinfo(0)+":@option 0 0 0";
		warp "quiz_02",59,345;	
		break;
	case 2:
		mes "[The Baaam]";
		mes "Well all you have to do is stay alive.";
		mes "That is by dodging exploding ^00FF00Bombrings^000000!";
		next;
		mes "[The Baaam]";
		mes "If you win, you will get:";
		mes "1x ^00FF00"+getitemname($bombring_reward)+"^000000!";
		close;
		break;
	case 3:
		mes "[The Baaam]";
		mes "Alright, see you around!";
		close;
		break;
	}
end;

OnInit:
	hideonnpc "The Baaam#prt";
}


quiz_02	mapflag	nobranch
quiz_02	mapflag	nomemo
quiz_02	mapflag	nopenalty
quiz_02	mapflag	nosave	SavePoint
quiz_02	mapflag	noskill
quiz_02	mapflag	noteleport
quiz_02	mapflag	nowarpto
quiz_02	mapflag	restricted	3

thanks in advance mates ^_^

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

The if statement is wrong. I guess it should check if there is only one player left not more then one. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

		if (getmapusers("quiz_02") > 1) {

to

		if (getmapusers("quiz_02") <= 1) {

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

i will try it and how about the other issue when there is only 1 player the event will stop because it never stop it still summoning

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...