refactor(Core/Spells): Implement QAston Proc System (#11079)

* .

* sql

* .

* .

* 1

* 2

* 3

* 4

* 5

* 6

* 7

* 8

* 9

* 10

* 11

* 12

* 13

* 14

* 15

* Update spell_item.cpp

* Update Unit.cpp

* 16

* 17

* 18

* 19

* 20

* 21

* Update Unit.cpp

* REVERT UltraNIX Commit

* 22

* 23

* .

* .

* .

* warrior

* warlock

* shaman rogue priest paladin mage

* spell item

* hunter

* druid

* dk

* war

* error style

* Update rev_1647677899565690722.sql

* Update rev_1647677899565690722.sql

* Update rev_1647677899565690722.sql

* .

* DOND DEL ME WAD DO DO

* error 2

* .

* .

* .

* FIX

* Update SpellInfoCorrections.cpp

* Update SpellInfoCorrections.cpp

* .

* ja genau

* Update .gitignore

* .

* .

* .,

* .

* .

* .

* .

* Update Unit.cpp
This commit is contained in:
IntelligentQuantum
2022-10-02 21:09:34 +03:30
committed by GitHub
parent 5189b43a28
commit cbd3fd0967
54 changed files with 9126 additions and 5957 deletions

View File

@@ -154,7 +154,6 @@ public:
{ "spell_loot_template", HandleReloadLootTemplatesSpellCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "spell_linked_spell", HandleReloadSpellLinkedSpellCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "spell_pet_auras", HandleReloadSpellPetAurasCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "spell_proc_event", HandleReloadSpellProcEventCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "spell_proc", HandleReloadSpellProcsCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "spell_scripts", HandleReloadSpellScriptsCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "spell_target_position", HandleReloadSpellTargetPositionCommand, SEC_ADMINISTRATOR, Console::Yes },
@@ -296,7 +295,6 @@ public:
HandleReloadSpellAreaCommand(handler);
HandleReloadSpellGroupsCommand(handler);
HandleReloadSpellLinkedSpellCommand(handler);
HandleReloadSpellProcEventCommand(handler);
HandleReloadSpellProcsCommand(handler);
HandleReloadSpellBonusesCommand(handler);
HandleReloadSpellTargetPositionCommand(handler);
@@ -853,14 +851,6 @@ public:
return true;
}
static bool HandleReloadSpellProcEventCommand(ChatHandler* handler)
{
LOG_INFO("server.loading", "Re-Loading Spell Proc Event conditions...");
sSpellMgr->LoadSpellProcEvents();
handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
return true;
}
static bool HandleReloadSpellProcsCommand(ChatHandler* handler)
{
LOG_INFO("server.loading", "Re-Loading Spell Proc conditions and data...");

View File

@@ -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
@@ -265,8 +267,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, nullptr, aurEff);
}
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();
}

View File

@@ -857,7 +857,7 @@ public:
resilienceReduction = damage - resilienceReduction;
damage -= resilienceReduction;
uint32 mitigated_damage = resilienceReduction;
DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK, mitigated_damage);
Unit::CalcAbsorbResist(dmgInfo);
Unit::DealDamageMods(plr, damage, &absorb);
int32 overkill = damage - plr->GetHealth();

View File

@@ -1589,6 +1589,26 @@ public:
{
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();
}
};
class spell_valanar_kinetic_bomb : public SpellScriptLoader

View File

@@ -1061,7 +1061,7 @@ public:
{
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
return eventInfo.GetActor() && eventInfo.GetActionTarget() && ((damageInfo && damageInfo->GetDamage()) || eventInfo.GetHitMask() & PROC_EX_ABSORB) && procSpell && procSpell->SpellIconID != 2731; // Xinef: Mark of the Fallen Champion
return eventInfo.GetActor() && eventInfo.GetActionTarget() && ((damageInfo && damageInfo->GetDamage()) || eventInfo.GetHitMask() & PROC_HIT_ABSORB) && procSpell && procSpell->SpellIconID != 2731; // Xinef: Mark of the Fallen Champion
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
@@ -1115,7 +1115,7 @@ public:
{
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
return eventInfo.GetActor() && eventInfo.GetActionTarget() && ((damageInfo && damageInfo->GetDamage()) || eventInfo.GetHitMask() & PROC_EX_ABSORB) && (!procSpell || procSpell->SpellIconID != 2731); // Xinef: Mark of the Fallen Champion
return eventInfo.GetActor() && eventInfo.GetActionTarget() && ((damageInfo && damageInfo->GetDamage()) || eventInfo.GetHitMask() & PROC_HIT_ABSORB) && (!procSpell || procSpell->SpellIconID != 2731); // Xinef: Mark of the Fallen Champion
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
@@ -1404,6 +1404,41 @@ public:
}
};
// 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();
}
};
void AddSC_boss_deathbringer_saurfang()
{
new boss_deathbringer_saurfang();
@@ -1418,4 +1453,5 @@ void AddSC_boss_deathbringer_saurfang()
new spell_deathbringer_boiling_blood();
new achievement_ive_gone_and_made_a_mess();
new npc_icc_blood_beast();
new spell_deathbringer_blood_beast_blood_link();
}

View File

@@ -1076,9 +1076,23 @@ public:
caster->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, caster, false);*/
}
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);
}
};
@@ -1707,6 +1721,45 @@ public:
}
};
// 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, nullptr, aurEff);
}
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();
}
};
void AddSC_boss_professor_putricide()
{
new boss_professor_putricide();
@@ -1731,4 +1784,5 @@ void AddSC_boss_professor_putricide()
new spell_putricide_mutated_transformation_dmg();
new spell_putricide_eat_ooze();
new spell_putricide_regurgitated_ooze();
new spell_putricide_ooze_tank_protection();
}

View File

@@ -952,7 +952,7 @@ public:
}
else
{
Unit::DealHeal(me, me, me->CountPctFromMaxHealth(3));
me->ModifyHealth(me->CountPctFromMaxHealth(5));
_events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
}
break;

View File

@@ -2987,6 +2987,8 @@ public:
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetDamage())

View File

@@ -89,6 +89,57 @@ public:
};
};
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, nullptr, aurEff);
}
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,
@@ -247,4 +298,5 @@ void AddSC_utgarde_keep()
new npc_enslaved_proto_drake();
new spell_ticking_time_bomb();
new spell_uk_second_wind();
}

View File

@@ -0,0 +1,58 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 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 Affero 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 "ScriptMgr.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Unit.h"
enum Spells
{
SPELL_MARK_OF_MALICE_TRIGGERED = 33494
};
// 33493 - Mark of Malice
class spell_mark_of_malice : public AuraScript
{
PrepareAuraScript(spell_mark_of_malice);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MARK_OF_MALICE_TRIGGERED });
}
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, nullptr, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mark_of_malice::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
void AddSC_shadow_labyrinth()
{
RegisterSpellScript(spell_mark_of_malice);
}

View File

@@ -33,16 +33,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
@@ -219,8 +220,47 @@ public:
}
};
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, nullptr, aurEff);
}
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();
}

View File

@@ -29,6 +29,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_boss_illidan(); //Black Temple
void AddSC_boss_shade_of_akama();
void AddSC_boss_supremus();
@@ -122,6 +123,7 @@ void AddOutlandScripts()
AddSC_boss_blackheart_the_inciter();
AddSC_boss_grandmaster_vorpil();
AddSC_boss_murmur();
AddSC_shadow_labyrinth();
AddSC_boss_illidan(); //Black Temple
AddSC_boss_shade_of_akama();
AddSC_boss_supremus();

View File

@@ -21,7 +21,11 @@
*/
#include "ScriptMgr.h"
#include "CreatureAIImpl.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "TemporarySummon.h"
enum HunterSpells
{
@@ -32,6 +36,26 @@ enum HunterSpells
SPELL_HUNTER_PET_SCALING = 62915
};
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,
SPELL_PET_SWOOP = 52825,
SPELL_PET_CHARGE = 61685,
PET_ICON_ID_GROWL = 201,
PET_ICON_ID_CLAW = 262,
PET_ICON_ID_BITE = 1680,
PET_ICON_ID_SMACK = 473
};
struct npc_pet_hunter_snake_trap : public ScriptedAI
{
npc_pet_hunter_snake_trap(Creature* creature) : ScriptedAI(creature) { _init = false; }
@@ -138,7 +162,156 @@ private:
uint32 _spellTimer;
};
// 57627 - Charge
class spell_pet_charge : public AuraScript
{
PrepareAuraScript(spell_pet_charge);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PET_SWOOP,
SPELL_PET_CHARGE
});
}
void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
// Remove +% AP aura
Unit* pet = eventInfo.GetActor();
Aura* aura = pet->GetAura(SPELL_PET_SWOOP, pet->GetGUID());
if (!aura)
aura = pet->GetAura(SPELL_PET_CHARGE, pet->GetGUID());
if (!aura)
return;
aura->DropCharge(AURA_REMOVE_BY_EXPIRE);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pet_charge::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -53178 - Guard Dog
class spell_pet_guard_dog : public AuraScript
{
PrepareAuraScript(spell_pet_guard_dog);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PET_GUARD_DOG_HAPPINESS });
}
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::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pet_guard_dog::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -62764 - Silverback
class spell_pet_silverback : public AuraScript
{
PrepareAuraScript(spell_pet_silverback);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PET_GUARD_DOG_HAPPINESS });
}
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::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pet_silverback::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -61680 - Culling the Herd
class spell_pet_culling_the_herd : public AuraScript
{
PrepareAuraScript(spell_pet_culling_the_herd);
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::CheckProc);
}
};
void AddSC_hunter_pet_scripts()
{
RegisterCreatureAI(npc_pet_hunter_snake_trap);
RegisterSpellScript(spell_pet_charge);
RegisterSpellScript(spell_pet_guard_dog);
RegisterSpellScript(spell_pet_silverback);
RegisterSpellScript(spell_pet_culling_the_herd);
}

View File

@@ -29,7 +29,7 @@
enum PriestSpells
{
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228,
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227,
SPELL_PRIEST_SHADOWFIEND_DEATH = 57989,
SPELL_PRIEST_SHADOWFIEND_DODGE = 8273,
SPELL_PRIEST_LIGHTWELL_CHARGES = 59907
};
@@ -67,12 +67,10 @@ struct npc_pet_pri_shadowfiend : public PetAI
AttackStart(target);
}
void JustDied(Unit* /*killer*/) override
void IsSummonedBy(Unit* summoner) override
{
if (me->IsSummon())
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
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);
}
};

View File

@@ -33,6 +33,13 @@
enum DeathKnightSpells
{
SPELL_DK_ACCLIMATION_HOLY = 50490,
SPELL_DK_ACCLIMATION_FIRE = 50362,
SPELL_DK_ACCLIMATION_FROST = 50485,
SPELL_DK_ACCLIMATION_ARCANE = 50486,
SPELL_DK_ACCLIMATION_SHADOW = 50489,
SPELL_DK_ACCLIMATION_NATURE = 50488,
SPELL_DK_ADVANTAGE_T10_4P_MELEE = 70657,
SPELL_DK_DEATH_AND_DECAY_TRIGGER = 52212,
SPELL_DK_GLYPH_OF_SCOURGE_STRIKE = 58642,
SPELL_DK_WANDERING_PLAGUE_TRIGGER = 50526,
@@ -59,6 +66,7 @@ enum DeathKnightSpells
SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1 = 50365,
SPELL_DK_IMPROVED_FROST_PRESENCE_R1 = 50384,
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1 = 50391,
SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL = 50475,
SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611,
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622,
SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962,
@@ -72,7 +80,23 @@ enum DeathKnightSpells
SPELL_DK_UNHOLY_PRESENCE = 48265,
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_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
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,
};
enum DeathKnightSpellIcons
@@ -82,7 +106,130 @@ 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
class spell_dk_acclimation : public AuraScript
{
PrepareAuraScript(spell_dk_acclimation);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_HOLY) ||
!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_FIRE) ||
!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_FROST) ||
!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_NATURE) ||
!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_SHADOW) ||
!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_ARCANE))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetDamageInfo())
{
switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
{
case SPELL_SCHOOL_HOLY:
case SPELL_SCHOOL_FIRE:
case SPELL_SCHOOL_NATURE:
case SPELL_SCHOOL_FROST:
case SPELL_SCHOOL_SHADOW:
case SPELL_SCHOOL_ARCANE:
return true;
default:
break;
}
}
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 triggerspell = 0;
switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
{
case SPELL_SCHOOL_HOLY:
triggerspell = SPELL_DK_ACCLIMATION_HOLY;
break;
case SPELL_SCHOOL_FIRE:
triggerspell = SPELL_DK_ACCLIMATION_FIRE;
break;
case SPELL_SCHOOL_NATURE:
triggerspell = SPELL_DK_ACCLIMATION_NATURE;
break;
case SPELL_SCHOOL_FROST:
triggerspell = SPELL_DK_ACCLIMATION_FROST;
break;
case SPELL_SCHOOL_SHADOW:
triggerspell = SPELL_DK_ACCLIMATION_SHADOW;
break;
case SPELL_SCHOOL_ARCANE:
triggerspell = SPELL_DK_ACCLIMATION_ARCANE;
break;
default:
return;
}
if (Unit* target = eventInfo.GetActionTarget())
{
target->CastSpell(target, triggerspell, true, nullptr, aurEff);
}
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dk_acclimation::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dk_acclimation::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 70656 - Advantage (T10 4P Melee Bonus)
class spell_dk_advantage_t10_4p : public AuraScript
{
PrepareAuraScript(spell_dk_advantage_t10_4p);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_ADVANTAGE_T10_4P_MELEE))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (Unit* caster = eventInfo.GetActor())
{
if (caster->GetTypeId() != TYPEID_PLAYER || caster->getClass() != CLASS_DEATH_KNIGHT)
{
return false;
}
for (uint8 i = 0; i < MAX_RUNES; ++i)
{
if (caster->ToPlayer()->GetRuneCooldown(i) == 0)
{
return false;
}
}
return true;
}
return false;
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dk_advantage_t10_4p::CheckProc);
}
};
// 50526 - Wandering Plague
@@ -438,19 +585,38 @@ class spell_dk_summon_gargoyle : public SpellScript
}
};
// 63611 - Improved Blood Presence
// 63611 - Improved Blood Presence Triggered
class spell_dk_improved_blood_presence_proc : public AuraScript
{
PrepareAuraScript(spell_dk_improved_blood_presence_proc);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetDamage();
if (eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER)
return true;
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
eventInfo.GetActor()->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL, SPELLVALUE_BASE_POINT0, CalculatePct(int32(dmgInfo->GetDamage()), aurEff->GetAmount()),
eventInfo.GetActor(), true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dk_improved_blood_presence_proc::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dk_improved_blood_presence_proc::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
@@ -693,7 +859,7 @@ class spell_dk_scent_of_blood_trigger : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
return (eventInfo.GetHitMask() & (PROC_EX_DODGE | PROC_EX_PARRY)) || (eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetDamage());
return (eventInfo.GetHitMask() & (PROC_HIT_DODGE | PROC_HIT_PARRY)) || (eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetDamage());
}
void Register() override
@@ -2135,8 +2301,287 @@ class spell_dk_will_of_the_necropolis : public AuraScript
}
};
// -49182 - Blade Barrier
class spell_dk_blade_barrier : public AuraScript
{
PrepareAuraScript(spell_dk_blade_barrier);
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::CheckProc);
}
};
// -48979 - Butchery
class spell_dk_butchery : public AuraScript
{
PrepareAuraScript(spell_dk_butchery);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_BUTCHERY_RUNIC_POWER });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 58642 - Glyph of Scourge Strike
class spell_dk_glyph_of_scourge_strike : public AuraScript
{
PrepareAuraScript(spell_dk_glyph_of_scourge_strike);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dk_glyph_of_scourge_strike::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 61257 - Runic Power Back on Snare/Root
class spell_dk_pvp_4p_bonus : public AuraScript
{
PrepareAuraScript(spell_dk_pvp_4p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_RUNIC_RETURN });
}
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::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dk_pvp_4p_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 49005 - Mark of Blood
class spell_dk_mark_of_blood : public AuraScript
{
PrepareAuraScript(spell_dk_mark_of_blood);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_MARK_OF_BLOOD_HEAL });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dk_mark_of_blood::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -51459 - Necrosis
class spell_dk_necrosis : public AuraScript
{
PrepareAuraScript(spell_dk_necrosis);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_NECROSIS_DAMAGE });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -49018 - Sudden Doom
class spell_dk_sudden_doom : public AuraScript
{
PrepareAuraScript(spell_dk_sudden_doom);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_DEATH_COIL_R1 });
}
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, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dk_sudden_doom::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -65661 Threat of Thassarian
class spell_dk_threat_of_thassarian : public AuraScript
{
PrepareAuraScript(spell_dk_threat_of_thassarian);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DK_OBLITERATE_OFF_HAND_R1,
SPELL_DK_FROST_STRIKE_OFF_HAND_R1,
SPELL_DK_PLAGUE_STRIKE_OFF_HAND_R1,
SPELL_DK_DEATH_STRIKE_OFF_HAND_R1,
SPELL_DK_RUNE_STRIKE_OFF_HAND_R1,
SPELL_DK_BLOOD_STRIKE_OFF_HAND_R1
});
}
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, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dk_threat_of_thassarian::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -49015 - Vendetta
class spell_dk_vendetta : public AuraScript
{
PrepareAuraScript(spell_dk_vendetta);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DK_VENDETTA_HEAL });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
void AddSC_deathknight_spell_scripts()
{
RegisterSpellScript(spell_dk_acclimation);
RegisterSpellScript(spell_dk_advantage_t10_4p);
RegisterSpellScript(spell_dk_wandering_plague);
RegisterSpellScript(spell_dk_raise_ally);
RegisterSpellScript(spell_dk_raise_ally_trigger);
@@ -2181,4 +2626,13 @@ void AddSC_deathknight_spell_scripts()
RegisterSpellScript(spell_dk_spell_deflection);
RegisterSpellScript(spell_dk_vampiric_blood);
RegisterSpellScript(spell_dk_will_of_the_necropolis);
RegisterSpellScript(spell_dk_blade_barrier);
RegisterSpellScript(spell_dk_butchery);
RegisterSpellScript(spell_dk_glyph_of_scourge_strike);
RegisterSpellScript(spell_dk_pvp_4p_bonus);
RegisterSpellScript(spell_dk_mark_of_blood);
RegisterSpellScript(spell_dk_necrosis);
RegisterSpellScript(spell_dk_sudden_doom);
RegisterSpellScript(spell_dk_threat_of_thassarian);
RegisterSpellScript(spell_dk_vendetta);
}

View File

@@ -55,12 +55,45 @@ enum DruidSpells
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
SPELL_DRUID_SAVAGE_ROAR = 62071,
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178,
SPELL_DRUID_T9_FERAL_RELIC_BEAR = 67354,
SPELL_DRUID_T9_FERAL_RELIC_CAT = 67355,
SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950,
SPELL_DRUID_BEAR_FORM_PASSIVE = 1178,
SPELL_DRUID_DIRE_BEAR_FORM_PASSIVE = 9635,
SPELL_DRUID_FORMS_TRINKET_BEAR = 37340,
SPELL_DRUID_FORMS_TRINKET_CAT = 37341,
SPELL_DRUID_FORMS_TRINKET_MOONKIN = 37343,
SPELL_DRUID_FORMS_TRINKET_NONE = 37344,
SPELL_DRUID_FORMS_TRINKET_TREE = 37342,
SPELL_DRUID_ENRAGE = 5229,
SPELL_DRUID_ENRAGED_DEFENSE = 70725,
SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS = 70726,
SPELL_DRUID_T3_PROC_ENERGIZE_MANA = 28722,
SPELL_DRUID_T3_PROC_ENERGIZE_RAGE = 28723,
SPELL_DRUID_T3_PROC_ENERGIZE_ENERGY = 28724,
SPELL_DRUID_BLESSING_OF_THE_CLAW = 28750,
SPELL_DRUID_REVITALIZE_ENERGIZE_MANA = 48542,
SPELL_DRUID_REVITALIZE_ENERGIZE_RAGE = 48541,
SPELL_DRUID_REVITALIZE_ENERGIZE_ENERGY = 48540,
SPELL_DRUID_REVITALIZE_ENERGIZE_RP = 48543,
SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN = 54833,
SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT = 54846,
SPELL_DRUID_GLYPH_OF_RIP = 54818,
SPELL_DRUID_RIP_DURATION_LACERATE_DMG = 60141,
SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED = 54820,
SPELL_DRUID_IMP_LEADER_OF_THE_PACK_R1 = 34297,
SPELL_DRUID_IMP_LEADER_OF_THE_PACK_HEAL = 34299,
SPELL_DRUID_IMP_LEADER_OF_THE_PACK_MANA = 68285,
SPELL_DRUID_EXHILARATE = 28742,
SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL = 54755,
SPELL_DRUID_INFUSION = 37238,
SPELL_DRUID_BLESSING_OF_REMULOS = 40445,
SPELL_DRUID_BLESSING_OF_ELUNE = 40446,
SPELL_DRUID_BLESSING_OF_CENARIUS = 40452,
SPELL_DRUID_LANGUISH = 71023,
SPELL_DRUID_REJUVENATION_T10_PROC = 70691,
SPELL_DRUID_BALANCE_T10_BONUS = 70718,
SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721
};
// 1178 - Bear Form (Passive)
@@ -239,7 +272,7 @@ class spell_dru_brambles_treant : public AuraScript
{
int32 amount = 0;
if (player->HasAura(SPELL_DRUID_BARKSKIN, player->GetGUID()))
player->ApplySpellMod(SPELL_DRUID_BARKSKIN, SPELLMOD_CHANCE_OF_SUCCESS, amount);
player->ApplySpellMod<SPELLMOD_CHANCE_OF_SUCCESS>(SPELL_DRUID_BARKSKIN, amount);
return roll_chance_i(amount);
}
@@ -254,7 +287,7 @@ class spell_dru_brambles_treant : public AuraScript
if (GetUnitOwner()->IsSummon())
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummonerUnit())
if (Player* player = owner->GetSpellModOwner())
player->ApplySpellMod(SPELL_DRUID_BARKSKIN, SPELLMOD_CHANCE_OF_SUCCESS, amount);
player->ApplySpellMod<SPELLMOD_CHANCE_OF_SUCCESS>(SPELL_DRUID_BARKSKIN, amount);
}
void Register() override
@@ -445,6 +478,80 @@ class spell_dru_enrage : public AuraScript
}
};
// 37336 - Druid Forms Trinket
class spell_dru_forms_trinket : public AuraScript
{
PrepareAuraScript(spell_dru_forms_trinket);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_BEAR) ||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_CAT) ||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_MOONKIN) ||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_NONE) ||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_TREE))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
Unit* target = eventInfo.GetActor();
switch (target->GetShapeshiftForm())
{
case FORM_BEAR:
case FORM_DIREBEAR:
case FORM_CAT:
case FORM_MOONKIN:
case FORM_NONE:
case FORM_TREE:
return true;
default:
break;
}
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* target = eventInfo.GetActor();
uint32 triggerspell = 0;
switch (target->GetShapeshiftForm())
{
case FORM_BEAR:
case FORM_DIREBEAR:
triggerspell = SPELL_DRUID_FORMS_TRINKET_BEAR;
break;
case FORM_CAT:
triggerspell = SPELL_DRUID_FORMS_TRINKET_CAT;
break;
case FORM_MOONKIN:
triggerspell = SPELL_DRUID_FORMS_TRINKET_MOONKIN;
break;
case FORM_NONE:
triggerspell = SPELL_DRUID_FORMS_TRINKET_NONE;
break;
case FORM_TREE:
triggerspell = SPELL_DRUID_FORMS_TRINKET_TREE;
break;
default:
return;
}
target->CastSpell(target, triggerspell, true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dru_forms_trinket::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dru_forms_trinket::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 54846 - Glyph of Starfire
class spell_dru_glyph_of_starfire : public SpellScript
{
@@ -797,35 +904,27 @@ class spell_dru_rip : public AuraScript
}
};
// 62606 - Savage Defense
// 62600 - Savage Defense
class spell_dru_savage_defense : public AuraScript
{
PrepareAuraScript(spell_dru_savage_defense);
uint32 absorbPct;
bool Load() override
bool Validate(SpellInfo const* spellInfo) override
{
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
return true;
return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
// Set absorbtion amount to unlimited
amount = -1;
}
void Absorb(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
{
absorbAmount = uint32(CalculatePct(GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK), absorbPct));
aurEff->SetAmount(0);
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
int32 amount = static_cast<int32>(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), aurEff->GetAmount()));
caster->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_savage_defense::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_dru_savage_defense::Absorb, EFFECT_0);
OnEffectProc += AuraEffectProcFn(spell_dru_savage_defense::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
@@ -1033,6 +1132,66 @@ class spell_dru_typhoon : public SpellScript
}
};
// 67353 - T9 Feral Relic (Idol of Mutilation)
class spell_dru_t9_feral_relic : public AuraScript
{
PrepareAuraScript(spell_dru_t9_feral_relic);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_T9_FERAL_RELIC_BEAR) ||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_T9_FERAL_RELIC_CAT))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
Unit* target = eventInfo.GetActor();
switch (target->GetShapeshiftForm())
{
case FORM_BEAR:
case FORM_DIREBEAR:
case FORM_CAT:
return true;
default:
break;
}
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 triggerspell = 0;
Unit* target = eventInfo.GetActor();
switch (target->GetShapeshiftForm())
{
case FORM_BEAR:
case FORM_DIREBEAR:
triggerspell = SPELL_DRUID_T9_FERAL_RELIC_BEAR;
break;
case FORM_CAT:
triggerspell = SPELL_DRUID_T9_FERAL_RELIC_CAT;
break;
default:
return;
}
target->CastSpell(target, triggerspell, true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dru_t9_feral_relic::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dru_t9_feral_relic::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 70691 - Rejuvenation
class spell_dru_t10_restoration_4p_bonus : public SpellScript
{
@@ -1150,6 +1309,441 @@ class spell_dru_berserk : public SpellScript
}
};
// 54832 - Glyph of Innervate
class spell_dru_glyph_of_innervate : public AuraScript
{
PrepareAuraScript(spell_dru_glyph_of_innervate);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN);
int32 amount = CalculatePct(static_cast<int32>(caster->GetCreatePowers(POWER_MANA)), aurEff->GetAmount());
amount /= spellInfo->GetMaxTicks();
caster->CastCustomSpell(SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_innervate::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 54821 - Glyph of Rake
class spell_dru_glyph_of_rake : public AuraScript
{
PrepareAuraScript(spell_dru_glyph_of_rake);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetProcTarget()->GetTypeId() == TYPEID_UNIT;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dru_glyph_of_rake::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_rake::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 54754 - Glyph of Rejuvenation
class spell_dru_glyph_of_rejuvenation : public AuraScript
{
PrepareAuraScript(spell_dru_glyph_of_rejuvenation);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetProcTarget()->HealthBelowPct(50);
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
HealInfo* healInfo = eventInfo.GetHealInfo();
if (!healInfo || !healInfo->GetHeal())
return;
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dru_glyph_of_rejuvenation::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_rejuvenation::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 54815 - Glyph of Shred
class spell_dru_glyph_of_shred : public AuraScript
{
PrepareAuraScript(spell_dru_glyph_of_shred);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DRUID_GLYPH_OF_RIP,
SPELL_DRUID_RIP_DURATION_LACERATE_DMG
});
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
// try to find spell Rip on the target
if (AuraEffect const* rip = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00800000, 0x0, 0x0, caster->GetGUID()))
{
// Rip's max duration, note: spells which modifies Rip's duration also counted like Glyph of Rip
uint32 countMin = rip->GetBase()->GetMaxDuration();
// just Rip's max duration without other spells
uint32 countMax = rip->GetSpellInfo()->GetMaxDuration();
// add possible auras' and Glyph of Shred's max duration
countMax += 3 * aurEff->GetAmount() * IN_MILLISECONDS; // Glyph of Shred -> +6 seconds
countMax += caster->HasAura(SPELL_DRUID_GLYPH_OF_RIP) ? 4 * IN_MILLISECONDS : 0; // Glyph of Rip -> +4 seconds
countMax += caster->HasAura(SPELL_DRUID_RIP_DURATION_LACERATE_DMG) ? 4 * IN_MILLISECONDS : 0; // T7 set bonus -> +4 seconds
// if min < max -> that means caster didn't cast 3 shred yet
// so set Rip's duration and max duration
if (countMin < countMax)
{
rip->GetBase()->SetDuration(rip->GetBase()->GetDuration() + aurEff->GetAmount() * IN_MILLISECONDS);
rip->GetBase()->SetMaxDuration(countMin + aurEff->GetAmount() * IN_MILLISECONDS);
}
}
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_shred::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 54845 - Glyph of Starfire
class spell_dru_glyph_of_starfire_dummy : public AuraScript
{
PrepareAuraScript(spell_dru_glyph_of_starfire_dummy);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_starfire_dummy::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -48539 - Revitalize
class spell_dru_revitalize : public AuraScript
{
PrepareAuraScript(spell_dru_revitalize);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DRUID_REVITALIZE_ENERGIZE_MANA,
SPELL_DRUID_REVITALIZE_ENERGIZE_RAGE,
SPELL_DRUID_REVITALIZE_ENERGIZE_ENERGY,
SPELL_DRUID_REVITALIZE_ENERGIZE_RP
});
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (!roll_chance_i(aurEff->GetAmount()))
return;
Unit* target = eventInfo.GetProcTarget();
uint32 spellId;
switch (target->getPowerType())
{
case POWER_MANA:
spellId = SPELL_DRUID_REVITALIZE_ENERGIZE_MANA;
break;
case POWER_RAGE:
spellId = SPELL_DRUID_REVITALIZE_ENERGIZE_RAGE;
break;
case POWER_ENERGY:
spellId = SPELL_DRUID_REVITALIZE_ENERGIZE_ENERGY;
break;
case POWER_RUNIC_POWER:
spellId = SPELL_DRUID_REVITALIZE_ENERGIZE_RP;
break;
default:
return;
}
eventInfo.GetActor()->CastSpell(target, spellId, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_revitalize::HandleProc, EFFECT_0, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
}
};
// 28716 - Rejuvenation
class spell_dru_t3_2p_bonus : public AuraScript
{
PrepareAuraScript(spell_dru_t3_2p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DRUID_T3_PROC_ENERGIZE_MANA,
SPELL_DRUID_T3_PROC_ENERGIZE_RAGE,
SPELL_DRUID_T3_PROC_ENERGIZE_ENERGY
});
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
if (!roll_chance_i(50))
return false;
return true;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* target = eventInfo.GetProcTarget();
uint32 spellId;
switch (target->getPowerType())
{
case POWER_MANA:
spellId = SPELL_DRUID_T3_PROC_ENERGIZE_MANA;
break;
case POWER_RAGE:
spellId = SPELL_DRUID_T3_PROC_ENERGIZE_RAGE;
break;
case POWER_ENERGY:
spellId = SPELL_DRUID_T3_PROC_ENERGIZE_ENERGY;
break;
default:
return;
}
eventInfo.GetActor()->CastSpell(target, spellId, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dru_t3_2p_bonus::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dru_t3_2p_bonus::HandleProc, EFFECT_0, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
}
};
// 28744 - Regrowth
class spell_dru_t3_6p_bonus : public AuraScript
{
PrepareAuraScript(spell_dru_t3_6p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_BLESSING_OF_THE_CLAW });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_BLESSING_OF_THE_CLAW, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_t3_6p_bonus::HandleProc, EFFECT_0, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
}
};
// 28719 - Healing Touch
class spell_dru_t3_8p_bonus : public AuraScript
{
PrepareAuraScript(spell_dru_t3_8p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_EXHILARATE });
}
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_DRUID_EXHILARATE, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_t3_8p_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 37288 - Mana Restore
// 37295 - Mana Restore
class spell_dru_t4_2p_bonus : public AuraScript
{
PrepareAuraScript(spell_dru_t4_2p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_INFUSION });
}
void HandleProc(AuraEffect const* /* aurEff */, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_INFUSION, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_t4_2p_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 40442 - Druid Tier 6 Trinket
class spell_dru_item_t6_trinket : public AuraScript
{
PrepareAuraScript(spell_dru_item_t6_trinket);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_DRUID_BLESSING_OF_REMULOS,
SPELL_DRUID_BLESSING_OF_ELUNE,
SPELL_DRUID_BLESSING_OF_CENARIUS
});
}
void HandleProc(AuraEffect const* /* aurEff */, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo)
return;
uint32 spellId;
int32 chance;
// Starfire
if (spellInfo->SpellFamilyFlags[0] & 0x00000004)
{
spellId = SPELL_DRUID_BLESSING_OF_REMULOS;
chance = 25;
}
// Rejuvenation
else if (spellInfo->SpellFamilyFlags[0] & 0x00000010)
{
spellId = SPELL_DRUID_BLESSING_OF_ELUNE;
chance = 25;
}
// Mangle (Bear) and Mangle (Cat)
else if (spellInfo->SpellFamilyFlags[1] & 0x00000440)
{
spellId = SPELL_DRUID_BLESSING_OF_CENARIUS;
chance = 40;
} else
return;
if (roll_chance_i(chance))
eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dru_item_t6_trinket::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 70664 - Druid T10 Restoration 4P Bonus (Rejuvenation)
class spell_dru_t10_restoration_4p_bonus_dummy : public AuraScript
{
PrepareAuraScript(spell_dru_t10_restoration_4p_bonus_dummy);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_REJUVENATION_T10_PROC });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo || spellInfo->Id == SPELL_DRUID_REJUVENATION_T10_PROC)
return false;
HealInfo* healInfo = eventInfo.GetHealInfo();
if (!healInfo || !healInfo->GetHeal())
return false;
Player* caster = eventInfo.GetActor()->ToPlayer();
if (!caster)
return false;
return caster->GetGroup() || caster != eventInfo.GetProcTarget();
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 amount = static_cast<int32>(eventInfo.GetHealInfo()->GetHeal());
eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_REJUVENATION_T10_PROC, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dru_t10_restoration_4p_bonus_dummy::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dru_t10_restoration_4p_bonus_dummy::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 24905 - Moonkin Form (Passive)
class spell_dru_moonkin_form_passive_proc : public AuraScript
{
@@ -1184,6 +1778,7 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_berserk);
RegisterSpellScript(spell_dru_dash);
RegisterSpellScript(spell_dru_enrage);
RegisterSpellScript(spell_dru_forms_trinket);
RegisterSpellScript(spell_dru_glyph_of_starfire);
RegisterSpellScript(spell_dru_idol_lifebloom);
RegisterSpellScript(spell_dru_innervate);
@@ -1204,7 +1799,20 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_swift_flight_passive);
RegisterSpellScript(spell_dru_tiger_s_fury);
RegisterSpellScript(spell_dru_typhoon);
RegisterSpellScript(spell_dru_t9_feral_relic);
RegisterSpellScript(spell_dru_t10_restoration_4p_bonus);
RegisterSpellScript(spell_dru_wild_growth);
RegisterSpellScript(spell_dru_glyph_of_innervate);
RegisterSpellScript(spell_dru_glyph_of_rake);
RegisterSpellScript(spell_dru_glyph_of_rejuvenation);
RegisterSpellScript(spell_dru_glyph_of_shred);
RegisterSpellScript(spell_dru_glyph_of_starfire_dummy);
RegisterSpellScript(spell_dru_revitalize);
RegisterSpellScript(spell_dru_t3_2p_bonus);
RegisterSpellScript(spell_dru_t3_6p_bonus);
RegisterSpellScript(spell_dru_t3_8p_bonus);
RegisterSpellScript(spell_dru_t4_2p_bonus);
RegisterSpellScript(spell_dru_item_t6_trinket);
RegisterSpellScript(spell_dru_t10_restoration_4p_bonus_dummy);
RegisterSpellScript(spell_dru_moonkin_form_passive_proc);
}

View File

@@ -848,8 +848,7 @@ class spell_gen_fixate_aura : public AuraScript
}
};
/* 64440 - Blade Warding
64568 - Blood Reserve */
// 64440 - Blade Warding
class spell_gen_proc_above_75 : public AuraScript
{
PrepareAuraScript(spell_gen_proc_above_75);
@@ -3634,6 +3633,53 @@ class spell_gen_bandage : public SpellScript
}
};
// Blood Reserve - 64568
enum BloodReserve
{
SPELL_GEN_BLOOD_RESERVE_AURA = 64568,
SPELL_GEN_BLOOD_RESERVE_HEAL = 64569
};
class spell_gen_blood_reserve : public AuraScript
{
PrepareAuraScript(spell_gen_blood_reserve);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_BLOOD_RESERVE_HEAL))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (Unit* caster = eventInfo.GetActionTarget())
{
if (caster->HealthBelowPct(35))
{
return true;
}
}
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget();
caster->CastCustomSpell(SPELL_GEN_BLOOD_RESERVE_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), caster, TRIGGERED_FULL_MASK, nullptr, aurEff);
caster->RemoveAura(SPELL_GEN_BLOOD_RESERVE_AURA);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_gen_blood_reserve::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_gen_blood_reserve::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
enum ParalyticPoison
{
SPELL_PARALYSIS = 35202

View File

@@ -61,15 +61,25 @@ enum HunterSpells
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114,
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711,
SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED = 54045,
SPELL_HUNTER_PIERCING_SHOTS = 63468,
SPELL_HUNTER_READINESS = 23989,
SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302,
SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418,
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_VICIOUS_VIPER = 61609,
SPELL_HUNTER_VIPER_ATTACK_SPEED = 60144,
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543,
SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT = 61389,
SPELL_LOCK_AND_LOAD_TRIGGER = 56453,
SPELL_LOCK_AND_LOAD_MARKER = 67544
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
};
class spell_hun_check_pet_los : public SpellScript
@@ -416,7 +426,7 @@ class spell_hun_ascpect_of_the_viper : public AuraScript
}
};
// 53209 Chimera Shot
// 53209 - Chimera Shot
class spell_hun_chimera_shot : public SpellScript
{
PrepareSpellScript(spell_hun_chimera_shot);
@@ -433,8 +443,8 @@ class spell_hun_chimera_shot : public SpellScript
{
uint32 spellId = 0;
int32 basePoint = 0;
Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras();
for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
Unit::AuraApplicationMap const& auras = unitTarget->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
Aura* aura = i->second->GetBase();
if (aura->GetCasterGUID() != caster->GetGUID())
@@ -444,53 +454,47 @@ class spell_hun_chimera_shot : public SpellScript
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();
ApplyPct(basePoint, TickCount * 40);
basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
// calculate damage of basic tick (bonuses are already factored in AuraEffect)
basePoint = aurEff->GetAmount() * aurEff->GetTotalTicks();
ApplyPct(basePoint, 40);
}
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
// 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
basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; // TODO: Caster uses unitTarget?
if (basePoint > casterBasePoint)
basePoint = casterBasePoint;
ApplyPct(basePoint, TickCount * 60);
// % of mana drained in max duration
basePoint = aurEff->GetAmount() * aurEff->GetTotalTicks();
// max value
int32 maxManaReturn = CalculatePct(static_cast<int32>(caster->GetMaxPower(POWER_MANA)), basePoint * 2);
ApplyPct(basePoint, unitTarget->GetMaxPower(POWER_MANA));
if (basePoint > maxManaReturn)
basePoint = maxManaReturn;
ApplyPct(basePoint, 60);
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
// 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)
{
if (caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown
{
if (caster->ToPlayer()->HasSpellCooldown(SPELL_HUNTER_CHIMERA_SHOT_SCORPID))
break;
caster->ToPlayer()->AddSpellCooldown(SPELL_HUNTER_CHIMERA_SHOT_SCORPID, 0, 60000);
}
spellId = SPELL_HUNTER_CHIMERA_SHOT_SCORPID;
}
// Refresh aura duration
aura->RefreshDuration();
aurEff->ChangeAmount(aurEff->CalculateAmount(caster), false);
}
break;
}
if (spellId)
{
caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
}
}
}
@@ -808,6 +812,49 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScript
}
};
// -53234 - Piercing Shots
class spell_hun_piercing_shots : public AuraScript
{
PrepareAuraScript(spell_hun_piercing_shots);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PIERCING_SHOTS))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetActionTarget())
return true;
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetActionTarget();
if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
{
SpellInfo const* piercingShots = sSpellMgr->AssertSpellInfo(SPELL_HUNTER_PIERCING_SHOTS);
uint32 dmg = dmgInfo->GetDamage();
uint32 bp = CalculatePct(int32(dmg), aurEff->GetAmount()) / static_cast<int32>(piercingShots->GetMaxTicks());
caster->CastCustomSpell(SPELL_HUNTER_PIERCING_SHOTS, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
}
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_hun_piercing_shots::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_hun_piercing_shots::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 54044 - Pet Carrion Feeder
class spell_hun_pet_carrion_feeder : public SpellScript
{
@@ -1008,6 +1055,43 @@ class spell_hun_tame_beast : public SpellScript
}
};
// 67151 - T9 4P Bonus
class spell_hun_t9_4p_bonus : public AuraScript
{
PrepareAuraScript(spell_hun_t9_4p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_T9_4P_GREATNESS))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER && eventInfo.GetActor()->ToPlayer()->GetPet())
{
return true;
}
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell(caster->ToPlayer()->GetPet(), SPELL_HUNTER_T9_4P_GREATNESS, true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_hun_t9_4p_bonus::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_hun_t9_4p_bonus::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 60144 - Viper Attack Speed
class spell_hun_viper_attack_speed : public AuraScript
{
@@ -1308,6 +1392,172 @@ class spell_hun_bestial_wrath : public SpellScript
}
};
// 57870 - Glyph of Mend Pet
class spell_hun_glyph_of_mend_pet : public AuraScript
{
PrepareAuraScript(spell_hun_glyph_of_mend_pet);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -53290 - Hunting Party
class spell_hun_hunting_party : public AuraScript
{
PrepareAuraScript(spell_hun_hunting_party);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_REPLENISHMENT });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 58914 - Kill Command
class spell_hun_kill_command_pet : public AuraScript
{
PrepareAuraScript(spell_hun_kill_command_pet);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_KILL_COMMAND_HUNTER });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -53228 - Rapid Recuperation (talent aura)
class spell_hun_rapid_recuperation_trigger : public AuraScript
{
PrepareAuraScript(spell_hun_rapid_recuperation_trigger);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1,
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2
});
}
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::HandleRapidFireProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc += AuraEffectProcFn(spell_hun_rapid_recuperation_trigger::HandleRapidKillingProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
// -34497 - Thrill of the Hunt
class spell_hun_thrill_of_the_hunt : public AuraScript
{
PrepareAuraScript(spell_hun_thrill_of_the_hunt);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA });
}
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());
ASSERT(explosiveShot->GetSpellInfo()->GetMaxTicks() > 0);
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
void AddSC_hunter_spell_scripts()
{
RegisterSpellScript(spell_hun_check_pet_los);
@@ -1329,13 +1579,20 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_misdirection_proc);
RegisterSpellScript(spell_hun_pet_carrion_feeder);
RegisterSpellScript(spell_hun_pet_heart_of_the_phoenix);
RegisterSpellScript(spell_hun_piercing_shots);
RegisterSpellScript(spell_hun_readiness);
RegisterSpellScript(spell_hun_scatter_shot);
RegisterSpellScript(spell_hun_sniper_training);
RegisterSpellScript(spell_hun_tame_beast);
RegisterSpellScript(spell_hun_t9_4p_bonus);
RegisterSpellScript(spell_hun_viper_attack_speed);
RegisterSpellScript(spell_hun_volley_trigger);
RegisterSpellScript(spell_hun_lock_and_load);
RegisterSpellScript(spell_hun_intimidation);
RegisterSpellScript(spell_hun_bestial_wrath);
RegisterSpellScript(spell_hun_glyph_of_mend_pet);
RegisterSpellScript(spell_hun_hunting_party);
RegisterSpellScript(spell_hun_kill_command_pet);
RegisterSpellScript(spell_hun_rapid_recuperation_trigger);
RegisterSpellScript(spell_hun_thrill_of_the_hunt);
}

File diff suppressed because it is too large Load Diff

View File

@@ -31,12 +31,11 @@
enum MageSpells
{
// Ours
SPELL_MAGE_BLAZING_SPEED = 31643,
SPELL_MAGE_BURNOUT_TRIGGER = 44450,
SPELL_MAGE_IMPROVED_BLIZZARD_CHILLED = 12486,
SPELL_MAGE_COMBUSTION = 11129,
// Theirs
SPELL_MAGE_COLD_SNAP = 11958,
SPELL_MAGE_FOCUS_MAGIC_PROC = 54648,
SPELL_MAGE_FROST_WARDING_R1 = 11189,
@@ -55,9 +54,49 @@ 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,
SPELL_MAGE_FINGERS_OF_FROST = 44543
};
// -31641 - Blazing Speed
class spell_mage_blazing_speed : public AuraScript
{
PrepareAuraScript(spell_mage_blazing_speed);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_BLAZING_SPEED });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (Unit* target = eventInfo.GetActionTarget())
{
target->CastSpell(target, SPELL_MAGE_BLAZING_SPEED, true, nullptr, aurEff);
}
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_blazing_speed::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
class spell_mage_arcane_blast : public SpellScript
{
PrepareSpellScript(spell_mage_arcane_blast);
@@ -100,7 +139,7 @@ class spell_mage_burning_determination : public AuraScript
return false;
// Xinef: immuned effect should just eat charge
if (eventInfo.GetHitMask() & PROC_EX_IMMUNE)
if (eventInfo.GetHitMask() & PROC_HIT_IMMUNE)
{
eventInfo.GetActionTarget()->RemoveAurasDueToSpell(54748);
return false;
@@ -933,6 +972,349 @@ class spell_mage_summon_water_elemental : public SpellScript
}
};
// -31571 - Arcane Potency
class spell_mage_arcane_potency : public AuraScript
{
PrepareAuraScript(spell_mage_arcane_potency);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_MAGE_ARCANE_POTENCY_RANK_1,
SPELL_MAGE_ARCANE_POTENCY_RANK_2
});
}
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, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_arcane_potency::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 11129 - Combustion
class spell_mage_combustion : public AuraScript
{
PrepareAuraScript(spell_mage_combustion);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_COMBUSTION_PROC });
}
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::CheckProc);
}
};
// -11185 - Improved Blizzard
class spell_mage_imp_blizzard : public AuraScript
{
PrepareAuraScript(spell_mage_imp_blizzard);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_CHILLED });
}
void HandleChill(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 triggerSpellId = sSpellMgr->GetSpellWithRank(SPELL_MAGE_CHILLED, GetSpellInfo()->GetRank());
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), triggerSpellId, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_imp_blizzard::HandleChill, EFFECT_0, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
}
};
// 37447 - Improved Mana Gems
// 61062 - Improved Mana Gems
class spell_mage_imp_mana_gems : public AuraScript
{
PrepareAuraScript(spell_mage_imp_mana_gems);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_MANA_SURGE });
}
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::HandleProc, EFFECT_1, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
}
};
// -31656 - Empowered Fire
class spell_mage_empowered_fire : public AuraScript
{
PrepareAuraScript(spell_mage_empowered_fire);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_EMPOWERED_FIRE_PROC });
}
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::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_empowered_fire::HandleProc, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER);
}
};
// 74396 - Fingers of Frost
class spell_mage_fingers_of_frost : public AuraScript
{
PrepareAuraScript(spell_mage_fingers_of_frost);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA });
}
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::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY);
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_fingers_of_frost::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
// 48108 - Hot Streak
// 57761 - Fireball!
class spell_mage_gen_extra_effects : public AuraScript
{
PrepareAuraScript(spell_mage_gen_extra_effects);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_MAGE_T10_2P_BONUS,
SPELL_MAGE_T10_2P_BONUS_EFFECT,
SPELL_MAGE_T8_4P_BONUS
});
}
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::CheckProc);
OnProc += AuraProcFn(spell_mage_gen_extra_effects::HandleProc);
}
};
// 56375 - Glyph of Polymorph
class spell_mage_glyph_of_polymorph : public AuraScript
{
PrepareAuraScript(spell_mage_glyph_of_polymorph);
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 56374 - Glyph of Icy Veins
class spell_mage_glyph_of_icy_veins : public AuraScript
{
PrepareAuraScript(spell_mage_glyph_of_icy_veins);
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -44445 - Hot Streak
class spell_mage_hot_streak : public AuraScript
{
PrepareAuraScript(spell_mage_hot_streak);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_HOT_STREAK_PROC });
}
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, aurEff);
}
// reset counter
counter->SetAmount(25);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_hot_streak::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -29441 - Magic Absorption
class spell_mage_magic_absorption : public AuraScript
{
PrepareAuraScript(spell_mage_magic_absorption);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_MAGIC_ABSORPTION_MANA });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -44404 - Missile Barrage
class spell_mage_missile_barrage : public AuraScript
{
PrepareAuraScript(spell_mage_missile_barrage);
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::CheckProc);
}
};
#define FingersOfFrostScriptName "spell_mage_fingers_of_frost_proc_aura"
class spell_mage_fingers_of_frost_proc_aura : public AuraScript
{ PrepareAuraScript(spell_mage_fingers_of_frost_proc_aura);
@@ -1043,6 +1425,7 @@ class spell_mage_fingers_of_frost_proc : public AuraScript
void AddSC_mage_spell_scripts()
{
RegisterSpellScript(spell_mage_blazing_speed);
RegisterSpellScript(spell_mage_arcane_blast);
RegisterSpellScript(spell_mage_burning_determination);
RegisterSpellScript(spell_mage_molten_armor);
@@ -1064,6 +1447,18 @@ void AddSC_mage_spell_scripts()
RegisterSpellScript(spell_mage_master_of_elements);
RegisterSpellScript(spell_mage_polymorph_cast_visual);
RegisterSpellScript(spell_mage_summon_water_elemental);
RegisterSpellScript(spell_mage_arcane_potency);
RegisterSpellScript(spell_mage_combustion);
RegisterSpellScript(spell_mage_imp_blizzard);
RegisterSpellScript(spell_mage_imp_mana_gems);
RegisterSpellScript(spell_mage_empowered_fire);
RegisterSpellScript(spell_mage_fingers_of_frost);
RegisterSpellScript(spell_mage_gen_extra_effects);
RegisterSpellScript(spell_mage_glyph_of_polymorph);
RegisterSpellScript(spell_mage_glyph_of_icy_veins);
RegisterSpellScript(spell_mage_hot_streak);
RegisterSpellScript(spell_mage_magic_absorption);
RegisterSpellScript(spell_mage_missile_barrage);
RegisterSpellScript(spell_mage_fingers_of_frost_proc_aura);
RegisterSpellScript(spell_mage_fingers_of_frost_proc);
}

View File

@@ -28,6 +28,7 @@
#include "SpellMgr.h"
#include "SpellScript.h"
#include "UnitAI.h"
#include "GameTime.h"
enum PaladinSpells
{
@@ -38,6 +39,7 @@ enum PaladinSpells
SPELL_PALADIN_HOLY_SHOCK_R1 = 20473,
SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912,
SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914,
SPELL_PALADIN_ILLUMINATION_ENERGIZE = 20272,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID = 37878,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
@@ -81,7 +83,44 @@ enum PaladinSpells
SPELL_PALADIN_AURA_MASTERY_IMMUNE = 64364,
SPELL_GENERIC_ARENA_DAMPENING = 74410,
SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411
SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411,
SPELL_PALADIN_SACRED_SHIELD = 53601,
SPELL_PALADIN_T9_HOLY_4P_BONUS = 67191,
SPELL_PALADIN_FLASH_OF_LIGHT_PROC = 66922,
SPELL_PALADIN_JUDGEMENTS_OF_THE_JUST_PROC = 68055,
SPELL_PALADIN_GLYPH_OF_DIVINITY_PROC = 54986,
SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA = 31930,
SPELL_REPLENISHMENT = 57669,
SPELL_PALADIN_RIGHTEOUS_VENGEANCE_DAMAGE = 61840,
SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL = 54203,
SPELL_PALADIN_SACRED_SHIELD_TRIGGER = 58597,
SPELL_PALADIN_T8_HOLY_4P_BONUS = 64895,
SPELL_PALADIN_HEART_OF_THE_CRUSADER_EFF_R1 = 21183,
SPELL_PALADIN_HOLY_POWER_ARMOR = 28790,
SPELL_PALADIN_HOLY_POWER_ATTACK_POWER = 28791,
SPELL_PALADIN_HOLY_POWER_SPELL_POWER = 28793,
SPELL_PALADIN_HOLY_POWER_MP5 = 28795,
SPELL_PALADIN_HOLY_VENGEANCE = 31803,
SPELL_PALADIN_SEAL_OF_VENGEANCE_DAMAGE = 42463,
SPELL_PALADIN_BLOOD_CORRUPTION = 53742,
SPELL_PALADIN_SEAL_OF_CORRUPTION_DAMAGE = 53739,
SPELL_PALADIN_SPIRITUAL_ATTUNEMENT_MANA = 31786,
SPELL_PALADIN_ENDURING_LIGHT = 40471,
SPELL_PALADIN_ENDURING_JUDGEMENT = 40472,
SPELL_PALADIN_GLYPH_OF_HOLY_LIGHT_HEAL = 54968,
SPELL_PALADIN_HOLY_MENDING = 64891,
SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL = 20267,
SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA = 20268
};
enum PaladinSpellIcons
@@ -218,13 +257,6 @@ class spell_pal_sacred_shield_base : public AuraScript
}
}
bool CheckProc(ProcEventInfo& eventInfo)
{
HealInfo* healinfo = eventInfo.GetHealInfo();
DamageInfo* damageinfo = eventInfo.GetDamageInfo();
return !(eventInfo.GetHitMask() & PROC_EX_INTERNAL_HOT) && ((healinfo && healinfo->GetHeal() > 0) || (damageinfo && damageinfo->GetDamage() > 0));
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -280,7 +312,6 @@ class spell_pal_sacred_shield_base : public AuraScript
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_sacred_shield_base::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc += AuraCheckProcFn(spell_pal_sacred_shield_base::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pal_sacred_shield_base::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -838,6 +869,51 @@ class spell_pal_holy_shock : public SpellScript
}
};
// -20210 - Illumination
class spell_pal_illumination : public AuraScript
{
PrepareAuraScript(spell_pal_illumination);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, SPELL_PALADIN_ILLUMINATION_ENERGIZE, SPELL_PALADIN_HOLY_SHOCK_R1 });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
// this script is valid only for the Holy Shock procs of illumination
if (eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetSpellInfo())
{
SpellInfo const* originalSpell = nullptr;
// if proc comes from the Holy Shock heal, need to get mana cost of original spell - else it's the original heal itself
if (eventInfo.GetHealInfo()->GetSpellInfo()->SpellFamilyFlags[1] & 0x00010000)
{
originalSpell = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1, eventInfo.GetHealInfo()->GetSpellInfo()->GetRank()));
}
else
{
originalSpell = eventInfo.GetHealInfo()->GetSpellInfo();
}
if (originalSpell && aurEff->GetSpellInfo())
{
Unit* target = eventInfo.GetActor(); // Paladin is the target of the energize
uint32 bp = CalculatePct(originalSpell->CalcPowerCost(target, originalSpell->GetSchoolMask()), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue());
target->CastCustomSpell(SPELL_PALADIN_ILLUMINATION_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
}
}
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_illumination::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 53407 - Judgement of Justice
// 20271 - Judgement of Light
// 53408 - Judgement of Wisdom
@@ -1043,7 +1119,7 @@ class spell_pal_seal_of_righteousness : public AuraScript
return false;
}
return target->IsAlive() && !eventInfo.GetTriggerAuraSpell() && (damageInfo->GetDamage() || (eventInfo.GetHitMask() & PROC_EX_ABSORB));
return target->IsAlive() && !eventInfo.GetTriggerAuraSpell() && (damageInfo->GetDamage() || (eventInfo.GetHitMask() & PROC_HIT_ABSORB));
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -1071,6 +1147,593 @@ class spell_pal_seal_of_righteousness : public AuraScript
}
};
// -31871 - Divine Purpose
class spell_pal_divine_purpose : public AuraScript
{
PrepareAuraScript(spell_pal_divine_purpose);
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (!roll_chance_i(aurEff->GetAmount()))
return;
eventInfo.GetProcTarget()->RemoveAurasWithMechanic(1 << MECHANIC_STUN, AURA_REMOVE_BY_ENEMY_SPELL);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_divine_purpose::HandleProc, EFFECT_2, SPELL_AURA_DUMMY);
}
};
// 54939 - Glyph of Divinity
class spell_pal_glyph_of_divinity : public AuraScript
{
PrepareAuraScript(spell_pal_glyph_of_divinity);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_GLYPH_OF_DIVINITY_PROC });
}
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
// Lay on Hands (Rank 1) does not have mana effect
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo || spellInfo->Effects[EFFECT_1].Effect != SPELL_EFFECT_ENERGIZE)
return;
Unit* caster = eventInfo.GetActor();
if (caster == eventInfo.GetProcTarget())
return;
int32 mana = spellInfo->Effects[EFFECT_1].CalcValue() * 2;
caster->CastCustomSpell(SPELL_PALADIN_GLYPH_OF_DIVINITY_PROC, SPELLVALUE_BASE_POINT1, mana, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_glyph_of_divinity::OnProc, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER);
}
};
// 54937 - Glyph of Holy Light (dummy aura)
class spell_pal_glyph_of_holy_light_dummy : public AuraScript
{
PrepareAuraScript(spell_pal_glyph_of_holy_light_dummy);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_GLYPH_OF_HOLY_LIGHT_HEAL });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
HealInfo* healInfo = eventInfo.GetHealInfo();
if (!healInfo || !healInfo->GetHeal())
return;
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
caster->CastCustomSpell(SPELL_PALADIN_GLYPH_OF_HOLY_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_glyph_of_holy_light_dummy::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -20335 - Heart of the Crusader
class spell_pal_heart_of_the_crusader : public AuraScript
{
PrepareAuraScript(spell_pal_heart_of_the_crusader);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_HEART_OF_THE_CRUSADER_EFF_R1 });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HEART_OF_THE_CRUSADER_EFF_R1, GetSpellInfo()->GetRank());
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_heart_of_the_crusader::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -20234 - Improved Lay on Hands
class spell_pal_improved_lay_of_hands : public AuraScript
{
PrepareAuraScript(spell_pal_improved_lay_of_hands);
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActionTarget(), GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true, nullptr, aurEff, GetTarget()->GetGUID());
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_improved_lay_of_hands::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// -53569 - Infusion of Light
class spell_pal_infusion_of_light : public AuraScript
{
PrepareAuraScript(spell_pal_infusion_of_light);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PALADIN_SACRED_SHIELD,
SPELL_PALADIN_T9_HOLY_4P_BONUS,
SPELL_PALADIN_FLASH_OF_LIGHT_PROC
});
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
{
// Flash of Light HoT on Flash of Light when Sacred Shield active
if (spellInfo->SpellFamilyFlags[0] & 0x40000000 && spellInfo->SpellIconID == 242)
{
PreventDefaultAction();
HealInfo* healInfo = eventInfo.GetHealInfo();
if (!healInfo || !healInfo->GetHeal())
return;
Unit* procTarget = eventInfo.GetActionTarget();
if (procTarget && procTarget->HasAura(SPELL_PALADIN_SACRED_SHIELD))
{
Unit* target = GetTarget();
int32 duration = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_FLASH_OF_LIGHT_PROC)->GetMaxDuration() / 1000;
int32 pct = GetSpellInfo()->Effects[EFFECT_2].CalcValue();
int32 bp0 = CalculatePct(healInfo->GetHeal() / duration, pct);
// Item - Paladin T9 Holy 4P Bonus
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_PALADIN_T9_HOLY_4P_BONUS, 0))
AddPct(bp0, aurEff->GetAmount());
target->CastCustomSpell(SPELL_PALADIN_FLASH_OF_LIGHT_PROC, SPELLVALUE_BASE_POINT0, bp0, procTarget, true, nullptr, aurEff);
}
}
// but should not proc on non-critical Holy Shocks
else if ((spellInfo->SpellFamilyFlags[0] & 0x200000 || spellInfo->SpellFamilyFlags[1] & 0x10000) && !(eventInfo.GetHitMask() & PROC_HIT_CRITICAL))
PreventDefaultAction();
}
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_infusion_of_light::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 40470 - Paladin Tier 6 Trinket
class spell_pal_item_t6_trinket : public AuraScript
{
PrepareAuraScript(spell_pal_item_t6_trinket);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PALADIN_ENDURING_LIGHT,
SPELL_PALADIN_ENDURING_JUDGEMENT
});
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo)
return;
uint32 spellId;
int32 chance;
// Holy Light & Flash of Light
if (spellInfo->SpellFamilyFlags[0] & 0xC0000000)
{
spellId = SPELL_PALADIN_ENDURING_LIGHT;
chance = 15;
}
// Judgements
else if (spellInfo->SpellFamilyFlags[0] & 0x00800000)
{
spellId = SPELL_PALADIN_ENDURING_JUDGEMENT;
chance = 50;
}
else
return;
if (roll_chance_i(chance))
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_item_t6_trinket::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 20185 - Judgement of Light
class spell_pal_judgement_of_light_heal : public AuraScript
{
PrepareAuraScript(spell_pal_judgement_of_light_heal);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetProcTarget();
int32 amount = static_cast<int32>(caster->CountPctFromMaxHealth(aurEff->GetAmount()));
caster->CastCustomSpell(SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_judgement_of_light_heal::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 20186 - Judgement of Wisdom
class spell_pal_judgement_of_wisdom_mana : public AuraScript
{
PrepareAuraScript(spell_pal_judgement_of_wisdom_mana);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetProcTarget()->getPowerType() == POWER_MANA;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetProcTarget();
int32 amount = CalculatePct(static_cast<int32>(caster->GetCreateMana()), aurEff->GetAmount());
caster->CastCustomSpell(SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pal_judgement_of_wisdom_mana::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pal_judgement_of_wisdom_mana::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -53695 - Judgements of the Just
class spell_pal_judgements_of_the_just : public AuraScript
{
PrepareAuraScript(spell_pal_judgements_of_the_just);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_JUDGEMENTS_OF_THE_JUST_PROC });
}
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(eventInfo.GetActionTarget(), SPELL_PALADIN_JUDGEMENTS_OF_THE_JUST_PROC, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_judgements_of_the_just::OnProc, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER);
}
};
// -31876 - Judgements of the Wise
class spell_pal_judgements_of_the_wise : public AuraScript
{
PrepareAuraScript(spell_pal_judgements_of_the_wise);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_REPLENISHMENT,
SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA
});
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell((Unit*)nullptr, SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA, true);
caster->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_judgements_of_the_wise::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 53601 - Sacred Shield (dummy)
class spell_pal_sacred_shield_dummy : public AuraScript
{
PrepareAuraScript(spell_pal_sacred_shield_dummy);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PALADIN_SACRED_SHIELD_TRIGGER,
SPELL_PALADIN_T8_HOLY_4P_BONUS
});
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = GetCaster();
if (!caster)
return;
TimePoint now = GameTime::Now();
if (_cooldownEnd > now)
return;
Seconds cooldown(aurEff->GetAmount());
if (AuraEffect const* bonus = caster->GetAuraEffect(SPELL_PALADIN_T8_HOLY_4P_BONUS, EFFECT_0, caster->GetGUID()))
cooldown = Seconds(bonus->GetAmount());
_cooldownEnd = now + cooldown;
caster->CastSpell(eventInfo.GetActionTarget(), SPELL_PALADIN_SACRED_SHIELD_TRIGGER, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_sacred_shield_dummy::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
// Cooldown tracking can't be done in DB because of T8 bonus
TimePoint _cooldownEnd = std::chrono::steady_clock::time_point::min();
};
// 31801 - Seal of Vengeance
// 53736 - Seal of Corruption
template <uint32 DoTSpellId, uint32 DamageSpellId>
class spell_pal_seal_of_vengeance : public SpellScriptLoader
{
public:
spell_pal_seal_of_vengeance(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
template <uint32 DoTSpell, uint32 DamageSpell>
class spell_pal_seal_of_vengeance_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_seal_of_vengeance_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
DoTSpell,
DamageSpell
});
}
/*
When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system).
1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..)
2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided.
Remember #2 happens regardless of #1 landing, it just requires the initial attack (autos, cs, etc) to land.
Stack Number % of Weapon Damage % with SotP
0 0% 0%
1 6.6% 7.6%
2 13.2% 15.2%
3 19.8% 22.8%
4 26.4% 30.4%
5 33% 38%
*/
void HandleApplyDoT(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_MELEE_AUTO_ATTACK))
return;
// don't cast triggered, spell already has SPELL_ATTR4_CAN_CAST_WHILE_CASTING attr
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), DoTSpell, false);
}
void HandleSeal(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, 0x00000000, 0x00000800, 0x00000000, caster->GetGUID());
if (!aurEff)
return;
uint8 stacks = aurEff->GetBase()->GetStackAmount();
uint8 maxStacks = aurEff->GetSpellInfo()->StackAmount;
if (stacks < maxStacks && !(eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS))
return;
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(DamageSpell);
int32 amount = spellInfo->Effects[EFFECT_0].CalcValue();
amount *= stacks;
amount /= maxStacks;
caster->CastCustomSpell(DamageSpell, SPELLVALUE_BASE_POINT0, amount, target, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_seal_of_vengeance_AuraScript::HandleApplyDoT, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_pal_seal_of_vengeance_AuraScript::HandleSeal, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_pal_seal_of_vengeance_AuraScript<DoTSpellId, DamageSpellId>();
}
};
// 20375 - Seal of Command
// 21084 - Seal of Righteousness
// 31801 - Seal of Vengeance
// 31892 - Seal of Blood
// 33127 - Seal of Command
// 38008 - Seal of Blood
// 41459 - Seal of Blood
// 53720 - Seal of the Martyr
// 53736 - Seal of Corruption
class spell_pal_seals : public AuraScript
{
PrepareAuraScript(spell_pal_seals);
// Effect 2 is used by Judgement code, we prevent the proc to avoid console logging of unknown spell trigger
bool CheckDummyProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
return false;
}
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_seals::CheckDummyProc, EFFECT_2, SPELL_AURA_DUMMY);
}
};
// -31785 - Spiritual Attunement
class spell_pal_spiritual_attunement : public AuraScript
{
PrepareAuraScript(spell_pal_spiritual_attunement);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_SPIRITUAL_ATTUNEMENT_MANA });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
// "when healed by other friendly targets' spells"
if (eventInfo.GetProcTarget() == eventInfo.GetActionTarget())
return false;
return eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetEffectiveHeal();
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
HealInfo* healInfo = eventInfo.GetHealInfo();
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetEffectiveHeal()), aurEff->GetAmount());
eventInfo.GetActionTarget()->CastCustomSpell(SPELL_PALADIN_SPIRITUAL_ATTUNEMENT_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pal_spiritual_attunement::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pal_spiritual_attunement::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 28789 - Holy Power
class spell_pal_t3_6p_bonus : public AuraScript
{
PrepareAuraScript(spell_pal_t3_6p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PALADIN_HOLY_POWER_ARMOR,
SPELL_PALADIN_HOLY_POWER_ATTACK_POWER,
SPELL_PALADIN_HOLY_POWER_SPELL_POWER,
SPELL_PALADIN_HOLY_POWER_MP5
});
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 spellId;
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
switch (target->getClass())
{
case CLASS_PALADIN:
case CLASS_PRIEST:
case CLASS_SHAMAN:
case CLASS_DRUID:
spellId = SPELL_PALADIN_HOLY_POWER_MP5;
break;
case CLASS_MAGE:
case CLASS_WARLOCK:
spellId = SPELL_PALADIN_HOLY_POWER_SPELL_POWER;
break;
case CLASS_HUNTER:
case CLASS_ROGUE:
spellId = SPELL_PALADIN_HOLY_POWER_ATTACK_POWER;
break;
case CLASS_WARRIOR:
spellId = SPELL_PALADIN_HOLY_POWER_ARMOR;
break;
default:
return;
}
caster->CastSpell(target, spellId, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pal_t3_6p_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
void AddSC_paladin_spell_scripts()
{
RegisterSpellAndAuraScriptPair(spell_pal_seal_of_command, spell_pal_seal_of_command_aura);
@@ -1091,6 +1754,7 @@ void AddSC_paladin_spell_scripts()
RegisterSpellAndAuraScriptPair(spell_pal_hand_of_sacrifice, spell_pal_hand_of_sacrifice_aura);
RegisterSpellScript(spell_pal_hand_of_salvation);
RegisterSpellScript(spell_pal_holy_shock);
RegisterSpellScript(spell_pal_illumination);
RegisterSpellScriptWithArgs(spell_pal_judgement, "spell_pal_judgement_of_justice", SPELL_PALADIN_JUDGEMENT_OF_JUSTICE);
RegisterSpellScriptWithArgs(spell_pal_judgement, "spell_pal_judgement_of_light", SPELL_PALADIN_JUDGEMENT_OF_LIGHT);
RegisterSpellScriptWithArgs(spell_pal_judgement, "spell_pal_judgement_of_wisdom", SPELL_PALADIN_JUDGEMENT_OF_WISDOM);
@@ -1098,4 +1762,21 @@ void AddSC_paladin_spell_scripts()
RegisterSpellScript(spell_pal_lay_on_hands);
RegisterSpellScript(spell_pal_righteous_defense);
RegisterSpellScript(spell_pal_seal_of_righteousness);
RegisterSpellScript(spell_pal_divine_purpose);
RegisterSpellScript(spell_pal_glyph_of_divinity);
RegisterSpellScript(spell_pal_glyph_of_holy_light_dummy);
RegisterSpellScript(spell_pal_heart_of_the_crusader);
RegisterSpellScript(spell_pal_improved_lay_of_hands);
RegisterSpellScript(spell_pal_infusion_of_light);
RegisterSpellScript(spell_pal_item_t6_trinket);
RegisterSpellScript(spell_pal_judgement_of_light_heal);
RegisterSpellScript(spell_pal_judgement_of_wisdom_mana);
RegisterSpellScript(spell_pal_judgements_of_the_just);
RegisterSpellScript(spell_pal_judgements_of_the_wise);
RegisterSpellScript(spell_pal_sacred_shield_dummy);
new spell_pal_seal_of_vengeance<SPELL_PALADIN_HOLY_VENGEANCE, SPELL_PALADIN_SEAL_OF_VENGEANCE_DAMAGE>("spell_pal_seal_of_vengeance");
new spell_pal_seal_of_vengeance<SPELL_PALADIN_BLOOD_CORRUPTION, SPELL_PALADIN_SEAL_OF_CORRUPTION_DAMAGE>("spell_pal_seal_of_corruption");
RegisterSpellScript(spell_pal_seals);
RegisterSpellScript(spell_pal_spiritual_attunement);
RegisterSpellScript(spell_pal_t3_6p_bonus);
}

View File

@@ -31,6 +31,7 @@
enum PriestSpells
{
SPELL_PRIEST_BLESSED_RECOVERY_R1 = 27813,
SPELL_PRIEST_DIVINE_AEGIS = 47753,
SPELL_PRIEST_EMPOWERED_RENEW = 63544,
SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING = 55675,
@@ -53,7 +54,22 @@ enum PriestSpells
SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411,
SPELL_PRIEST_TWIN_DISCIPLINE_R1 = 47586,
SPELL_PRIEST_SPIRITUAL_HEALING_R1 = 14898,
SPELL_PRIEST_DIVINE_PROVIDENCE_R1 = 47562
SPELL_PRIEST_DIVINE_PROVIDENCE_R1 = 47562,
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
@@ -149,6 +165,41 @@ class spell_pri_shadowfiend_scaling : public AuraScript
}
};
// -27811 - Blessed Recovery
class spell_pri_blessed_recovery : public AuraScript
{
PrepareAuraScript(spell_pri_blessed_recovery);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_BLESSED_RECOVERY_R1 });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
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());
ASSERT(triggerInfo->GetMaxTicks() > 0);
bp /= triggerInfo->GetMaxTicks();
target->CastCustomSpell(triggerSpell, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pri_blessed_recovery::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// -34861 - Circle of Healing
class spell_pri_circle_of_healing : public SpellScript
{
@@ -349,15 +400,6 @@ class spell_pri_item_greater_heal_refund : public AuraScript
return ValidateSpellInfo({ SPELL_PRIEST_ITEM_EFFICIENCY });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (HealInfo* healInfo = eventInfo.GetHealInfo())
if (Unit* healTarget = healInfo->GetTarget())
if (eventInfo.GetHitMask() & PROC_EX_NO_OVERHEAL && healTarget->IsFullHealth())
return true;
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
@@ -366,7 +408,6 @@ class spell_pri_item_greater_heal_refund : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pri_item_greater_heal_refund::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pri_item_greater_heal_refund::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
@@ -522,6 +563,33 @@ class spell_pri_mind_sear : public SpellScript
}
};
// -47580 - Pain and Suffering (dummy aura)
class spell_pri_pain_and_suffering_dummy : public SpellScriptLoader
{
public:
spell_pri_pain_and_suffering_dummy() : SpellScriptLoader("spell_pri_pain_and_suffering_dummy") { }
class spell_pri_pain_and_suffering_dummy_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pri_pain_and_suffering_dummy_AuraScript);
bool CheckDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
return false;
}
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_pri_pain_and_suffering_dummy_AuraScript::CheckDummy, EFFECT_1, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_pri_pain_and_suffering_dummy_AuraScript;
}
};
// 47948 - Pain and Suffering (Proc)
class spell_pri_pain_and_suffering_proc : public SpellScript
{
@@ -926,9 +994,326 @@ class spell_pri_mind_control : public AuraScript
}
};
// 26169 - Oracle Healing Bonus
class spell_pri_aq_3p_bonus : public AuraScript
{
PrepareAuraScript(spell_pri_aq_3p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_ORACULAR_HEAL });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -64127 - Body and Soul
class spell_pri_body_and_soul : public AuraScript
{
PrepareAuraScript(spell_pri_body_and_soul);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PRIEST_BODY_AND_SOUL_POISON_TRIGGER,
SPELL_PRIEST_ABOLISH_DISEASE
});
}
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, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pri_body_and_soul::HandleProcTriggerSpell, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc += AuraEffectProcFn(spell_pri_body_and_soul::HandleProcDummy, EFFECT_1, SPELL_AURA_DUMMY);
}
};
// 55677 - Glyph of Dispel Magic
class spell_pri_glyph_of_dispel_magic : public AuraScript
{
PrepareAuraScript(spell_pri_glyph_of_dispel_magic);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -47569 - Improved Shadowform
class spell_pri_imp_shadowform : public AuraScript
{
PrepareAuraScript(spell_pri_imp_shadowform);
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (roll_chance_i(aurEff->GetAmount()))
eventInfo.GetActor()->RemoveMovementImpairingAuras(true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pri_imp_shadowform::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -15337 - Improved Spirit Tap
class spell_pri_improved_spirit_tap : public AuraScript
{
PrepareAuraScript(spell_pri_improved_spirit_tap);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PRIEST_SHADOW_WORD_DEATH_R1,
SPELL_PRIEST_MIND_BLAST_R1
});
}
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::CheckProc);
}
};
// 40438 - Priest Tier 6 Trinket
class spell_pri_item_t6_trinket : public AuraScript
{
PrepareAuraScript(spell_pri_item_t6_trinket);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_PRIEST_DIVINE_BLESSING,
SPELL_PRIEST_DIVINE_WRATH
});
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 57989 - Shadowfiend Death
class spell_pri_shadowfiend_death : public AuraScript
{
PrepareAuraScript(spell_pri_shadowfiend_death);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA });
}
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, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pri_shadowfiend_death::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pri_shadowfiend_death::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 15286 - Vampiric Embrace
class spell_pri_vampiric_embrace : public AuraScript
{
PrepareAuraScript(spell_pri_vampiric_embrace);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 28809 - Greater Heal
class spell_pri_t3_4p_bonus : public AuraScript
{
PrepareAuraScript(spell_pri_t3_4p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_ARMOR_OF_FAITH });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_ARMOR_OF_FAITH, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pri_t3_4p_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 37594 - Greater Heal Refund
class spell_pri_t5_heal_2p_bonus : public AuraScript
{
PrepareAuraScript(spell_pri_t5_heal_2p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_ITEM_EFFICIENCY });
}
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, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pri_t5_heal_2p_bonus::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pri_t5_heal_2p_bonus::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
void AddSC_priest_spell_scripts()
{
RegisterSpellScript(spell_pri_shadowfiend_scaling);
RegisterSpellScript(spell_pri_blessed_recovery);
RegisterSpellScript(spell_pri_circle_of_healing);
RegisterSpellScript(spell_pri_divine_aegis);
RegisterSpellScript(spell_pri_divine_hymn);
@@ -941,6 +1326,7 @@ void AddSC_priest_spell_scripts()
RegisterSpellScript(spell_pri_mana_burn);
RegisterSpellScript(spell_pri_mana_leech);
RegisterSpellScript(spell_pri_mind_sear);
new spell_pri_pain_and_suffering_dummy();
RegisterSpellScript(spell_pri_pain_and_suffering_proc);
RegisterSpellScript(spell_pri_penance);
RegisterSpellAndAuraScriptPair(spell_pri_power_word_shield, spell_pri_power_word_shield_aura);
@@ -949,4 +1335,14 @@ void AddSC_priest_spell_scripts()
RegisterSpellScript(spell_pri_shadow_word_death);
RegisterSpellScript(spell_pri_vampiric_touch);
RegisterSpellScript(spell_pri_mind_control);
RegisterSpellScript(spell_pri_aq_3p_bonus);
RegisterSpellScript(spell_pri_body_and_soul);
RegisterSpellScript(spell_pri_glyph_of_dispel_magic);
RegisterSpellScript(spell_pri_imp_shadowform);
RegisterSpellScript(spell_pri_improved_spirit_tap);
RegisterSpellScript(spell_pri_item_t6_trinket);
RegisterSpellScript(spell_pri_shadowfiend_death);
RegisterSpellScript(spell_pri_vampiric_embrace);
RegisterSpellScript(spell_pri_t3_4p_bonus);
RegisterSpellScript(spell_pri_t5_heal_2p_bonus);
}

