Scripts/Spells: Implement druid talent Maim (#31586)

This commit is contained in:
Cristian Vintila
2026-02-05 14:06:18 +02:00
committed by GitHub
parent ee0c30a968
commit 70e99c6442
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_dru_maim');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(22570, 'spell_dru_maim');

View File

@@ -114,6 +114,7 @@ enum DruidSpells
SPELL_DRUID_LUNAR_BEAM_HEAL = 204069,
SPELL_DRUID_LUNAR_BEAM_DAMAGE = 414613,
SPELL_DRUID_LUNAR_INSPIRATION_OVERRIDE = 155627,
SPELL_DRUID_MAIM_STUN = 203123,
SPELL_DRUID_MANGLE = 33917,
SPELL_DRUID_MANGLE_TALENT = 231064,
SPELL_DRUID_MASS_ENTANGLEMENT = 102359,
@@ -1408,6 +1409,38 @@ class spell_dru_luxuriant_soil : public AuraScript
}
};
// 22570 - Maim
class spell_dru_maim : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_MAIM_STUN });
}
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& /*damage*/, int32& /*flatMod*/, float& pctMod)
{
int32 comboPoints = GetSpell()->GetPowerTypeCostAmount(POWER_COMBO_POINTS).value_or(0);
pctMod *= comboPoints;
}
void HandleEffectHit(SpellEffIndex /*effIndex*/)
{
int32 comboPoints = GetSpell()->GetPowerTypeCostAmount(POWER_COMBO_POINTS).value_or(0);
GetCaster()->CastSpell(GetHitUnit(), SPELL_DRUID_MAIM_STUN, CastSpellExtraArgsInit{
.TriggeringSpell = GetSpell(),
.SpellValueOverrides = { { SPELLVALUE_DURATION, comboPoints * IN_MILLISECONDS } }
});
}
void Register() override
{
CalcDamage += SpellCalcDamageFn(spell_dru_maim::CalculateDamage);
OnEffectHitTarget += SpellEffectFn(spell_dru_maim::HandleEffectHit, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 33917 - Mangle
class spell_dru_mangle : public SpellScript
{
@@ -2901,6 +2934,7 @@ void AddSC_druid_spell_scripts()
RegisterAreaTriggerAI(at_dru_lunar_beam);
RegisterSpellScript(spell_dru_lunar_inspiration);
RegisterSpellScript(spell_dru_luxuriant_soil);
RegisterSpellScript(spell_dru_maim);
RegisterSpellScript(spell_dru_mangle);
RegisterSpellScript(spell_dru_matted_fur_absorb);
RegisterSpellScript(spell_dru_moonfire);