Scrips/Spells: Implement druid talent Thorns of Iron (#31537)

This commit is contained in:
Cristian Vintila
2026-02-01 21:10:34 +02:00
committed by GitHub
parent 8b036024d6
commit 2babc6f8db
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_dru_thorns_of_iron_damage');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(400223, 'spell_dru_thorns_of_iron_damage');
DELETE FROM `spell_proc` WHERE `SpellId` IN (400222);
INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
(400222,0x00,7,0x00000000,0x00000000,0x00004000,0x00000000,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0,0,0,0); -- Thorns of Iron

View File

@@ -2134,6 +2134,26 @@ class spell_dru_t10_restoration_4p_bonus_dummy : public AuraScript
}
};
// 400223 - Thorns of Iron (Damage)
class spell_dru_thorns_of_iron_damage : public SpellScript
{
void HandleEffectHit(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
int32 noTargets = GetUnitTargetCountForEffect(effIndex);
int32 pct = GetTriggeringSpell()->GetEffect(effIndex).CalcValue(caster);
int32 damage = CalculatePct(caster->GetArmor(), pct) / noTargets;
SetHitDamage(damage);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dru_thorns_of_iron_damage::HandleEffectHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
// 77758 - Thrash
class spell_dru_thrash : public SpellScript
{
@@ -2621,6 +2641,7 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_t10_balance_4p_bonus);
RegisterSpellScript(spell_dru_t10_restoration_4p_bonus);
RegisterSpellScript(spell_dru_t10_restoration_4p_bonus_dummy);
RegisterSpellScript(spell_dru_thorns_of_iron_damage);
RegisterSpellScript(spell_dru_thrash);
RegisterSpellScript(spell_dru_thrash_aura);
RegisterSpellScript(spell_dru_travel_form);