mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Fixed Riptide bonus on Chain Heal
closes #1152 Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=-1064;
|
||||
INSERT INTO `spell_script_names` VALUES
|
||||
(-1064, 'spell_sha_chain_heal');
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user