Skip to content

Commit

Permalink
Druid: Reimplement mangle bleed bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Sep 16, 2023
1 parent 827df6b commit 0ce7cae
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,12 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(26980,'spell_regrowth'),
(33831,'spell_force_of_nature_summon'),
(41929,'spell_guardian_aggro_spell'),
(33876,'spell_mangle_druid_tbc'),
(33878,'spell_mangle_druid_tbc'),
(33982,'spell_mangle_druid_tbc'),
(33983,'spell_mangle_druid_tbc'),
(33986,'spell_mangle_druid_tbc'),
(33987,'spell_mangle_druid_tbc'),
(1178,'spell_druid_form_scaling_ap_auras'),
(3025,'spell_druid_form_scaling_ap_auras'),
(9635,'spell_druid_form_scaling_ap_auras'),
Expand Down
43 changes: 43 additions & 0 deletions src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,53 @@ struct GuardianAggroSpell : public SpellScript
}
};

// 33876, 33878 - Mangle
struct MangleDruidTBC : public AuraScript
{
void OnAuraInit(Aura* aura) const override
{
aura->SetAffectOverriden();
}

void OnApply(Aura* aura, bool apply) const override
{
aura->GetTarget()->RegisterScriptedLocationAura(aura, SCRIPT_LOCATION_MELEE_DAMAGE_TAKEN, apply);
aura->GetTarget()->RegisterScriptedLocationAura(aura, SCRIPT_LOCATION_SPELL_DAMAGE_TAKEN, apply);
}

bool OnAffectCheck(Aura const* /*aura*/, SpellEntry const* spellInfo) const override
{
if (spellInfo == nullptr)
return false;

if (GetAllSpellMechanicMask(spellInfo) & (1 << (MECHANIC_BLEED - 1)))
return true;

switch (spellInfo->Id)
{
case 5221: // Shred
case 6800:
case 8992:
case 9829:
case 9830:
case 27001:
case 27002:
return true;
default: return false;
}
}

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

void LoadDruidScripts()
{
RegisterSpellScript<Regrowth>("spell_regrowth");
RegisterSpellScript<FormScalingAttackPowerAuras>("spell_druid_form_scaling_ap_auras");
RegisterSpellScript<ForceOfNatureSummon>("spell_force_of_nature_summon");
RegisterSpellScript<GuardianAggroSpell>("spell_guardian_aggro_spell");
RegisterSpellScript<MangleDruidTBC>("spell_mangle_druid_tbc");
}

0 comments on commit 0ce7cae

Please sign in to comment.