diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index af350ae963d..3cb07340bc1 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -1729,7 +1729,19 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (60043,'spell_lava_burst'), (55438,'spell_glyph_of_lesser_healing_wave'), (2825,'spell_heroism_bloodlust'), -(32182,'spell_heroism_bloodlust'); +(32182,'spell_heroism_bloodlust'), +(39610,'spell_mana_tide_totem_effect'), +(55440,'spell_glyph_of_healing_wave'), +(63280,'spell_glyph_of_totem_of_wrath'), +(52041,'spell_healing_stream_totem_effect'), +(52046,'spell_healing_stream_totem_effect'), +(52047,'spell_healing_stream_totem_effect'), +(52048,'spell_healing_stream_totem_effect'), +(52049,'spell_healing_stream_totem_effect'), +(52050,'spell_healing_stream_totem_effect'), +(58759,'spell_healing_stream_totem_effect'), +(58760,'spell_healing_stream_totem_effect'), +(58761,'spell_healing_stream_totem_effect'); -- Food and Drink INSERT INTO spell_scripts(Id, ScriptName) VALUES diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/ScalingAuras.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/ScalingAuras.cpp index 17bdfb3d37e..5f05af04e54 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/ScalingAuras.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/ScalingAuras.cpp @@ -692,10 +692,13 @@ struct FeralSpiritPetScaling1 : public AuraScript { if (owner->IsPlayer()) { + float mod = 0.5f; + if (Aura* aura = owner->GetAura(63271, EFFECT_INDEX_0)) + mod += float(aura->GetAmount()) / 100; int32 nature = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE); if (nature < 0) nature = 0; - value = nature * 0.5f; + value = nature * mod; } } break; diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp index a94293c62cb..87f1ccd9036 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp @@ -122,6 +122,28 @@ struct EarthShield : public AuraScript } }; +// 39610 - Mana Tide Totem +struct ManaTideTotemEffect : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override + { + Unit* unitTarget = spell->GetUnitTarget(); + Unit* caster = spell->GetCaster(); + if (!unitTarget || unitTarget->GetPowerType() != POWER_MANA) + return; + + int32 damage = spell->GetDamage(); + + // Glyph of Mana Tide + if (Unit* owner = caster->GetOwner()) + if (Aura* dummy = owner->GetDummyAura(55441)) + damage += dummy->GetModifier()->m_amount; + // Regenerate 6% of Total Mana Every 3 secs + int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100; + caster->CastCustomSpell(unitTarget, 39609, &EffectBasePoints0, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED); + } +}; + enum { SPELL_SHAMAN_ELEMENTAL_MASTERY = 16166, @@ -339,6 +361,91 @@ struct GlyphOfLesserHealingWave : public AuraScript } }; +// 55440 - Glyph of Healing Wave +struct GlyphOfHealingWave : public AuraScript +{ + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override + { + // Not proc from self heals + if (procData.source == procData.target) + return SPELL_AURA_PROC_FAILED; + procData.basepoints[0] = aura->GetAmount() * procData.damage / 100; + procData.triggerTarget = procData.source; + procData.triggeredSpellId = 55533; + return SPELL_AURA_PROC_OK; + } +}; + +// 63280 - Glyph of Totem of Wrath +struct GlyphOfTotemOfWrath : public AuraScript +{ + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override + { + Unit* source = procData.source; + Totem* totem = source->GetTotem(TOTEM_SLOT_FIRE); + if (!totem) + return SPELL_AURA_PROC_FAILED; + + // find totem aura bonus + Unit::AuraList const& spellPower = totem->GetAurasByType(SPELL_AURA_NONE); + for (auto i : spellPower) + { + // select proper aura for format aura type in spell proto + if (i->GetTarget() == totem && i->GetSpellProto()->EffectApplyAuraName[i->GetEffIndex()] == SPELL_AURA_MOD_HEALING_DONE && + i->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && i->GetSpellProto()->SpellFamilyFlags & uint64(0x0000000004000000)) + { + procData.basepoints[0] = aura->GetAmount() * i->GetModifier()->m_amount / 100; + break; + } + } + + if (!procData.basepoints[0]) + return SPELL_AURA_PROC_FAILED; + + procData.basepoints[1] = procData.basepoints[0]; + procData.triggeredSpellId = 63283; // Totem of Wrath, caster bonus + procData.triggerTarget = source; + return SPELL_AURA_PROC_OK; + } +}; + +// 52041 - Healing Stream Totem +struct HealingStreamTotemEffect : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override + { + if (Unit* unitTarget = spell->GetUnitTarget()) + { + int32 damage = spell->GetDamage(); + Unit* caster = spell->GetCaster(); + if (Unit* owner = caster->GetOwner()) + { + // spell have SPELL_DAMAGE_CLASS_NONE and not get bonuses from owner, use main spell for bonuses + if (spell->m_triggeredBySpellInfo) + { + damage = int32(owner->SpellHealingBonusDone(unitTarget, spell->m_triggeredBySpellInfo, damage, HEAL)); + damage = int32(unitTarget->SpellHealingBonusTaken(owner, spell->m_triggeredBySpellInfo, damage, HEAL)); + } + + // Restorative Totems + Aura* restorativeTotems = owner->GetAura(16206, EFFECT_INDEX_1); + if (!restorativeTotems) + restorativeTotems = owner->GetAura(16205, EFFECT_INDEX_1); + if (!restorativeTotems) + restorativeTotems = owner->GetAura(16187, EFFECT_INDEX_1); + + if (restorativeTotems) + damage += restorativeTotems->GetModifier()->m_amount * damage / 100; + + // Glyph of Healing Stream Totem + if (Aura* dummy = owner->GetDummyAura(55456)) + damage += dummy->GetModifier()->m_amount * damage / 100; + } + caster->CastCustomSpell(unitTarget, 52042, &damage, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED); + } + } +}; + void LoadShamanScripts() { Script* pNewScript = new Script; @@ -348,6 +455,7 @@ void LoadShamanScripts() RegisterSpellScript("spell_sentry_totem"); RegisterSpellScript("spell_earth_shield"); + RegisterSpellScript("spell_mana_tide_totem_effect"); RegisterSpellScript("spell_item_shaman_t10_elemental_2p_bonus"); RegisterSpellScript("spell_earthbind_totem"); RegisterSpellScript("spell_lava_lash"); @@ -360,4 +468,7 @@ void LoadShamanScripts() RegisterSpellScript("spell_astral_shift_shaman"); RegisterSpellScript("spell_lava_burst"); RegisterSpellScript("spell_glyph_of_lesser_healing_wave"); + RegisterSpellScript("spell_glyph_of_healing_wave"); + RegisterSpellScript("spell_glyph_of_totem_of_wrath"); + RegisterSpellScript("spell_healing_stream_totem_effect"); } \ No newline at end of file diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 0e8cbeedc8b..d60c372d353 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -4239,35 +4239,6 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) m_caster->CastSpell(unitTarget, 52025, TRIGGERED_OLD_TRIGGERED); return; } - // Healing Stream Totem - if (m_spellInfo->SpellFamilyFlags & uint64(0x0000000000002000)) - { - if (unitTarget) - { - if (Unit* owner = m_caster->GetOwner()) - { - // spell have SPELL_DAMAGE_CLASS_NONE and not get bonuses from owner, use main spell for bonuses - if (m_triggeredBySpellInfo) - { - damage = int32(owner->SpellHealingBonusDone(unitTarget, m_triggeredBySpellInfo, damage, HEAL)); - damage = int32(unitTarget->SpellHealingBonusTaken(owner, m_triggeredBySpellInfo, damage, HEAL)); - } - - // Restorative Totems - Unit::AuraList const& mDummyAuras = owner->GetAurasByType(SPELL_AURA_DUMMY); - for (auto mDummyAura : mDummyAuras) - // only its have dummy with specific icon - if (mDummyAura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && mDummyAura->GetSpellProto()->SpellIconID == 338) - damage += mDummyAura->GetModifier()->m_amount * damage / 100; - - // Glyph of Healing Stream Totem - if (Aura* dummy = owner->GetDummyAura(55456)) - damage += dummy->GetModifier()->m_amount * damage / 100; - } - m_caster->CastCustomSpell(unitTarget, 52042, &damage, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_originalCasterGUID); - } - return; - } // Mana Spring Totem if (m_spellInfo->SpellFamilyFlags & uint64(0x0000000000004000)) { @@ -4297,20 +4268,6 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) return; } - if (m_spellInfo->Id == 39610) // Mana Tide Totem effect - { - if (!unitTarget || unitTarget->GetPowerType() != POWER_MANA) - return; - - // Glyph of Mana Tide - if (Unit* owner = m_caster->GetOwner()) - if (Aura* dummy = owner->GetDummyAura(55441)) - damage += dummy->GetModifier()->m_amount; - // Regenerate 6% of Total Mana Every 3 secs - int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100; - m_caster->CastCustomSpell(unitTarget, 39609, &EffectBasePoints0, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_originalCasterGUID); - return; - } break; } case SPELLFAMILY_DEATHKNIGHT: diff --git a/src/game/Spells/UnitAuraProcHandler.cpp b/src/game/Spells/UnitAuraProcHandler.cpp index 1cbed8ce7e1..f2c2b080f89 100644 --- a/src/game/Spells/UnitAuraProcHandler.cpp +++ b/src/game/Spells/UnitAuraProcHandler.cpp @@ -2580,17 +2580,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(ProcExecutionData& data) target = this; break; } - // Glyph of Healing Wave - case 55440: - { - // Not proc from self heals - if (this == pVictim) - return SPELL_AURA_PROC_FAILED; - basepoints[0] = triggerAmount * damage / 100; - target = this; - triggered_spell_id = 55533; - break; - } // Spirit Hunt case 58877: { @@ -2602,34 +2591,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(ProcExecutionData& data) triggered_spell_id = 58879; break; } - // Glyph of Totem of Wrath - case 63280: - { - Totem* totem = GetTotem(TOTEM_SLOT_FIRE); - if (!totem) - return SPELL_AURA_PROC_FAILED; - - // find totem aura bonus - AuraList const& spellPower = totem->GetAurasByType(SPELL_AURA_NONE); - for (auto i : spellPower) - { - // select proper aura for format aura type in spell proto - if (i->GetTarget() == totem && i->GetSpellProto()->EffectApplyAuraName[i->GetEffIndex()] == SPELL_AURA_MOD_HEALING_DONE && - i->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && i->GetSpellProto()->SpellFamilyFlags & uint64(0x0000000004000000)) - { - basepoints[0] = triggerAmount * i->GetModifier()->m_amount / 100; - break; - } - } - - if (!basepoints[0]) - return SPELL_AURA_PROC_FAILED; - - basepoints[1] = basepoints[0]; - triggered_spell_id = 63283; // Totem of Wrath, caster bonus - target = this; - break; - } // Item - Shaman T8 Elemental 4P Bonus case 64928: {