aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp47
1 files changed, 47 insertions, 0 deletions
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);
}