View File

@@ -42,6 +42,9 @@ enum RogueSpells
SPELL_ROGUE_SHIV_TRIGGERED = 5940,
SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST = 57933,
SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628,
SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER = 63975,
SPELL_ROGUE_QUICK_RECOVERY_ENERGY = 31663,
SPELL_ROGUE_CRIPPLING_POISON = 3409
};
class spell_rog_savage_combat : public AuraScript
@@ -126,7 +129,7 @@ class spell_rog_blade_flurry : public AuraScript
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage);
values.AddSpellMod(SPELLVALUE_FORCED_CRIT_RESULT, int32(eventInfo.GetHitMask() & PROC_EX_CRITICAL_HIT));
values.AddSpellMod(SPELLVALUE_FORCED_CRIT_RESULT, int32(eventInfo.GetHitMask() & PROC_HIT_CRITICAL));
GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, values, procTarget, TRIGGERED_FULL_MASK, nullptr, aurEff);
}
}
@@ -675,6 +678,154 @@ class spell_rog_tricks_of_the_trade_proc : public AuraScript
}
};
// -51664 - Cut to the Chase
class spell_rog_cut_to_the_chase : public AuraScript
{
PrepareAuraScript(spell_rog_cut_to_the_chase);
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -51625 - Deadly Brew
class spell_rog_deadly_brew : public AuraScript
{
PrepareAuraScript(spell_rog_deadly_brew);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_ROGUE_CRIPPLING_POISON });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_CRIPPLING_POISON, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_rog_deadly_brew::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -31244 - Quick Recovery
class spell_rog_quick_recovery : public AuraScript
{
PrepareAuraScript(spell_rog_quick_recovery);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_ROGUE_QUICK_RECOVERY_ENERGY });
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 56800 - Glyph of Backstab (dummy)
class spell_rog_glyph_of_backstab : public AuraScript
{
PrepareAuraScript(spell_rog_glyph_of_backstab);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_rog_glyph_of_backstab::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -13983 - Setup
class spell_rog_setup : public AuraScript
{
PrepareAuraScript(spell_rog_setup);
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::CheckProc);
}
};
// -51627 - Turn the Tables
class spell_rog_turn_the_tables : public AuraScript
{
PrepareAuraScript(spell_rog_turn_the_tables);
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
}
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::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
void AddSC_rogue_spell_scripts()
{
RegisterSpellScript(spell_rog_savage_combat);
@@ -690,4 +841,10 @@ void AddSC_rogue_spell_scripts()
RegisterSpellScript(spell_rog_shiv);
RegisterSpellScript(spell_rog_tricks_of_the_trade);
RegisterSpellScript(spell_rog_tricks_of_the_trade_proc);
RegisterSpellScript(spell_rog_cut_to_the_chase);
RegisterSpellScript(spell_rog_deadly_brew);
RegisterSpellScript(spell_rog_quick_recovery);
RegisterSpellScript(spell_rog_glyph_of_backstab);
RegisterSpellScript(spell_rog_setup);
RegisterSpellScript(spell_rog_turn_the_tables);
}

