mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Spells: Fix Incanters Flow (#27395)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_incanters_flow';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(1463,'spell_mage_incanters_flow');
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user