mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 04:59:41 -04:00
Core/Scripts: Convert spells to new proc system
- Converted Unit::HandleDummyAuraProc function to AuraScripts * Extra: DMC: Madness now uses DB texts. yay! * Extra: improvements on Imp. Spell Reflection (range and max targets, filter caster with conditions) - Fixed Glyph of Succubus. (Closes #6599) - Changed old (not-blizz) behavior of Vampiric Embrace: * Before: party heal affected the priest too and self heal was reduced by that amount to not over-heal * Now: self heal amount not affected, rather filter the priest out of the party heal using conditions :) - Solve bug in AQ 3p set bonus, it should only trigger when healing others, not self heals. - Priest T10 2p bonus (heal) now rolls its effect properly - Use brand new GetEffectiveHeal to fix #17142 - While we're at it, also close #17034 for good - Converted Unit::HandleAuraProc function to AuraScripts (#17941) - Converted Unit::HandleAuraProc function to AuraScripts (cont'd) (#17955) - Corrected Flametongue weapon damage formula - Actually check offhand weapon for flametongue in Lava Lash script - Implemented halved proc chance for Missile Barrage on Arcane Barrage, Fireball, Frostbolt and Frostfire Bolt cast - Converted Unit::HandleProcTriggerSpell function to AuraScripts (#17956) - De-hack Earth shield. Fixes #13808 - Updated Honor among Thieves - Implemented mana proc for Mark of Conquest in case of ranged attack - Fixed Scent of Blood giving more stacks than the talent rank currently learnt. - Ported old proc table. Proc system is dead. Long live the proc system! - Recklessness should get charges removed per cast. Closes #15529 - Use proc system to remove Molten Core charges on Incinerate/Soul Fire cast. Closes #15942 Closes #3463 Closes #5401 Closes #15595 Closes #15974 Closes #16679 Closes #17925
This commit is contained in:
@@ -50,6 +50,20 @@ enum MageSpells
|
||||
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT = 70908,
|
||||
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907,
|
||||
SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126,
|
||||
SPELL_MAGE_CHILLED = 12484,
|
||||
SPELL_MAGE_MANA_SURGE = 37445,
|
||||
SPELL_MAGE_MAGIC_ABSORPTION_MANA = 29442,
|
||||
SPELL_MAGE_ARCANE_POTENCY_RANK_1 = 57529,
|
||||
SPELL_MAGE_ARCANE_POTENCY_RANK_2 = 57531,
|
||||
SPELL_MAGE_HOT_STREAK_PROC = 48108,
|
||||
SPELL_MAGE_ARCANE_SURGE = 37436,
|
||||
SPELL_MAGE_COMBUSTION_PROC = 28682,
|
||||
SPELL_MAGE_EMPOWERED_FIRE_PROC = 67545,
|
||||
SPELL_MAGE_T10_2P_BONUS = 70752,
|
||||
SPELL_MAGE_T10_2P_BONUS_EFFECT = 70753,
|
||||
SPELL_MAGE_T8_4P_BONUS = 64869,
|
||||
SPELL_MAGE_MISSILE_BARRAGE = 44401,
|
||||
SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA = 44544
|
||||
};
|
||||
|
||||
enum MageSpellIcons
|
||||
@@ -82,6 +96,46 @@ class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// -31571 - Arcane Potency
|
||||
class spell_mage_arcane_potency : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_arcane_potency() : SpellScriptLoader("spell_mage_arcane_potency") { }
|
||||
|
||||
class spell_mage_arcane_potency_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_arcane_potency_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_POTENCY_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_POTENCY_RANK_2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
static uint32 const triggerSpell[2] = { SPELL_MAGE_ARCANE_POTENCY_RANK_1, SPELL_MAGE_ARCANE_POTENCY_RANK_2 };
|
||||
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1];
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_arcane_potency_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_arcane_potency_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -11113 - Blast Wave
|
||||
class spell_mage_blast_wave : public SpellScriptLoader
|
||||
{
|
||||
@@ -153,6 +207,38 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// -54747 - Burning Determination
|
||||
// 54748 - Burning Determination
|
||||
class spell_mage_burning_determination : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_burning_determination() : SpellScriptLoader("spell_mage_burning_determination") { }
|
||||
|
||||
class spell_mage_burning_determination_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_burning_determination_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||
if (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_INTERRUPT) | (1 << MECHANIC_SILENCE)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mage_burning_determination_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_burning_determination_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -44449 - Burnout
|
||||
class spell_mage_burnout : public SpellScriptLoader
|
||||
{
|
||||
@@ -235,6 +321,208 @@ class spell_mage_cold_snap : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 11129 - Combustion
|
||||
class spell_mage_combustion : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_combustion() : SpellScriptLoader("spell_mage_combustion") { }
|
||||
|
||||
class spell_mage_combustion_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_combustion_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_COMBUSTION_PROC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Do not take charges, add a stack of crit buff
|
||||
if (!(eventInfo.GetHitMask() & PROC_HIT_CRITICAL))
|
||||
{
|
||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MAGE_COMBUSTION_PROC, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mage_combustion_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_combustion_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -11185 - Improved Blizzard
|
||||
class spell_mage_imp_blizzard : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_imp_blizzard() : SpellScriptLoader("spell_mage_imp_blizzard") { }
|
||||
|
||||
class spell_mage_imp_blizzard_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_imp_blizzard_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleChill(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
uint32 triggerSpellId = sSpellMgr->GetSpellWithRank(SPELL_MAGE_CHILLED, GetSpellInfo()->GetRank());
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), triggerSpellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_imp_blizzard_AuraScript::HandleChill, EFFECT_0, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_imp_blizzard_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 37447 - Improved Mana Gems
|
||||
// 61062 - Improved Mana Gems
|
||||
class spell_mage_imp_mana_gems : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_imp_mana_gems() : SpellScriptLoader("spell_mage_imp_mana_gems") { }
|
||||
|
||||
class spell_mage_imp_mana_gems_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_imp_mana_gems_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_MANA_SURGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MAGE_MANA_SURGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_imp_mana_gems_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_imp_mana_gems_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -31656 - Empowered Fire
|
||||
class spell_mage_empowered_fire : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_empowered_fire() : SpellScriptLoader("spell_mage_empowered_fire") { }
|
||||
|
||||
class spell_mage_empowered_fire_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_empowered_fire_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_EMPOWERED_FIRE_PROC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||
if (spellInfo->Id == SPELL_MAGE_IGNITE)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* target = GetTarget();
|
||||
int32 bp0 = int32(CalculatePct(target->GetCreateMana(), aurEff->GetAmount()));
|
||||
target->CastCustomSpell(SPELL_MAGE_EMPOWERED_FIRE_PROC, SPELLVALUE_BASE_POINT0, bp0, target, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mage_empowered_fire_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_empowered_fire_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_empowered_fire_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 74396 - Fingers of Frost
|
||||
class spell_mage_fingers_of_frost : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_fingers_of_frost() : SpellScriptLoader("spell_mage_fingers_of_frost") { }
|
||||
|
||||
class spell_mage_fingers_of_frost_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_fingers_of_frost_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->RemoveAuraFromStack(GetId());
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_fingers_of_frost_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_fingers_of_frost_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_fingers_of_frost_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -543 - Fire Ward
|
||||
// -6143 - Frost Ward
|
||||
class spell_mage_fire_frost_ward : public SpellScriptLoader
|
||||
@@ -354,6 +642,222 @@ class spell_mage_focus_magic : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 44401 - Missile Barrage
|
||||
// 48108 - Hot Streak
|
||||
// 57761 - Fireball!
|
||||
class spell_mage_gen_extra_effects : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_gen_extra_effects() : SpellScriptLoader("spell_mage_gen_extra_effects") { }
|
||||
|
||||
class spell_mage_gen_extra_effects_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_gen_extra_effects_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_T10_2P_BONUS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_T10_2P_BONUS_EFFECT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_T8_4P_BONUS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
// Prevent double proc for Arcane missiles
|
||||
if (caster == eventInfo.GetProcTarget())
|
||||
return false;
|
||||
|
||||
// Proc chance is unknown, we'll just use dummy aura amount
|
||||
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_MAGE_T8_4P_BONUS, EFFECT_0))
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
|
||||
if (caster->HasAura(SPELL_MAGE_T10_2P_BONUS))
|
||||
caster->CastSpell((Unit*)nullptr, SPELL_MAGE_T10_2P_BONUS_EFFECT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mage_gen_extra_effects_AuraScript::CheckProc);
|
||||
OnProc += AuraProcFn(spell_mage_gen_extra_effects_AuraScript::HandleProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_gen_extra_effects_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 56375 - Glyph of Polymorph
|
||||
class spell_mage_glyph_of_polymorph : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_glyph_of_polymorph() : SpellScriptLoader("spell_mage_glyph_of_polymorph") { }
|
||||
|
||||
class spell_mage_glyph_of_polymorph_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_glyph_of_polymorph_AuraScript);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, ObjectGuid::Empty, target->GetAura(32409)); // SW:D shall not be removed.
|
||||
target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
|
||||
target->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_polymorph_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_glyph_of_polymorph_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 56374 - Glyph of Icy Veins
|
||||
class spell_mage_glyph_of_icy_veins : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_glyph_of_icy_veins() : SpellScriptLoader("spell_mage_glyph_of_icy_veins") { }
|
||||
|
||||
class spell_mage_glyph_of_icy_veins_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_glyph_of_icy_veins_AuraScript);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->RemoveAurasByType(SPELL_AURA_HASTE_SPELLS, ObjectGuid::Empty, 0, true, false);
|
||||
caster->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_icy_veins_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_glyph_of_icy_veins_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 56372 - Glyph of Ice Block
|
||||
class spell_mage_glyph_of_ice_block : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_glyph_of_ice_block() : SpellScriptLoader("spell_mage_glyph_of_ice_block") { }
|
||||
|
||||
class spell_mage_glyph_of_ice_block_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_glyph_of_ice_block_AuraScript);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* cdSpell = sSpellMgr->GetSpellInfo(itr->first);
|
||||
if (!cdSpell || cdSpell->SpellFamilyName != SPELLFAMILY_MAGE
|
||||
|| !(cdSpell->SpellFamilyFlags[0] & 0x00000040))
|
||||
return false;
|
||||
return true;
|
||||
}, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_ice_block_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_glyph_of_ice_block_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -44445 - Hot Streak
|
||||
class spell_mage_hot_streak : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_hot_streak() : SpellScriptLoader("spell_mage_hot_streak") { }
|
||||
|
||||
class spell_mage_hot_streak_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_hot_streak_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_HOT_STREAK_PROC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
AuraEffect* counter = GetEffect(EFFECT_1);
|
||||
if (!counter)
|
||||
return;
|
||||
|
||||
// Count spell criticals in a row in second aura
|
||||
if (eventInfo.GetHitMask() & PROC_HIT_CRITICAL)
|
||||
{
|
||||
counter->SetAmount(counter->GetAmount() * 2);
|
||||
if (counter->GetAmount() < 100) // not enough
|
||||
return;
|
||||
|
||||
// roll chance
|
||||
if (!roll_chance_i(aurEff->GetAmount()))
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell(caster, SPELL_MAGE_HOT_STREAK_PROC, true);
|
||||
}
|
||||
|
||||
// reset counter
|
||||
counter->SetAmount(25);
|
||||
}
|
||||
|
||||
void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
// Prevent console spam
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_hot_streak_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_hot_streak_AuraScript::HandleDummy, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_hot_streak_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -11426 - Ice Barrier
|
||||
class spell_mage_ice_barrier : public SpellScriptLoader
|
||||
{
|
||||
@@ -502,6 +1006,43 @@ class spell_mage_living_bomb : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -29441 - Magic Absorption
|
||||
class spell_mage_magic_absorption : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_magic_absorption() : SpellScriptLoader("spell_mage_magic_absorption") { }
|
||||
|
||||
class spell_mage_magic_absorption_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_magic_absorption_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_MAGIC_ABSORPTION_MANA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActionTarget();
|
||||
int32 bp = CalculatePct(static_cast<int32>(caster->GetMaxPower(POWER_MANA)), aurEff->GetAmount());
|
||||
caster->CastCustomSpell(SPELL_MAGE_MAGIC_ABSORPTION_MANA, SPELLVALUE_BASE_POINT0, bp, caster, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_magic_absorption_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_magic_absorption_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -1463 - Mana Shield
|
||||
class spell_mage_mana_shield : public SpellScriptLoader
|
||||
{
|
||||
@@ -512,6 +1053,14 @@ class spell_mage_mana_shield : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_mage_mana_shield_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!spell_mage_incanters_absorbtion_base_AuraScript::Validate(spellInfo) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_SURGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
|
||||
{
|
||||
canBeRecalculated = false;
|
||||
@@ -527,10 +1076,18 @@ class spell_mage_mana_shield : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
Unit* caster = eventInfo.GetActionTarget();
|
||||
caster->CastSpell(caster, SPELL_MAGE_ARCANE_SURGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_mana_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MANA_SHIELD);
|
||||
AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield_AuraScript::Trigger, EFFECT_0);
|
||||
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_mana_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MANA_SHIELD);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -586,6 +1143,42 @@ class spell_mage_master_of_elements : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -44404 - Missile Barrage
|
||||
class spell_mage_missile_barrage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_missile_barrage() : SpellScriptLoader("spell_mage_missile_barrage") { }
|
||||
|
||||
class spell_mage_missile_barrage_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_missile_barrage_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
// Arcane Blast - full chance
|
||||
if (spellInfo->SpellFamilyFlags[0] & 0x20000000)
|
||||
return true;
|
||||
|
||||
// Rest of spells have half chance
|
||||
return roll_chance_i(50);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mage_missile_barrage_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mage_missile_barrage_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum SilvermoonPolymorph
|
||||
{
|
||||
NPC_AUROSALIA = 18744,
|
||||
@@ -683,17 +1276,31 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader
|
||||
|
||||
void AddSC_mage_spell_scripts()
|
||||
{
|
||||
new spell_mage_arcane_potency();
|
||||
new spell_mage_blast_wave();
|
||||
new spell_mage_blazing_speed();
|
||||
new spell_mage_burning_determination();
|
||||
new spell_mage_burnout();
|
||||
new spell_mage_cold_snap();
|
||||
new spell_mage_combustion();
|
||||
new spell_mage_imp_blizzard();
|
||||
new spell_mage_imp_mana_gems();
|
||||
new spell_mage_empowered_fire();
|
||||
new spell_mage_fingers_of_frost();
|
||||
new spell_mage_fire_frost_ward();
|
||||
new spell_mage_focus_magic();
|
||||
new spell_mage_gen_extra_effects();
|
||||
new spell_mage_glyph_of_polymorph();
|
||||
new spell_mage_glyph_of_icy_veins();
|
||||
new spell_mage_glyph_of_ice_block();
|
||||
new spell_mage_hot_streak();
|
||||
new spell_mage_ice_barrier();
|
||||
new spell_mage_ignite();
|
||||
new spell_mage_living_bomb();
|
||||
new spell_mage_magic_absorption();
|
||||
new spell_mage_mana_shield();
|
||||
new spell_mage_master_of_elements();
|
||||
new spell_mage_missile_barrage();
|
||||
new spell_mage_polymorph_cast_visual();
|
||||
new spell_mage_summon_water_elemental();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user