Jump to content
  • 0

BombRing every 2 hour


Vettra

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  34
  • Reputation:   0
  • Joined:  07/19/17
  • Last Seen:  

Hey guys, I need the modification in this event for every 2 hours!

 

code:

Spoiler

-	script	Bombring	-1,{
OnInit:
	set .eventstarted, 0;
	set $bombring_reward,100;
	bindatcmd "enablebombring","Bombring::OnGMStart";
	bindatcmd "disablebombring","Bombring::OnGMStop";
	hideonnpc "The Baaam#qz";
	hideonnpc "Evento BombRing#prt";
	end;
	
OnGMStart:
	if (getgroupid() < 99){
		dispbottom "You are not eligible for this command.", RED;
		end;
	}
	set .eventstarted, 0;
OnEventStart:
	initnpctimer;
	hideoffnpc "Evento BombRing#prt";
	set .x, 5;
OnTimer0000:
	if (.eventstarted == 1) 
		end;
	announce "[BombRing]: O evento BombRing começou, vá em prontera para entrar!",bc_all;
	sleep2 5000;
	announce "[BombRing]: "+.x+" minutos para começar!",bc_all;
	set .x, .x - 1;
	end;
OnTimer60000:
OnTimer120000:
OnTimer180000:
OnTimer240000:
	if (.eventstarted == 1) 
		end;
	announce "[BombRing]: "+.x+" minutos para o evento começar!",bc_all;
	set .x, .x - 1;
	end;
OnTimer290000:
	if (.eventstarted == 1) 
		end;
	announce "[BombRing]: 10 segundos para começar!",bc_all;
	end;
OnTimer300000:
	if (.eventstarted == 1) 
		end;
	set .totalplayers, getmapusers ("quiz_02");
	announce "[The Baaam]: "+.totalplayers+" jogadores entraram no evento!",bc_all;
	announce "[The Baaam]: O evento começou!!",bc_all;
	hideonnpc "The Baaam#prt";
	stopnpctimer;
	callsub OnEventStart1;
	end;
	
OnEventStart1:
	set .totalplayers, getmapusers ("quiz_02");
	mapannounce "quiz_02","[BombRing]: Ok, escutem, é assim que funciona.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: Bombrings correrão desenfreados nesta área.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: e todos eles vão...BOOOOOOM!",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: tudo o que você tem que fazer é ficar vivo :P",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: Isso acontecerá por 30 segundos, em um total de 5 rounds.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: Entãoooo, prontos ou não ai vem eles!!!", 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","[BombRing]: Wooooow! Isso é raro! jogadores ganharam! :D",bc_all;
	}
	end;
		
OnBombringSummon:
	mapannounce "quiz_02","[BombRing]: Round "+.round+"!!",bc_all;
	set .eventstarted, 1;
	initnpctimer;
	while (.eventstarted == 1) {
		if ( (3 * .totalplayers) <= 60)
			areamonster "quiz_02",48,334,71,357,"Corra por sua vida!",1904,3 * .totalplayers;
		else
			areamonster "quiz_02",48,334,71,357,"Corra por sua vida!",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 == 1)
		mapannounce "quiz_02","[BombRing]: Round "+.round+" acabou!!",bc_all;
	if (.round < 5)
		mapannounce "quiz_02","[BombRing]: proximo round em 10 segundos.",bc_all;
	return;
	
OnTimer31000:
	if (.eventstarted == 0)
		end;
	else
		set .eventstarted, 0;
		killmonsterall "quiz_02";
		cleanmap "quiz_02";
	stopnpctimer;
	end;
	
OnPCDieEvent:
	if (strcharinfo(3) == "quiz_02") {
		mapannounce "quiz_02","[BombRing]: "+strcharinfo(0)+" foi explodido!!",bc_all;
		dispbottom "Você recebeu 1x [Ticket de Recompensa] por participar do evento.";
		getitem 100,1;
		warp "savepoint",0,0;
		if (getmapusers("quiz_02") <= 1) {
			stopnpctimer;
			set .eventstarted, 0;
			set .round, 6;
			killmonsterall "quiz_02";
			cleanmap "quiz_02";
			hideoffnpc "The Baaam#qz";
			mapannounce "quiz_02","[The Baaam]: Temos um vencedor!!",bc_all;
		} 	
	}
	end;
	
OnGMStop:
	set .eventstarted, 0;
	set .round, 6;
	killmonsterall "quiz_02";
	cleanmap "quiz_02";
	hideoffnpc "The Baaam#qz";	
	end;
}

