Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pasdVn/290507 to your computer and use it in GitHub Desktop.
Save pasdVn/290507 to your computer and use it in GitHub Desktop.
From 7a2b1712ec9d4829a855bd7ff0f6b7aee3fc58e4 Mon Sep 17 00:00:00 2001
From: pasdVn <pasdVn3@gmx.de>
Date: Wed, 24 Feb 2010 13:05:06 +0100
Subject: [PATCH 4/6] implemented spell penetration benefit of pets from their owner
---
src/game/Unit.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e2e15e1..b0eac31 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1839,6 +1839,9 @@ void Unit::CalculateAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolMask, D
float tmpvalue2 = (float)GetResistance(GetFirstSchoolInMask(schoolMask));
// Ignore resistance by self SPELL_AURA_MOD_TARGET_RESISTANCE aura
tmpvalue2 += (float)pCaster->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask);
+ // all pets receive 100% of owner's spell penetration
+ if (pCaster->GetTypeId() == TYPEID_UNIT && ((Creature*)pCaster)->isPet() && pCaster->GetOwner())
+ tmpvalue2 += (float)pCaster->GetOwner()->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask);
tmpvalue2 *= (float)(0.15f / getLevel());
if (tmpvalue2 < 0.0f)
--
1.6.5.1.1367.gcd48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment