but so far what I’ve tried had no effect. You still have to log out and back in to see the Beastmastery talents modify your pet’s stats.
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 87f207e..85c8f13 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -23988,6 +23988,12 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
// update free talent points
SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
+
+ // Check for pet and apply player talents that modify pet stats
+ if (GetPet() && GetPet()->isAlive() && GetPet()->IsInWorld())
+ {
+ GetPet()->UpdateAllStats();
+ }
}
void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
After picking talents like thick hide which increases your pet’s armor by x, UpdateAllStats() didn’t modify the armor stat based on the new aura.
Any advice as to which area I should be looking at would be appreciated. I was thinking of copying some of the calls in LoadPetFromDB() to reload the auras but thought that might double them rather than replace them. Also I’m not sure exactly where the player auras are applied to the pet.
We don’t need to reapply the mods every tick, they just need to be replaced/updated when the talent is learned. As it stands now, the auras are applied correctly when the pet is loaded so we could duplicate that by removing the auras and reapplying them when the talent is learned/unlearned.
I just wasn’t sure how the auras were applied is all. Are they considered casted by the player or pet?
Right, see when I was reviewing the code, I took “Pet Auras” to mean the auras cast by the pet (ie: from the pet talent tree) and “Player Auras” to mean those cast by the player (Beastmastery tree). I think however that it considers any aura that effects the pet a “Pet Aura” which is a bit misleading.
I don’t want to muck up the aura handlers but I think anything that is learned by the player should be a player aura, regardless of who it effects.