Scripts/Spells: Implement shaman talent Arctic Snowstorm (#30178)

This commit is contained in:
Aqua Deus
2024-09-12 16:24:49 +02:00
committed by GitHub
parent 75385afded
commit 58668b4de1
2 changed files with 70 additions and 1 deletions

View File

@@ -41,6 +41,8 @@ enum ShamanSpells
SPELL_SHAMAN_AFTERSHOCK_ENERGIZE = 210712,
SPELL_SHAMAN_ANCESTRAL_GUIDANCE = 108281,
SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL = 114911,
SPELL_SHAMAN_ARCTIC_SNOWSTORM_AREATRIGGER = 462767,
SPELL_SHAMAN_ARCTIC_SNOWSTORM_SLOW = 462765,
SPELL_SHAMAN_ASCENDANCE_ELEMENTAL = 114050,
SPELL_SHAMAN_ASCENDANCE_ENHANCEMENT = 114051,
SPELL_SHAMAN_ASCENDANCE_RESTORATION = 114052,
@@ -73,6 +75,7 @@ enum ShamanSpells
SPELL_SHAMAN_FLAMETONGUE_ATTACK = 10444,
SPELL_SHAMAN_FLAMETONGUE_WEAPON_ENCHANT = 334294,
SPELL_SHAMAN_FLAMETONGUE_WEAPON_AURA = 319778,
SPELL_SHAMAN_FROST_SHOCK = 196840,
SPELL_SHAMAN_FROST_SHOCK_ENERGIZE = 289439,
SPELL_SHAMAN_GATHERING_STORMS = 198299,
SPELL_SHAMAN_GATHERING_STORMS_BUFF = 198300,
@@ -223,6 +226,26 @@ class spell_sha_ancestral_guidance_heal : public SpellScript
}
};
// 462764 - Arctic Snowstorm
class spell_sha_arctic_snowstorm : public AuraScript
{
bool Validate(SpellInfo const* /*spellEntry*/) override
{
return ValidateSpellInfo({ SPELL_SHAMAN_ARCTIC_SNOWSTORM_AREATRIGGER });
}
void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
{
eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_SHAMAN_ARCTIC_SNOWSTORM_AREATRIGGER,
TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_sha_arctic_snowstorm::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 114052 - Ascendance (Restoration)
class spell_sha_ascendance_restoration : public AuraScript
{
@@ -1866,8 +1889,32 @@ class spell_sha_windspeakers_lava_resurgence : public SpellScript
}
};
// 462767 - Arctic Snowstorm
// 36797 - AreatriggerId
struct areatrigger_sha_arctic_snowstorm : AreaTriggerAI
{
using AreaTriggerAI::AreaTriggerAI;
void OnUnitEnter(Unit* unit) override
{
if (Unit* caster = at->GetCaster())
{
if (unit->GetAura(SPELL_SHAMAN_FROST_SHOCK, caster->GetGUID()))
return;
if (caster->IsValidAttackTarget(unit))
caster->CastSpell(unit, SPELL_SHAMAN_ARCTIC_SNOWSTORM_SLOW, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
}
}
void OnUnitExit(Unit* unit) override
{
unit->RemoveAurasDueToSpell(SPELL_SHAMAN_ARCTIC_SNOWSTORM_SLOW, at->GetCasterGuid());
}
};
// 192078 - Wind Rush Totem (Spell)
// 12676 - AreaTriggerId
// 12676 - AreaTriggerId
struct areatrigger_sha_wind_rush_totem : AreaTriggerAI
{
static constexpr uint32 REFRESH_TIME = 4500;
@@ -1915,6 +1962,7 @@ void AddSC_shaman_spell_scripts()
RegisterSpellScript(spell_sha_aftershock);
RegisterSpellScript(spell_sha_ancestral_guidance);
RegisterSpellScript(spell_sha_ancestral_guidance_heal);
RegisterSpellScript(spell_sha_arctic_snowstorm);
RegisterSpellScript(spell_sha_ascendance_restoration);
RegisterSpellScript(spell_sha_chain_lightning);
RegisterSpellScript(spell_sha_chain_lightning_overload);
@@ -1967,5 +2015,6 @@ void AddSC_shaman_spell_scripts()
RegisterSpellScript(spell_sha_windfury_weapon);
RegisterSpellScript(spell_sha_windfury_weapon_proc);
RegisterSpellScript(spell_sha_windspeakers_lava_resurgence);
RegisterAreaTriggerAI(areatrigger_sha_arctic_snowstorm);
RegisterAreaTriggerAI(areatrigger_sha_wind_rush_totem);
}