View Single Post
  #4  
Old 07-23-2023, 03:41 PM
Asylum
Sarnak
 
Join Date: Jun 2013
Posts: 81
Default

Yes, it's been a while since I was on here but I'm back and thought I'd start by trying to help answer some questions for those writing scripts. I know I'm not even close to the knowledge of some on here, but in the process of relearning this to start up my old EMU server, I'll try to answer some of your coding questions.

This one seems quite easy to accomplish, as nilbog suggested, just have the named NPC signal to a monitoring (watch) npc that it has spawned. I have attached the code you'll need. I prefer Perl so translate to lua as you wish.

As I mentioned, it's been a time since posting on here, and I may or may not have remembered the proper syntax for attaching code. Apologies.

Code:
#Watch npc, your NPC A (1000) change ID from 1000 to match your NPC A watch npc
#Add the following code to your NPC A Perl file.

sub EVENT_SIGNAL {
	if ($signal == 1) {
		quest::shout("Some named NPC has spawned!");
	}
}

#Named mob, your NPC B (1001) change ID from 1001 to match your NPC B named mob
#Add the following code to your NPC B Perl file.

sub EVENT_SPAWN {
	quest::signalwith(1000, 1); #let NPC A know I spawned, change ID from 1000 to match your NPC A
}
Reply With Quote