aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2024-09-12 16:24:49 +0200
committerGitHub <noreply@github.com>2024-09-12 16:24:49 +0200
commit58668b4de1cf3ca1974d5ecdea0cfa44e953c29d (patch)
treed4e588fd64816abf635e7350a70d4f635c08d498
parent75385afded3806f850cce0bd64f72cc9d806a9e0 (diff)
Scripts/Spells: Implement shaman talent Arctic Snowstorm (#30178)
-rw-r--r--sql/updates/world/master/2024_09_12_00_world.sql20
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp51
2 files changed, 70 insertions, 1 deletions
diff --git a/sql/updates/world/master/2024_09_12_00_world.sql b/sql/updates/world/master/2024_09_12_00_world.sql
new file mode 100644
index 00000000000..86cb8ed78db
--- /dev/null
+++ b/sql/updates/world/master/2024_09_12_00_world.sql
@@ -0,0 +1,20 @@
+SET @ATID := 36797;
+
+-- Serverside Areatrigger
+DELETE FROM `areatrigger_create_properties` WHERE `Id`=34472 AND `IsCustom`=0;
+INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTarget`, `TimeToTargetScale`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
+(34472, 0, @ATID, 1, 4, 0, 0, 0, 0, -1, 0, 0, NULL, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 'areatrigger_sha_arctic_snowstorm', 0);
+
+DELETE FROM `areatrigger_template` WHERE `Id`=@ATID AND `IsCustom`=1;
+INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `Flags`, `ActionSetId`, `ActionSetFlags`, `VerifiedBuild`) VALUES
+(@ATID, 1, 1, 0, 0, 0);
+
+-- Proc
+DELETE FROM `spell_proc` WHERE `SpellId` IN (462764);
+INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
+(462764,0x0,11,0x80000000,0x00000000,0x00000000,0x00000000,0x0,0x0,0x1,0x2,0x0,0x0,0x0,0,0,0,0); -- Arctic Snowstorm
+
+-- Spells
+DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_sha_arctic_snowstorm';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(462764, 'spell_sha_arctic_snowstorm');
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index a48072df244..1905205b24e 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -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);
}