Jump to content

[patch]SPELL_AURA_284


Recommended Posts

Posted

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

implements aura 284

For which repository revision was the patch created?

9570

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

haven't seen any

Who has been writing this patch? Please include either forum user names or email addresses.

me

diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index 1bce86b..fb5a5ee 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -326,7 +326,7 @@ enum AuraType
    SPELL_AURA_MOD_HONOR_GAIN = 281,
    SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
    SPELL_AURA_MOD_HEALING_RECEIVED = 283,                  // Possibly only for some spell family class spells
-    SPELL_AURA_284,
+    SPELL_AURA_LINKED = 284,
    SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
    SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
    SPELL_AURA_DEFLECT_SPELLS = 287,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index acee827..4a64b7c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -334,7 +334,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
    &Aura::HandleNoImmediateEffect,                         //281 SPELL_AURA_MOD_HONOR_GAIN             implemented in Player::RewardHonor
    &Aura::HandleAuraIncreaseBaseHealthPercent,             //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
    &Aura::HandleNoImmediateEffect,                         //283 SPELL_AURA_MOD_HEALING_RECEIVED       implemented in Unit::SpellHealingBonus
-    &Aura::HandleNULL,                                      //284 51 spells
+    &Aura::HandleAuraLinked,                                //284 SPELL_AURA_LINKED
    &Aura::HandleAuraModAttackPowerOfArmor,                 //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR  implemented in Player::UpdateAttackPowerAndDamage
    &Aura::HandleNoImmediateEffect,                         //286 SPELL_AURA_ABILITY_PERIODIC_CRIT      implemented in Aura::IsCritFromAbilityAura called from Aura::PeriodicTick
    &Aura::HandleNoImmediateEffect,                         //287 SPELL_AURA_DEFLECT_SPELLS             implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
@@ -8367,3 +8367,29 @@ void Aura::HandleAllowOnlyAbility(bool apply, bool Real)
    m_target->UpdateDamagePhysical(RANGED_ATTACK);
    m_target->UpdateDamagePhysical(OFF_ATTACK);
}
+
+void Aura::HandleAuraLinked(bool apply, bool Real)
+{
+    if(!Real)
+        return;
+
+    uint32 linked_spell_id = GetSpellProto()->EffectTriggerSpell[GetEffIndex()];
+    int32 basepoints = GetModifier()->m_amount;
+
+    SpellEntry const *spellInfo = sSpellStore.LookupEntry(linked_spell_id);
+    if (!spellInfo)
+    {
+        sLog.outError("HandleAuraLinked of spell %u: triggering unknown spell id %i", GetSpellProto()->Id, linked_spell_id);
+        return;
+    }
+
+    if (apply)
+    {
+        if (basepoints)
+            m_target->CastCustomSpell(m_target, spellInfo, &basepoints, NULL, NULL, true, NULL, this, GetCaster() ? GetCaster()->GetGUID() : NULL);
+        else
+            m_target->CastSpell(m_target, spellInfo, true, NULL, this, GetCaster() ? GetCaster()->GetGUID() : NULL);
+    }
+    else
+        m_target->RemoveAurasDueToSpell(linked_spell_id);
+}
\\ No newline at end of file
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 5f0b2d6..0cda226 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -221,6 +221,7 @@ class MANGOS_DLL_SPEC Aura
        void HandleModTargetArmorPct(bool Apply, bool Real);
        void HandleAuraModAllCritChance(bool Apply, bool Real);
        void HandleAllowOnlyAbility(bool Apply, bool Real);
+        void HandleAuraLinked(bool Apply, bool Real);

        virtual ~Aura();

I'm not sure about right name for this aura, but it should work similar to SpellSpecificBoosts except that its based on single aura instead of the whole spell. Triggered spells not always exist in dbc so need to find correct ids and add them later

  • 3 weeks later...
Posted

i see the case of spell 66237 (Incinerate Flesh), there is a EffectMiscValue1 = 34801, does it have a meaning? doesnt seem to be a spellid.

also i don't think its correct to send basepoints through bp0 to triggered spell, since it can have more than 1 effect and with different meaning (see spell 63985 that links 62356)

oh, and adding originalCaster parameter is redundant if you used triggeredByAura argument

×
×
  • 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