Jump to content
  • 0

Permanent_Monster_Spawn does not obey


calaluis

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   3
  • Joined:  04/13/15
  • Last Seen:  

Hello community,

Through this channel, I would like to ask why the command does not obey me, in the sense that is assigned for example, maximum 5 monsters of the Bakonawa type that must appear on the map. Instead of appearing 5, more than 10 appear.

This is the script that developed:

//===== rAthena Script =======================================
//= Recompensas
//===== By: ==================================================
//= Calaluis
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Un NPC que entrega recompensas.
//============================================================

gef_fild14,187,196,6	script	GM Eventos	871,{
	
	mes "[GM Eventos]";
	mes "Hola! este es el mapa en donde yo invoco mounstruos.";
	mes "Todos los monstruos invocados en este mapa, dropean items sorpresa!!";
	close;
	
	OnNPCKillEvent:
	if(strcharinfo(3) == "gef_fild14")
	{
		switch(killedrid)
		{
			case 1002: // Poring normal.
				if ( rand(100) <= 20 ) {
					setarray .@item, 501,502,503;
					setarray .@amount, 10,10,10;
					.@index = rand( getarraysize( .@item ) );
					getitem .@item[.@index],.@amount[.@index];
					mes "[GM Eventos]";
					mes "Has ganado "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
				}
				else {
					mes "[GM Eventos]";
					mes "Lo siento, no has obtenido item de evento. Sigue participando.";
				}
				break;
			case 1847: // Poring de lvl 98 de evento.
				mapannounce "gef_fild14", "Felicitaciones! Jugador, "+ strcharinfo(0) +" has matado monstruo de evento !!!",0;
				if ( rand(100) <= 5 ) {
					setarray .@item, 18754,15058,12622;
					setarray .@amount, 1,1,1;
					.@index = rand( getarraysize( .@item ) );
					getitem .@item[.@index],.@amount[.@index];
					mes "[GM Eventos]";
					mes "Has ganado "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
				}
				else {
					mes "[GM Eventos]";
					mes "Lo siento, no has obtenido item de evento. Sigue participando.";
				}
				break;
			case 2322: // Bakonawa (Bestia acuática de mar).
				mapannounce "gef_fild14", "Felicitaciones! Jugador, "+ strcharinfo(0) +" has matado monstruo de evento !!!",0;
				if ( rand(100) <= 5 ) {
					setarray .@item, 5208,2589,20749,18652;
					setarray .@amount, 1,1,1,1;
					.@index = rand( getarraysize( .@item ) );
					getitem .@item[.@index],.@amount[.@index];
					mes "[GM Eventos]";
					mes "Has ganado "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
				}
				else {
					mes "[GM Eventos]";
					mes "Lo siento, no has obtenido item de evento. Sigue participando.";
				}
				break;
			case 2562: // Dwigh (no tira skills pero es tanke).
				mapannounce "gef_fild14", "Felicitaciones! Jugador, "+ strcharinfo(0) +" has matado monstruo de evento !!!",0;
				if ( rand(100) <= 5 ) {
					setarray .@item, 18561,18603,2576;
					setarray .@amount, 1,1,1;
					.@index = rand( getarraysize( .@item ) );
					getitem .@item[.@index],.@amount[.@index];
					mes "[GM Eventos]";
					mes "Has ganado "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
				}
				else {
					mes "[GM Eventos]";
					mes "Lo siento, no has obtenido item de evento. Sigue participando.";
				}
				break;
			case 2317: // Bangungot (animal mutante que parece pinguino).
				mapannounce "gef_fild14", "Felicitaciones! Jugador, "+ strcharinfo(0) +" has matado monstruo de evento !!!",0;
				if ( rand(100) <= 5 ) {
					setarray .@item, 18856,2910,18539,18666;
					setarray .@amount, 1,1,1,1;
					.@index = rand( getarraysize( .@item ) );
					getitem .@item[.@index],.@amount[.@index];
					mes "[GM Eventos]";
					mes "Has ganado "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
				}
				else {
					mes "[GM Eventos]";
					mes "Lo siento, no has obtenido item de evento. Sigue participando.";
				}
				break;
		}
	}
		//getitem 7539,5;
	end;
}

gef_fild14,0,0,0,0	monster	Poring	1002,30,10000,11000,0
gef_fild14,0,0,0,0	monster	Super Poring	1847,30,10000,11000,0
gef_fild14,0,0,0,0	monster	Bakonawa	2322,5,10000,11000,0
gef_fild14,0,0,0,0	monster	Dwigh	2562,20,10000,11000,0
gef_fild14,0,0,0,0	monster	Bangungot	2317,10,10000,11000,0

The only way to normalize this is to close the emulator and rerun.

This problem is triggered, when using the @Reloadnpc command and then using the command @ killmonster2.

I am attentive to comments to make repairs.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

you loaded the same script multiple times.

permanent spawned monsters aren't removed when you load the script.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   3
  • Joined:  04/13/15
  • Last Seen:  

2 hours ago, Emistry said:

you loaded the same script multiple times.

permanent spawned monsters aren't removed when you load the script.

I need to load the monster script, one for each mob.

If I use the command @reloadnpc, will the monster script generate more monsters than there are or keep the amount specified on the map?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   3
  • Joined:  04/13/15
  • Last Seen:  

Dear @Emistry , thanks for the answer, since I have been inquiring enough on the subject, for which, I can say that I was not respecting the internal framework that the emulator has, that's why the anomaly.

Those who wish to deepen this specific topic, can ask me without problem.

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