Jump to content
  • 0

Error buildin_getmapxy Housing System


hardelite

Question


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

Good afternoon ladies and gentlemen!

After updating the rAthena version, I encountered a problem with some old Zephyrus Housing System scripting functions.Error:

[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): Piano#Rb1 at rentinb1 (19,15)

[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): Interruptor PvP#Rb1 at rentinb1 (23,21)

Script:

Spoiler

//============================================================ 
//= PVP Interruptor PvP
//============================================================ 
 
rentb1,23,21,3	script	Interruptor PvP#Rb1	837,{ callfunc "rent_pvp"; }
 
//============================================================ 
//= Function to control the pvp switch.
//============================================================ 
 
function	script	rent_pvp	{
	if (getmapxy(@mapa$,@mapx,@mapy,0,strcharinfo(0)) != 0) end;
	mes "[Interrupter PvP]";
	mes "What do you want to do?";
	next;
	menu "- Turn on PvP",L_PvpOn,"- Turn off PvP",L_PvpOff,"Cancel",-;
	mes "[Interruptor PvP]";
	mes "Ok, come back when you wish.";
	close;
 
L_PvpOn:
	mes "[Interrupter PvP]";
	mes "PvP has been enabled. Get ready for the fight!";
	pvpon @mapa$;
	close;
 
L_PvpOff:
	mes "[Interrupter PvP]";
	mes "PvP has been disabled.";
	pvpoff @mapa$;
	close;
}

//============================================================ 
//= Piano
//============================================================ 
 
rentinb1,19,15,0	script	Piano#Rb1	111,{ callfunc "rent_pianoStart","b1"; OnTimer50000: callfunc "rent_pianoStop","b1"; }
 
//============================================================ 
//= Function for the piano
//= (id of House)
//============================================================ 
 
function	script	rent_pianoStart	{
	if (getmapxy(@mapa$,@mapx,@mapy,0,strcharinfo(0)) != 0) end;
	mes "[Automatic piano]";
	if (getd("$@Piano" + getarg(0)) > 0) {
		mes "Wait a while for the song to finish or when the piano is ready again.";
		close;
	}
	mes "Please choose the song you want:";
	set @Tema, select ("Song 01","Chaos of Eternity","Song 03","Song 04","Bragis Poem","Song 06","Ring of Nibelungen","Song 08","Song 09","Song 10","Dont Forget Me Not","In To The Abyss","Song 13","Assassin of Sunset","Song 15","Song 16","Song 17","Song 18","Song 19","None");
	if (@Tema >= 20) close;
	if (@Tema < 10) set @Tema$, "m0" + @Tema + ".wav";
	else set @Tema$, "m" + @Tema + ".wav";
	close2;
	if (getd("$@Piano" + getarg(0)) <= 0) {
		// Sonar el Tema Elegido
		setd "$@Piano" + getarg(0), 1; // Reproduciendo
		initnpctimer;
		switch (@Tema) {
			case 14: soundeffectall "assassin_of_sunset.wav",1,@mapa$,0,0,50,50; break;
			case 12: soundeffectall "in_to_the_abyss.wav",1,@mapa$,0,0,50,50; break;
			case 11: soundeffectall "dont_forget_me_not.wav",1,@mapa$,0,0,50,50; break;
			case 7:  soundeffectall "ring_of_nibelungen.wav",1,@mapa$,0,0,50,50; break;
			case 5:  soundeffectall "bragis_poem.wav",1,@mapa$,0,0,50,50; break;
			case 2:  soundeffectall "chaos_of_eternity.wav",1,@mapa$,0,0,50,50; break;
			default: soundeffectall @Tema$,1,@mapa$,0,0,50,50; break;
		}
	}
	end;
}
 
function	script	rent_pianoStop	{
	emotion ET_SLEEPY;
	stopnpctimer;
	setd "$@Piano" + getarg(0), 0; // Finishes the song
	end;
}

 

Could someone help me solve them? Please.

In advance, thank you very much.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

there is change on getmapxy function long ago you should update all getmapxy param type from 0 to BL_PC

*getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"})

This function will locate a character object, NPC object or pet's coordinates
and place their coordinates into the variables specified when calling it. It
will return 0 if the search was successful, and -1 if the parameters given were
not variables or the search was not successful.

Type is the type of object to search for:

	BL_PC   - Character object (default)
	BL_NPC  - NPC object
	BL_PET  - Pet object
	BL_HOM  - Homunculus object
	BL_MER  - Mercenary object
	BL_ELEM - Elemental object

The search value is optional. If it is not specified, the location of the
invoking character will always be returned for types BL_PC and BL_PET,
the location of the NPC running this function for type BL_NPC.

If a search value is specified, for types BL_PC and BL_NPC, the
character or NPC with the specified name or GID will be located.

If type is BL_PET/BL_HOM/BL_MER/BL_ELEM, the search
will locate the current object of the character who's name/GID is given in the
search value, it will NOT locate the object by name.

 

Edited by Litro Endemic
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:  

Thanks for the answer @Litro Endemic
But this is too complex for me.

I can understand this in the simplest script.

But in this script specifically I can not understand.

My script level is very basic, I try to learn more every day, but when I have these functions "(@map $, @ mapx, ...)" together I get lost.

Could you fix this so I can follow suit? Please.

if (getmapxy(@mapa$,@mapx,@mapy,0,strcharinfo(0)) != 0) end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

from

if (getmapxy(@mapa$,@mapx,@mapy,0,strcharinfo(0)) != 0) end;

to

if (getmapxy(@mapa$,@mapx,@mapy, BL_PC, strcharinfo(0)) != 0) end;

 

  • 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:  

Oh, thank you so much mr. @Litro Endemic
The example was exceptional.

I didn't know what the value "0" meant.
Now I understand and can use in the other scripts.

Thanks! I will study more.

@edit problem solved!

Edited by hardelite
problem solved!
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...