aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraquadeus <95978183+aquadeus@users.noreply.github.com>2021-12-18 11:24:10 +0100
committerGitHub <noreply@github.com>2021-12-18 11:24:10 +0100
commitda8d6b5180a586f2cbf8ea4e859a1d5336ea8336 (patch)
treeff88652ccd8298fbe7e7838d1efc56b2c36f268e /src
parent635b1721d602f135fea8abbd6671917987b050b6 (diff)
Scripts/Spells: Fix Incanters Flow (#27395)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index af4d3b66985..d56ee711aee 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -56,6 +56,7 @@ enum MageSpells
SPELL_MAGE_ICE_BARRIER = 11426,
SPELL_MAGE_ICE_BLOCK = 45438,
SPELL_MAGE_IGNITE = 12654,
+ SPELL_MAGE_INCANTERS_FLOW = 116267,
SPELL_MAGE_LIVING_BOMB_EXPLOSION = 44461,
SPELL_MAGE_LIVING_BOMB_PERIODIC = 217694,
SPELL_MAGE_MANA_SURGE = 37445,
@@ -724,6 +725,48 @@ class spell_mage_imp_mana_gems : public AuraScript
}
};
+// 1463 - Incanter's Flow
+class spell_mage_incanters_flow : public AuraScript
+{
+ PrepareAuraScript(spell_mage_incanters_flow);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_MAGE_INCANTERS_FLOW });
+ }
+
+ void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ // Incanter's flow should not cycle out of combat
+ if (!GetTarget()->IsInCombat())
+ return;
+
+ if (Aura* aura = GetTarget()->GetAura(SPELL_MAGE_INCANTERS_FLOW))
+ {
+ uint32 stacks = aura->GetStackAmount();
+
+ // Force always to values between 1 and 5
+ if ((modifier == -1 && stacks == 1) || (modifier == 1 && stacks == 5))
+ {
+ modifier *= -1;
+ return;
+ }
+
+ aura->ModStackAmount(modifier);
+ }
+ else
+ GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTERS_FLOW, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_incanters_flow::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+
+private:
+ int8 modifier = 1;
+};
+
// 44457 - Living Bomb
class spell_mage_living_bomb : public SpellScript
{
@@ -1118,6 +1161,7 @@ void AddSC_mage_spell_scripts()
RegisterSpellScript(spell_mage_ice_lance_damage);
RegisterAuraScript(spell_mage_ignite);
RegisterAuraScript(spell_mage_imp_mana_gems);
+ RegisterAuraScript(spell_mage_incanters_flow);
RegisterSpellScript(spell_mage_living_bomb);
RegisterSpellScript(spell_mage_living_bomb_explosion);
RegisterAuraScript(spell_mage_living_bomb_periodic);