mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 14:10:18 -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:
@@ -17,17 +17,19 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "hyjal.h"
|
||||
#include "hyjal_trash.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CARRION_SWARM = 31306,
|
||||
SPELL_SLEEP = 31298,
|
||||
SPELL_VAMPIRIC_AURA = 38196,
|
||||
SPELL_INFERNO = 31299,
|
||||
SPELL_IMMOLATION = 31303,
|
||||
SPELL_INFERNO_EFFECT = 31302,
|
||||
SPELL_CARRION_SWARM = 31306,
|
||||
SPELL_SLEEP = 31298,
|
||||
SPELL_VAMPIRIC_AURA = 38196,
|
||||
SPELL_VAMPIRIC_AURA_HEAL = 31285,
|
||||
SPELL_INFERNO = 31299,
|
||||
SPELL_IMMOLATION = 31303,
|
||||
SPELL_INFERNO_EFFECT = 31302
|
||||
};
|
||||
|
||||
enum Texts
|
||||
@@ -261,8 +263,48 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class spell_anetheron_vampiric_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_anetheron_vampiric_aura() : SpellScriptLoader("spell_anetheron_vampiric_aura") { }
|
||||
|
||||
class spell_anetheron_vampiric_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_anetheron_vampiric_aura_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_AURA_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
int32 bp = damageInfo->GetDamage() * 3;
|
||||
eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_anetheron_vampiric_aura_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_anetheron_vampiric_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_anetheron()
|
||||
{
|
||||
new boss_anetheron();
|
||||
new npc_towering_infernal();
|
||||
new spell_anetheron_vampiric_aura();
|
||||
}
|
||||
|
||||
@@ -1498,6 +1498,26 @@ class spell_taldaram_ball_of_inferno_flame : public SpellScriptLoader
|
||||
{
|
||||
return new spell_taldaram_ball_of_inferno_flame_SpellScript();
|
||||
}
|
||||
|
||||
class spell_taldaram_ball_of_inferno_flame_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_taldaram_ball_of_inferno_flame_AuraScript);
|
||||
|
||||
void HandleStackDrop(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnProc += AuraProcFn(spell_taldaram_ball_of_inferno_flame_AuraScript::HandleStackDrop);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_taldaram_ball_of_inferno_flame_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 72080 - Kinetic Bomb (Valanar)
|
||||
|
||||
@@ -431,7 +431,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
case 72445:
|
||||
case 72446:
|
||||
if (me->GetPower(POWER_ENERGY) != me->GetMaxPower(POWER_ENERGY))
|
||||
target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, me, true);
|
||||
target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, (Unit*)nullptr, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1135,8 +1135,7 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex); // make this the default handler
|
||||
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true);
|
||||
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1151,6 +1150,41 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 72176 - Blood Beast's Blood Link
|
||||
class spell_deathbringer_blood_beast_blood_link : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_deathbringer_blood_beast_blood_link() : SpellScriptLoader("spell_deathbringer_blood_beast_blood_link") { }
|
||||
|
||||
class spell_deathbringer_blood_beast_blood_link_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_deathbringer_blood_beast_blood_link_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BLOOD_LINK_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetProcTarget()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 3, (Unit*)nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_deathbringer_blood_beast_blood_link_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_deathbringer_blood_beast_blood_link_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_deathbringer_blood_nova : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1170,8 +1204,7 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex); // make this the default handler
|
||||
if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY))
|
||||
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true);
|
||||
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1349,6 +1382,7 @@ void AddSC_boss_deathbringer_saurfang()
|
||||
new spell_deathbringer_blood_link_aura();
|
||||
new spell_deathbringer_blood_power();
|
||||
new spell_deathbringer_rune_of_blood();
|
||||
new spell_deathbringer_blood_beast_blood_link();
|
||||
new spell_deathbringer_blood_nova();
|
||||
new spell_deathbringer_blood_nova_targeting();
|
||||
new spell_deathbringer_boiling_blood();
|
||||
|
||||
@@ -838,9 +838,23 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
void HandleProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
uint32 stack = GetStackAmount();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
|
||||
int32 const mod = caster->GetMap()->Is25ManRaid() ? 1500 : 1250;
|
||||
int32 dmg = 0;
|
||||
for (uint8 i = 1; i <= stack; ++i)
|
||||
dmg += mod * i;
|
||||
|
||||
caster->CastCustomSpell(SPELL_EXPUNGED_GAS, SPELLVALUE_BASE_POINT0, dmg);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_putricide_gaseous_bloat_AuraScript::HandleExtraEffect, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
OnProc += AuraProcFn(spell_putricide_gaseous_bloat_AuraScript::HandleProc);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1078,6 +1092,45 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 71770 - Ooze Spell Tank Protection
|
||||
class spell_putricide_ooze_tank_protection : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_putricide_ooze_tank_protection() : SpellScriptLoader("spell_putricide_ooze_tank_protection") { }
|
||||
|
||||
class spell_putricide_ooze_tank_protection_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_putricide_ooze_tank_protection_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell) ||
|
||||
!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* actionTarget = eventInfo.GetActionTarget();
|
||||
actionTarget->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_putricide_ooze_tank_protection_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
OnEffectProc += AuraEffectProcFn(spell_putricide_ooze_tank_protection_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_putricide_ooze_tank_protection_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_putricide_choking_gas_bomb : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1602,6 +1655,7 @@ void AddSC_boss_professor_putricide()
|
||||
new spell_putricide_slime_puddle_aura();
|
||||
new spell_putricide_unstable_experiment();
|
||||
new spell_putricide_ooze_eruption_searcher();
|
||||
new spell_putricide_ooze_tank_protection();
|
||||
new spell_putricide_choking_gas_bomb();
|
||||
new spell_putricide_unbound_plague();
|
||||
new spell_putricide_eat_ooze();
|
||||
|
||||
@@ -1189,7 +1189,8 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
}
|
||||
else
|
||||
{
|
||||
me->DealHeal(me, me->CountPctFromMaxHealth(5));
|
||||
// looks totally hacky to me
|
||||
me->ModifyHealth(me->CountPctFromMaxHealth(5));
|
||||
_events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2037,11 +2037,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader
|
||||
void TriggerDamageSpellFromPlayer()
|
||||
{
|
||||
if (Player* hitTarget = GetHitPlayer())
|
||||
{
|
||||
// There is some proc in this spell I have absolutely no idea of use, but just in case...
|
||||
TriggerCastFlags triggerFlags = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_DISALLOW_PROC_EVENTS);
|
||||
hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, triggerFlags, NULL, NULL, GetCaster()->GetGUID());
|
||||
}
|
||||
hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, true, nullptr, nullptr, GetCaster()->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1063,6 +1063,51 @@ class spell_xt002_submerged : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_xt002_321_boombot_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_xt002_321_boombot_aura() : SpellScriptLoader("spell_xt002_321_boombot_aura") { }
|
||||
|
||||
class spell_xt002_321_boombot_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_321_boombot_aura_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (eventInfo.GetActionTarget()->GetEntry() != NPC_XS013_SCRAPBOT)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
InstanceScript* instance = eventInfo.GetActor()->GetInstanceScript();
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->DoCastSpellOnPlayers(SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_xt002_321_boombot_aura_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_xt002_321_boombot_aura_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_xt002_321_boombot_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_nerf_engineering : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
@@ -1122,6 +1167,7 @@ void AddSC_boss_xt002()
|
||||
new spell_xt002_heart_overload_periodic();
|
||||
new spell_xt002_tympanic_tantrum();
|
||||
new spell_xt002_submerged();
|
||||
new spell_xt002_321_boombot_aura();
|
||||
|
||||
new achievement_nerf_engineering();
|
||||
new achievement_heartbreaker();
|
||||
|
||||
@@ -2750,6 +2750,7 @@ class spell_yogg_saron_grim_reprisal : public SpellScriptLoader // 63305
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 damage = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), 60);
|
||||
GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetDamageInfo()->GetAttacker(), true, NULL, aurEff);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,11 @@ class spell_ingvar_woe_strike : public SpellScriptLoader
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return eventInfo.GetHealInfo()->GetHeal() != 0;
|
||||
HealInfo* healInfo = eventInfo.GetHealInfo();
|
||||
if (!healInfo || !healInfo->GetHeal())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
|
||||
@@ -191,6 +191,57 @@ class spell_fixate : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum SecondWind
|
||||
{
|
||||
SPELL_SECOND_WIND_TRIGGER = 42771
|
||||
};
|
||||
|
||||
// 42770 - Second Wind
|
||||
class spell_uk_second_wind : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_uk_second_wind() : SpellScriptLoader("spell_uk_second_wind") { }
|
||||
|
||||
class spell_uk_second_wind_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_uk_second_wind_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SECOND_WIND_TRIGGER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActionTarget();
|
||||
caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_uk_second_wind_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_uk_second_wind_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_uk_second_wind_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum EnslavedProtoDrake
|
||||
{
|
||||
TYPE_PROTODRAKE_AT = 28,
|
||||
@@ -301,4 +352,5 @@ void AddSC_utgarde_keep()
|
||||
new npc_enslaved_proto_drake();
|
||||
new spell_ticking_time_bomb();
|
||||
new spell_fixate();
|
||||
new spell_uk_second_wind();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MARK_OF_MALICE_TRIGGERED = 33494
|
||||
};
|
||||
|
||||
class spell_mark_of_malice : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mark_of_malice() : SpellScriptLoader("spell_mark_of_malice") { }
|
||||
|
||||
class spell_mark_of_malice_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_malice_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_MALICE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
// just drop charges
|
||||
if (aurEff->GetBase()->GetCharges() > 1)
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_mark_of_malice_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_mark_of_malice_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_shadow_labyrinth()
|
||||
{
|
||||
new spell_mark_of_malice();
|
||||
}
|
||||
@@ -34,16 +34,17 @@ enum Texts
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOW_VOLLEY = 32963,
|
||||
SPELL_CLEAVE = 31779,
|
||||
SPELL_THUNDERCLAP = 36706,
|
||||
SPELL_VOID_BOLT = 39329,
|
||||
SPELL_MARK_OF_KAZZAK = 32960,
|
||||
SPELL_MARK_OF_KAZZAK_DAMAGE = 32961,
|
||||
SPELL_ENRAGE = 32964,
|
||||
SPELL_CAPTURE_SOUL = 32966,
|
||||
SPELL_TWISTED_REFLECTION = 21063,
|
||||
SPELL_BERSERK = 32965,
|
||||
SPELL_SHADOW_VOLLEY = 32963,
|
||||
SPELL_CLEAVE = 31779,
|
||||
SPELL_THUNDERCLAP = 36706,
|
||||
SPELL_VOID_BOLT = 39329,
|
||||
SPELL_MARK_OF_KAZZAK = 32960,
|
||||
SPELL_MARK_OF_KAZZAK_DAMAGE = 32961,
|
||||
SPELL_ENRAGE = 32964,
|
||||
SPELL_CAPTURE_SOUL = 32966,
|
||||
SPELL_TWISTED_REFLECTION = 21063,
|
||||
SPELL_TWISTED_REFLECTION_HEAL = 21064,
|
||||
SPELL_BERSERK = 32965,
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -222,8 +223,47 @@ class spell_mark_of_kazzak : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_twisted_reflection : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_twisted_reflection() : SpellScriptLoader("spell_twisted_reflection") { }
|
||||
|
||||
class spell_twisted_reflection_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_twisted_reflection_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TWISTED_REFLECTION_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), SPELL_TWISTED_REFLECTION_HEAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_twisted_reflection_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_twisted_reflection_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_doomlordkazzak()
|
||||
{
|
||||
new boss_doomlord_kazzak();
|
||||
new spell_mark_of_kazzak();
|
||||
new spell_twisted_reflection();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ void AddSC_boss_ambassador_hellmaw();
|
||||
void AddSC_boss_blackheart_the_inciter();
|
||||
void AddSC_boss_grandmaster_vorpil();
|
||||
void AddSC_boss_murmur();
|
||||
void AddSC_shadow_labyrinth();
|
||||
void AddSC_instance_shadow_labyrinth();
|
||||
|
||||
// Black Temple
|
||||
@@ -159,6 +160,7 @@ void AddOutlandScripts()
|
||||
AddSC_boss_blackheart_the_inciter();
|
||||
AddSC_boss_grandmaster_vorpil();
|
||||
AddSC_boss_murmur();
|
||||
AddSC_shadow_labyrinth();
|
||||
AddSC_instance_shadow_labyrinth();
|
||||
|
||||
// Black Temple
|
||||
|
||||
@@ -35,6 +35,17 @@ enum HunterCreatures
|
||||
NPC_HUNTER_VIPER = 19921
|
||||
};
|
||||
|
||||
enum PetSpellsMisc
|
||||
{
|
||||
SPELL_PET_GUARD_DOG_HAPPINESS = 54445,
|
||||
SPELL_PET_SILVERBACK_RANK_1 = 62800,
|
||||
SPELL_PET_SILVERBACK_RANK_2 = 62801,
|
||||
PET_ICON_ID_GROWL = 201,
|
||||
PET_ICON_ID_CLAW = 262,
|
||||
PET_ICON_ID_BITE = 1680,
|
||||
PET_ICON_ID_SMACK = 473
|
||||
};
|
||||
|
||||
class npc_pet_hunter_snake_trap : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -139,7 +150,156 @@ class npc_pet_hunter_snake_trap : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
// -53178 - Guard Dog
|
||||
class spell_pet_guard_dog : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pet_guard_dog() : SpellScriptLoader("spell_pet_guard_dog") { }
|
||||
|
||||
class spell_pet_guard_dog_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pet_guard_dog_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Growl shares family flags with other spells
|
||||
// filter by spellIcon instead
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true);
|
||||
|
||||
float addThreat = CalculatePct(eventInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount());
|
||||
eventInfo.GetProcTarget()->AddThreat(caster, addThreat);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_pet_guard_dog_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pet_guard_dog_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pet_guard_dog_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -62764 - Silverback
|
||||
class spell_pet_silverback : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pet_silverback() : SpellScriptLoader("spell_pet_silverback") { }
|
||||
|
||||
class spell_pet_silverback_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pet_silverback_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Growl shares family flags with other spells
|
||||
// filter by spellIcon instead
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
static uint32 const triggerSpell[2] = { SPELL_PET_SILVERBACK_RANK_1, SPELL_PET_SILVERBACK_RANK_2 };
|
||||
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1];
|
||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_pet_silverback_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pet_silverback_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pet_silverback_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -61680 - Culling the Herd
|
||||
class spell_pet_culling_the_herd : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pet_culling_the_herd() : SpellScriptLoader("spell_pet_culling_the_herd") { }
|
||||
|
||||
class spell_pet_culling_the_herd_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pet_culling_the_herd_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Claw, Bite and Smack share FamilyFlags with other spells
|
||||
// filter by spellIcon instead
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
switch (spellInfo->SpellIconID)
|
||||
{
|
||||
case PET_ICON_ID_CLAW:
|
||||
case PET_ICON_ID_BITE:
|
||||
case PET_ICON_ID_SMACK:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_pet_culling_the_herd_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pet_culling_the_herd_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hunter_pet_scripts()
|
||||
{
|
||||
new npc_pet_hunter_snake_trap();
|
||||
new spell_pet_guard_dog();
|
||||
new spell_pet_silverback();
|
||||
new spell_pet_culling_the_herd();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
enum PriestSpells
|
||||
{
|
||||
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228,
|
||||
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227,
|
||||
SPELL_PRIEST_SHADOWFIEND_DEATH = 57989,
|
||||
SPELL_PRIEST_LIGHTWELL_CHARGES = 59907
|
||||
};
|
||||
|
||||
@@ -70,12 +70,10 @@ class npc_pet_pri_shadowfiend : public CreatureScript
|
||||
{
|
||||
npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { }
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
void IsSummonedBy(Unit* summoner) override
|
||||
{
|
||||
if (me->IsSummon())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
|
||||
owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
|
||||
if (summoner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
|
||||
DoCastAOE(SPELL_PRIEST_SHADOWFIEND_DEATH);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -73,7 +73,24 @@ enum DeathKnightSpells
|
||||
SPELL_DK_UNHOLY_PRESENCE_TRIGGERED = 49772,
|
||||
SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
|
||||
SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
|
||||
SPELL_DK_GHOUL_THRASH = 47480
|
||||
SPELL_DK_GHOUL_THRASH = 47480,
|
||||
SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT = 69961,
|
||||
SPELL_DK_BUTCHERY_RUNIC_POWER = 50163,
|
||||
SPELL_DK_MARK_OF_BLOOD_HEAL = 61607,
|
||||
SPELL_DK_UNHOLY_BLIGHT_DAMAGE = 50536,
|
||||
SPELL_DK_GLYPH_OF_UNHOLY_BLIGHT = 63332,
|
||||
SPELL_DK_VENDETTA_HEAL = 50181,
|
||||
SPELL_DK_NECROSIS_DAMAGE = 51460,
|
||||
SPELL_DK_OBLITERATE_OFF_HAND_R1 = 66198,
|
||||
SPELL_DK_FROST_STRIKE_OFF_HAND_R1 = 66196,
|
||||
SPELL_DK_PLAGUE_STRIKE_OFF_HAND_R1 = 66216,
|
||||
SPELL_DK_DEATH_STRIKE_OFF_HAND_R1 = 66188,
|
||||
SPELL_DK_RUNE_STRIKE_OFF_HAND_R1 = 66217,
|
||||
SPELL_DK_BLOOD_STRIKE_OFF_HAND_R1 = 66215,
|
||||
SPELL_DK_RUNIC_RETURN = 61258,
|
||||
SPELL_DK_WANDERING_PLAGUE_DAMAGE = 50526,
|
||||
SPELL_DK_DEATH_COIL_R1 = 47541,
|
||||
SPELL_DK_DEATH_GRIP_INITIAL = 49576
|
||||
};
|
||||
|
||||
enum DeathKnightSpellIcons
|
||||
@@ -83,7 +100,9 @@ enum DeathKnightSpellIcons
|
||||
|
||||
enum Misc
|
||||
{
|
||||
NPC_DK_GHOUL = 26125
|
||||
NPC_DK_GHOUL = 26125,
|
||||
NPC_DK_DANCING_RUNE_WEAPON = 27893,
|
||||
SPELL_CATEGORY_HOWLING_BLAST = 1248
|
||||
};
|
||||
|
||||
// -49200 - Acclimation
|
||||
@@ -393,6 +412,38 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -49182 - Blade Barrier
|
||||
class spell_dk_blade_barrier : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_blade_barrier() : SpellScriptLoader("spell_dk_blade_barrier") { }
|
||||
|
||||
class spell_dk_blade_barrier_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_blade_barrier_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (eventInfo.GetSpellInfo() != nullptr)
|
||||
if (Player* player = eventInfo.GetActor()->ToPlayer())
|
||||
if (player->getClass() == CLASS_DEATH_KNIGHT && player->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_dk_blade_barrier_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_blade_barrier_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48721 - Blood Boil
|
||||
class spell_dk_blood_boil : public SpellScriptLoader
|
||||
{
|
||||
@@ -525,6 +576,41 @@ class spell_dk_bloodworms : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -48979 - Butchery
|
||||
class spell_dk_butchery : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_butchery() : SpellScriptLoader("spell_dk_butchery") { }
|
||||
|
||||
class spell_dk_butchery_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_butchery_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BUTCHERY_RUNIC_POWER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastCustomSpell(SPELL_DK_BUTCHERY_RUNIC_POWER, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_butchery_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_butchery_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class CorpseExplosionCheck
|
||||
{
|
||||
public:
|
||||
@@ -649,6 +735,69 @@ class spell_dk_corpse_explosion : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 49028 - Dancing Rune Weapon
|
||||
class spell_dk_dancing_rune_weapon : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_dancing_rune_weapon() : SpellScriptLoader("spell_dk_dancing_rune_weapon") { }
|
||||
|
||||
class spell_dk_dancing_rune_weapon_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_dancing_rune_weapon_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sObjectMgr->GetCreatureTemplate(NPC_DK_DANCING_RUNE_WEAPON))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is a port of the old switch hack in Unit.cpp, it's not correct
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* drw = nullptr;
|
||||
for (Unit* controlled : caster->m_Controlled)
|
||||
{
|
||||
if (controlled->GetEntry() == NPC_DK_DANCING_RUNE_WEAPON)
|
||||
{
|
||||
drw = controlled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!drw || !drw->GetVictim())
|
||||
return;
|
||||
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
int32 amount = static_cast<int32>(damageInfo->GetDamage()) / 2;
|
||||
drw->SendSpellNonMeleeDamageLog(drw->GetVictim(), spellInfo->Id, amount, spellInfo->GetSchoolMask(), 0, 0, false, 0, false);
|
||||
drw->DealDamage(drw->GetVictim(), amount, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_dancing_rune_weapon_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_dancing_rune_weapon_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dk_death_and_decay : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -874,6 +1023,84 @@ class spell_dk_death_pact : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -54639 - Blood of the North
|
||||
// -49208 - Reaping
|
||||
// -49467 - Death Rune Mastery
|
||||
class spell_dk_death_rune : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_death_rune() : SpellScriptLoader("spell_dk_death_rune") { }
|
||||
|
||||
class spell_dk_death_rune_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_death_rune_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
|
||||
Player* player = caster->ToPlayer();
|
||||
if (player->getClass() != CLASS_DEATH_KNIGHT)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
Player* player = eventInfo.GetActor()->ToPlayer();
|
||||
|
||||
AuraEffect* aurEff = GetEffect(EFFECT_0);
|
||||
if (!aurEff)
|
||||
return;
|
||||
|
||||
// Reset amplitude - set death rune remove timer to 30s
|
||||
aurEff->ResetPeriodic(true);
|
||||
|
||||
uint32 runesLeft = 1;
|
||||
|
||||
// Death Rune Mastery
|
||||
if (GetSpellInfo()->SpellIconID == 2622)
|
||||
runesLeft = 2;
|
||||
|
||||
for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
|
||||
{
|
||||
if (GetSpellInfo()->SpellIconID == 2622)
|
||||
{
|
||||
if (player->GetBaseRune(i) == RUNE_BLOOD)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player->GetBaseRune(i) != RUNE_BLOOD)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player->GetRuneCooldown(i) != (player->GetRuneBaseCooldown(i) - player->GetLastRuneGraceTimer(i)))
|
||||
continue;
|
||||
|
||||
--runesLeft;
|
||||
// Mark aura as used
|
||||
player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_dk_death_rune_AuraScript::CheckProc);
|
||||
OnProc += AuraProcFn(spell_dk_death_rune_AuraScript::HandleProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_death_rune_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -49998 - Death Strike
|
||||
class spell_dk_death_strike : public SpellScriptLoader
|
||||
{
|
||||
@@ -966,6 +1193,116 @@ class spell_dk_ghoul_explode : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 62259 - Glyph of Death Grip
|
||||
class spell_dk_glyph_of_death_grip : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_glyph_of_death_grip() : SpellScriptLoader("spell_dk_glyph_of_death_grip") { }
|
||||
|
||||
class spell_dk_glyph_of_death_grip_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_glyph_of_death_grip_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_GRIP_INITIAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->GetSpellHistory()->ResetCooldown(SPELL_DK_DEATH_GRIP_INITIAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_glyph_of_death_grip_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_glyph_of_death_grip_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 58642 - Glyph of Scourge Strike
|
||||
class spell_dk_glyph_of_scourge_strike : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_glyph_of_scourge_strike() : SpellScriptLoader("spell_dk_glyph_of_scourge_strike") { }
|
||||
|
||||
class spell_dk_glyph_of_scourge_strike_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_glyph_of_scourge_strike_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_glyph_of_scourge_strike_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_glyph_of_scourge_strike_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 51209 - Hungering Cold
|
||||
class spell_dk_hungering_cold : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_hungering_cold() : SpellScriptLoader("spell_dk_hungering_cold") { }
|
||||
|
||||
class spell_dk_hungering_cold_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_hungering_cold_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo) // probably melee damage so let's proc
|
||||
return true;
|
||||
|
||||
return (spellInfo->Dispel != DISPEL_DISEASE);
|
||||
}
|
||||
|
||||
void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
// Prevent console spam
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_dk_hungering_cold_AuraScript::CheckProc);
|
||||
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_hungering_cold_AuraScript::HandleDummy, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_hungering_cold_AuraScript::HandleDummy, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_hungering_cold_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48792 - Icebound Fortitude
|
||||
class spell_dk_icebound_fortitude : public SpellScriptLoader
|
||||
{
|
||||
@@ -1049,10 +1386,18 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader
|
||||
target->RemoveAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
// Prevent console spam
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_improved_blood_presence_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1213,6 +1558,127 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 61257 - Runic Power Back on Snare/Root
|
||||
class spell_dk_pvp_4p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_pvp_4p_bonus() : SpellScriptLoader("spell_dk_pvp_4p_bonus") { }
|
||||
|
||||
class spell_dk_pvp_4p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_pvp_4p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_RUNIC_RETURN))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_SNARE))) != 0;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActionTarget()->CastSpell((Unit*)nullptr, SPELL_DK_RUNIC_RETURN, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_dk_pvp_4p_bonus_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_pvp_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_pvp_4p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 49005 - Mark of Blood
|
||||
class spell_dk_mark_of_blood : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_mark_of_blood() : SpellScriptLoader("spell_dk_mark_of_blood") { }
|
||||
|
||||
class spell_dk_mark_of_blood_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_mark_of_blood_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_MARK_OF_BLOOD_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_mark_of_blood_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_mark_of_blood_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -51459 - Necrosis
|
||||
class spell_dk_necrosis : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_necrosis() : SpellScriptLoader("spell_dk_necrosis") { }
|
||||
|
||||
class spell_dk_necrosis_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_necrosis_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_NECROSIS_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
eventInfo.GetActor()->CastCustomSpell(SPELL_DK_NECROSIS_DAMAGE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_necrosis_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_necrosis_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// ID - 50842 Pestilence
|
||||
class spell_dk_pestilence : public SpellScriptLoader
|
||||
{
|
||||
@@ -1565,6 +2031,43 @@ class spell_dk_raise_dead : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -49188 - Rime
|
||||
class spell_dk_rime : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_rime() : SpellScriptLoader("spell_dk_rime") { }
|
||||
|
||||
class spell_dk_blade_barrier_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_blade_barrier_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
return GetTarget()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
GetTarget()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
return spellInfo && spellInfo->GetCategory() == SPELL_CATEGORY_HOWLING_BLAST;
|
||||
}, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_dk_blade_barrier_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_blade_barrier_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_blade_barrier_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 59754 Rune Tap - Party
|
||||
class spell_dk_rune_tap_party : public SpellScriptLoader
|
||||
{
|
||||
@@ -1613,7 +2116,7 @@ class spell_dk_scent_of_blood : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff);
|
||||
GetTarget()->RemoveAuraFromStack(GetSpellInfo()->Id);
|
||||
ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1628,6 +2131,37 @@ class spell_dk_scent_of_blood : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -49004 - Scent of Blood trigger
|
||||
class spell_dk_scent_of_blood_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_scent_of_blood_trigger() : SpellScriptLoader("spell_dk_scent_of_blood_trigger") { }
|
||||
|
||||
class spell_dk_scent_of_blood_trigger_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_scent_of_blood_trigger_AuraScript);
|
||||
|
||||
// Each rank of Scent of Blood adds a trigger spell effect
|
||||
// thus each effect adds one stack when proccing
|
||||
// We need to remove the old buff before proccing again
|
||||
// or we would be adding stacks to a possibly existing aura
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_scent_of_blood_trigger_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_scent_of_blood_trigger_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 55090 - Scourge Strike (55265, 55270, 55271)
|
||||
class spell_dk_scourge_strike : public SpellScriptLoader
|
||||
{
|
||||
@@ -1744,6 +2278,188 @@ class spell_dk_spell_deflection : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -49018 - Sudden Doom
|
||||
class spell_dk_sudden_doom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_sudden_doom() : SpellScriptLoader("spell_dk_sudden_doom") { }
|
||||
|
||||
class spell_dk_sudden_doom_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_sudden_doom_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_R1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DK_DEATH_COIL_R1);
|
||||
uint32 spellId = 0;
|
||||
|
||||
while (spellInfo)
|
||||
{
|
||||
if (!caster->HasSpell(spellInfo->Id))
|
||||
break;
|
||||
|
||||
spellId = spellInfo->Id;
|
||||
spellInfo = spellInfo->GetNextRankSpell();
|
||||
}
|
||||
|
||||
if (!spellId)
|
||||
return;
|
||||
|
||||
caster->CastSpell(eventInfo.GetProcTarget(), spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_sudden_doom_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_sudden_doom_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -65661 Threat of Thassarian
|
||||
class spell_dk_threat_of_thassarian : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_threat_of_thassarian() : SpellScriptLoader("spell_dk_threat_of_thassarian") { }
|
||||
|
||||
class spell_dk_threat_of_thassarian_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_threat_of_thassarian_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_OBLITERATE_OFF_HAND_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_FROST_STRIKE_OFF_HAND_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_PLAGUE_STRIKE_OFF_HAND_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE_OFF_HAND_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_RUNE_STRIKE_OFF_HAND_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_STRIKE_OFF_HAND_R1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
if (!roll_chance_i(aurEff->GetAmount()))
|
||||
return;
|
||||
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
// Must dual wield
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
if (!caster->haveOffhandWeapon())
|
||||
return;
|
||||
|
||||
uint32 spellId = 0;
|
||||
// Plague Strike
|
||||
if (spellInfo->SpellFamilyFlags[0] & 0x00000001)
|
||||
spellId = SPELL_DK_PLAGUE_STRIKE_OFF_HAND_R1;
|
||||
// Death Strike
|
||||
else if (spellInfo->SpellFamilyFlags[0] & 0x00000010)
|
||||
spellId = SPELL_DK_DEATH_STRIKE_OFF_HAND_R1;
|
||||
// Blood Strike
|
||||
else if (spellInfo->SpellFamilyFlags[0] & 0x00400000)
|
||||
spellId = SPELL_DK_BLOOD_STRIKE_OFF_HAND_R1;
|
||||
// Frost Strike
|
||||
else if (spellInfo->SpellFamilyFlags[1] & 0x00000004)
|
||||
spellId = SPELL_DK_FROST_STRIKE_OFF_HAND_R1;
|
||||
// Obliterate
|
||||
else if (spellInfo->SpellFamilyFlags[1] & 0x00020000)
|
||||
spellId = SPELL_DK_OBLITERATE_OFF_HAND_R1;
|
||||
// Rune Strike
|
||||
else if (spellInfo->SpellFamilyFlags[1] & 0x20000000)
|
||||
spellId = SPELL_DK_RUNE_STRIKE_OFF_HAND_R1;
|
||||
|
||||
if (!spellId)
|
||||
return;
|
||||
|
||||
spellId = sSpellMgr->GetSpellWithRank(spellId, spellInfo->GetRank());
|
||||
caster->CastSpell(eventInfo.GetProcTarget(), spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_threat_of_thassarian_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_threat_of_thassarian_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 49194 - Unholy Blight
|
||||
class spell_dk_unholy_blight : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_unholy_blight() : SpellScriptLoader("spell_dk_unholy_blight") { }
|
||||
|
||||
class spell_dk_unholy_blight_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_unholy_blight_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_BLIGHT_DAMAGE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_GLYPH_OF_UNHOLY_BLIGHT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DK_UNHOLY_BLIGHT_DAMAGE);
|
||||
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
if (AuraEffect const* glyph = caster->GetAuraEffect(SPELL_DK_GLYPH_OF_UNHOLY_BLIGHT, EFFECT_0, caster->GetGUID()))
|
||||
AddPct(amount, glyph->GetAmount());
|
||||
|
||||
amount /= spellInfo->GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to healing done
|
||||
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_DK_UNHOLY_BLIGHT_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
|
||||
caster->CastCustomSpell(SPELL_DK_UNHOLY_BLIGHT_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_unholy_blight_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_unholy_blight_AuraScript();
|
||||
}
|
||||
};
|
||||
// 55233 - Vampiric Blood
|
||||
class spell_dk_vampiric_blood : public SpellScriptLoader
|
||||
{
|
||||
@@ -1771,6 +2487,88 @@ class spell_dk_vampiric_blood : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -49015 - Vendetta
|
||||
class spell_dk_vendetta : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_vendetta() : SpellScriptLoader("spell_dk_vendetta") { }
|
||||
|
||||
class spell_dk_vendetta_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_vendetta_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_VENDETTA_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount());
|
||||
caster->CastCustomSpell(SPELL_DK_VENDETTA_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_vendetta_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_vendetta_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -49217 - Wandering Plague
|
||||
class spell_dk_wandering_plague : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dk_wandering_plague() : SpellScriptLoader("spell_dk_wandering_plague") { }
|
||||
|
||||
class spell_dk_wandering_plague_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_wandering_plague_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_WANDERING_PLAGUE_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
if (!roll_chance_f(caster->GetUnitCriticalChance(BASE_ATTACK, target)))
|
||||
return;
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
caster->CastCustomSpell(SPELL_DK_WANDERING_PLAGUE_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_wandering_plague_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_dk_wandering_plague_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 52284 - Will of the Necropolis
|
||||
class spell_dk_will_of_the_necropolis : public SpellScriptLoader
|
||||
{
|
||||
@@ -2200,30 +2998,47 @@ void AddSC_deathknight_spell_scripts()
|
||||
new spell_dk_anti_magic_shell_raid();
|
||||
new spell_dk_anti_magic_shell_self();
|
||||
new spell_dk_anti_magic_zone();
|
||||
new spell_dk_blade_barrier();
|
||||
new spell_dk_blood_boil();
|
||||
new spell_dk_blood_gorged();
|
||||
new spell_dk_bloodworms();
|
||||
new spell_dk_butchery();
|
||||
new spell_dk_corpse_explosion();
|
||||
new spell_dk_dancing_rune_weapon();
|
||||
new spell_dk_death_and_decay();
|
||||
new spell_dk_death_coil();
|
||||
new spell_dk_death_gate();
|
||||
new spell_dk_death_grip();
|
||||
new spell_dk_death_pact();
|
||||
new spell_dk_death_rune();
|
||||
new spell_dk_death_strike();
|
||||
new spell_dk_ghoul_explode();
|
||||
new spell_dk_glyph_of_death_grip();
|
||||
new spell_dk_glyph_of_scourge_strike();
|
||||
new spell_dk_hungering_cold();
|
||||
new spell_dk_icebound_fortitude();
|
||||
new spell_dk_improved_blood_presence();
|
||||
new spell_dk_improved_blood_presence_triggered();
|
||||
new spell_dk_improved_frost_presence();
|
||||
new spell_dk_improved_unholy_presence();
|
||||
new spell_dk_pvp_4p_bonus();
|
||||
new spell_dk_mark_of_blood();
|
||||
new spell_dk_necrosis();
|
||||
new spell_dk_pestilence();
|
||||
new spell_dk_presence();
|
||||
new spell_dk_raise_dead();
|
||||
new spell_dk_rime();
|
||||
new spell_dk_rune_tap_party();
|
||||
new spell_dk_scent_of_blood();
|
||||
new spell_dk_scent_of_blood_trigger();
|
||||
new spell_dk_scourge_strike();
|
||||
new spell_dk_spell_deflection();
|
||||
new spell_dk_sudden_doom();
|
||||
new spell_dk_threat_of_thassarian();
|
||||
new spell_dk_unholy_blight();
|
||||
new spell_dk_vampiric_blood();
|
||||
new spell_dk_vendetta();
|
||||
new spell_dk_wandering_plague();
|
||||
new spell_dk_will_of_the_necropolis();
|
||||
new spell_dk_death_grip_initial();
|
||||
new spell_dk_raise_ally_initial();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1443,51 +1443,6 @@ class spell_gen_ds_flush_knockback : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum DummyTrigger
|
||||
{
|
||||
SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470,
|
||||
SPELL_PERSISTANT_SHIELD = 26467
|
||||
};
|
||||
|
||||
class spell_gen_dummy_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_dummy_trigger() : SpellScriptLoader("spell_gen_dummy_trigger") { }
|
||||
|
||||
class spell_gen_dummy_trigger_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_dummy_trigger_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (SpellInfo const* triggeredByAuraSpell = GetTriggeringSpell())
|
||||
if (triggeredByAuraSpell->Id == SPELL_PERSISTANT_SHIELD_TRIGGERED)
|
||||
caster->CastCustomSpell(target, SPELL_PERSISTANT_SHIELD_TRIGGERED, &damage, NULL, NULL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_dummy_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_gen_dummy_trigger_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -2763,6 +2718,41 @@ class spell_gen_orc_disguise : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_proc_below_pct_damaged : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_proc_below_pct_damaged(const char* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_proc_below_pct_damaged_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_proc_below_pct_damaged_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return false;
|
||||
|
||||
int32 pct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
|
||||
|
||||
if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_gen_proc_below_pct_damaged_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_gen_proc_below_pct_damaged_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum ParachuteSpells
|
||||
{
|
||||
SPELL_PARACHUTE = 45472,
|
||||
@@ -3535,6 +3525,53 @@ class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum VampiricTouch
|
||||
{
|
||||
SPELL_VAMPIRIC_TOUCH_HEAL = 52724
|
||||
};
|
||||
|
||||
// 52723 - Vampiric Touch
|
||||
// 60501 - Vampiric Touch
|
||||
class spell_gen_vampiric_touch : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_vampiric_touch() : SpellScriptLoader("spell_gen_vampiric_touch") { }
|
||||
|
||||
class spell_gen_vampiric_touch_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_vampiric_touch_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_TOUCH_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
int32 bp = damageInfo->GetDamage() / 2;
|
||||
caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_gen_vampiric_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_gen_vampiric_touch_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum VehicleScaling
|
||||
{
|
||||
SPELL_GEAR_SCALING = 66668
|
||||
@@ -4324,7 +4361,6 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_despawn_self();
|
||||
new spell_gen_divine_storm_cd_reset();
|
||||
new spell_gen_ds_flush_knockback();
|
||||
new spell_gen_dummy_trigger();
|
||||
new spell_gen_dungeon_credit();
|
||||
new spell_gen_elune_candle();
|
||||
new spell_gen_gadgetzan_transporter_backfire();
|
||||
@@ -4352,6 +4388,12 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_on_tournament_mount();
|
||||
new spell_gen_oracle_wolvar_reputation();
|
||||
new spell_gen_orc_disguise();
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_soul_harvesters_charm");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_commendation_of_kaelthas");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin_heroic");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale_heroic");
|
||||
new spell_gen_parachute();
|
||||
new spell_gen_pet_summoned();
|
||||
new spell_gen_profession_research();
|
||||
@@ -4369,6 +4411,7 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_pvp_trinket_wotf_shared_cd();
|
||||
new spell_gen_turkey_marker();
|
||||
new spell_gen_upper_deck_create_foam_sword();
|
||||
new spell_gen_vampiric_touch();
|
||||
new spell_gen_vehicle_scaling();
|
||||
new spell_gen_vendor_bark_trigger();
|
||||
new spell_gen_wg_water();
|
||||
|
||||
@@ -60,8 +60,14 @@ enum HunterSpells
|
||||
SPELL_HUNTER_VIPER_ATTACK_SPEED = 60144,
|
||||
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543,
|
||||
SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481,
|
||||
SPELL_LOCK_AND_LOAD_TRIGGER = 56453,
|
||||
SPELL_LOCK_AND_LOAD_MARKER = 67544
|
||||
SPELL_HUNTER_LOCK_AND_LOAD_TRIGGER = 56453,
|
||||
SPELL_HUNTER_LOCK_AND_LOAD_MARKER = 67544,
|
||||
SPELL_HUNTER_KILL_COMMAND_HUNTER = 34027,
|
||||
SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA = 34720,
|
||||
SPELL_REPLENISHMENT = 57669,
|
||||
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1 = 56654,
|
||||
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 = 58882,
|
||||
SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS = 57894
|
||||
};
|
||||
|
||||
// 13161 - Aspect of the Beast
|
||||
@@ -209,51 +215,56 @@ class spell_hun_chimera_shot : public SpellScriptLoader
|
||||
flag96 familyFlag = aura->GetSpellInfo()->SpellFamilyFlags;
|
||||
if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
|
||||
continue;
|
||||
if (AuraEffect* aurEff = aura->GetEffect(0))
|
||||
if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_0))
|
||||
{
|
||||
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
|
||||
if (familyFlag[0] & 0x4000)
|
||||
{
|
||||
int32 TickCount = aurEff->GetTotalTicks();
|
||||
spellId = SPELL_HUNTER_CHIMERA_SHOT_SERPENT;
|
||||
basePoint = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
|
||||
ApplyPct(basePoint, TickCount * 40);
|
||||
basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(aura->GetSpellInfo()->Id, SPELLMOD_DOT, basePoint);
|
||||
|
||||
aurEff->SetBonusAmount(caster->SpellDamageBonusDone(unitTarget, aurEff->GetSpellInfo(), 0, DOT));
|
||||
// first, calculate damage of basic tick (C&P from AuraEffect::HandlePeriodicDamageAurasTick)
|
||||
basePoint = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod<SPELLMOD_DOT>(aurEff->GetSpellInfo()->Id, basePoint);
|
||||
basePoint = unitTarget->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
|
||||
|
||||
// then, multiply to get damage potential
|
||||
basePoint *= aurEff->GetTotalTicks();
|
||||
ApplyPct(basePoint, 40);
|
||||
}
|
||||
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
|
||||
else if (familyFlag[1] & 0x00000080)
|
||||
{
|
||||
int32 TickCount = aura->GetEffect(0)->GetTotalTicks();
|
||||
spellId = SPELL_HUNTER_CHIMERA_SHOT_VIPER;
|
||||
|
||||
// Amount of one aura tick
|
||||
// Amount of one aura tick (C&P from AuraEffect::HandlePeriodicManaLeechAuraTick)
|
||||
basePoint = aurEff->GetAmount();
|
||||
// max value
|
||||
int32 maxmana = CalculatePct(caster->GetMaxPower(POWER_MANA), basePoint * 2.0f);
|
||||
ApplyPct(basePoint, caster->GetMaxPower(POWER_MANA));
|
||||
if (basePoint > maxmana)
|
||||
basePoint = maxmana;
|
||||
|
||||
basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
|
||||
int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; /// @todo WTF? caster uses unitTarget?
|
||||
int32 casterBasePoint = CalculatePct(caster->GetMaxPower(POWER_MANA), aurEff->GetAmount() * 2.0f);
|
||||
if (basePoint > casterBasePoint)
|
||||
basePoint = casterBasePoint;
|
||||
ApplyPct(basePoint, TickCount * 60);
|
||||
|
||||
basePoint *= aurEff->GetTotalTicks();
|
||||
ApplyPct(basePoint, 60);
|
||||
}
|
||||
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
|
||||
else if (familyFlag[0] & 0x00008000)
|
||||
spellId = SPELL_HUNTER_CHIMERA_SHOT_SCORPID;
|
||||
// ?? nothing say in spell desc (possibly need addition check)
|
||||
//if (familyFlag & 0x0000010000000000LL || // dot
|
||||
// familyFlag & 0x0000100000000000LL) // stun
|
||||
//{
|
||||
// spellId = 53366; // 53366 Chimera Shot - Wyvern
|
||||
//}
|
||||
|
||||
// Refresh aura duration
|
||||
aura->RefreshDuration();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (spellId)
|
||||
caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
|
||||
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, basePoint, unitTarget, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD));
|
||||
if (spellId == SPELL_HUNTER_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown
|
||||
caster->GetSpellHistory()->AddCooldown(spellId, 0, std::chrono::minutes(1));
|
||||
}
|
||||
@@ -364,6 +375,76 @@ class spell_hun_glyph_of_arcane_shot : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 57870 - Glyph of Mend Pet
|
||||
class spell_hun_glyph_of_mend_pet : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_glyph_of_mend_pet() : SpellScriptLoader("spell_hun_glyph_of_mend_pet") { }
|
||||
|
||||
class spell_hun_glyph_of_mend_pet_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_glyph_of_mend_pet_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_glyph_of_mend_pet_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hun_glyph_of_mend_pet_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -53290 - Hunting Party
|
||||
class spell_hun_hunting_party : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_hunting_party() : SpellScriptLoader("spell_hun_hunting_party") { }
|
||||
|
||||
class spell_hun_hunting_party_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_hunting_party_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_hunting_party_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hun_hunting_party_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -19572 - Improved Mend Pet
|
||||
class spell_hun_improved_mend_pet : public SpellScriptLoader
|
||||
{
|
||||
@@ -442,6 +523,46 @@ class spell_hun_invigoration : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 58914 - Kill Command
|
||||
class spell_hun_kill_command_pet : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_kill_command_pet() : SpellScriptLoader("spell_hun_kill_command_pet") { }
|
||||
|
||||
class spell_hun_kill_command_pet_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_kill_command_pet_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_KILL_COMMAND_HUNTER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
// prevent charge drop (aura has both proc charge and stacks)
|
||||
PreventDefaultAction();
|
||||
|
||||
if (Unit* owner = eventInfo.GetActor()->GetOwner())
|
||||
owner->RemoveAuraFromStack(SPELL_HUNTER_KILL_COMMAND_HUNTER);
|
||||
|
||||
ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_kill_command_pet_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hun_kill_command_pet_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 53478 - Last Stand Pet
|
||||
class spell_hun_last_stand_pet : public SpellScriptLoader
|
||||
{
|
||||
@@ -490,15 +611,15 @@ class spell_hun_lock_and_load : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_TRIGGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_MARKER))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_LOCK_AND_LOAD_TRIGGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HUNTER_LOCK_AND_LOAD_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (eventInfo.GetActor()->HasAura(SPELL_LOCK_AND_LOAD_MARKER))
|
||||
if (eventInfo.GetActor()->HasAura(SPELL_HUNTER_LOCK_AND_LOAD_MARKER))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -522,8 +643,8 @@ class spell_hun_lock_and_load : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_TRIGGER, true);
|
||||
caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_MARKER, true);
|
||||
caster->CastSpell(caster, SPELL_HUNTER_LOCK_AND_LOAD_TRIGGER, true);
|
||||
caster->CastSpell(caster, SPELL_HUNTER_LOCK_AND_LOAD_MARKER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -753,11 +874,13 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
{
|
||||
if (!caster->HasAura(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
|
||||
{
|
||||
owner->CastCustomSpell(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true);
|
||||
caster->CastSpell(caster, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -868,6 +991,64 @@ class spell_hun_rapid_recuperation : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -53228 - Rapid Recuperation (talent aura)
|
||||
class spell_hun_rapid_recuperation_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_rapid_recuperation_trigger() : SpellScriptLoader("spell_hun_rapid_recuperation_trigger") { }
|
||||
|
||||
class spell_hun_rapid_recuperation_trigger_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_rapid_recuperation_trigger_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleRapidFireProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Proc only from Rapid Fire
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 0x00000020))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleRapidKillingProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
static uint32 const triggerSpells[2] = { SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1, SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 };
|
||||
|
||||
PreventDefaultAction();
|
||||
|
||||
// Proc only from Rapid Killing
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || !(spellInfo->SpellFamilyFlags[1] & 0x01000000))
|
||||
return;
|
||||
|
||||
uint8 rank = GetSpellInfo()->GetRank();
|
||||
uint32 spellId = triggerSpells[rank - 1];
|
||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_rapid_recuperation_trigger_AuraScript::HandleRapidFireProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_rapid_recuperation_trigger_AuraScript::HandleRapidKillingProc, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hun_rapid_recuperation_trigger_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 23989 - Readiness
|
||||
class spell_hun_readiness : public SpellScriptLoader
|
||||
{
|
||||
@@ -1135,6 +1316,64 @@ class spell_hun_target_only_pet_and_owner : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -34497 - Thrill of the Hunt
|
||||
class spell_hun_thrill_of_the_hunt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_thrill_of_the_hunt() : SpellScriptLoader("spell_hun_thrill_of_the_hunt") { }
|
||||
|
||||
class spell_hun_thrill_of_the_hunt_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_thrill_of_the_hunt_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
int32 amount = 0;
|
||||
|
||||
// Explosive Shot
|
||||
if (spellInfo->SpellFamilyFlags[2] & 0x200)
|
||||
{
|
||||
if (AuraEffect const* explosiveShot = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_HUNTER, 0x00000000, 0x80000000, 0x00000000, caster->GetGUID()))
|
||||
{
|
||||
// due to Lock and Load SpellInfo::CalcPowerCost might return 0, so just calculate it manually
|
||||
amount = CalculatePct(static_cast<int32>(CalculatePct(caster->GetCreateMana(), explosiveShot->GetSpellInfo()->ManaCostPercentage)), aurEff->GetAmount());
|
||||
amount /= explosiveShot->GetSpellInfo()->GetMaxTicks();
|
||||
}
|
||||
}
|
||||
else
|
||||
amount = CalculatePct(static_cast<int32>(spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask())), aurEff->GetAmount());
|
||||
|
||||
if (!amount)
|
||||
return;
|
||||
|
||||
caster->CastCustomSpell(SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_thrill_of_the_hunt_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hun_thrill_of_the_hunt_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 67151 - T9 4P Bonus
|
||||
class spell_hun_t9_4p_bonus : public SpellScriptLoader
|
||||
{
|
||||
@@ -1230,8 +1469,11 @@ void AddSC_hunter_spell_scripts()
|
||||
new spell_hun_chimera_shot();
|
||||
new spell_hun_disengage();
|
||||
new spell_hun_glyph_of_arcane_shot();
|
||||
new spell_hun_glyph_of_mend_pet();
|
||||
new spell_hun_hunting_party();
|
||||
new spell_hun_improved_mend_pet();
|
||||
new spell_hun_invigoration();
|
||||
new spell_hun_kill_command_pet();
|
||||
new spell_hun_last_stand_pet();
|
||||
new spell_hun_lock_and_load();
|
||||
new spell_hun_masters_call();
|
||||
@@ -1241,12 +1483,14 @@ void AddSC_hunter_spell_scripts()
|
||||
new spell_hun_pet_heart_of_the_phoenix();
|
||||
new spell_hun_piercing_shots();
|
||||
new spell_hun_rapid_recuperation();
|
||||
new spell_hun_rapid_recuperation_trigger();
|
||||
new spell_hun_readiness();
|
||||
new spell_hun_roar_of_sacrifice();
|
||||
new spell_hun_scatter_shot();
|
||||
new spell_hun_sniper_training();
|
||||
new spell_hun_tame_beast();
|
||||
new spell_hun_target_only_pet_and_owner();
|
||||
new spell_hun_thrill_of_the_hunt();
|
||||
new spell_hun_t9_4p_bonus();
|
||||
new spell_hun_viper_attack_speed();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,20 @@ enum PriestSpells
|
||||
SPELL_PRIEST_SHADOW_WORD_DEATH = 32409,
|
||||
SPELL_PRIEST_T9_HEALING_2P = 67201,
|
||||
SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL = 64085,
|
||||
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227,
|
||||
SPELL_REPLENISHMENT = 57669,
|
||||
SPELL_PRIEST_BODY_AND_SOUL_POISON_TRIGGER = 64136,
|
||||
SPELL_PRIEST_ABOLISH_DISEASE = 552,
|
||||
SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL = 15290,
|
||||
SPELL_PRIEST_DIVINE_BLESSING = 40440,
|
||||
SPELL_PRIEST_DIVINE_WRATH = 40441,
|
||||
SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL = 56131,
|
||||
SPELL_PRIEST_ORACULAR_HEAL = 26170,
|
||||
SPELL_PRIEST_ARMOR_OF_FAITH = 28810,
|
||||
SPELL_PRIEST_BLESSED_HEALING = 70772,
|
||||
SPELL_PRIEST_MIND_BLAST_R1 = 8092,
|
||||
SPELL_PRIEST_SHADOW_WORD_DEATH_R1 = 32379,
|
||||
SPELL_PRIEST_MIND_FLAY_DAMAGE = 58381
|
||||
};
|
||||
|
||||
enum PriestSpellIcons
|
||||
@@ -89,6 +103,50 @@ class RaidCheck
|
||||
Unit const* _caster;
|
||||
};
|
||||
|
||||
// 26169 - Oracle Healing Bonus
|
||||
class spell_pri_aq_3p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_aq_3p_bonus() : SpellScriptLoader("spell_pri_aq_3p_bonus") { }
|
||||
|
||||
class spell_pri_aq_3p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_aq_3p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ORACULAR_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
if (caster == eventInfo.GetProcTarget())
|
||||
return;
|
||||
|
||||
HealInfo* healInfo = eventInfo.GetHealInfo();
|
||||
if (!healInfo || !healInfo->GetHeal())
|
||||
return;
|
||||
|
||||
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), 10);
|
||||
caster->CastCustomSpell(SPELL_PRIEST_ORACULAR_HEAL, SPELLVALUE_BASE_POINT0, amount, caster, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_aq_3p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_aq_3p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -27811 - Blessed Recovery
|
||||
class spell_pri_blessed_recovery : public SpellScriptLoader
|
||||
{
|
||||
@@ -109,16 +167,18 @@ public:
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
|
||||
{
|
||||
if (Unit* target = eventInfo.GetActionTarget())
|
||||
{
|
||||
uint32 triggerSpell = sSpellMgr->GetSpellWithRank(SPELL_PRIEST_BLESSED_RECOVERY_R1, aurEff->GetSpellInfo()->GetRank());
|
||||
uint32 bp = CalculatePct(int32(dmgInfo->GetDamage()), aurEff->GetAmount()) / 3;
|
||||
bp += target->GetRemainingPeriodicAmount(target->GetGUID(), triggerSpell, SPELL_AURA_PERIODIC_HEAL);
|
||||
target->CastCustomSpell(triggerSpell, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
DamageInfo* dmgInfo = eventInfo.GetDamageInfo();
|
||||
if (!dmgInfo || !dmgInfo->GetDamage())
|
||||
return;
|
||||
|
||||
Unit* target = eventInfo.GetActionTarget();
|
||||
uint32 triggerSpell = sSpellMgr->GetSpellWithRank(SPELL_PRIEST_BLESSED_RECOVERY_R1, aurEff->GetSpellInfo()->GetRank());
|
||||
SpellInfo const* triggerInfo = sSpellMgr->AssertSpellInfo(triggerSpell);
|
||||
|
||||
int32 bp = CalculatePct(static_cast<int32>(dmgInfo->GetDamage()), aurEff->GetAmount());
|
||||
bp /= triggerInfo->GetMaxTicks();
|
||||
bp += target->GetRemainingPeriodicAmount(target->GetGUID(), triggerSpell, SPELL_AURA_PERIODIC_HEAL);
|
||||
target->CastCustomSpell(triggerSpell, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -133,6 +193,65 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// -64127 - Body and Soul
|
||||
class spell_pri_body_and_soul : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_body_and_soul() : SpellScriptLoader("spell_pri_body_and_soul") { }
|
||||
|
||||
class spell_pri_body_and_soul_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_body_and_soul_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_BODY_AND_SOUL_POISON_TRIGGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ABOLISH_DISEASE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProcTriggerSpell(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Proc only on Power Word: Shield
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 0x00000001))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleProcDummy(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
// Proc only on self casted abolish disease
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
if (spellInfo->Id != SPELL_PRIEST_ABOLISH_DISEASE || caster != eventInfo.GetProcTarget())
|
||||
return;
|
||||
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
caster->CastSpell(caster, SPELL_PRIEST_BODY_AND_SOUL_POISON_TRIGGER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_body_and_soul_AuraScript::HandleProcTriggerSpell, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_body_and_soul_AuraScript::HandleProcDummy, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_body_and_soul_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -34861 - Circle of Healing
|
||||
class spell_pri_circle_of_healing : public SpellScriptLoader
|
||||
{
|
||||
@@ -201,7 +320,11 @@ class spell_pri_divine_aegis : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
int32 absorb = CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount());
|
||||
HealInfo* healInfo = eventInfo.GetHealInfo();
|
||||
if (!healInfo || !healInfo->GetHeal())
|
||||
return;
|
||||
|
||||
int32 absorb = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount());
|
||||
|
||||
// Multiple effects stack, so let's try to find this aura.
|
||||
if (AuraEffect const* aegis = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_PRIEST_DIVINE_AEGIS, EFFECT_0))
|
||||
@@ -260,6 +383,50 @@ class spell_pri_divine_hymn : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 55677 - Glyph of Dispel Magic
|
||||
class spell_pri_glyph_of_dispel_magic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_glyph_of_dispel_magic() : SpellScriptLoader("spell_pri_glyph_of_dispel_magic") { }
|
||||
|
||||
class spell_pri_glyph_of_dispel_magic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_glyph_of_dispel_magic_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
// Dispel Magic shares spellfamilyflag with abolish disease
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || spellInfo->SpellIconID != 74)
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
int32 amount = static_cast<int32>(target->CountPctFromMaxHealth(aurEff->GetAmount()));
|
||||
|
||||
caster->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_glyph_of_dispel_magic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_glyph_of_dispel_magic_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 55680 - Glyph of Prayer of Healing
|
||||
class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
|
||||
{
|
||||
@@ -281,8 +448,12 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
HealInfo* healInfo = eventInfo.GetHealInfo();
|
||||
if (!healInfo || !healInfo->GetHeal())
|
||||
return;
|
||||
|
||||
SpellInfo const* triggeredSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL);
|
||||
int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks());
|
||||
int32 heal = int32(CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks());
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
}
|
||||
|
||||
@@ -398,38 +569,117 @@ class spell_pri_hymn_of_hope : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 37594 - Greater Heal Refund
|
||||
class spell_pri_item_greater_heal_refund : public SpellScriptLoader
|
||||
// -47569 - Improved Shadowform
|
||||
class spell_pri_imp_shadowform : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_item_greater_heal_refund() : SpellScriptLoader("spell_pri_item_greater_heal_refund") { }
|
||||
spell_pri_imp_shadowform() : SpellScriptLoader("spell_pri_imp_shadowform") { }
|
||||
|
||||
class spell_pri_item_greater_heal_refund_AuraScript : public AuraScript
|
||||
class spell_pri_imp_shadowform_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_item_greater_heal_refund_AuraScript);
|
||||
PrepareAuraScript(spell_pri_imp_shadowform_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ITEM_EFFICIENCY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, NULL, aurEff);
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
eventInfo.GetActor()->RemoveMovementImpairingAuras();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_item_greater_heal_refund_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_imp_shadowform_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_item_greater_heal_refund_AuraScript();
|
||||
return new spell_pri_imp_shadowform_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -15337 - Improved Spirit Tap
|
||||
class spell_pri_improved_spirit_tap : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_improved_spirit_tap() : SpellScriptLoader("spell_pri_improved_spirit_tap") { }
|
||||
|
||||
class spell_pri_improved_spirit_tap_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_improved_spirit_tap_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_SHADOW_WORD_DEATH_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MIND_BLAST_R1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||
{
|
||||
if (spellInfo->IsRankOf(sSpellMgr->AssertSpellInfo(SPELL_PRIEST_SHADOW_WORD_DEATH_R1)) ||
|
||||
spellInfo->IsRankOf(sSpellMgr->AssertSpellInfo(SPELL_PRIEST_MIND_BLAST_R1)))
|
||||
return true;
|
||||
else if (spellInfo->Id == SPELL_PRIEST_MIND_FLAY_DAMAGE)
|
||||
return roll_chance_i(50);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_pri_improved_spirit_tap_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_improved_spirit_tap_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 40438 - Priest Tier 6 Trinket
|
||||
class spell_pri_item_t6_trinket : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_item_t6_trinket() : SpellScriptLoader("spell_pri_item_t6_trinket") { }
|
||||
|
||||
class spell_pri_item_t6_trinket_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_item_t6_trinket_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_BLESSING) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_WRATH))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_HEAL)
|
||||
caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_BLESSING, true);
|
||||
|
||||
if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_DAMAGE)
|
||||
caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_WRATH, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_item_t6_trinket_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_item_t6_trinket_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -838,6 +1088,56 @@ class spell_pri_renew : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 57989 - Shadowfiend Death
|
||||
class spell_pri_shadowfiend_death : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_shadowfiend_death() : SpellScriptLoader("spell_pri_shadowfiend_death") { }
|
||||
|
||||
class spell_pri_shadowfiend_death_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_shadowfiend_death_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return false;
|
||||
|
||||
Unit* shadowfiend = eventInfo.GetActionTarget();
|
||||
if (!shadowfiend->GetOwner())
|
||||
return false;
|
||||
|
||||
return shadowfiend->HealthBelowPctDamaged(1, damageInfo->GetDamage());
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActionTarget()->GetOwner();
|
||||
caster->CastSpell(caster, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_pri_shadowfiend_death_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_shadowfiend_death_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_shadowfiend_death_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -32379 - Shadow Word Death
|
||||
class spell_pri_shadow_word_death : public SpellScriptLoader
|
||||
{
|
||||
@@ -871,6 +1171,48 @@ class spell_pri_shadow_word_death : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 15286 - Vampiric Embrace
|
||||
class spell_pri_vampiric_embrace : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_vampiric_embrace() : SpellScriptLoader("spell_pri_vampiric_embrace") { }
|
||||
|
||||
class spell_pri_vampiric_embrace_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_vampiric_embrace_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
int32 selfHeal = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
int32 partyHeal = selfHeal / 5;
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastCustomSpell((Unit*)nullptr, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &partyHeal, &selfHeal, nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_vampiric_embrace_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_vampiric_embrace_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -34914 - Vampiric Touch
|
||||
class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
{
|
||||
@@ -883,7 +1225,8 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -891,18 +1234,29 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
void HandleDispel(DispelInfo* /*dispelInfo*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Unit* target = GetUnitOwner())
|
||||
{
|
||||
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() * 8;
|
||||
// backfire damage
|
||||
caster->CastCustomSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_vampiric_touch_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -912,16 +1266,152 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 28809 - Greater Heal
|
||||
class spell_pri_t3_4p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_t3_4p_bonus() : SpellScriptLoader("spell_pri_t3_4p_bonus") { }
|
||||
|
||||
class spell_pri_t3_4p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_t3_4p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ARMOR_OF_FAITH))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_ARMOR_OF_FAITH, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_t3_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_t3_4p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 37594 - Greater Heal Refund
|
||||
class spell_pri_t5_heal_2p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_t5_heal_2p_bonus() : SpellScriptLoader("spell_pri_t5_heal_2p_bonus") { }
|
||||
|
||||
class spell_pri_t5_heal_2p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_t5_heal_2p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ITEM_EFFICIENCY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (HealInfo* healInfo = eventInfo.GetHealInfo())
|
||||
if (Unit* healTarget = healInfo->GetTarget())
|
||||
if (healInfo->GetEffectiveHeal())
|
||||
if (healTarget->GetHealth() >= healTarget->GetMaxHealth())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_pri_t5_heal_2p_bonus_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_t5_heal_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_t5_heal_2p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 70770 - Item - Priest T10 Healer 2P Bonus
|
||||
class spell_pri_t10_heal_2p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_t10_heal_2p_bonus() : SpellScriptLoader("spell_pri_t10_heal_2p_bonus") { }
|
||||
|
||||
class spell_pri_t10_heal_2p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_t10_heal_2p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_BLESSED_HEALING))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
HealInfo* healInfo = eventInfo.GetHealInfo();
|
||||
if (!healInfo || !healInfo->GetHeal())
|
||||
return;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_BLESSED_HEALING);
|
||||
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
|
||||
amount /= spellInfo->GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to healing done
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PRIEST_BLESSED_HEALING, SPELL_AURA_PERIODIC_HEAL);
|
||||
|
||||
caster->CastCustomSpell(SPELL_PRIEST_BLESSED_HEALING, SPELLVALUE_BASE_POINT0, amount, target, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_t10_heal_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_pri_t10_heal_2p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_priest_spell_scripts()
|
||||
{
|
||||
new spell_pri_aq_3p_bonus();
|
||||
new spell_pri_blessed_recovery();
|
||||
new spell_pri_body_and_soul();
|
||||
new spell_pri_circle_of_healing();
|
||||
new spell_pri_divine_aegis();
|
||||
new spell_pri_divine_hymn();
|
||||
new spell_pri_glyph_of_dispel_magic();
|
||||
new spell_pri_glyph_of_prayer_of_healing();
|
||||
new spell_pri_guardian_spirit();
|
||||
new spell_pri_hymn_of_hope();
|
||||
new spell_pri_item_greater_heal_refund();
|
||||
new spell_pri_imp_shadowform();
|
||||
new spell_pri_improved_spirit_tap();
|
||||
new spell_pri_item_t6_trinket();
|
||||
new spell_pri_lightwell_renew();
|
||||
new spell_pri_mana_burn();
|
||||
new spell_pri_mana_leech();
|
||||
@@ -931,6 +1421,11 @@ void AddSC_priest_spell_scripts()
|
||||
new spell_pri_power_word_shield();
|
||||
new spell_pri_prayer_of_mending_heal();
|
||||
new spell_pri_renew();
|
||||
new spell_pri_shadowfiend_death();
|
||||
new spell_pri_shadow_word_death();
|
||||
new spell_pri_vampiric_embrace();
|
||||
new spell_pri_vampiric_touch();
|
||||
new spell_pri_t3_4p_bonus();
|
||||
new spell_pri_t5_heal_2p_bonus();
|
||||
new spell_pri_t10_heal_2p_bonus();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,10 @@ enum RogueSpells
|
||||
SPELL_ROGUE_HONOR_AMONG_THIEVES = 51698,
|
||||
SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC = 52916,
|
||||
SPELL_ROGUE_HONOR_AMONG_THIEVES_2 = 51699,
|
||||
SPELL_ROGUE_T10_2P_BONUS = 70804
|
||||
SPELL_ROGUE_T10_2P_BONUS = 70804,
|
||||
SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER = 63975,
|
||||
SPELL_ROGUE_QUICK_RECOVERY_ENERGY = 31663,
|
||||
SPELL_ROGUE_CRIPPLING_POISON = 3409
|
||||
};
|
||||
|
||||
// 13877, 33735, (check 51211, 65956) - Blade Flurry
|
||||
@@ -173,6 +176,80 @@ class spell_rog_cheat_death : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -51664 - Cut to the Chase
|
||||
class spell_rog_cut_to_the_chase : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_cut_to_the_chase() : SpellScriptLoader("spell_rog_cut_to_the_chase") { }
|
||||
|
||||
class spell_rog_cut_to_the_chase_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_cut_to_the_chase_AuraScript);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
// "refresh your Slice and Dice duration to its 5 combo point maximum"
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
// lookup Slice and Dice
|
||||
if (AuraEffect const* snd = caster->GetAuraEffect(SPELL_AURA_MOD_MELEE_HASTE, SPELLFAMILY_ROGUE, 0x00040000, 0x00000000, 0x00000000, caster->GetGUID()))
|
||||
{
|
||||
// Max 5 cp duration
|
||||
uint32 countMax = snd->GetSpellInfo()->GetMaxDuration();
|
||||
|
||||
snd->GetBase()->SetDuration(countMax, true);
|
||||
snd->GetBase()->SetMaxDuration(snd->GetBase()->GetDuration());
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_cut_to_the_chase_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_rog_cut_to_the_chase_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -51625 - Deadly Brew
|
||||
class spell_rog_deadly_brew : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_deadly_brew() : SpellScriptLoader("spell_rog_deadly_brew") { }
|
||||
|
||||
class spell_rog_deadly_brew_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_deadly_brew_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_CRIPPLING_POISON))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_CRIPPLING_POISON, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_deadly_brew_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_rog_deadly_brew_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -2818 - Deadly Poison
|
||||
class spell_rog_deadly_poison : public SpellScriptLoader
|
||||
{
|
||||
@@ -522,8 +599,49 @@ class spell_rog_prey_on_the_weak : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -31244 - Quick Recovery
|
||||
class spell_rog_quick_recovery : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_quick_recovery() : SpellScriptLoader("spell_rog_quick_recovery") { }
|
||||
|
||||
class spell_rog_quick_recovery_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_quick_recovery_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_QUICK_RECOVERY_ENERGY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
int32 amount = CalculatePct(spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask()), aurEff->GetAmount());
|
||||
caster->CastCustomSpell(SPELL_ROGUE_QUICK_RECOVERY_ENERGY, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_quick_recovery_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_rog_quick_recovery_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -1943 - Rupture
|
||||
#define RuptureScriptName "spell_rog_rupture"
|
||||
static char const* const RuptureScriptName = "spell_rog_rupture";
|
||||
class spell_rog_rupture : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -586,6 +704,41 @@ class spell_rog_rupture : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 56800 - Glyph of Backstab (dummy)
|
||||
class spell_rog_glyph_of_backstab : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_glyph_of_backstab() : SpellScriptLoader("spell_rog_glyph_of_backstab") { }
|
||||
|
||||
class spell_rog_glyph_of_backstab_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_glyph_of_backstab_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_glyph_of_backstab_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_rog_glyph_of_backstab_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 63975 - Glyph of Backstab (triggered - serverside)
|
||||
class spell_rog_glyph_of_backstab_triggered : public SpellScriptLoader
|
||||
{
|
||||
@@ -642,6 +795,37 @@ class spell_rog_glyph_of_backstab_triggered : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -13983 - Setup
|
||||
class spell_rog_setup : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_setup() : SpellScriptLoader("spell_rog_setup") { }
|
||||
|
||||
class spell_rog_setup_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_setup_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (Player* target = GetTarget()->ToPlayer())
|
||||
if (eventInfo.GetActor() == target->GetSelectedUnit())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_rog_setup_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_rog_setup_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 5938 - Shiv
|
||||
class spell_rog_shiv : public SpellScriptLoader
|
||||
{
|
||||
@@ -785,16 +969,21 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_rog_honor_among_thieves_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_HONOR_AMONG_THIEVES_2) ||
|
||||
!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
if (!caster || caster->HasAura(SPELL_ROGUE_HONOR_AMONG_THIEVES_2))
|
||||
return false;
|
||||
|
||||
if (!caster->GetSpellHistory()->HasCooldown(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -806,7 +995,7 @@ public:
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD), nullptr, aurEff, caster->GetGUID());
|
||||
target->CastSpell(target, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, nullptr, aurEff, caster->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -851,36 +1040,9 @@ public:
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void HandleBeforeHit()
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
/*
|
||||
* The applied aura has a duration of 8 seconds
|
||||
* This prevents new applications while its active
|
||||
* Removing it on each new proc enables the application from different sources (different grouped players)
|
||||
* and on new procs after the source cooldown is finished (1 second)
|
||||
*/
|
||||
if (target->HasAura(GetSpellInfo()->Id))
|
||||
target->RemoveAura(GetSpellInfo()->Id);
|
||||
}
|
||||
|
||||
void TriggerCooldown()
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
target->GetSpellHistory()->AddCooldown(GetSpellInfo()->Id, 0, std::chrono::seconds(1));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_honor_among_thieves_proc_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
|
||||
BeforeHit += SpellHitFn(spell_rog_honor_among_thieves_proc_SpellScript::HandleBeforeHit);
|
||||
AfterHit += SpellHitFn(spell_rog_honor_among_thieves_proc_SpellScript::TriggerCooldown);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -895,14 +1057,17 @@ public:
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
if (Unit* spellTarget = ObjectAccessor::GetUnit(*player, player->GetTarget()))
|
||||
player->CastSpell(spellTarget, SPELL_ROGUE_HONOR_AMONG_THIEVES_2, true);
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
player->CastSpell((Unit*)nullptr, SPELL_ROGUE_HONOR_AMONG_THIEVES_2, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_rog_honor_among_thieves_proc_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_rog_honor_among_thieves_proc_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -912,55 +1077,101 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 70805 - Rogue T10 2P Bonus -- THIS SHOULD BE REMOVED WITH NEW PROC SYSTEM.
|
||||
class spell_rog_t10_2p_bonus : public SpellScriptLoader
|
||||
// -51627 - Turn the Tables
|
||||
class spell_rog_turn_the_tables : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_t10_2p_bonus() : SpellScriptLoader("spell_rog_t10_2p_bonus") { }
|
||||
public:
|
||||
spell_rog_turn_the_tables() : SpellScriptLoader("spell_rog_turn_the_tables") { }
|
||||
|
||||
class spell_rog_t10_2p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_rog_t10_2p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
class spell_rog_turn_the_tables_AuraScript : public AuraScript
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_T10_2P_BONUS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
PrepareAuraScript(spell_rog_turn_the_tables_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
target->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true, nullptr, aurEff, caster->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_turn_the_tables_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return eventInfo.GetActor() == eventInfo.GetActionTarget();
|
||||
return new spell_rog_turn_the_tables_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void Register() override
|
||||
// 52910,52914,52915 - Turn the Tables proc
|
||||
class spell_rog_turn_the_tables_proc : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_turn_the_tables_proc() : SpellScriptLoader("spell_rog_turn_the_tables_proc") { }
|
||||
|
||||
class spell_rog_turn_the_tables_proc_SpellScript : public SpellScript
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_rog_t10_2p_bonus_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
PrepareSpellScript(spell_rog_turn_the_tables_proc_SpellScript);
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_rog_t10_2p_bonus_AuraScript();
|
||||
}
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.clear();
|
||||
|
||||
Unit* target = GetOriginalCaster();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_turn_the_tables_proc_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_rog_turn_the_tables_proc_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_rogue_spell_scripts()
|
||||
{
|
||||
new spell_rog_blade_flurry();
|
||||
new spell_rog_cheat_death();
|
||||
new spell_rog_cut_to_the_chase();
|
||||
new spell_rog_deadly_brew();
|
||||
new spell_rog_deadly_poison();
|
||||
new spell_rog_killing_spree();
|
||||
new spell_rog_nerves_of_steel();
|
||||
new spell_rog_preparation();
|
||||
new spell_rog_prey_on_the_weak();
|
||||
new spell_rog_quick_recovery();
|
||||
new spell_rog_rupture();
|
||||
new spell_rog_glyph_of_backstab();
|
||||
new spell_rog_glyph_of_backstab_triggered();
|
||||
new spell_rog_setup();
|
||||
new spell_rog_shiv();
|
||||
new spell_rog_tricks_of_the_trade();
|
||||
new spell_rog_tricks_of_the_trade_proc();
|
||||
new spell_rog_honor_among_thieves();
|
||||
new spell_rog_honor_among_thieves_proc();
|
||||
new spell_rog_t10_2p_bonus();
|
||||
new spell_rog_turn_the_tables();
|
||||
new spell_rog_turn_the_tables_proc();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,7 @@ enum WarlockSpells
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444,
|
||||
SPELL_WARLOCK_DEMONIC_PACT_PROC = 48090,
|
||||
SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181,
|
||||
SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME = 63311,
|
||||
SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE = 63106,
|
||||
@@ -58,13 +59,29 @@ enum WarlockSpells
|
||||
SPELL_WARLOCK_NETHER_PROTECTION_NATURE = 54375,
|
||||
SPELL_WARLOCK_SOULSHATTER = 32835,
|
||||
SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106,
|
||||
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117
|
||||
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
|
||||
SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED = 63321,
|
||||
SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE_R1 = 27285,
|
||||
SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC = 32865,
|
||||
SPELL_WARLOCK_SHADOW_TRANCE = 17941,
|
||||
SPELL_WARLOCK_SOUL_LEECH_HEAL = 30294,
|
||||
SPELL_WARLOCK_IMP_SOUL_LEECH_R1 = 54117,
|
||||
SPELL_WARLOCK_SOUL_LEECH_PET_MANA_1 = 54607,
|
||||
SPELL_WARLOCK_SOUL_LEECH_PET_MANA_2 = 59118,
|
||||
SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_1 = 54300,
|
||||
SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_2 = 59117,
|
||||
SPELL_REPLENISHMENT = 57669,
|
||||
SPELL_WARLOCK_SHADOWFLAME = 37378,
|
||||
SPELL_WARLOCK_FLAMESHADOW = 37379,
|
||||
SPELL_WARLOCK_GLYPH_OF_SUCCUBUS = 56250,
|
||||
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371
|
||||
};
|
||||
|
||||
enum WarlockSpellIcons
|
||||
{
|
||||
WARLOCK_ICON_ID_IMPROVED_LIFE_TAP = 208,
|
||||
WARLOCK_ICON_ID_MANA_FEED = 1982
|
||||
WARLOCK_ICON_ID_MANA_FEED = 1982,
|
||||
WARLOCK_ICON_ID_DEMONIC_PACT = 3220
|
||||
};
|
||||
|
||||
// -710 - Banish
|
||||
@@ -250,6 +267,36 @@ class spell_warl_curse_of_doom : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_decimation : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_decimation() : SpellScriptLoader("spell_warl_decimation") { }
|
||||
|
||||
class spell_warl_decimation_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_decimation_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||
if (eventInfo.GetActionTarget()->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellInfo, eventInfo.GetActor()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warl_decimation_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_decimation_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 48018 - Demonic Circle: Summon
|
||||
class spell_warl_demonic_circle_summon : public SpellScriptLoader
|
||||
{
|
||||
@@ -480,6 +527,79 @@ class spell_warl_fel_synergy : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -18094 - Nightfall
|
||||
// 56218 - Glyph of Corruption
|
||||
class spell_warl_glyph_of_corruption_nightfall : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_glyph_of_corruption_nightfall() : SpellScriptLoader("spell_warl_glyph_of_corruption_nightfall") { }
|
||||
|
||||
class spell_warl_glyph_of_corruption_nightfall_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_glyph_of_corruption_nightfall_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SHADOW_TRANCE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell(caster, SPELL_WARLOCK_SHADOW_TRANCE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_glyph_of_corruption_nightfall_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_glyph_of_corruption_nightfall_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 63320 - Glyph of Life Tap
|
||||
class spell_warl_glyph_of_life_tap : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_glyph_of_life_tap() : SpellScriptLoader("spell_warl_glyph_of_life_tap") { }
|
||||
|
||||
class spell_warl_glyph_of_life_tap_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_glyph_of_life_tap_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell(caster, SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_glyph_of_life_tap_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_glyph_of_life_tap_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 63310 - Glyph of Shadowflame
|
||||
class spell_warl_glyph_of_shadowflame : public SpellScriptLoader
|
||||
{
|
||||
@@ -618,6 +738,44 @@ class spell_warl_health_funnel : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -18213 - Improved Drain Soul
|
||||
class spell_warl_improved_drain_soul : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_improved_drain_soul() : SpellScriptLoader("spell_warl_improved_drain_soul") { }
|
||||
|
||||
class spell_warl_improved_drain_soul_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_improved_drain_soul_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* target = GetTarget();
|
||||
int32 bp0 = CalculatePct(target->GetMaxPower(POWER_MANA), GetSpellInfo()->Effects[EFFECT_2].BasePoints);
|
||||
target->CastCustomSpell(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC, SPELLVALUE_BASE_POINT0, bp0, target, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_improved_drain_soul_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_improved_drain_soul_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -1454 - Life Tap
|
||||
class spell_warl_life_tap : public SpellScriptLoader
|
||||
{
|
||||
@@ -779,6 +937,55 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 54909, 53646 - Demonic Pact
|
||||
class spell_warl_demonic_pact : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_demonic_pact() : SpellScriptLoader("spell_warl_demonic_pact") { }
|
||||
|
||||
class spell_warl_demonic_pact_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_demonic_pact_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_PACT_PROC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor() && eventInfo.GetActor()->IsPet();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
if (Unit* owner = eventInfo.GetActor()->GetOwner())
|
||||
{
|
||||
if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_DEMONIC_PACT, EFFECT_0))
|
||||
{
|
||||
int32 bp0 = static_cast<int32>((aurEff->GetAmount() * owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_MAGIC) + 100.0f) / 100.0f);
|
||||
owner->CastCustomSpell(SPELL_WARLOCK_DEMONIC_PACT_PROC, SPELLVALUE_BASE_POINT0, bp0, (Unit*)nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warl_demonic_pact_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_demonic_pact_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_demonic_pact_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 18541 - Ritual of Doom Effect
|
||||
class spell_warl_ritual_of_doom_effect : public SpellScriptLoader
|
||||
{
|
||||
@@ -807,6 +1014,47 @@ class spell_warl_ritual_of_doom_effect : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 6358 - Seduction
|
||||
class spell_warl_seduction : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_seduction() : SpellScriptLoader("spell_warl_seduction") { }
|
||||
|
||||
class spell_warl_seduction_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_seduction_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SUCCUBUS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* owner = GetCaster()->GetOwner();
|
||||
if (!owner || !owner->HasAura(SPELL_WARLOCK_GLYPH_OF_SUCCUBUS))
|
||||
return;
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
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
|
||||
{
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_warl_seduction_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_warl_seduction_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -27285 - Seed of Corruption
|
||||
class spell_warl_seed_of_corruption : public SpellScriptLoader
|
||||
{
|
||||
@@ -835,6 +1083,118 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -27243 - Seed of Corruption
|
||||
class spell_warl_seed_of_corruption_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_seed_of_corruption_dummy() : SpellScriptLoader("spell_warl_seed_of_corruption_dummy") { }
|
||||
|
||||
class spell_warl_seed_of_corruption_dummy_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_seed_of_corruption_dummy_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE_R1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo)
|
||||
return;
|
||||
|
||||
int32 amount = aurEff->GetAmount() - damageInfo->GetDamage();
|
||||
if (amount > 0)
|
||||
{
|
||||
const_cast<AuraEffect*>(aurEff)->SetAmount(amount);
|
||||
if (!GetTarget()->HealthBelowPctDamaged(1, damageInfo->GetDamage()))
|
||||
return;
|
||||
}
|
||||
|
||||
Remove();
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE_R1, GetSpellInfo()->GetRank());
|
||||
caster->CastSpell(eventInfo.GetActionTarget(), spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_seed_of_corruption_dummy_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_seed_of_corruption_dummy_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 32863 - Seed of Corruption
|
||||
// 36123 - Seed of Corruption
|
||||
// 38252 - Seed of Corruption
|
||||
// 39367 - Seed of Corruption
|
||||
// 44141 - Seed of Corruption
|
||||
// 70388 - Seed of Corruption
|
||||
// Monster spells, triggered only on amount drop (not on death)
|
||||
class spell_warl_seed_of_corruption_generic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_seed_of_corruption_generic() : SpellScriptLoader("spell_warl_seed_of_corruption_generic") { }
|
||||
|
||||
class spell_warl_seed_of_corruption_generic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_seed_of_corruption_generic_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo)
|
||||
return;
|
||||
|
||||
int32 amount = aurEff->GetAmount() - damageInfo->GetDamage();
|
||||
if (amount > 0)
|
||||
{
|
||||
const_cast<AuraEffect*>(aurEff)->SetAmount(amount);
|
||||
return;
|
||||
}
|
||||
|
||||
Remove();
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
caster->CastSpell(eventInfo.GetActionTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_seed_of_corruption_generic_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_seed_of_corruption_generic_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -7235 - Shadow Ward
|
||||
class spell_warl_shadow_ward : public SpellScriptLoader
|
||||
{
|
||||
@@ -921,6 +1281,71 @@ class spell_warl_siphon_life : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -30293 - Soul Leech
|
||||
class spell_warl_soul_leech : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_soul_leech() : SpellScriptLoader("spell_warl_soul_leech") { }
|
||||
|
||||
class spell_warl_soul_leech_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_soul_leech_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_LEECH_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMP_SOUL_LEECH_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_LEECH_PET_MANA_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_LEECH_PET_MANA_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
static uint32 const casterMana[2] = { SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_1, SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_2 };
|
||||
static uint32 const petMana[2] = { SPELL_WARLOCK_SOUL_LEECH_PET_MANA_1, SPELL_WARLOCK_SOUL_LEECH_PET_MANA_2 };
|
||||
|
||||
PreventDefaultAction();
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return;
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
int32 bp = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
caster->CastCustomSpell(SPELL_WARLOCK_SOUL_LEECH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true);
|
||||
|
||||
// Improved Soul Leech code below
|
||||
AuraEffect const* impSoulLeech = GetTarget()->GetAuraEffectOfRankedSpell(SPELL_WARLOCK_IMP_SOUL_LEECH_R1, EFFECT_1, aurEff->GetCasterGUID());
|
||||
if (!impSoulLeech)
|
||||
return;
|
||||
|
||||
uint8 impSoulLeechRank = impSoulLeech->GetSpellInfo()->GetRank();
|
||||
uint32 selfSpellId = casterMana[impSoulLeechRank - 1];
|
||||
uint32 petSpellId = petMana[impSoulLeechRank - 1];
|
||||
|
||||
caster->CastSpell((Unit*)nullptr, selfSpellId, true);
|
||||
caster->CastSpell((Unit*)nullptr, petSpellId, true);
|
||||
|
||||
if (roll_chance_i(impSoulLeech->GetAmount()))
|
||||
caster->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_soul_leech_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_soul_leech_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 29858 - Soulshatter
|
||||
class spell_warl_soulshatter : public SpellScriptLoader
|
||||
{
|
||||
@@ -960,6 +1385,45 @@ class spell_warl_soulshatter : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 37377 - Shadowflame
|
||||
// 39437 - Shadowflame Hellfire and RoF
|
||||
template <uint32 TriggerSpellId>
|
||||
class spell_warl_t4_2p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_t4_2p_bonus(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
|
||||
|
||||
template <uint32 Trigger>
|
||||
class spell_warl_t4_2p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_t4_2p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(Trigger))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell(caster, Trigger, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warl_t4_2p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warl_t4_2p_bonus_AuraScript<TriggerSpellId>();
|
||||
}
|
||||
};
|
||||
|
||||
// -30108 - Unstable Affliction
|
||||
class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
@@ -1005,20 +1469,31 @@ void AddSC_warlock_spell_scripts()
|
||||
new spell_warl_banish();
|
||||
new spell_warl_create_healthstone();
|
||||
new spell_warl_curse_of_doom();
|
||||
new spell_warl_decimation();
|
||||
new spell_warl_demonic_circle_summon();
|
||||
new spell_warl_demonic_circle_teleport();
|
||||
new spell_warl_demonic_empowerment();
|
||||
new spell_warl_demonic_pact();
|
||||
new spell_warl_everlasting_affliction();
|
||||
new spell_warl_fel_synergy();
|
||||
new spell_warl_glyph_of_life_tap();
|
||||
new spell_warl_glyph_of_shadowflame();
|
||||
new spell_warl_haunt();
|
||||
new spell_warl_health_funnel();
|
||||
new spell_warl_glyph_of_corruption_nightfall();
|
||||
new spell_warl_improved_drain_soul();
|
||||
new spell_warl_life_tap();
|
||||
new spell_warl_nether_protection();
|
||||
new spell_warl_ritual_of_doom_effect();
|
||||
new spell_warl_seduction();
|
||||
new spell_warl_seed_of_corruption();
|
||||
new spell_warl_seed_of_corruption_dummy();
|
||||
new spell_warl_seed_of_corruption_generic();
|
||||
new spell_warl_shadow_ward();
|
||||
new spell_warl_siphon_life();
|
||||
new spell_warl_soul_leech();
|
||||
new spell_warl_soulshatter();
|
||||
new spell_warl_t4_2p_bonus<SPELL_WARLOCK_FLAMESHADOW>("spell_warl_t4_2p_bonus_shadow");
|
||||
new spell_warl_t4_2p_bonus<SPELL_WARLOCK_SHADOWFLAME>("spell_warl_t4_2p_bonus_fire");
|
||||
new spell_warl_unstable_affliction();
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_BLADESTORM_PERIODIC_WHIRLWIND = 50622,
|
||||
SPELL_WARRIOR_BLOODTHIRST = 23885,
|
||||
SPELL_WARRIOR_BLOODTHIRST_DAMAGE = 23881,
|
||||
SPELL_WARRIOR_BLOODSURGE_R1 = 29723,
|
||||
SPELL_WARRIOR_CHARGE = 34846,
|
||||
SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE = 59653,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_1 = 12162,
|
||||
@@ -39,6 +40,8 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC = 12721,
|
||||
SPELL_WARRIOR_EXECUTE = 20647,
|
||||
SPELL_WARRIOR_EXECUTE_GCD_REDUCED = 71069,
|
||||
SPELL_WARRIOR_EXTRA_CHARGE = 70849,
|
||||
SPELL_WARRIOR_GLYPH_OF_EXECUTION = 58367,
|
||||
SPELL_WARRIOR_GLYPH_OF_VIGILANCE = 63326,
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
|
||||
@@ -46,6 +49,8 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976,
|
||||
SPELL_WARRIOR_RETALIATION_DAMAGE = 22858,
|
||||
SPELL_WARRIOR_SLAM = 50783,
|
||||
SPELL_WARRIOR_SLAM_GCD_REDUCED = 71072,
|
||||
SPELL_WARRIOR_SUDDEN_DEATH_R1 = 46913,
|
||||
SPELL_WARRIOR_SUNDER_ARMOR = 58567,
|
||||
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1 = 12723,
|
||||
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 = 26654,
|
||||
@@ -55,7 +60,13 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849,
|
||||
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
|
||||
SPELL_WARRIOR_VIGILANCE_PROC = 50725,
|
||||
SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665
|
||||
SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665,
|
||||
SPELL_WARRIOR_IMPROVED_SPELL_REFLECTION_TRIGGER = 59725,
|
||||
SPELL_WARRIOR_SECOND_WIND_TRIGGER_1 = 29841,
|
||||
SPELL_WARRIOR_SECOND_WIND_TRIGGER_2 = 29842,
|
||||
SPELL_WARRIOR_GLYPH_OF_BLOCKING = 58374,
|
||||
SPELL_WARRIOR_STOICISM = 70845,
|
||||
SPELL_WARRIOR_T10_MELEE_4P_BONUS = 70847
|
||||
};
|
||||
|
||||
enum WarriorSpellIcons
|
||||
@@ -69,6 +80,7 @@ enum MiscSpells
|
||||
SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY = 25899,
|
||||
SPELL_PRIEST_RENEWED_HOPE = 63944,
|
||||
SPELL_GEN_DAMAGE_REDUCTION_AURA = 68066,
|
||||
SPELL_CATEGORY_SHIELD_SLAM = 1209
|
||||
};
|
||||
|
||||
// 23881 - Bloodthirst
|
||||
@@ -258,7 +270,10 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3))
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -272,15 +287,11 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
ApplyPct(damage, 16 * GetSpellInfo()->GetRank());
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC);
|
||||
uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
damage /= spellInfo->GetMaxTicks();
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID()))
|
||||
damage += (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct() * int32(ticks - aurEff->GetTickNumber());
|
||||
|
||||
damage /= int32(ticks);
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, &damage, NULL, NULL, true);
|
||||
damage += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
caster->CastCustomSpell(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, SPELLVALUE_BASE_POINT0, damage, target, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,6 +307,56 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -12834 - Deep Wounds Aura
|
||||
class spell_warr_deep_wounds_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_deep_wounds_aura() : SpellScriptLoader("spell_warr_deep_wounds_aura") { }
|
||||
|
||||
class spell_warr_deep_wounds_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_deep_wounds_aura_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER && eventInfo.GetDamageInfo();
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* actor = eventInfo.GetActor();
|
||||
float damage = 0.f;
|
||||
|
||||
if (eventInfo.GetDamageInfo()->GetAttackType() == OFF_ATTACK)
|
||||
damage = (actor->GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + actor->GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)) / 2.f;
|
||||
else
|
||||
damage = (actor->GetFloatValue(UNIT_FIELD_MINDAMAGE) + actor->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2.f;
|
||||
|
||||
actor->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, SPELLVALUE_BASE_POINT0, int32(damage), eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warr_deep_wounds_aura_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_deep_wounds_aura_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_deep_wounds_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// -5308 - Execute
|
||||
class spell_warr_execute : public SpellScriptLoader
|
||||
{
|
||||
@@ -352,6 +413,94 @@ class spell_warr_execute : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -29723 - Bloodsurge
|
||||
// -46913 - Sudden Death
|
||||
class spell_warr_extra_proc : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_extra_proc() : SpellScriptLoader("spell_warr_extra_proc") { }
|
||||
|
||||
class spell_warr_extra_proc_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_extra_proc_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_T10_MELEE_4P_BONUS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_EXTRA_CHARGE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SLAM_GCD_REDUCED) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_EXECUTE_GCD_REDUCED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
AuraEffect const* bonusAurEff = target->GetAuraEffect(SPELL_WARRIOR_T10_MELEE_4P_BONUS, EFFECT_0);
|
||||
if (!bonusAurEff)
|
||||
return;
|
||||
|
||||
if (!roll_chance_i(bonusAurEff->GetAmount()))
|
||||
return;
|
||||
|
||||
target->CastSpell((Unit*)nullptr, SPELL_WARRIOR_EXTRA_CHARGE, true, nullptr, aurEff);
|
||||
|
||||
SpellInfo const* auraInfo = aurEff->GetSpellInfo();
|
||||
if (auraInfo->IsRankOf(sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_BLOODSURGE_R1)))
|
||||
target->CastSpell((Unit*)nullptr, SPELL_WARRIOR_SLAM_GCD_REDUCED, true, nullptr, aurEff);
|
||||
else if (auraInfo->IsRankOf(sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_SUDDEN_DEATH_R1)))
|
||||
target->CastSpell((Unit*)nullptr, SPELL_WARRIOR_EXECUTE_GCD_REDUCED, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_extra_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_extra_proc_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 58375 - Glyph of Blocking
|
||||
class spell_warr_glyph_of_blocking : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_glyph_of_blocking() : SpellScriptLoader("spell_warr_glyph_of_blocking") { }
|
||||
|
||||
class spell_warr_glyph_of_blocking_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_glyph_of_blocking_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_BLOCKING))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastSpell(caster, SPELL_WARRIOR_GLYPH_OF_BLOCKING, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_glyph_of_blocking_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_glyph_of_blocking_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 58387 - Glyph of Sunder Armor
|
||||
class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader
|
||||
{
|
||||
@@ -388,31 +537,39 @@ class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 59725 - Improved Spell Reflection
|
||||
// -59088 - Improved Spell Reflection
|
||||
class spell_warr_improved_spell_reflection : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { }
|
||||
|
||||
class spell_warr_improved_spell_reflection_SpellScript : public SpellScript
|
||||
class spell_warr_improved_spell_reflection_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript);
|
||||
PrepareAuraScript(spell_warr_improved_spell_reflection_AuraScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (GetCaster())
|
||||
unitList.remove(GetCaster());
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_IMPROVED_SPELL_REFLECTION_TRIGGER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
caster->CastCustomSpell(SPELL_WARRIOR_IMPROVED_SPELL_REFLECTION_TRIGGER, SPELLVALUE_MAX_TARGETS, aurEff->GetAmount(), caster, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_improved_spell_reflection_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_improved_spell_reflection_SpellScript();
|
||||
return new spell_warr_improved_spell_reflection_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -444,6 +601,44 @@ class spell_warr_intimidating_shout : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 70844 - Item - Warrior T10 Protection 4P Bonus
|
||||
class spell_warr_item_t10_prot_4p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_item_t10_prot_4p_bonus() : SpellScriptLoader("spell_warr_item_t10_prot_4p_bonus") { }
|
||||
|
||||
class spell_warr_item_t10_prot_4p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_item_t10_prot_4p_bonus_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_STOICISM))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* target = eventInfo.GetActionTarget();
|
||||
int32 bp0 = CalculatePct(target->GetMaxHealth(), GetSpellInfo()->Effects[EFFECT_1].CalcValue());
|
||||
target->CastCustomSpell(SPELL_WARRIOR_STOICISM, SPELLVALUE_BASE_POINT0, bp0, (Unit*)nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnProc += AuraProcFn(spell_warr_item_t10_prot_4p_bonus_AuraScript::HandleProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_item_t10_prot_4p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 12975 - Last Stand
|
||||
class spell_warr_last_stand : public SpellScriptLoader
|
||||
{
|
||||
@@ -606,6 +801,56 @@ class spell_warr_retaliation : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -29834 - Second Wind
|
||||
class spell_warr_second_wind : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_second_wind() : SpellScriptLoader("spell_warr_second_wind") { }
|
||||
|
||||
class spell_warr_second_wind_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_second_wind_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SECOND_WIND_TRIGGER_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SECOND_WIND_TRIGGER_2))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
static uint32 const triggeredSpells[2] = { SPELL_WARRIOR_SECOND_WIND_TRIGGER_1, SPELL_WARRIOR_SECOND_WIND_TRIGGER_2 };
|
||||
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActionTarget();
|
||||
uint32 spellId = triggeredSpells[GetSpellInfo()->GetRank() - 1];
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warr_second_wind_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_second_wind_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_second_wind_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 64380, 65941 - Shattering Throw
|
||||
class spell_warr_shattering_throw : public SpellScriptLoader
|
||||
{
|
||||
@@ -737,6 +982,73 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// -46951 - Sword and Board
|
||||
class spell_warr_sword_and_board : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_sword_and_board() : SpellScriptLoader("spell_warr_sword_and_board") { }
|
||||
|
||||
class spell_warr_sword_and_board_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_sword_and_board_AuraScript);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
// Remove cooldown on Shield Slam
|
||||
GetTarget()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
return spellInfo && spellInfo->GetCategory() == SPELL_CATEGORY_SHIELD_SLAM;
|
||||
}, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_sword_and_board_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_sword_and_board_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 28845 - Cheat Death
|
||||
class spell_warr_t3_prot_8p_bonus : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warr_t3_prot_8p_bonus() : SpellScriptLoader("spell_warr_t3_prot_8p_bonus") { }
|
||||
|
||||
class spell_warr_t3_prot_8p_bonus_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warr_t3_prot_8p_bonus_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (eventInfo.GetActionTarget()->HealthBelowPct(20))
|
||||
return true;
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo && damageInfo->GetDamage())
|
||||
if (GetTarget()->HealthBelowPctDamaged(20, damageInfo->GetDamage()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_warr_t3_prot_8p_bonus_AuraScript::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_warr_t3_prot_8p_bonus_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 50720 - Vigilance
|
||||
class spell_warr_vigilance : public SpellScriptLoader
|
||||
{
|
||||
@@ -871,17 +1183,24 @@ void AddSC_warrior_spell_scripts()
|
||||
new spell_warr_concussion_blow();
|
||||
new spell_warr_damage_shield();
|
||||
new spell_warr_deep_wounds();
|
||||
new spell_warr_deep_wounds_aura();
|
||||
new spell_warr_execute();
|
||||
new spell_warr_extra_proc();
|
||||
new spell_warr_glyph_of_blocking();
|
||||
new spell_warr_glyph_of_sunder_armor();
|
||||
new spell_warr_improved_spell_reflection();
|
||||
new spell_warr_intimidating_shout();
|
||||
new spell_warr_item_t10_prot_4p_bonus();
|
||||
new spell_warr_last_stand();
|
||||
new spell_warr_overpower();
|
||||
new spell_warr_rend();
|
||||
new spell_warr_retaliation();
|
||||
new spell_warr_second_wind();
|
||||
new spell_warr_shattering_throw();
|
||||
new spell_warr_slam();
|
||||
new spell_warr_sweeping_strikes();
|
||||
new spell_warr_sword_and_board();
|
||||
new spell_warr_t3_prot_8p_bonus();
|
||||
new spell_warr_vigilance();
|
||||
new spell_warr_vigilance_trigger();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user