Jump to content
  • 0
daikatana_

Create an NPC inside an instance

Question

Hi,

Is there any way I can create an NPC inside an instance that would trigger OnTouch? Or just trigger some script after stepping on certain coordinates inside an instance without an NPC?

Thanks.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
On 6/22/2019 at 1:45 PM, daikatana_ said:

To explain that a bit further.... After the character touches certain coordinates, I want to display a message and then a mob will attack the character.

prontera,173,200,4	script	Blah	-1,5,5,{
	end;
	
OnTouch:
	if(!instance_id()) end;
	npctalk "This is a message!";
	monster "place",60,100,"Poring",1002,1,"NPCNAME::OnLabel";
	disablenpc instance_npcname(strnpcinfo(0));
}

This is the best way to figure out commands.

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6194

Link to comment
Share on other sites

  • 0

Sorta but it would be dumb to do so... In order to do it without an npc at those coordinates, you would need to loop and constantly track your players' positions until they are at that point then run the rest of the script.

The better way of doing that would be to create a hidden npc at the coordinates you want to trigger OnTouch. They should still work within an instance. Using -1 for an npc's sprite will make it hidden from the client.

Link to comment
Share on other sites

  • 0

Thanks. But how do I create that NPC just for the current instance? Map name won't accept variables.

To explain that a bit further.... After the character touches certain coordinates, I want to display a message and then a mob will attack the character.

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

Important Information

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