diff options
-rw-r--r-- | sql/updates/world/master/2021_10_03_06_world_shaman_wind_rush_totem.sql | 11 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 47 |
2 files changed, 58 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_10_03_06_world_shaman_wind_rush_totem.sql b/sql/updates/world/master/2021_10_03_06_world_shaman_wind_rush_totem.sql new file mode 100644 index 00000000000..58f5f4ddb45 --- /dev/null +++ b/sql/updates/world/master/2021_10_03_06_world_shaman_wind_rush_totem.sql @@ -0,0 +1,11 @@ +-- +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=97285; +DELETE FROM `smart_scripts` WHERE `entryorguid`=97285 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `action_type`, `action_param1`, `target_type`, `comment`) VALUES +(97285, 0, 0, 0, 25, 11, 192078, 1, 'On Reset - Cast Spell Wind Rush Totem - Self'); + +UPDATE `areatrigger_template` SET `ScriptName`='areatrigger_sha_wind_rush_totem', `VerifiedBuild`=40120 WHERE `Id`=12676; + +DELETE FROM `areatrigger_create_properties` WHERE `Id`=8537; +INSERT INTO `areatrigger_create_properties` (`Id`, `AreaTriggerId`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `TimeToTarget`, `TimeToTargetScale`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `VerifiedBuild`) VALUES +(8537, 12676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 40120); -- SpellId : 192078 diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 543b93187d8..362e0ee04d6 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -22,6 +22,7 @@ */ #include "ScriptMgr.h" +#include "AreaTriggerAI.h" #include "CellImpl.h" #include "CreatureAIImpl.h" // for RAND() #include "GridNotifiersImpl.h" @@ -76,6 +77,7 @@ enum ShamanSpells SPELL_SHAMAN_TOTEMIC_POWER_ATTACK_POWER = 28826, SPELL_SHAMAN_TOTEMIC_POWER_ARMOR = 28827, SPELL_SHAMAN_WINDFURY_ATTACK = 25504, + SPELL_SHAMAN_WIND_RUSH = 192082, }; enum MiscSpells @@ -1435,6 +1437,50 @@ public: } }; +// 192078 - Wind Rush Totem (Spell) +// 12676 - AreaTriggerId +struct areatrigger_sha_wind_rush_totem : AreaTriggerAI +{ + static constexpr uint32 REFRESH_TIME = 4500; + + areatrigger_sha_wind_rush_totem(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger), _refreshTimer(REFRESH_TIME) { } + + void OnUpdate(uint32 diff) override + { + _refreshTimer -= diff; + if (_refreshTimer <= 0) + { + if (Unit* caster = at->GetCaster()) + { + for (ObjectGuid const& guid : at->GetInsideUnits()) + { + if (Unit* unit = ObjectAccessor::GetUnit(*caster, guid)) + { + if (!caster->IsFriendlyTo(unit)) + continue; + + caster->CastSpell(unit, SPELL_SHAMAN_WIND_RUSH, true); + } + } + } + _refreshTimer += REFRESH_TIME; + } + } + + void OnUnitEnter(Unit* unit) override + { + if (Unit* caster = at->GetCaster()) + { + if (!caster->IsFriendlyTo(unit)) + return; + + caster->CastSpell(unit, SPELL_SHAMAN_WIND_RUSH, true); + } + } +private: + int32 _refreshTimer; +}; + void AddSC_shaman_spell_scripts() { new spell_sha_ancestral_guidance(); @@ -1469,4 +1515,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_t10_elemental_4p_bonus(); new spell_sha_t10_restoration_4p_bonus(); new spell_sha_windfury(); + RegisterAreaTriggerAI(areatrigger_sha_wind_rush_totem); } |