Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2003, 06:03 AM
IASoveraign
Fire Beetle
 
Join Date: Jan 2003
Posts: 5
Default Code: Pet agro fix (well, if it was broken)

I noticed my pets weren't attacking critters that attacked me, so I made a small change to attack.cpp (highlighted below).

Code:
		// Agro the client's pet if it has one.
		if (other->IsClient())
		{
			// TODO: When NPC's charm - pet might become client, not NPC -- Soveraign
			NPC * client_pet = (NPC *) other->GetPet();
			if (client_pet)
			{
				client_pet->AddToHateList(this);
			}
		}
Reply With Quote
  #2  
Old 01-12-2003, 11:35 AM
IASoveraign
Fire Beetle
 
Join Date: Jan 2003
Posts: 5
Default

FYI - that attack.cpp is from the 4.1 distribution and looks to be out of sync with the CVS.
Reply With Quote
  #3  
Old 01-12-2003, 12:03 PM
Baron Sprite's Avatar
Baron Sprite
Dragon
 
Join Date: Jan 2002
Posts: 708
Default

k I merged it for you, gj.
__________________
Waking up in the morgue is pretty harsh, but it beats being dead.
Begun, this irc stat war has.
Reply With Quote
  #4  
Old 01-13-2003, 02:48 AM
neotokyo
Hill Giant
 
Join Date: Oct 2002
Posts: 118
Default

and i just removed it again, it was in the wrong function :-/

you not only need to check for NPC melee attacks but spell attacks too, and you'd miss them in NPC::Attack. so i put it where it belongs (Client:amage)

good point about clients being charmed pets too - i would have missed that, but since i didn't put charm as possible offensive spell it wouldnt matter until someone changed the NPC behavior code.
Reply With Quote
  #5  
Old 01-13-2003, 07:53 AM
Baron Sprite's Avatar
Baron Sprite
Dragon
 
Join Date: Jan 2002
Posts: 708
Default

Oh yeah.
__________________
Waking up in the morgue is pretty harsh, but it beats being dead.
Begun, this irc stat war has.
Reply With Quote
  #6  
Old 01-13-2003, 08:46 AM
IASoveraign
Fire Beetle
 
Join Date: Jan 2003
Posts: 5
Default

Yeah, that makes more sense to make sure special attacks are considered. Which reminds me, I've noticed in 0.4.1 that NPCs do not agro if special attacked by a PC. Perhaps a line needs to be moved from Client::Attack to NPC:amage?

But that begs the question, what about agro on misses? I'm really new to the code base but, :amage isn't called if you miss, right?

If that is the case, then should AddToHateList be added to all attack methods (using a low hate of zero or 1)?
Reply With Quote
Reply

Thread Tools
Display Modes

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 04: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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3