Alllow SE_PetMeleeMitigation to work on swarm pets.

This commit is contained in:
KayenEQ 2014-07-24 14:06:15 -04:00
parent 1b239b7119
commit 9fcea56fbf

View File

@ -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;
}