Skip to content

Commit

Permalink
Shaman: Reimplement Healing Way using spell script
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Sep 16, 2023
1 parent 74f2f63 commit 3e9df30
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
-- Shaman
INSERT INTO spell_scripts(Id, ScriptName) VALUES
(6495,'spell_sentry_totem'),
(29203,'spell_healing_way'),
(974,'spell_earth_shield'),
(32593,'spell_earth_shield'),
(32594,'spell_earth_shield');
Expand Down
9 changes: 0 additions & 9 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7741,15 +7741,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* pCaster, SpellEntry const* spellInfo,
// apply benefit affected by spell power implicit coeffs and spell level penalties
TakenTotal = pCaster->SpellBonusWithCoeffs(spellInfo, TakenTotal, TakenAdvertisedBenefit, 0, damagetype, false);

// Healing Way dummy affects healing taken from Healing Wave
if (spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && (spellInfo->SpellFamilyFlags & uint64(0x0000000000000040)))
{
AuraList const& auraDummy = GetAurasByType(SPELL_AURA_DUMMY);
for (auto itr : auraDummy)
if (itr->GetId() == 29203)
TakenTotalMod *= (itr->GetModifier()->m_amount + 100.0f) / 100.0f;
}

// use float as more appropriate for negative values and percent applying
float heal = (healamount + TakenTotal * int32(stack)) * TakenTotalMod;

Expand Down
15 changes: 15 additions & 0 deletions src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ struct EarthShield : public AuraScript
}
};

// 29203 - Healing Way
struct HealingWay : public AuraScript
{
void OnApply(Aura* aura, bool apply) const override
{
aura->GetTarget()->RegisterScriptedLocationAura(aura, SCRIPT_LOCATION_SPELL_HEALING_TAKEN, apply);
}

void OnDamageCalculate(Aura* aura, Unit* /*victim*/, int32& /*advertisedBenefit*/, float& totalMod) const override
{
totalMod *= (aura->GetModifier()->m_amount + 100.0f) / 100.0f;
}
};

void LoadShamanScripts()
{
Script* pNewScript = new Script;
Expand All @@ -119,4 +133,5 @@ void LoadShamanScripts()

RegisterSpellScript<SentryTotem>("spell_sentry_totem");
RegisterSpellScript<EarthShield>("spell_earth_shield");
RegisterSpellScript<HealingWay>("spell_healing_way");
}

0 comments on commit 3e9df30

Please sign in to comment.