Jump to content
  • 0
Sign in to follow this  
danilopietro

Ajuda com Evento Poring Bomb

Question

Fala galera, gostaria de saber se alguém consegue me ajudar. Estou utilizando o evento Poring Bomb do próprio emulador (Lastman). Traduzi ele, mas por algum motivo, quando tento abrir o WhispGlobal, nada acontece. Segue o script:

//Bomb Poring Event. by Jeroen
//================================
//Version: 2.1
//================================
//= Version: 1.6 Added Array for player + Rewards.
//= Version: 1.7 Optimised the script so its less resource intensive.(Received tips from Eurphy on rAthena, Thanks!)
//= Version: 1.8 Removed the use of 06guild_05, also started adding some new code for the next update.
//= Version: 1.9 Cleaned up the code a little bit.
//= Version: 2.0 Added a few more stuff to the config at the bottom, also did a bit more code cleaning.
//= Also added a GM Menu and other stuff(will have to expand the GM menu at some point).
//= Version: 2.1 Added a configurable map and added it to the GM menu.
//================================
//Notes:
//=If used on the eAthena Emulator, its required to change the Bomb porings AI to explode right away. 0x308D is the one I personally recommend.
//=GM's can activate it by sending a PM to NPC:bombgame with the word Start. To enter the GM menu, send the pm 'Menu' 
//Future Plans:
//=Combining the two arrays, into one to clean up a little bit of space
//================================
-	script	bombgame	-1,{
OnStart:
	enablenpc "Poring Bomb";
	setmapflag .bomb_map$,12;
	setmapflag .bomb_map$,34;
	setmapflag .bomb_map$,mf_noskill;
	set .bombevent, 1;
	announce "[Poring Bomb]Está na hora do evento Poring Bomb!",0;
	sleep 3000;
	announce "[Poring Bomb] Um portal foi aberto na Sala de Eventos!",0;
	sleep 3000;
	announce "[Poring Bomb] O portal ficará aberto por 2 minutos.",0;
	sleep 120000;
	if(getmapusers(.bomb_map$) < .min_player) {
		announce "[Poring Bomb]Parece que não tem players o suficiente para o evento. Que chato!",0;
		disablenpc "Poring Bomb";
		set .bombevent, 0;
		mapwarp .bomb_map$,"prontera",150,149;
		set .bombstarted, 0;
		end;
	}
	announce "[Poring Bomb] O portal para o Poring Bomb foi fechado!",0;
	disablenpc "Poring Bomb";
	mapannounce .bomb_map$,"[Poring Bomb] O evento começará em 1 minuto!",bc_map,"0x00ffff";
	sleep 60000;
	for(set .@i, 0; .@i < getarraysize(.bomb_iamount); set .@i,.@i+1) {
		if(.bomb_players[.@i+1] != 0) {
			if(getmapusers(.bomb_map$) >= .bomb_players[.@i] && getmapusers(.bomb_map$) < .bomb_players[.@i+1]) {
				set .bomb_iamount2, .bomb_iamount[.@i];
				break;
			}
		} else {
			set .bomb_iamount2, .bomb_iamount[.@i];
			break;
		}
	}
	set .bombevent, 0;
	for(set .@i, 0; .@i < getarraysize(.mapf); set .@i,.@i+1) setmapflag .bomb_map$,.mapf[.@i];
	mapannounce .bomb_map$,"[Poring Bomb] O round começa em 10 segundos!",bc_map,"0x00ffff";
	sleep 10000;
	while(1) {
		sleep .timer_bombs;
		killmonsterall .bomb_map$;
		if(getmapusers(.bomb_map$) == 1) {
			set .bombstarted, 0;
			mapwarp .bomb_map$,.bomb_map$,0,0;
			end;
		} else if (!getmapusers(.bomb_map$)) {
			announce "[Poring Bomb] Parece que todos morreram no último ataque!",0;
			set .bombstarted, 0;
			for(set .@i, 0; .@i < getarraysize(.mapf); set .@i,.@i+1) removemapflag .bomb_map$,.mapf[.@i];
			removemapflag .bomb_map$,12;
			removemapflag .bomb_map$,34;
			removemapflag .bomb_map$,mf_noskill;
			end;
		} else {
			set .@raidnum,.@raidnum+1;
			mapannounce .bomb_map$,"[Poring Bomb] Ataque "+.@raidnum,bc_map,"0x00ffff";
			sleep 1000;
			monster .bomb_map$,0,0,"--ja--",1904,.mobcount;
			set .mobcount,.mobcount+.increase;
		}
	}

OnWhisperGlobal:
	if(@whispervar0$ == "Start" || @whispervar0$ == "start" ) { 
		if(.bombstarted) {
			mes "O evento ainda está acontecendo!";
			close;
		}
		if(getgroupid() < .min_GMlvl) end;
		mes "Gostaria de iniciar o evento?";
		if (select("Sim:Não") == 2) close;
		else {
			mes "Começar com quantas bombas?";
			mes "^00FF00Min:^000000"+.min_bombs+".";
			mes "^00FF00Max:^000000"+.max_bombs+".";
			while(1) {
				input .mobcount;
				if(.mobcount > .max_bombs) mes "Por favor, selecione uma quantidade menor.";
				else if(.mobcount < .min_bombs) mes "Por favor, selecione uma quantidade maior.";
				else break;
			}
			next;
			mes "Quantas bombas a mais por round?";
			mes "^00FF00Max:^000000"+(.max_bombs/5)+".";
			while(1) {
				input .increase;
				if (!.increase) mes "Por favor, selecione uma quantidade maior";
				else if (.increase > (.max_bombs/5)) mes "Por favor, selecione uma quantidade menor."; //increase should never be greater than the max bomb increase, Divided by 5 to set a certain limit.
				else break;
			}
			next;
			mes "Certo, aqui vamos nós!.";
			donpcevent strnpcinfo(0)+"::OnStart";
			set .bombstarted, 1;
			close;
		}
	}
	else if( @whispervar0$ == "Menu" || @whispervar0$ == "menu") {
		if(getgroupid() < .min_GMmenu) end; 
		if(select("^FF0000GM Menu^000000:Cancelar") == 2) close;
		while(1) {
			switch(select(
				"^777777~Mínimo de bombas requeridas^FF0000["+.min_bombs+"]^000000:"+
				"^777777~Máximo de bombas requeridas^FF0000["+.max_bombs+"]^000000:"+
				"^777777~Recompensa^FF0000["+((!.bomb_item)?" Tickets de Evento":getitemname(.bomb_item))+"]^000000:"+
				"^777777~Mínimo de players^FF0000["+.min_player+"]^000000:"+
				"^777777~Mapa^FF0000["+.bomb_map$+"]^000000:"+
				"^777777~Fechar^000000")) {
				case 1:
					mes "Informe a nova quantidade mínima de bombas.";
					mes "Quantidade mínima atual: ^0000FF "+.min_bombs+"^000000.";
					input .min_bombs;
					next;
					break;
				case 2:
					mes "Informe a nova quantidade máxima de bombas.";
					mes "Quantidade máxima atual: ^0000FF "+.max_bombs+"^000000.";
					input .max_bombs;
					if (.max_bombs < 20 || .max_bombs > 1000) { set .max_bombs, 200; mes "Quantidade de bombas inválida. Configurando para 200."; } //it is NOT recomemnded to go over 1000!
					next;
					break;
				case 3:
					mes "Selecione o novo prêmio.";
					mes "Prêmio atual: ^0000FF "+((!.bomb_item)?"Tickets de Evento":getitemname(.bomb_item))+"^000000.";
					input .bomb_item;
					if (.bomb_item == 0){ next; break;} //allowing to set .bomb_item to 0 to use event rewards
					if (getitemname(.bomb_item) == "null" ) { set .bomb_item, 501; mes "Item inválido. Configurando para Poção Vermelha."; }
					next;
					break;
				case 4:
					mes "Informe a nova quantidade mínima de players para iniciar o evento.";
					mes "Quantidade mínima de players atual: ^0000FF "+.min_player+"^000000.";
					input .min_player;
					if (.min_player < 2) { set .min_player, 2; mes "Quantidade inválida. Configurando mínimo de players para 2."; }
					next;
					break;
				case 5:
					mes "Informe o novo mapa para o evento.";
					mes "Mapa atual:^0000FF "+.bomb_map$+"^000000.";
					input .bomb_map$;
					if(getmapusers(.bomb_map$) == -1) { set .bomb_map$, "06guild_04"; mes "Mapa inválido. Configurando para 06guild_04"; }
					next;
					break;
				default: close; break;
			}
		}
	}
	else end;


OnPCDieEvent:
	if (strcharinfo(3) != .bomb_map$) end;
	mapannounce .bomb_map$, strcharinfo(0)+" está fora! Participantes restantes: "+(getmapusers(.bomb_map$) - 2),bc_map,"0x00ffff";
	warp "SavePoint",0,0;
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .bomb_map$) end;
	if (.bombstarted) {
		dispbottom "O evento está sendo realizado no momento.";
		warp "SavePoint",0,0;
	} else {
		for(set .@i, 0; .@i < getarraysize(.mapf); set .@i,.@i+1) removemapflag .bomb_map$,.mapf[.@i];
		removemapflag .bomb_map$,12;
		removemapflag .bomb_map$,34;
		removemapflag .bomb_map$,mf_noskill;
		announce strcharinfo(0)+" ganhou o Evento Poring Bomb!",0;
		if (.bomb_item) getitem .bomb_item, .bomb_iamount2;
		else { set #Event_Points,#Event_Points+.bomb_iamount2; dispbottom "You now have "+#Event_Points+" Event Points"; }
		dispbottom "Parabéns! Você ganhou o Evento Poring Bomb!";
		dispbottom "Você será teletransportado para fora em 5 segundos.";
		specialeffect 568;
		sleep2 5000;
		dispbottom "Obrigado por participar!";
		warp "SavePoint",0,0;
		end;
	}
end;

//------------------Config----------------------------
OnInit:
	disablenpc "Poring Bomb";
	//sets max bomb Porings on a map set by a GM.
	set .max_bombs, 120;
	set .increase, 10;
	//sets min bombs
	set .min_bombs, 10;
	set .mobcount, 10;
	//timer until the new raid spawns (Atleast 10 seconds is recommended!)
	set .timer_bombs, (1000*15); //15 seconds, 1000 * 150 = 15000
	//Item reward, set to 0 to use event points (Var used for event points = #Event_Points)
	set .bomb_item, 7180; //Event Points
	//How many points Array lenght needs to be the same as the Array lenght below.
	setarray .bomb_iamount[0],800;
	//Array of how many players are in the room, for the reward amount (event points or Item amount)
	setarray .bomb_players[0],1;
	//Event Map
	set .bomb_map$, "guild_vs5";
	//Minimum required player amount.
	set .min_player, 2;
	//Required GM level to start event.
	set .min_GMlvl, 90;
	//Required GM level to enter GM menu
	set .min_GMmenu, 90;
	//Mapflags
	setarray .mapf[0],0,1,2,3,4,11,13,22,33,42; //in order "No memo, No teleport, no save, no branch, No Penalty,No trade, No Warp, No go, No return, no warp to, load event"
end;

}
//Prontera NPC:
ama_test,38,102,5	script	Poring Bomb	BOMBPORING,{

if (checkmount()) {
	mes "Você não pode entrar no evento de Peco Peco.";
	close;
	}
	if (getvariableofnpc(.bombevent, "bombgame")) {
		mes "[Poring Bomb]";
		mes "Ola, gostaria de entrar no evento?";
		next;
	if (select("Sim, por favor:Não agora, obrigado") == 1) { sc_end SC_ALL; warp (getvariableofnpc(.bomb_map$, "bombgame")),0,0; }
	else mes "Que pena, vejo você em breve!";
	close;
	} else {
		mes "[Poring Bomb]";
		mes "O evento não está aberto!";
		close;
	}
}

Agradeço desde já!

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.