diff options
author | megamage <none@none> | 2009-08-27 20:44:51 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-27 20:44:51 -0500 |
commit | 624d20fb30e193528eadf24b30fa370ca54ad8fc (patch) | |
tree | 6ebf56bf79bd41e19e6128a2fbd9e33c37acabc5 /src | |
parent | dc208f351beb90244c7af9615428c70c37dbb40e (diff) |
*Implement spell savage defense. By Vladimir
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index dc404b40abf..471709a7b2d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1878,6 +1878,12 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; } + // Savage Defense (amount store original percent of attack power applied) + if (spellProto->SpellIconID == 50) // only spell with this aura fit + { + RemainingDamage -= int32(currentAbsorb * pVictim->GetTotalAttackPowerValue(BASE_ATTACK) / 100); + continue; + } break; } case SPELLFAMILY_ROGUE: @@ -1954,56 +1960,50 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe } case SPELLFAMILY_DEATHKNIGHT: { - // Unbreakable Armor - if (spellProto->Id == 51271) + switch(spellProto->Id) { - Unit* caster = (*i)->GetCaster(); - if (!caster) - continue; - - uint32 absorbed = uint32( currentAbsorb * caster->GetArmor() * 0.01f ); + case 51271: // Unbreakable Armor + if(Unit *caster = (*i)->GetCaster()) + { + uint32 absorbed = uint32( currentAbsorb * caster->GetArmor() * 0.01f ); - // Glyph of Unbreakable Armor - if (AuraEffect *aurEff = caster->GetAuraEffect(58635, 0)) - absorbed += uint32( absorbed * aurEff->GetAmount() / 100 ); + // Glyph of Unbreakable Armor + if (AuraEffect *aurEff = caster->GetAuraEffect(58635, 0)) + absorbed += uint32( absorbed * aurEff->GetAmount() / 100 ); - RemainingDamage -= absorbed; - continue; - } - // Anti-Magic Shell (on self) - if (spellProto->Id == 48707) - { - // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. - // This, if I'm not mistaken, shows that we get back ~2% of the absorbed damage as runic power. - int32 absorbed = RemainingDamage * currentAbsorb / 100; - int32 regen = absorbed * 2 / 10; - pVictim->CastCustomSpell(pVictim, 49088, ®en, 0, 0, true, 0, (*i)); - RemainingDamage -= absorbed; - continue; - } - // Anti-Magic Shell (on single party/raid member) - if (spellProto->Id == 50462) - { - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - // Anti-Magic Zone - if (spellProto->Id == 50461) - { - Unit* caster = (*i)->GetCaster(); - if (!caster) + RemainingDamage -= absorbed; + } continue; - int32 absorbed = RemainingDamage * currentAbsorb / 100; - int32 canabsorb = caster->GetHealth(); - if (canabsorb < absorbed) - absorbed = canabsorb; + case 48707: // Anti-Magic Shell (on self) + { + // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. + // This, if I'm not mistaken, shows that we get back ~2% of the absorbed damage as runic power. + int32 absorbed = RemainingDamage * currentAbsorb / 100; + int32 regen = absorbed * 2 / 10; + pVictim->CastCustomSpell(pVictim, 49088, ®en, 0, 0, true, 0, (*i)); + RemainingDamage -= absorbed; + continue; + } + case 50462: // Anti-Magic Shell (on single party/raid member) + RemainingDamage -= RemainingDamage * currentAbsorb / 100; + continue; + case 50461: // Anti-Magic Zone + if(Unit *caster = (*i)->GetCaster()) + { + int32 absorbed = RemainingDamage * currentAbsorb / 100; + int32 canabsorb = caster->GetHealth(); + if (canabsorb < absorbed) + absorbed = canabsorb; - RemainingDamage -= absorbed; + RemainingDamage -= absorbed; - uint32 ab_damage = absorbed; - DealDamageMods(caster,ab_damage,NULL); - DealDamage(caster, ab_damage, NULL, damagetype, schoolMask, 0, false); - continue; + uint32 ab_damage = absorbed; + DealDamageMods(caster,ab_damage,NULL); + DealDamage(caster, ab_damage, NULL, damagetype, schoolMask, 0, false); + } + continue; + default: + break; } break; } |