Thread: Pet Aggro Fix
View Single Post
  #1  
Old 08-16-2007, 07:17 PM
cbodmer
Fire Beetle
 
Join Date: Oct 2006
Posts: 24
Default Pet Aggro Fix

I've noticed that pet aggro doesn't work right. If a player sends their pet into a camp of social mobs, all the mobs aggro on the player instead of the pet. The pet usually manages to grab the attention from the targetted mob, but the remainder of the mobs go after the pet owner.

This behaviour is not correct. The pet owner needs to be on the aggro list, but with less aggro than the pet.

I've made the following patch to attack.cpp (vs -1030) which fixes the problem for me:

Code:
--- EQEmu-0.7.0-1030/zone/attack.cpp	2007-08-11 08:14:57.000000000 +0200
+++ EQEmu-0.7.0-1030-cb/zone/attack.cpp	2007-08-17 08:39:52.000000000 +0200
@@ -1597,17 +1597,23 @@
 	if (other == myowner)
 		return;
 	
+	// cb:2007-08-17
+	// first add self
+	hate_list.Add(other, hate, damage, bFrenzy, !iBuffTic);
+	
+	// then add pet owner if there's one
 	if (owner) { // Other is a pet, add him and it
 		// EverHood 6/12/06
 		// Can't add a feigned owner to hate list
 		if(owner->IsClient() && owner->CastToClient()->GetFeigned()) {
 			//they avoid hate due to feign death...
 		} else {
-			hate_list.Add(owner, 1, damage, false, !iBuffTic);
+			// cb:2007-08-17
+			// owner must get on list, but he's not actually gained any hate yet
+			//hate_list.Add(owner, 1, damage, false, !iBuffTic);
+			hate_list.Add(owner, 0, 0, false, !iBuffTic);
 		}
-	}
-	
-	hate_list.Add(other, hate, damage, bFrenzy, !iBuffTic);
+	}	
 	
 	if (mypet && (!(GetAA(aaPetDiscipline) && mypet->IsHeld()))) { // I have a pet, add other to it
 		if(!mypet->IsFamiliar())
Cheers,
Chris
Reply With Quote