Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2009, 02:21 PM
nilbog
Hill Giant
 
Join Date: Nov 2007
Posts: 197
Default npc persistent pets

Per request of So_1337, here's the code necessary to make npc pets remain and fight after their master is slain.

This change brought to you by Ladoth, bringer of classic code. He is the lead source developer for project1999, and without him, we wouldn't have lots of cool stuff.

in zone/mob.cpp, change this

line 1420
Code:
void Mob::SetOwnerID(int16 NewOwnerID) {
	if (NewOwnerID == GetID() && NewOwnerID != 0) // ok, no charming yourself now =p
		return;
	ownerid = NewOwnerID;
	if (ownerid == 0 && this->IsNPC() && this->GetPetType() != petCharmed)
		this->Depop();
}
to this

Code:
void Mob::SetOwnerID(int16 NewOwnerID) {
	if (NewOwnerID == GetID() && NewOwnerID != 0) // ok, no charming yourself now =p
		return;

	// @LADOTH 07182009 don't depop a pet for NPC owners
	Mob* oldowner = entity_list.GetMob(ownerid);

	ownerid = NewOwnerID;
	if (ownerid == 0 && this->IsNPC() && this->GetPetType() != petCharmed && oldowner && oldowner->IsClient())
		this->Depop();
}
Reply With Quote
  #2  
Old 08-25-2009, 09:32 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

You may experience a slight bug in this. Sometimes for NPC's if you feign off the pet aggro they'll return to the point where they were summoned and go indifferent. Not sure if the fix for this was put into the code yet or not as I know zip all about source code.
__________________
Retired EMarr
Project1999 Developer
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:24 AM.


 

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