Created
January 30, 2010 10:46
-
-
Save pasdVn/290507 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 7a2b1712ec9d4829a855bd7ff0f6b7aee3fc58e4 Mon Sep 17 00:00:00 2001 | |
From: pasdVn <[email protected]> | |
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