diff options
author | Subv <s.v.h21@hotmail.com> | 2012-04-08 18:56:36 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-04-08 19:09:30 -0500 |
commit | e309c4fe1b4d141dc49faef307c443aa7c595580 (patch) | |
tree | 9625bbb16f43a7d4617364fb847b92b2f6ad6a87 /src | |
parent | 93ca33a8ccc062626fe0e9f04896b0de0c4d8fd0 (diff) |
Core/Spells: Fixed Riptide bonus on Chain Heal
closes #1152
Signed-off-by: Subv <s.v.h21@hotmail.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 11 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 46 |
2 files changed, 46 insertions, 11 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 97e75a0c6db..4e05c9fdac2 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1614,17 +1614,6 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) // Lifebloom - final heal coef multiplied by original DoT stack else if (m_spellInfo->Id == 33778) addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL, m_spellValue->EffectBasePoints[1]); - // Riptide - increase healing done by Chain Heal - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x100) - { - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); - if (AuraEffect* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, m_originalCasterGUID)) - { - addhealth = int32(addhealth * 1.25f); - // consume aura - unitTarget->RemoveAura(aurEff->GetBase()); - } - } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 96ee7a18429..5b5a48f33af 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -542,6 +542,51 @@ class spell_sha_lava_lash : public SpellScriptLoader } }; +// 1064 Chain Heal +class spell_sha_chain_heal : public SpellScriptLoader +{ + public: + spell_sha_chain_heal() : SpellScriptLoader("spell_sha_chain_heal") { } + + class spell_sha_chain_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_chain_heal_SpellScript); + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (firstHeal) + { + // Check if the target has Riptide + if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) + { + riptide = true; + // Consume it + GetHitUnit()->RemoveAura(aurEff->GetBase()); + } + firstHeal = false; + } + // Riptide increases the Chain Heal effect by 25% + if (riptide) + SetHitHeal(GetHitHeal() * 1.25f); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_chain_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + firstHeal = true; + riptide = false; + } + + bool firstHeal; + bool riptide; + + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_chain_heal_SpellScript(); + } +}; void AddSC_shaman_spell_scripts() { @@ -556,4 +601,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_healing_stream_totem(); new spell_sha_mana_spring_totem(); new spell_sha_lava_lash(); + new spell_sha_chain_heal(); } |