From 9fcea56fbfbb4dfcd0a14e23b21aa96fa5bfaea9 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 24 Jul 2014 14:06:15 -0400 Subject: [PATCH] Alllow SE_PetMeleeMitigation to work on swarm pets. --- zone/attack.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 7831ac9d6..67f351e17 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -566,15 +566,15 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac if (!IsPet()) armor = (armor / RuleR(Combat, NPCACFactor)); - else{ - Mob *owner = nullptr; + + Mob *owner = nullptr; + if (IsPet()) owner = GetOwner(); - if (owner){ - PetACBonus = owner->aabonuses.PetMeleeMitigation - + owner->itembonuses.PetMeleeMitigation + - owner->spellbonuses.PetMeleeMitigation; - } - } + else if ((CastToNPC()->GetSwarmOwner())) + owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner()); + + if (owner) + PetACBonus = owner->aabonuses.PetMeleeMitigation + owner->itembonuses.PetMeleeMitigation + owner->spellbonuses.PetMeleeMitigation; armor += spellbonuses.AC + itembonuses.AC + PetACBonus + 1; }