File diff suppressed because it is too large Load Diff

View File

@@ -43,6 +43,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_DRAIN_SOUL_AURA = 58070,
SPELL_WARLOCK_GLYPH_OF_DRAIN_SOUL_PROC = 58068,
@@ -58,17 +59,38 @@ enum WarlockSpells
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
SPELL_WARLOCK_NETHER_PROTECTION_HOLY = 54370,
SPELL_WARLOCK_NETHER_PROTECTION_FIRE = 54371,
SPELL_WARLOCK_NETHER_PROTECTION_FROST = 54372,
SPELL_WARLOCK_NETHER_PROTECTION_ARCANE = 54373,
SPELL_WARLOCK_NETHER_PROTECTION_SHADOW = 54374,
SPELL_WARLOCK_NETHER_PROTECTION_NATURE = 54375,
SPELL_WARLOCK_SOULSHATTER = 32835,
SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106,
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_R1 = 18213,
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371,
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
};
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
};
class spell_warl_eye_of_kilrogg : public AuraScript
@@ -637,6 +659,42 @@ class spell_warl_everlasting_affliction : public SpellScript
}
};
// 54909, 53646 - Demonic Pact
class spell_warl_demonic_pact : public AuraScript
{
PrepareAuraScript(spell_warl_demonic_pact);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_DEMONIC_PACT_PROC });
}
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::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warl_demonic_pact::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 18541 - Ritual of Doom Effect
class spell_warl_ritual_of_doom_effect : public SpellScript
{
@@ -654,6 +712,92 @@ class spell_warl_ritual_of_doom_effect : public SpellScript
}
};
// -27243 - Seed of Corruption
class spell_warl_seed_of_corruption_dummy : public AuraScript
{
PrepareAuraScript(spell_warl_seed_of_corruption_dummy);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE_R1 });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetDamage())
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, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warl_seed_of_corruption_dummy::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
// 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 AuraScript
{
PrepareAuraScript(spell_warl_seed_of_corruption_generic);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetDamage())
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, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warl_seed_of_corruption_generic::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
// -27285 - Seed of Corruption
class spell_warl_seed_of_corruption : public SpellScript
{
@@ -684,6 +828,61 @@ class spell_warl_seed_of_corruption : public SpellScript
}
};
// -30293 - Soul Leech
class spell_warl_soul_leech : public AuraScript
{
PrepareAuraScript(spell_warl_soul_leech);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_WARLOCK_SOUL_LEECH_HEAL,
SPELL_WARLOCK_IMP_SOUL_LEECH_R1,
SPELL_WARLOCK_SOUL_LEECH_PET_MANA_1,
SPELL_WARLOCK_SOUL_LEECH_PET_MANA_2,
SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_1,
SPELL_WARLOCK_SOUL_LEECH_CASTER_MANA_2,
SPELL_REPLENISHMENT
});
}
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::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 29858 - Soulshatter
class spell_warl_soulshatter : public SpellScript
{
@@ -813,6 +1012,97 @@ class spell_warl_life_tap : public SpellScript
}
};
// -30299 - Nether Protection
class spell_warl_nether_protection : public AuraScript
{
PrepareAuraScript(spell_warl_nether_protection);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_NETHER_PROTECTION_HOLY, SPELL_WARLOCK_NETHER_PROTECTION_FIRE, SPELL_WARLOCK_NETHER_PROTECTION_FROST, SPELL_WARLOCK_NETHER_PROTECTION_ARCANE, SPELL_WARLOCK_NETHER_PROTECTION_SHADOW, SPELL_WARLOCK_NETHER_PROTECTION_NATURE });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetDamageInfo())
{
switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
{
case SPELL_SCHOOL_HOLY:
case SPELL_SCHOOL_FIRE:
case SPELL_SCHOOL_NATURE:
case SPELL_SCHOOL_FROST:
case SPELL_SCHOOL_SHADOW:
case SPELL_SCHOOL_ARCANE:
return true;
default:
break;
}
}
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 triggerspell = 0;
switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
{
case SPELL_SCHOOL_HOLY:
triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_HOLY;
break;
case SPELL_SCHOOL_FIRE:
triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_FIRE;
break;
case SPELL_SCHOOL_NATURE:
triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_NATURE;
break;
case SPELL_SCHOOL_FROST:
triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_FROST;
break;
case SPELL_SCHOOL_SHADOW:
triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_SHADOW;
break;
case SPELL_SCHOOL_ARCANE:
triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_ARCANE;
break;
default:
return;
}
if (Unit* target = eventInfo.GetActionTarget())
target->CastSpell(target, triggerspell, true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_warl_nether_protection::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warl_nether_protection::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// -63156 - Decimation
class spell_warl_decimation : public AuraScript
{
PrepareAuraScript(spell_warl_decimation);
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::CheckProc);
}
};
// 48018 - Demonic Circle: Summon
class spell_warl_demonic_circle_summon : public AuraScript
{
@@ -968,6 +1258,31 @@ class spell_warl_haunt_aura : public AuraScript
}
};
// 37377 - Shadowflame
// 39437 - Shadowflame Hellfire and RoF
template <uint32 TriggerSpellId>
class spell_warl_t4_2p_bonus : public AuraScript
{
PrepareAuraScript(spell_warl_t4_2p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ TriggerSpellId });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell(caster, TriggerSpellId, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warl_t4_2p_bonus::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -30108 - Unstable Affliction
class spell_warl_unstable_affliction : public AuraScript
{
@@ -1098,6 +1413,53 @@ class spell_warl_shadow_ward : public AuraScript
}
};
// -18094 - Nightfall
// 56218 - Glyph of Corruption
class spell_warl_glyph_of_corruption_nightfall : public AuraScript
{
PrepareAuraScript(spell_warl_glyph_of_corruption_nightfall);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_SHADOW_TRANCE });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell(caster, SPELL_WARLOCK_SHADOW_TRANCE, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warl_glyph_of_corruption_nightfall::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 63320 - Glyph of Life Tap
class spell_warl_glyph_of_life_tap : public AuraScript
{
PrepareAuraScript(spell_warl_glyph_of_life_tap);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell(caster, SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warl_glyph_of_life_tap::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 63310 - Glyph of Shadowflame
class spell_warl_glyph_of_shadowflame : public AuraScript
{
@@ -1292,6 +1654,7 @@ void AddSC_warlock_spell_scripts()
RegisterSpellAndAuraScriptPair(spell_warl_haunt, spell_warl_haunt_aura);
RegisterSpellScript(spell_warl_health_funnel);
RegisterSpellScript(spell_warl_life_tap);
RegisterSpellScript(spell_warl_nether_protection);
RegisterSpellScript(spell_warl_ritual_of_doom_effect);
RegisterSpellScript(spell_warl_seed_of_corruption);
RegisterSpellScript(spell_warl_shadow_ward);
@@ -1299,6 +1662,15 @@ void AddSC_warlock_spell_scripts()
RegisterSpellScript(spell_warl_soulshatter);
RegisterSpellScript(spell_warl_unstable_affliction);
RegisterSpellScript(spell_warl_drain_soul);
RegisterSpellScript(spell_warl_demonic_pact);
RegisterSpellScript(spell_warl_decimation);
RegisterSpellScript(spell_warl_seed_of_corruption_dummy);
RegisterSpellScript(spell_warl_seed_of_corruption_generic);
RegisterSpellScript(spell_warl_soul_leech);
RegisterSpellScriptWithArgs(spell_warl_t4_2p_bonus<SPELL_WARLOCK_FLAMESHADOW>, "spell_warl_t4_2p_bonus_shadow");
RegisterSpellScriptWithArgs(spell_warl_t4_2p_bonus<SPELL_WARLOCK_SHADOWFLAME>, "spell_warl_t4_2p_bonus_fire");
RegisterSpellScript(spell_warl_glyph_of_corruption_nightfall);
RegisterSpellScript(spell_warl_glyph_of_life_tap);
RegisterSpellScript(spell_warl_shadowburn);
RegisterSpellScript(spell_warl_glyph_of_felguard);
}

View File

@@ -35,6 +35,7 @@ enum WarriorSpells
SPELL_WARRIOR_IMPROVED_SPELL_REFLECTION_TRIGGER = 59725,
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,
@@ -42,6 +43,8 @@ enum WarriorSpells
SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_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,
@@ -49,6 +52,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,
@@ -59,6 +64,11 @@ enum WarriorSpells
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
SPELL_WARRIOR_VIGILANCE_PROC = 50725,
SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665,
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,
SPELL_WARRIOR_WHIRLWIND_OFF = 44949
};
@@ -73,6 +83,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
};
class spell_warr_mocking_blow : public SpellScript
@@ -224,6 +235,31 @@ class spell_warr_improved_spell_reflection_trigger_aura : public AuraScript
}
};
// 70844 - Item - Warrior T10 Protection 4P Bonus
class spell_warr_item_t10_prot_4p_bonus : public AuraScript
{
PrepareAuraScript(spell_warr_item_t10_prot_4p_bonus);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_STOICISM });
}
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::HandleProc);
}
};
// 12975 - Last Stand
class spell_warr_last_stand : public SpellScript
{
@@ -254,7 +290,13 @@ class spell_warr_deep_wounds : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC });
return ValidateSpellInfo(
{
SPELL_WARRIOR_DEEP_WOUNDS_RANK_1,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_2,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_3,
SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC
});
}
void HandleDummy(SpellEffIndex /*effIndex*/)
@@ -269,7 +311,7 @@ class spell_warr_deep_wounds : public SpellScript
ApplyPct(damage, 16.0f * GetSpellInfo()->GetRank() / 6.0f);
target->CastDelayedSpellWithPeriodicAmount(caster, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, SPELL_AURA_PERIODIC_DAMAGE, damage, EFFECT_0);
//caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, nullptr, nullptr, true);
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, nullptr, nullptr, true);
}
}
@@ -373,6 +415,47 @@ class spell_warr_damage_shield : public AuraScript
}
};
// -12834 - Deep Wounds Aura
class spell_warr_deep_wounds_aura : public AuraScript
{
PrepareAuraScript(spell_warr_deep_wounds_aura);
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo)
return false;
return eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER;
}
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::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warr_deep_wounds_aura::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// -5308 - Execute
class spell_warr_execute : public SpellScript
{
@@ -430,6 +513,71 @@ class spell_warr_execute : public SpellScript
}
};
// -29723 - Sudden Death
// -46913 - Bloodsurge
class spell_warr_extra_proc : public AuraScript
{
PrepareAuraScript(spell_warr_extra_proc);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_WARRIOR_T10_MELEE_4P_BONUS,
SPELL_WARRIOR_EXTRA_CHARGE,
SPELL_WARRIOR_SLAM_GCD_REDUCED,
SPELL_WARRIOR_EXECUTE_GCD_REDUCED
});
}
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::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 58375 - Glyph of Blocking
class spell_warr_glyph_of_blocking : public AuraScript
{
PrepareAuraScript(spell_warr_glyph_of_blocking);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_GLYPH_OF_BLOCKING });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell(caster, SPELL_WARRIOR_GLYPH_OF_BLOCKING, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warr_glyph_of_blocking::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 12809 - Concussion Blow
class spell_warr_concussion_blow : public SpellScript
{
@@ -588,6 +736,46 @@ class spell_warr_rend : public AuraScript
}
};
// -29834 - Second Wind
class spell_warr_second_wind : public AuraScript
{
PrepareAuraScript(spell_warr_second_wind);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_WARRIOR_SECOND_WIND_TRIGGER_1,
SPELL_WARRIOR_SECOND_WIND_TRIGGER_2
});
}
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, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_warr_second_wind::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warr_second_wind::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 64380, 65941 - Shattering Throw
class spell_warr_shattering_throw : public SpellScript
{
@@ -678,6 +866,30 @@ private:
Unit* _procTarget = nullptr;
};
// 28845 - Cheat Death
class spell_warr_t3_prot_8p_bonus : public AuraScript
{
PrepareAuraScript(spell_warr_t3_prot_8p_bonus);
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::CheckProc);
}
};
// 50720 - Vigilance
class spell_warr_vigilance : public AuraScript
{
@@ -812,38 +1024,6 @@ class spell_warr_glyph_of_sunder_armor : public AuraScript
}
};
// Spell 28845 - Cheat Death
enum CheatDeath
{
SPELL_CHEAT_DEATH_TRIGGER = 28846
};
class spell_warr_t3_prot_8p_bonus : public AuraScript
{
PrepareAuraScript(spell_warr_t3_prot_8p_bonus);
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetActionTarget() && eventInfo.GetActionTarget()->GetHealthPct() <= 20.0f;
}
void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
if (Unit* target = eventInfo.GetActionTarget())
{
target->CastSpell(target, SPELL_CHEAT_DEATH_TRIGGER, true);
}
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_warr_t3_prot_8p_bonus::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warr_t3_prot_8p_bonus::HandleEffectProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 20230 - Retaliation
class spell_warr_retaliation : public AuraScript
{
@@ -904,4 +1084,10 @@ void AddSC_warrior_spell_scripts()
RegisterSpellScript(spell_warr_vigilance);
RegisterSpellScript(spell_warr_vigilance_trigger);
RegisterSpellScript(spell_warr_t3_prot_8p_bonus);
RegisterSpellScript(spell_warr_item_t10_prot_4p_bonus);
RegisterSpellScript(spell_warr_deep_wounds_aura);
RegisterSpellScript(spell_warr_extra_proc);
RegisterSpellScript(spell_warr_glyph_of_blocking);
RegisterSpellScript(spell_warr_second_wind);
RegisterSpellScript(spell_warr_t3_prot_8p_bonus);
}