quiz_02,59,345,5	script	The Baaam#qz	1904,{
mes "[^666699"+strnpcinfo(1)+"^000000]";
mes "Mandou bem! Você é muito bom nisso!";
next;

mes "[^666699"+strnpcinfo(1)+"^000000]";
mes "Você recebeu ^ff990010x [<ITEM>Moedas de Ouro<INFO>671</INFO></ITEM>]^000000 e ^ff99005x [<ITEM>Ticket's de Recompensa<INFO>100</INFO></ITEM>]^000000";
getitem 671,10;
getitem $bombring_reward,5;
next;
mes "[^666699"+strnpcinfo(1)+"^000000]";
mes "Agora saia antes que você acabe explodindo!";
next;
atcommand "@go 0";
end;
}

prontera,142,167,5	script	Evento BombRing#prt	879,{
mes "[^666699The Baaam^000000]";
mes "Olá!! gostaria de participar do evento Bombring?";
Switch(Select("Sim!:Que evento é esse?:Não...")) {
	case 1:
		mes "[^666699The Baaam^000000]";
		mes "Muito bem! esteja pronto!";
		next;
		warp "quiz_02",59,345;	
		break;
	case 2:
		mes "[^666699The Baaam^000000]";
		mes "Bem, tudo o que você tem que fazer é ficar vivo...";
		mes "Isto é, esquivando das explosões dos ^00FF00Bombrings^000000!";
		next;
		mes "[^666699The Baaam^000000]";
		mes "Se você ganhar:";
		mes "^ff990010x [<ITEM>Moedas de Ouro<INFO>671</INFO></ITEM>]^000000";
		mes "^ff99005x [<ITEM>Ticket's de Recompensa<INFO>100</INFO></ITEM>]^000000";
		close;
		break;
	case 3:
		mes "[^666699The Baaam^000000]";
		mes "Tudo bem, volte se mudar de idéia!";
		close;
		break;
	}
end;

OnInit:
	hideonnpc "Evento BombRing#prt";
}

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  75
  • Reputation:   7
  • Joined:  08/10/17
  • Last Seen:  

I think I did it right .. though I don't have a lot of experience with timers yet. Basically I just attacked the GMstart and GMstop instructions with a cooldown variable and made a 2 hour timer outside the event to control it

All customizations are labeled with '  //*EDIT:  '

-	script	Bombring	-1,{
OnInit:
	set .eventstarted, 0;
	set $bombring_reward,100;
	bindatcmd "enablebombring","Bombring::OnGMStart";
	bindatcmd "disablebombring","Bombring::OnGMStop";
	hideonnpc "The Baaam#qz";
	hideonnpc "Evento BombRing#prt";
	end;
	
OnGMStart:
	if (getgroupid() < 99){
		dispbottom "You are not eligible for this command.", RED;
		end;
	}
	if (.eventCooldown == 1) {//*EDIT:
		dispbottom "You cannot start the event so soon.", RED; //*EDIT:
		end; //*EDIT:
	} //*EDIT:
	set .eventstarted, 0;
OnEventStart:
	initnpctimer;
	hideoffnpc "Evento BombRing#prt";
	set .x, 5;
OnTimer0000:
	if (.eventstarted == 1) 
		end;
	announce "[BombRing]: O evento BombRing começou, vá em prontera para entrar!",bc_all;
	sleep2 5000;
	announce "[BombRing]: "+.x+" minutos para começar!",bc_all;
	set .x, .x - 1;
	end;
OnTimer60000:
OnTimer120000:
OnTimer180000:
OnTimer240000:
	if (.eventstarted == 1) 
		end;
	announce "[BombRing]: "+.x+" minutos para o evento começar!",bc_all;
	set .x, .x - 1;
	end;
OnTimer290000:
	if (.eventstarted == 1) 
		end;
	announce "[BombRing]: 10 segundos para começar!",bc_all;
	end;
OnTimer300000:
	if (.eventstarted == 1) 
		end;
	set .totalplayers, getmapusers ("quiz_02");
	announce "[The Baaam]: "+.totalplayers+" jogadores entraram no evento!",bc_all;
	announce "[The Baaam]: O evento começou!!",bc_all;
	hideonnpc "The Baaam#prt";
	stopnpctimer;
	callsub OnEventStart1;
	end;
	
OnEventStart1:
	set .totalplayers, getmapusers ("quiz_02");
	mapannounce "quiz_02","[BombRing]: Ok, escutem, é assim que funciona.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: Bombrings correrão desenfreados nesta área.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: e todos eles vão...BOOOOOOM!",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: tudo o que você tem que fazer é ficar vivo :P",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: Isso acontecerá por 30 segundos, em um total de 5 rounds.",bc_all;
	sleep 2000;
	mapannounce "quiz_02","[BombRing]: Entãoooo, prontos ou não ai vem eles!!!", 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","[BombRing]: Wooooow! Isso é raro! jogadores ganharam! :D",bc_all;
	}
	end;
		
