diff options
author | QAston <none@none> | 2009-08-17 21:06:01 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-17 21:06:01 +0200 |
commit | 97f0f98ec4a6b5da2490463f51b3775bb7e0c77a (patch) | |
tree | 30bcb56c973f2914a98b9cda4ec0deea4daa3e95 /src | |
parent | e27576ab45063dbc79a1f82f1d4a9283d8682bcd (diff) |
*Implement aura type SPELL_AURA_LINKED(284).
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuraDefines.h | 2 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 22 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 1 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 0c2fefa848a..0822b95db94 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -333,7 +333,7 @@ enum AuraType SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, SPELL_AURA_ABILITY_PERIODIC_CRIT = 286, SPELL_AURA_DEFLECT_SPELLS, - SPELL_AURA_288, + SPELL_AURA_IGNORE_HIT_DIRECTION, SPELL_AURA_289, SPELL_AURA_MOD_CRIT_PCT, SPELL_AURA_MOD_XP_QUEST_PCT, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index f42809d0290..bf9496a3d6b 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -337,7 +337,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT 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 SPELL_AURA_LINKED + &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 AuraEffect::PeriodicTick &Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult @@ -6846,6 +6846,26 @@ void AuraEffect::HandleAuraModCritPct(bool apply, bool Real, bool changeAmount) ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply); } +void AuraEffect::HandleAuraLinked(bool apply, bool Real, bool /*changeAmount*/) +{ + if (!Real) + return; + + if (apply) + { + Unit * caster = GetCaster(); + if (!caster) + return; + // If amount avalible cast with basepoints (Crypt Fever for example) + if (m_amount) + caster->CastCustomSpell(m_target, m_spellProto->EffectTriggerSpell[m_effIndex], &m_amount, NULL, NULL, true, NULL, this); + else + caster->CastSpell(m_target, m_spellProto->EffectTriggerSpell[m_effIndex],true, NULL, this); + } + else + m_target->RemoveAura(m_spellProto->EffectTriggerSpell[m_effIndex], GetCasterGUID(), AuraRemoveMode(GetParentAura()->GetRemoveMode())); +} + int32 AuraEffect::CalculateCrowdControlAuraAmount(Unit * caster) { // Damage cap for CC effects diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index d3f3ade9b01..262795077c6 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -328,6 +328,7 @@ class TRINITY_DLL_SPEC AuraEffect void HandleAuraInitializeImages(bool Apply, bool Real, bool changeAmount); void HandleAuraCloneCaster(bool Apply, bool Real, bool changeAmount); void HandleAuraModCritPct(bool Apply, bool Real, bool changeAmount); + void HandleAuraLinked(bool Apply, bool Real, bool changeAmount); void HandleAuraEffectSpecificMods(bool apply, bool Real, bool changeAmount); int32 CalculateCrowdControlAuraAmount(Unit * caster); |