Jump to content

[fix][8110] Aura 229


Guest Lightguard

Recommended Posts

What bug does the patch fix? What features does the patch add?

- This patch would add aura SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE

For which repository revision was the patch created?

- Created for revision 8076

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

- There was a bug report somewhere but the forum's search engine is like hell. Feint and a few other spells are using it.

From 1176f71e200ffbc8c53edf7f041ee9bca37b75a8 Mon Sep 17 00:00:00 2001
From: Lightguard <[email protected]>
Date: Fri, 26 Jun 2009 23:11:01 +0200
Subject: [PATCH] Add aura 229

---
src/game/SpellAuras.cpp |    2 +-
src/game/Unit.cpp       |   16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 442da50..89913de 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -279,7 +279,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleAuraPeriodicDummy,                         //226 SPELL_AURA_PERIODIC_DUMMY
    &Aura::HandlePeriodicTriggerSpellWithValue,             //227 SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
    &Aura::HandleNoImmediateEffect,                         //228 stealth detection
-    &Aura::HandleNULL,                                      //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
+    &Aura::HandleNoImmediateEffect,                         //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE implemented in Unit::SpellDamageBonus
    &Aura::HandleAuraModIncreaseMaxHealth,                  //230 Commanding Shout
    &Aura::HandleNoImmediateEffect,                         //231 SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
    &Aura::HandleNoImmediateEffect,                         //232 SPELL_AURA_MECHANIC_DURATION_MOD           implement in Unit::CalculateSpellDuration
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e0196c9..0accc92 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7903,6 +7903,14 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
                TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
    }

+    // Mod damage taken from AoE spells
+    if(IsAreaOfEffectSpell(spellProto))
+    {
+        AuraList const& avoidAuras = pVictim->GetAurasByType(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE);
+        for(AuraList::const_iterator itr = avoidAuras.begin(); itr != avoidAuras.end(); ++itr)
+            TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f)/100.0f;
+    }
+
    // Taken/Done fixed damage bonus auras
    int32 DoneAdvertisedBenefit  = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto));
    int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(GetSpellSchoolMask(spellProto), pVictim);
@@ -8746,6 +8754,14 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
            TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
    }

+    // Mod damage taken from AoE spells
+    if(spellProto && IsAreaOfEffectSpell(spellProto))
+    {
+        AuraList const& avoidAuras = pVictim->GetAurasByType(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE);
+        for(AuraList::const_iterator itr = avoidAuras.begin(); itr != avoidAuras.end(); ++itr)
+            TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f)/100.0f;
+    }
+
    float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod;

    // apply spellmod to Done damage
-- 
1.6.3.2.1299.gee46c

Patchfile

Link to comment
Share on other sites

  • 1 month later...
In [8110]. Thank you :)

MaNGOS/0.14.0 (* * Revision 8416 - *) for Linux_x64 (little-endian)
Using script library: ScriptDev2 (for MaNGOS 8273+) Revision [1369] 2009-08-24 13:52:29 (Unix)
Using World DB: PSDB WotLK (243)
Using creature EventAI: PSDB EventAI & ACID 3.0.0

[spell][48659] Feint.

Agro is decrease but damages from mass spells are the same.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use