Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2015, 10:48 AM
iluvseq
Sarnak
 
Join Date: Aug 2009
Location: Somewhere
Posts: 53
Default Have NPC Guards only assist players with > indifferent faction

I understand the 'normal' way to configure a guard, where you enable NPC Aggro and make them aggressive to a faction, and then assign that faction to the beasts in the area.

However, this makes the guards attack those beasts whenever in range, and regardless of if they are attacking a player or not.

While I do want that for some guards, what I really want are faction based "defensive" guards who do not attack unprovoked, but will assist players who are at least amiable to their faction, and refuse to help players who are not.

I guess the issue is that players don't do a 'call for help' so there is nothing that kicks in like when NPCs have aggro.

I guess I could do some sort of proximity triggered quest on the NPC and have it look for creatures in range that have the friendly player on their hatelist or something like that, but I was hoping there was a more elegant mechanism.
Reply With Quote
  #2  
Old 01-17-2015, 11:08 AM
iluvseq
Sarnak
 
Join Date: Aug 2009
Location: Somewhere
Posts: 53
Default

Looks like set_proximity() creates an immobile zone, which would be fine for static guards, but I'm trying to implement this on a roamer. Any ideas?
Reply With Quote
  #3  
Old 01-18-2015, 06:30 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

If you are going to use proximities for that and want them to work for a moving guard, you probably need to use a timer to update the proximity on a regular basis. Here is an example from a script I use:

Code:
$ProxRangeXY = 100;
$ProxRangeZ = 25;

sub EVENT_SPAWN {
	quest::set_proximity($x - $ProxRangeXY, $x + $ProxRangeXY, $y - $ProxRangeXY, $y + $ProxRangeXY, $z - $ProxRangeZ, $z + $ProxRangeZ);
	quest::settimer("setprox", 2);
}


sub EVENT_TIMER {

	if ($timer eq "setprox") {
		quest::clear_proximity();
		quest::set_proximity($x - $ProxRangeXY, $x + $ProxRangeXY, $y - $ProxRangeXY, $y + $ProxRangeXY, $z - $ProxRangeZ, $z + $ProxRangeZ);
	}

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 01-18-2015, 10:06 AM
iluvseq
Sarnak
 
Join Date: Aug 2009
Location: Somewhere
Posts: 53
Default

That'll work, thank you!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:46 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3