OnBombringSummon:
	mapannounce "quiz_02","[BombRing]: Round "+.round+"!!",bc_all;
	set .eventstarted, 1;
	initnpctimer;
	while (.eventstarted == 1) {
		if ( (3 * .totalplayers) <= 60)
			areamonster "quiz_02",48,334,71,357,"Corra por sua vida!",1904,3 * .totalplayers;
		else
			areamonster "quiz_02",48,334,71,357,"Corra por sua vida!",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 == 1)
		mapannounce "quiz_02","[BombRing]: Round "+.round+" acabou!!",bc_all;
	if (.round < 5)
		mapannounce "quiz_02","[BombRing]: proximo round em 10 segundos.",bc_all;
	return;
	
OnTimer31000:
	if (.eventstarted == 0)
		end;
	else
		set .eventstarted, 0;
		killmonsterall "quiz_02";
		cleanmap "quiz_02";
	stopnpctimer;
	end;
	
OnPCDieEvent:
	if (strcharinfo(3) == "quiz_02") {
		mapannounce "quiz_02","[BombRing]: "+strcharinfo(0)+" foi explodido!!",bc_all;
		dispbottom "Você recebeu 1x [Ticket de Recompensa] por participar do evento.";
		getitem 100,1;
		warp "savepoint",0,0;
		if (getmapusers("quiz_02") <= 1) {
			stopnpctimer;
			set .eventstarted, 0;
			set .round, 6;
			killmonsterall "quiz_02";
			cleanmap "quiz_02";
			hideoffnpc "The Baaam#qz";
			mapannounce "quiz_02","[The Baaam]: Temos um vencedor!!",bc_all;
		} 	
	}
	end;
	
OnGMStop:	
	set .eventstarted, 0;
	set .round, 6;
	killmonsterall "quiz_02";
	cleanmap "quiz_02";
	hideoffnpc "The Baaam#qz";	
	initnpctimer;  //*EDIT: start the cooldown timer
	.eventCooldown = 1;  //*EDIT turn on cooldown message
	end;
	
OnTimer720000:  //*EDIT: 2 hours
	stopnpctimer; //*EDIT: stop timer
	.eventCooldown = 0; //*EDIT turn off cooldown message
}

quiz_02,59,345,5	script	The Baaam#qz	1904,{
mes "[^666699"+strnpcinfo(1)+"^000000]";
mes "Mandou bem! Você é muito bom nisso!";
next;

mes "[^666699"+strnpcinfo(1)+"^000000]";
mes "Você recebeu ^ff990010x [<ITEM>Moedas de Ouro<INFO>671</INFO></ITEM>]^000000 e ^ff99005x [<ITEM>Ticket's de Recompensa<INFO>100</INFO></ITEM>]^000000";
getitem 671,10;
getitem $bombring_reward,5;
next;
mes "[^666699"+strnpcinfo(1)+"^000000]";
mes "Agora saia antes que você acabe explodindo!";
next;
atcommand "@go 0";
end;
}

prontera,142,167,5	script	Evento BombRing#prt	879,{
mes "[^666699The Baaam^000000]";
mes "Olá!! gostaria de participar do evento Bombring?";
Switch(Select("Sim!:Que evento é esse?:Não...")) {
	case 1:
		mes "[^666699The Baaam^000000]";
		mes "Muito bem! esteja pronto!";
		next;
		warp "quiz_02",59,345;	
		break;
	case 2:
		mes "[^666699The Baaam^000000]";
		mes "Bem, tudo o que você tem que fazer é ficar vivo...";
		mes "Isto é, esquivando das explosões dos ^00FF00Bombrings^000000!";
		next;
		mes "[^666699The Baaam^000000]";
		mes "Se você ganhar:";
		mes "^ff990010x [<ITEM>Moedas de Ouro<INFO>671</INFO></ITEM>]^000000";
		mes "^ff99005x [<ITEM>Ticket's de Recompensa<INFO>100</INFO></ITEM>]^000000";
		close;
		break;
	case 3:
		mes "[^666699The Baaam^000000]";
		mes "Tudo bem, volte se mudar de idéia!";
		close;
		break;
	}
end;

OnInit:
	hideonnpc "Evento BombRing#prt";
}

 

Edited by SpiritD
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...