Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -21,12 +21,14 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_dk_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Containers.h"
|
||||
#include "Creature.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "Containers.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum DeathKnightSpells
|
||||
{
|
||||
@@ -129,15 +131,9 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_dk_anti_magic_shell_self_AuraScript);
|
||||
|
||||
public:
|
||||
spell_dk_anti_magic_shell_self_AuraScript()
|
||||
{
|
||||
absorbPct = 0;
|
||||
hpPct = 0;
|
||||
}
|
||||
uint32 absorbPct = 0;
|
||||
uint32 hpPct = 0;
|
||||
|
||||
private:
|
||||
uint32 absorbPct, hpPct;
|
||||
bool Load() override
|
||||
{
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
@@ -147,9 +143,7 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_RUNIC_POWER_ENERGIZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_RUNIC_POWER_ENERGIZE });
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||
@@ -167,7 +161,7 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
|
||||
// damage absorbed by Anti-Magic Shell energizes the DK with additional runic power.
|
||||
// This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power.
|
||||
int32 bp = CalculatePct(absorbAmount, 20);
|
||||
GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -194,14 +188,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_dk_anti_magic_zone_AuraScript);
|
||||
|
||||
public:
|
||||
spell_dk_anti_magic_zone_AuraScript()
|
||||
{
|
||||
absorbPct = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 absorbPct;
|
||||
uint32 absorbPct = 0;
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
@@ -211,9 +198,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_ANTI_MAGIC_SHELL_TALENT });
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||
@@ -261,9 +246,7 @@ class spell_dk_blood_boil : public SpellScriptLoader
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_BOIL_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_BLOOD_BOIL_TRIGGERED });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -304,18 +287,9 @@ class spell_dk_blood_gorged : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_dk_blood_gorged_AuraScript);
|
||||
|
||||
public:
|
||||
spell_dk_blood_gorged_AuraScript()
|
||||
{
|
||||
_procTarget = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_BLOOD_GORGED_HEAL });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -327,7 +301,7 @@ class spell_dk_blood_gorged : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
int32 heal = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 150));
|
||||
GetTarget()->CastCustomSpell(SPELL_DK_BLOOD_GORGED_HEAL, SPELLVALUE_BASE_POINT0, heal, _procTarget, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_DK_BLOOD_GORGED_HEAL, SPELLVALUE_BASE_POINT0, heal, _procTarget, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -336,8 +310,7 @@ class spell_dk_blood_gorged : public SpellScriptLoader
|
||||
OnEffectProc += AuraEffectProcFn(spell_dk_blood_gorged_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
Unit* _procTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -358,15 +331,13 @@ class spell_dk_butchery : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BUTCHERY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_BUTCHERY });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastCustomSpell(SPELL_DK_BUTCHERY, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_DK_BUTCHERY, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -392,15 +363,13 @@ class spell_dk_death_and_decay : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_AND_DECAY_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_DEATH_AND_DECAY_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleDummyTick(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastCustomSpell(SPELL_DK_DEATH_AND_DECAY_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff);
|
||||
caster->CastCustomSpell(SPELL_DK_DEATH_AND_DECAY_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -426,9 +395,7 @@ class spell_dk_death_coil : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_DEATH_COIL_DAMAGE, SPELL_DK_DEATH_COIL_HEAL });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -440,13 +407,13 @@ class spell_dk_death_coil : public SpellScriptLoader
|
||||
if (caster->IsFriendlyTo(target))
|
||||
{
|
||||
int32 bp = int32(damage * 1.5f);
|
||||
caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, NULL, NULL, true);
|
||||
caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART, EFFECT_1))
|
||||
damage += auraEffect->GetBaseAmount();
|
||||
caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true);
|
||||
caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -583,7 +550,7 @@ class spell_dk_death_pact : public SpellScriptLoader
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targetList)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = (*itr)->ToUnit())
|
||||
@@ -624,12 +591,13 @@ class spell_dk_death_strike : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE_ENABLER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_SHIELD_MASTERY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_SHIELD_ABSORB))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DK_DEATH_STRIKE_ENABLER,
|
||||
SPELL_DK_DEATH_STRIKE_HEAL,
|
||||
SPELL_DK_BLOOD_SHIELD_MASTERY,
|
||||
SPELL_DK_BLOOD_SHIELD_ABSORB
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -751,9 +719,7 @@ class spell_dk_ghoul_explode : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_CORPSE_EXPLOSION_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_CORPSE_EXPLOSION_TRIGGERED });
|
||||
}
|
||||
|
||||
void Suicide(SpellEffIndex /*effIndex*/)
|
||||
@@ -838,19 +804,20 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DK_BLOOD_PRESENCE,
|
||||
SPELL_DK_FROST_PRESENCE,
|
||||
SPELL_DK_UNHOLY_PRESENCE,
|
||||
SPELL_DK_BLOOD_PRESENCE_TRIGGERED
|
||||
});
|
||||
}
|
||||
|
||||
void HandleModDamagePctTaken(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if ((target->HasAura(SPELL_DK_FROST_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, -aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, -aurEff->GetAmount(), target, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleModAttackerMeleeCritChance(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -900,11 +867,12 @@ class spell_dk_improved_frost_presence : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DK_BLOOD_PRESENCE,
|
||||
SPELL_DK_UNHOLY_PRESENCE,
|
||||
SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -949,18 +917,19 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DK_BLOOD_PRESENCE,
|
||||
SPELL_DK_FROST_PRESENCE,
|
||||
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_FROST_PRESENCE)) && !target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1021,12 +990,13 @@ class spell_dk_pestilence : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_PESTILENCE_REDUCED_DOTS)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_PESTILENCE_VISUAL)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PLAGUE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_FEVER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DK_PESTILENCE_REDUCED_DOTS,
|
||||
SPELL_DK_PESTILENCE_VISUAL,
|
||||
SPELL_DK_BLOOD_PLAGUE,
|
||||
SPELL_DK_FROST_FEVER
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -1135,18 +1105,18 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_FROST_PRESENCE_R1)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE_TRIGGERED)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DK_BLOOD_PRESENCE,
|
||||
SPELL_DK_FROST_PRESENCE,
|
||||
SPELL_DK_UNHOLY_PRESENCE,
|
||||
SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1,
|
||||
SPELL_DK_IMPROVED_FROST_PRESENCE_R1,
|
||||
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1,
|
||||
SPELL_DK_BLOOD_PRESENCE_TRIGGERED,
|
||||
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED,
|
||||
SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED
|
||||
});
|
||||
}
|
||||
|
||||
void HandleImprovedBloodPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1168,10 +1138,10 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
}
|
||||
|
||||
if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, val, target, TRIGGERED_FULL_MASK, NULL, aurEff);
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, val, target, TRIGGERED_FULL_MASK, nullptr, aurEff);
|
||||
}
|
||||
else if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE)
|
||||
target->CastSpell(target, SPELL_DK_BLOOD_PRESENCE_TRIGGERED, true, NULL, aurEff);
|
||||
target->CastSpell(target, SPELL_DK_BLOOD_PRESENCE_TRIGGERED, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleImprovedFrostPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1198,7 +1168,7 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
Unit* target = GetTarget();
|
||||
if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, impAurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, impAurEff->GetAmount(), target, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1236,11 +1206,12 @@ class spell_dk_raise_dead : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())
|
||||
|| !sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].CalcValue())
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_MASTER_OF_GHOULS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
uint32(spellInfo->Effects[EFFECT_0].CalcValue()),
|
||||
uint32(spellInfo->Effects[EFFECT_1].CalcValue()),
|
||||
SPELL_DK_MASTER_OF_GHOULS
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -1316,15 +1287,13 @@ class spell_dk_scent_of_blood : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCENT_OF_BLOOD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_SCENT_OF_BLOOD });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, nullptr, aurEff);
|
||||
GetTarget()->RemoveAuraFromStack(GetId());
|
||||
}
|
||||
|
||||
@@ -1350,20 +1319,11 @@ class spell_dk_scourge_strike : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dk_scourge_strike_SpellScript);
|
||||
|
||||
public:
|
||||
spell_dk_scourge_strike_SpellScript()
|
||||
{
|
||||
multiplier = 1.0f;
|
||||
}
|
||||
|
||||
private:
|
||||
float multiplier;
|
||||
float multiplier = 1.0f;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCOURGE_STRIKE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_SCOURGE_STRIKE_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1388,7 +1348,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(SPELL_DK_BLACK_ICE_R1, EFFECT_0))
|
||||
AddPct(bp, aurEff->GetAmount());
|
||||
|
||||
caster->CastCustomSpell(unitTarget, SPELL_DK_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
|
||||
caster->CastCustomSpell(unitTarget, SPELL_DK_SCOURGE_STRIKE_TRIGGERED, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1444,9 +1404,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DK_WILL_OF_THE_NECROPOLIS });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_dru_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Containers.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "Containers.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum DruidSpells
|
||||
{
|
||||
@@ -60,7 +61,7 @@ enum DruidSpells
|
||||
SPELL_DRUID_NATURES_GRACE_TRIGGER = 16886,
|
||||
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
|
||||
SPELL_DRUID_SAVAGE_ROAR = 62071,
|
||||
SPELL_DRUID_STAMPEDE_BAER_RANK_1 = 81016,
|
||||
SPELL_DRUID_STAMPEDE_BEAR_RANK_1 = 81016,
|
||||
SPELL_DRUID_STAMPEDE_CAT_RANK_1 = 81021,
|
||||
SPELL_DRUID_STAMPEDE_CAT_STATE = 109881,
|
||||
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178
|
||||
@@ -108,10 +109,7 @@ class spell_dru_eclipse : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_GRACE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_GRACE_TRIGGER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_NATURES_GRACE, SPELL_DRUID_NATURES_GRACE_TRIGGER });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -263,12 +261,13 @@ class spell_dru_enrage : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_KING_OF_THE_JUNGLE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DRUID_ENRAGE_MOD_DAMAGE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DRUID_ENRAGED_DEFENSE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DRUID_KING_OF_THE_JUNGLE,
|
||||
SPELL_DRUID_ENRAGE_MOD_DAMAGE,
|
||||
SPELL_DRUID_ENRAGED_DEFENSE,
|
||||
SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS
|
||||
});
|
||||
}
|
||||
|
||||
void RecalculateBaseArmor()
|
||||
@@ -332,9 +331,7 @@ class spell_dru_glyph_of_innervate : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_GLYPH_OF_INNERVATE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_GLYPH_OF_INNERVATE });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -346,7 +343,7 @@ class spell_dru_glyph_of_innervate : public SpellScriptLoader
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_GLYPH_OF_INNERVATE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_GLYPH_OF_INNERVATE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -374,9 +371,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_INCREASED_MOONFIRE_DURATION))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_INCREASED_MOONFIRE_DURATION });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -424,15 +419,13 @@ class spell_dru_glyph_of_starfire_proc : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_GLYPH_OF_STARFIRE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_GLYPH_OF_STARFIRE });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_STARFIRE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_STARFIRE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -554,11 +547,7 @@ class spell_dru_lifebloom : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_FINAL_HEAL))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_ENERGIZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, SPELL_DRUID_LIFEBLOOM_ENERGIZE });
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -575,15 +564,15 @@ class spell_dru_lifebloom : public SpellScriptLoader
|
||||
healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
|
||||
healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, nullptr, nullptr, true, nullptr, aurEff, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
|
||||
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, nullptr, nullptr, true, nullptr, aurEff, GetCasterGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, nullptr, nullptr, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
@@ -598,15 +587,15 @@ class spell_dru_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
|
||||
healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
|
||||
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, nullptr, nullptr, true, nullptr, nullptr, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
|
||||
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, nullptr, nullptr, true, nullptr, nullptr, GetCasterGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, nullptr, nullptr, true, nullptr, nullptr, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -636,16 +625,14 @@ class spell_dru_living_seed : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIVING_SEED_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_LIVING_SEED_PROC });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 amount = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_PROC, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_PROC, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -672,15 +659,13 @@ class spell_dru_living_seed_proc : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIVING_SEED_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_LIVING_SEED_HEAL });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -853,15 +838,13 @@ class spell_dru_savage_roar : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_SAVAGE_ROAR });
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->CastSpell(target, SPELL_DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
|
||||
target->CastSpell(target, SPELL_DRUID_SAVAGE_ROAR, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -945,13 +928,14 @@ class spell_dru_stampede : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_STAMPEDE_BAER_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_STAMPEDE_CAT_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_STAMPEDE_CAT_STATE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FERAL_CHARGE_CAT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DRUID_FERAL_CHARGE_BEAR))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DRUID_STAMPEDE_BEAR_RANK_1,
|
||||
SPELL_DRUID_STAMPEDE_CAT_RANK_1,
|
||||
SPELL_DRUID_STAMPEDE_CAT_STATE,
|
||||
SPELL_DRUID_FERAL_CHARGE_CAT,
|
||||
SPELL_DRUID_FERAL_CHARGE_BEAR
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectCatProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -960,8 +944,8 @@ class spell_dru_stampede : public SpellScriptLoader
|
||||
if (GetTarget()->GetShapeshiftForm() != FORM_CAT || eventInfo.GetDamageInfo()->GetSpellInfo()->Id != SPELL_DRUID_FERAL_CHARGE_CAT)
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_CAT_RANK_1, GetSpellInfo()->GetRank()), true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_STAMPEDE_CAT_STATE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_CAT_RANK_1, GetSpellInfo()->GetRank()), true, nullptr, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DRUID_STAMPEDE_CAT_STATE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectBearProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -970,7 +954,7 @@ class spell_dru_stampede : public SpellScriptLoader
|
||||
if (GetTarget()->GetShapeshiftForm() != FORM_BEAR || eventInfo.GetDamageInfo()->GetSpellInfo()->Id != SPELL_DRUID_FERAL_CHARGE_BEAR)
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_BAER_RANK_1, GetSpellInfo()->GetRank()), true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_DRUID_STAMPEDE_BEAR_RANK_1, GetSpellInfo()->GetRank()), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1017,16 +1001,14 @@ class spell_dru_survival_instincts : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SURVIVAL_INSTINCTS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DRUID_SURVIVAL_INSTINCTS });
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
|
||||
target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
|
||||
@@ -23,21 +23,23 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "Battleground.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Item.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Pet.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader
|
||||
@@ -103,13 +105,14 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_FIRE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_NATURE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_FROST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_SHADOW) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_ARCANE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_GEN_ADAPTIVE_WARDING_FIRE,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_NATURE,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_FROST,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_SHADOW,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_ARCANE
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -176,8 +179,8 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
|
||||
|
||||
enum AlchemistStone
|
||||
{
|
||||
ALECHEMIST_STONE_HEAL = 21399,
|
||||
ALECHEMIST_STONE_MANA = 21400,
|
||||
ALCHEMIST_STONE_HEAL = 21399,
|
||||
ALCHEMIST_STONE_MANA = 21400,
|
||||
};
|
||||
|
||||
// 17619 - Alchemist Stone
|
||||
@@ -192,10 +195,7 @@ class spell_gen_alchemist_stone : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(ALECHEMIST_STONE_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(ALECHEMIST_STONE_MANA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ ALCHEMIST_STONE_HEAL, ALCHEMIST_STONE_MANA });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -211,14 +211,14 @@ class spell_gen_alchemist_stone : public SpellScriptLoader
|
||||
int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f);
|
||||
|
||||
if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_HEAL))
|
||||
spellId = ALECHEMIST_STONE_HEAL;
|
||||
spellId = ALCHEMIST_STONE_HEAL;
|
||||
else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_ENERGIZE))
|
||||
spellId = ALECHEMIST_STONE_MANA;
|
||||
spellId = ALCHEMIST_STONE_MANA;
|
||||
|
||||
if (!spellId)
|
||||
return;
|
||||
|
||||
GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
|
||||
@@ -280,9 +280,7 @@ class spell_gen_animal_blood : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SPAWN_BLOOD_POOL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SPAWN_BLOOD_POOL });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -362,9 +360,7 @@ class spell_gen_aura_service_uniform : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SERVICE_UNIFORM });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -459,9 +455,7 @@ class spell_gen_bandage : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_RECENTLY_BANDAGED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -511,9 +505,7 @@ class spell_gen_blood_reserve : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_BLOOD_RESERVE_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GEN_BLOOD_RESERVE_HEAL });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -679,7 +671,7 @@ enum BreakShieldSpells
|
||||
class spell_gen_break_shield: public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_break_shield(const char* name) : SpellScriptLoader(name) { }
|
||||
spell_gen_break_shield(char const* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_break_shield_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -792,9 +784,7 @@ class spell_gen_burning_depths_necrolyte_image : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_2].CalcValue())))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ uint32(spellInfo->Effects[EFFECT_2].CalcValue()) });
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -837,16 +827,14 @@ class spell_gen_cannibalize : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CANNIBALIZE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CANNIBALIZE_TRIGGERED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckIfCorpseNear()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
float max_range = GetSpellInfo()->GetMaxRange(false);
|
||||
WorldObject* result = NULL;
|
||||
WorldObject* result = nullptr;
|
||||
// search for nearby enemy corpse in range
|
||||
Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY);
|
||||
Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
|
||||
@@ -892,16 +880,14 @@ class spell_gen_chaos_blast : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CHAOS_BLAST });
|
||||
}
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
int32 basepoints0 = 100;
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true);
|
||||
caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1028,23 +1014,17 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_gen_clone_weapon_auraScript);
|
||||
|
||||
public:
|
||||
spell_gen_clone_weapon_auraScript()
|
||||
{
|
||||
prevItem = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED_AURA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_COPY_WEAPON_AURA,
|
||||
SPELL_COPY_WEAPON_2_AURA,
|
||||
SPELL_COPY_WEAPON_3_AURA,
|
||||
SPELL_COPY_OFFHAND_AURA,
|
||||
SPELL_COPY_OFFHAND_2_AURA,
|
||||
SPELL_COPY_RANGED_AURA
|
||||
});
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1132,8 +1112,7 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_gen_clone_weapon_auraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 prevItem;
|
||||
uint32 prevItem = 0;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -1198,10 +1177,11 @@ class spell_gen_create_lance : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_ALLIANCE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_HORDE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_CREATE_LANCE_ALLIANCE,
|
||||
SPELL_CREATE_LANCE_HORDE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -1282,28 +1262,33 @@ enum DalaranDisguiseSpells
|
||||
class spell_gen_dalaran_disguise : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) { }
|
||||
spell_gen_dalaran_disguise(char const* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_dalaran_disguise_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
switch (spellInfo->Id)
|
||||
{
|
||||
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
|
||||
return false;
|
||||
break;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SUNREAVER_DISGUISE_FEMALE,
|
||||
SPELL_SUNREAVER_DISGUISE_MALE
|
||||
});
|
||||
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
|
||||
return false;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SILVER_COVENANT_DISGUISE_FEMALE,
|
||||
SPELL_SILVER_COVENANT_DISGUISE_MALE
|
||||
});
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1472,13 +1457,12 @@ class spell_gen_defend : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_VISUAL_SHIELD_1,
|
||||
SPELL_VISUAL_SHIELD_2,
|
||||
SPELL_VISUAL_SHIELD_3
|
||||
});
|
||||
}
|
||||
|
||||
void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1490,7 +1474,7 @@ class spell_gen_defend : public SpellScriptLoader
|
||||
for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
|
||||
target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
|
||||
|
||||
target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff);
|
||||
target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, nullptr, aurEff);
|
||||
}
|
||||
else
|
||||
GetTarget()->RemoveAurasDueToSpell(GetId());
|
||||
@@ -1594,9 +1578,7 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DIVINE_STORM });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1664,13 +1646,6 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_gen_dungeon_credit_SpellScript);
|
||||
|
||||
public:
|
||||
spell_gen_dungeon_credit_SpellScript()
|
||||
{
|
||||
_handled = false;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
@@ -1685,7 +1660,7 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
_handled = true;
|
||||
Unit* caster = GetCaster();
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster);
|
||||
instance->UpdateEncounterStateForSpellCast(GetSpellInfo()->Id, caster);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1693,8 +1668,7 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
AfterHit += SpellHitFn(spell_gen_dungeon_credit_SpellScript::CreditEncounter);
|
||||
}
|
||||
|
||||
private:
|
||||
bool _handled;
|
||||
bool _handled = false;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
@@ -1727,13 +1701,14 @@ class spell_gen_elune_candle : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ELUNE_CANDLE_OMEN_HEAD,
|
||||
SPELL_ELUNE_CANDLE_OMEN_CHEST,
|
||||
SPELL_ELUNE_CANDLE_OMEN_HAND_R,
|
||||
SPELL_ELUNE_CANDLE_OMEN_HAND_L,
|
||||
SPELL_ELUNE_CANDLE_NORMAL
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1761,7 +1736,7 @@ class spell_gen_elune_candle : public SpellScriptLoader
|
||||
else
|
||||
spellId = SPELL_ELUNE_CANDLE_NORMAL;
|
||||
|
||||
GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL);
|
||||
GetCaster()->CastSpell(GetHitUnit(), spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1794,11 +1769,12 @@ class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH,
|
||||
SPELL_TRANSPORTER_EVIL_TWIN,
|
||||
SPELL_TRANSPORTER_MALFUNCTION_MISS
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -1895,10 +1871,11 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_TRANSPORTER_SUCCESS,
|
||||
SPELL_TRANSPORTER_FAILURE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -1937,15 +1914,13 @@ class spell_gen_interrupt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_THROW_INTERRUPT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GEN_THROW_INTERRUPT });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_GEN_THROW_INTERRUPT, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_GEN_THROW_INTERRUPT, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2001,7 +1976,7 @@ enum GenericLifebloom
|
||||
class spell_gen_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
spell_gen_lifebloom(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
|
||||
class spell_gen_lifebloom_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -2012,9 +1987,7 @@ class spell_gen_lifebloom : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _spellId });
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -2024,7 +1997,7 @@ class spell_gen_lifebloom : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
// final heal
|
||||
GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastSpell(GetTarget(), _spellId, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2224,9 +2197,7 @@ class spell_gen_moss_covered_feet : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FALL_DOWN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FALL_DOWN });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -2247,7 +2218,7 @@ class spell_gen_moss_covered_feet : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum Netherbloom
|
||||
enum Netherbloom : uint32
|
||||
{
|
||||
SPELL_NETHERBLOOM_POLLEN_1 = 28703
|
||||
};
|
||||
@@ -2265,8 +2236,9 @@ class spell_gen_netherbloom : public SpellScriptLoader
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NETHERBLOOM_POLLEN_1 + i))
|
||||
if (!ValidateSpellInfo({ SPELL_NETHERBLOOM_POLLEN_1 + i }))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2322,9 +2294,7 @@ class spell_gen_nightmare_vine : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NIGHTMARE_POLLEN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_NIGHTMARE_POLLEN });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -2373,14 +2343,15 @@ class spell_gen_obsidian_armor : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_HOLY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FIRE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_NATURE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FROST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_SHADOW) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_ARCANE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_HOLY,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_FIRE,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_NATURE,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_FROST,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_SHADOW,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_ARCANE
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -2423,7 +2394,7 @@ class spell_gen_obsidian_armor : public SpellScriptLoader
|
||||
default:
|
||||
return;
|
||||
}
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2501,11 +2472,12 @@ class spell_gen_orc_disguise : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ORC_DISGUISE_TRIGGER,
|
||||
SPELL_ORC_DISGUISE_MALE,
|
||||
SPELL_ORC_DISGUISE_FEMALE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -2550,9 +2522,7 @@ class spell_gen_paralytic_poison : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PARALYSIS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PARALYSIS });
|
||||
}
|
||||
|
||||
void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -2578,7 +2548,7 @@ class spell_gen_paralytic_poison : public SpellScriptLoader
|
||||
class spell_gen_proc_below_pct_damaged : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_proc_below_pct_damaged(const char* name) : SpellScriptLoader(name) { }
|
||||
spell_gen_proc_below_pct_damaged(char const* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_proc_below_pct_damaged_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -2654,10 +2624,11 @@ class spell_gen_parachute : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PARACHUTE,
|
||||
SPELL_PARACHUTE_BUFF
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -2974,9 +2945,7 @@ class spell_gen_running_wild : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ALTERED_FORM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ALTERED_FORM });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -3094,9 +3063,7 @@ class spell_gen_seaforium_blast : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -3107,7 +3074,7 @@ class spell_gen_seaforium_blast : public SpellScriptLoader
|
||||
|
||||
void AchievementCredit(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
// but in effect handling OriginalCaster can become NULL
|
||||
// but in effect handling OriginalCaster can become nullptr
|
||||
if (Unit* originalCaster = GetOriginalCaster())
|
||||
if (GameObject* go = GetHitGObj())
|
||||
if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
|
||||
@@ -3182,7 +3149,7 @@ class spell_gen_spirit_healer_res : public SpellScriptLoader
|
||||
{
|
||||
WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
|
||||
data << uint64(target->GetGUID());
|
||||
originalCaster->GetSession()->SendPacket(&data);
|
||||
originalCaster->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3207,7 +3174,7 @@ enum SummonElemental
|
||||
class spell_gen_summon_elemental : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_summon_elemental(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
spell_gen_summon_elemental(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
|
||||
class spell_gen_summon_elemental_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -3218,9 +3185,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _spellId });
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -3235,7 +3200,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader
|
||||
if (GetCaster())
|
||||
if (Unit* owner = GetCaster()->GetOwner())
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER) /// @todo this check is maybe wrong
|
||||
owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
|
||||
owner->ToPlayer()->RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -3273,9 +3238,7 @@ class spell_gen_summon_tournament_mount : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_LANCE_EQUIPPED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckIfLanceEquiped()
|
||||
@@ -3349,10 +3312,11 @@ class spell_gen_tournament_duel : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ON_TOURNAMENT_MOUNT,
|
||||
SPELL_MOUNTED_DUEL
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -3436,9 +3400,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(Triggered))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ Triggered });
|
||||
}
|
||||
|
||||
void HandleScript()
|
||||
@@ -3500,7 +3462,7 @@ class spell_gen_turkey_marker : public SpellScriptLoader
|
||||
|
||||
// on stack 15 cast the achievement crediting spell
|
||||
if (GetStackAmount() >= 15)
|
||||
target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID());
|
||||
target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -3592,9 +3554,7 @@ class spell_gen_vampiric_touch : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_TOUCH_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_VAMPIRIC_TOUCH_HEAL });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -3759,15 +3719,13 @@ class spell_gen_whisper_gulch_yogg_saron_whisper : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_YOGG_SARON_WHISPER_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_YOGG_SARON_WHISPER_DUMMY });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell((Unit*)NULL, SPELL_YOGG_SARON_WHISPER_DUMMY, true);
|
||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_YOGG_SARON_WHISPER_DUMMY, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -3862,9 +3820,7 @@ class spell_gen_gm_freeze : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GM_FREEZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GM_FREEZE });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -4047,18 +4003,9 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_gen_mixology_bonus_AuraScript);
|
||||
|
||||
public:
|
||||
spell_gen_mixology_bonus_AuraScript()
|
||||
{
|
||||
bonus = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MIXOLOGY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MIXOLOGY });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -4244,7 +4191,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int32 bonus;
|
||||
int32 bonus = 0;
|
||||
|
||||
void Register() override
|
||||
{
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
* Scriptnames in this file should be prefixed with "spell_#holidayname_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
|
||||
// 45102 Romantic Picnic
|
||||
enum SpellsPicnic
|
||||
@@ -135,10 +136,7 @@ class spell_hallow_end_candy : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
for (uint32 spellId : spells)
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(spells);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -181,10 +179,11 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE,
|
||||
SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -238,11 +237,19 @@ class spell_hallow_end_trick : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_SKELETON_COSTUME) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_TRICK_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PIRATE_COSTUME_MALE,
|
||||
SPELL_PIRATE_COSTUME_FEMALE,
|
||||
SPELL_NINJA_COSTUME_MALE,
|
||||
SPELL_NINJA_COSTUME_FEMALE,
|
||||
SPELL_LEPER_GNOME_COSTUME_MALE,
|
||||
SPELL_LEPER_GNOME_COSTUME_FEMALE,
|
||||
SPELL_SKELETON_COSTUME,
|
||||
SPELL_GHOST_COSTUME_MALE,
|
||||
SPELL_GHOST_COSTUME_FEMALE,
|
||||
SPELL_TRICK_BUFF
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -311,9 +318,7 @@ class spell_hallow_end_trick_or_treat : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRICK) || !sSpellMgr->GetSpellInfo(SPELL_TREAT) || !sSpellMgr->GetSpellInfo(SPELL_TRICKED_OR_TREATED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_TRICK, SPELL_TREAT, SPELL_TRICKED_OR_TREATED });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -349,13 +354,12 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRICKY_TREAT_SPEED))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRICKY_TREAT_TRIGGER))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_UPSET_TUMMY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_TRICKY_TREAT_SPEED,
|
||||
SPELL_TRICKY_TREAT_TRIGGER,
|
||||
SPELL_UPSET_TUMMY
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -402,16 +406,17 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_LEPER_GNOME_COSTUME_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GHOST_COSTUME_FEMALE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PIRATE_COSTUME_MALE,
|
||||
SPELL_PIRATE_COSTUME_FEMALE,
|
||||
SPELL_NINJA_COSTUME_MALE,
|
||||
SPELL_NINJA_COSTUME_FEMALE,
|
||||
SPELL_LEPER_GNOME_COSTUME_MALE,
|
||||
SPELL_LEPER_GNOME_COSTUME_FEMALE,
|
||||
SPELL_GHOST_COSTUME_MALE,
|
||||
SPELL_GHOST_COSTUME_FEMALE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScriptEffect()
|
||||
@@ -472,7 +477,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
|
||||
private:
|
||||
uint32 const _triggeredSpellId;
|
||||
public:
|
||||
spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
spell_pilgrims_bounty_buff_food(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
class spell_pilgrims_bounty_buff_food_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -565,7 +570,7 @@ class spell_pilgrims_bounty_feast_on : public SpellScriptLoader
|
||||
if (Player* player = target->ToPlayer())
|
||||
{
|
||||
player->CastSpell(player, SPELL_ON_PLATE_EAT_VISUAL, true);
|
||||
caster->CastSpell(player, _spellId, true, NULL, NULL, player->GetGUID());
|
||||
caster->CastSpell(player, _spellId, true, nullptr, nullptr, player->GetGUID());
|
||||
}
|
||||
|
||||
if (Aura* aura = caster->GetAura(GetEffectValue()))
|
||||
@@ -609,9 +614,7 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL_MAX))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_KILL_COUNTER_VISUAL, SPELL_KILL_COUNTER_VISUAL_MAX });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -673,59 +676,58 @@ class spell_pilgrims_bounty_well_fed : public SpellScriptLoader
|
||||
uint32 _triggeredSpellId;
|
||||
|
||||
public:
|
||||
spell_pilgrims_bounty_well_fed(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
spell_pilgrims_bounty_well_fed(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
class spell_pilgrims_bounty_well_fed_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
|
||||
private:
|
||||
uint32 _triggeredSpellId;
|
||||
public:
|
||||
spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
public:
|
||||
spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
|
||||
private:
|
||||
PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
uint32 _triggeredSpellId;
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Player* target = GetHitPlayer();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (Aura const* aura = target->GetAura(GetSpellInfo()->Id))
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (aura->GetStackAmount() == 5)
|
||||
target->CastSpell(target, _triggeredSpellId, true);
|
||||
return ValidateSpellInfo({ _triggeredSpellId });
|
||||
}
|
||||
|
||||
Aura const* turkey = target->GetAura(SPELL_TURKEY_HELPINS);
|
||||
Aura const* cranberies = target->GetAura(SPELL_CRANBERRY_HELPINS);
|
||||
Aura const* stuffing = target->GetAura(SPELL_STUFFING_HELPINS);
|
||||
Aura const* sweetPotatoes = target->GetAura(SPELL_SWEET_POTATO_HELPINS);
|
||||
Aura const* pie = target->GetAura(SPELL_PIE_HELPINS);
|
||||
|
||||
if ((turkey && turkey->GetStackAmount() == 5) && (cranberies && cranberies->GetStackAmount() == 5) && (stuffing && stuffing->GetStackAmount() == 5)
|
||||
&& (sweetPotatoes && sweetPotatoes->GetStackAmount() == 5) && (pie && pie->GetStackAmount() == 5))
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
target->CastSpell(target, SPELL_THE_SPIRIT_OF_SHARING, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_TURKEY_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_CRANBERRY_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_STUFFING_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_SWEET_POTATO_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_PIE_HELPINS);
|
||||
}
|
||||
}
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Player* target = GetHitPlayer();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_well_fed_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
if (Aura const* aura = target->GetAura(GetSpellInfo()->Id))
|
||||
{
|
||||
if (aura->GetStackAmount() == 5)
|
||||
target->CastSpell(target, _triggeredSpellId, true);
|
||||
}
|
||||
|
||||
Aura const* turkey = target->GetAura(SPELL_TURKEY_HELPINS);
|
||||
Aura const* cranberies = target->GetAura(SPELL_CRANBERRY_HELPINS);
|
||||
Aura const* stuffing = target->GetAura(SPELL_STUFFING_HELPINS);
|
||||
Aura const* sweetPotatoes = target->GetAura(SPELL_SWEET_POTATO_HELPINS);
|
||||
Aura const* pie = target->GetAura(SPELL_PIE_HELPINS);
|
||||
|
||||
if ((turkey && turkey->GetStackAmount() == 5) && (cranberies && cranberies->GetStackAmount() == 5) && (stuffing && stuffing->GetStackAmount() == 5)
|
||||
&& (sweetPotatoes && sweetPotatoes->GetStackAmount() == 5) && (pie && pie->GetStackAmount() == 5))
|
||||
{
|
||||
target->CastSpell(target, SPELL_THE_SPIRIT_OF_SHARING, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_TURKEY_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_CRANBERRY_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_STUFFING_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_SWEET_POTATO_HELPINS);
|
||||
target->RemoveAurasDueToSpell(SPELL_PIE_HELPINS);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_well_fed_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
@@ -780,107 +782,113 @@ class spell_pilgrims_bounty_on_plate : public SpellScriptLoader
|
||||
uint32 _triggeredSpellId4;
|
||||
|
||||
public:
|
||||
spell_pilgrims_bounty_on_plate(const char* name, uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScriptLoader(name),
|
||||
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4) { }
|
||||
spell_pilgrims_bounty_on_plate(char const* name, uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScriptLoader(name),
|
||||
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4)
|
||||
{
|
||||
}
|
||||
|
||||
class spell_pilgrims_bounty_on_plate_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pilgrims_bounty_on_plate_SpellScript);
|
||||
private:
|
||||
uint32 _triggeredSpellId1;
|
||||
uint32 _triggeredSpellId2;
|
||||
uint32 _triggeredSpellId3;
|
||||
uint32 _triggeredSpellId4;
|
||||
|
||||
public:
|
||||
spell_pilgrims_bounty_on_plate_SpellScript(uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScript(),
|
||||
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4) { }
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId1)
|
||||
|| !sSpellMgr->GetSpellInfo(_triggeredSpellId2)
|
||||
|| !sSpellMgr->GetSpellInfo(_triggeredSpellId3)
|
||||
|| !sSpellMgr->GetSpellInfo(_triggeredSpellId4))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Vehicle* GetTable(Unit* target)
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
public:
|
||||
spell_pilgrims_bounty_on_plate_SpellScript(uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScript(),
|
||||
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4)
|
||||
{
|
||||
if (Unit* vehBase = target->GetVehicleBase())
|
||||
if (Vehicle* table = vehBase->GetVehicle())
|
||||
if (table->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
|
||||
return table;
|
||||
}
|
||||
else if (Vehicle* veh = target->GetVehicle())
|
||||
if (veh->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
|
||||
return veh;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
private:
|
||||
uint32 _triggeredSpellId1;
|
||||
uint32 _triggeredSpellId2;
|
||||
uint32 _triggeredSpellId3;
|
||||
uint32 _triggeredSpellId4;
|
||||
|
||||
Unit* GetPlateInSeat(Vehicle* table, uint8 seat)
|
||||
{
|
||||
if (Unit* holderUnit = table->GetPassenger(SEAT_PLATE_HOLDER))
|
||||
if (Vehicle* holder = holderUnit->GetVehicleKit())
|
||||
if (Unit* plate = holder->GetPassenger(seat))
|
||||
return plate;
|
||||
PrepareSpellScript(spell_pilgrims_bounty_on_plate_SpellScript);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target || caster == target)
|
||||
return;
|
||||
|
||||
Vehicle* table = GetTable(caster);
|
||||
if (!table || table != GetTable(target))
|
||||
return;
|
||||
|
||||
if (Vehicle* casterChair = caster->GetVehicleKit())
|
||||
if (Unit* casterPlr = casterChair->GetPassenger(SEAT_PLAYER))
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
if (casterPlr == target)
|
||||
return;
|
||||
_triggeredSpellId1,
|
||||
_triggeredSpellId2,
|
||||
_triggeredSpellId3,
|
||||
_triggeredSpellId4
|
||||
});
|
||||
}
|
||||
|
||||
casterPlr->CastSpell(casterPlr, _triggeredSpellId2, true); //Credit for Sharing is Caring(always)
|
||||
Vehicle* GetTable(Unit* target)
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (Unit* vehBase = target->GetVehicleBase())
|
||||
if (Vehicle* table = vehBase->GetVehicle())
|
||||
if (table->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
|
||||
return table;
|
||||
}
|
||||
else if (Vehicle* veh = target->GetVehicle())
|
||||
if (veh->GetCreatureEntry() == NPC_BOUNTIFUL_TABLE)
|
||||
return veh;
|
||||
|
||||
uint8 seat = target->GetTransSeat();
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && target->GetVehicleBase())
|
||||
seat = target->GetVehicleBase()->GetTransSeat();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (Unit* plate = GetPlateInSeat(table, seat))
|
||||
Unit* GetPlateInSeat(Vehicle* table, uint8 seat)
|
||||
{
|
||||
if (Unit* holderUnit = table->GetPassenger(SEAT_PLATE_HOLDER))
|
||||
if (Vehicle* holder = holderUnit->GetVehicleKit())
|
||||
if (Unit* plate = holder->GetPassenger(seat))
|
||||
return plate;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target || caster == target)
|
||||
return;
|
||||
|
||||
Vehicle* table = GetTable(caster);
|
||||
if (!table || table != GetTable(target))
|
||||
return;
|
||||
|
||||
if (Vehicle* casterChair = caster->GetVehicleKit())
|
||||
if (Unit* casterPlr = casterChair->GetPassenger(SEAT_PLAYER))
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER) //Food Fight case
|
||||
if (casterPlr == target)
|
||||
return;
|
||||
|
||||
casterPlr->CastSpell(casterPlr, _triggeredSpellId2, true); //Credit for Sharing is Caring(always)
|
||||
|
||||
uint8 seat = target->GetTransSeat();
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && target->GetVehicleBase())
|
||||
seat = target->GetVehicleBase()->GetTransSeat();
|
||||
|
||||
if (Unit* plate = GetPlateInSeat(table, seat))
|
||||
{
|
||||
casterPlr->CastSpell(target, _triggeredSpellId1, true);
|
||||
caster->CastSpell(target->GetVehicleBase(), _triggeredSpellId4, true); //CanEat-chair(always)
|
||||
}
|
||||
else
|
||||
{
|
||||
casterPlr->CastSpell(plate, _triggeredSpellId3, true); //Food Visual on plate
|
||||
caster->CastSpell(target, _triggeredSpellId4, true); //CanEat-chair(always)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER) //Food Fight case
|
||||
{
|
||||
casterPlr->CastSpell(target, _triggeredSpellId1, true);
|
||||
caster->CastSpell(target->GetVehicleBase(), _triggeredSpellId4, true); //CanEat-chair(always)
|
||||
}
|
||||
else
|
||||
{
|
||||
casterPlr->CastSpell(plate, _triggeredSpellId3, true); //Food Visual on plate
|
||||
caster->CastSpell(target, _triggeredSpellId4, true); //CanEat-chair(always)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_on_plate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_on_plate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_on_plate_SpellScript(_triggeredSpellId1, _triggeredSpellId2, _triggeredSpellId3, _triggeredSpellId4);
|
||||
}
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pilgrims_bounty_on_plate_SpellScript(_triggeredSpellId1, _triggeredSpellId2, _triggeredSpellId3, _triggeredSpellId4);
|
||||
}
|
||||
};
|
||||
|
||||
/* 61804 - A Serving of Cranberries
|
||||
@@ -898,7 +906,7 @@ class spell_pilgrims_bounty_a_serving_of : public SpellScriptLoader
|
||||
private:
|
||||
uint32 _triggeredSpellId;
|
||||
public:
|
||||
spell_pilgrims_bounty_a_serving_of(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
spell_pilgrims_bounty_a_serving_of(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
class spell_pilgrims_bounty_a_serving_of_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -912,9 +920,7 @@ class spell_pilgrims_bounty_a_serving_of : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _triggeredSpellId });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -976,11 +982,12 @@ class spell_winter_veil_mistletoe : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_MISTLETOE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_HOLLY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_SNOWFLAKES))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_CREATE_MISTLETOE,
|
||||
SPELL_CREATE_HOLLY,
|
||||
SPELL_CREATE_SNOWFLAKES
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1013,6 +1020,14 @@ enum PX238WinterWondervolt
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4 = 26274
|
||||
};
|
||||
|
||||
uint32 const WonderboltTransformSpells[] =
|
||||
{
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
|
||||
};
|
||||
|
||||
class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1024,33 +1039,20 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(WonderboltTransformSpells);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
uint32 const spells[4] =
|
||||
{
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
|
||||
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
|
||||
};
|
||||
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (target->HasAura(spells[i]))
|
||||
for (uint32 spell : WonderboltTransformSpells)
|
||||
if (target->HasAura(spell))
|
||||
return;
|
||||
|
||||
target->CastSpell(target, spells[urand(0, 3)], true);
|
||||
target->CastSpell(target, Trinity::Containers::SelectRandomContainerElement(WonderboltTransformSpells), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1321,7 +1323,7 @@ class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScript
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
// All this spells trigger a spell that requires reagents; if the
|
||||
// triggered spell is cast as "triggered", reagents are not consumed
|
||||
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
|
||||
GetHitUnit()->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1507,9 +1509,13 @@ class spell_midsummer_braziers_hit : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TORCH_TOSSING_TRAINING) || !sSpellMgr->GetSpellInfo(SPELL_TORCH_TOSSING_PRACTICE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_TORCH_TOSSING_TRAINING,
|
||||
SPELL_TORCH_TOSSING_PRACTICE,
|
||||
SPELL_TORCH_TOSSING_TRAINING_SUCCESS_ALLIANCE,
|
||||
SPELL_TORCH_TOSSING_TRAINING_SUCCESS_HORDE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1560,11 +1566,13 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HAS_FULL_MIDSUMMER_SET)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_RIBBON_DANCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURNING_HOT_POLE_DANCE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_RIBBON_DANCE_COSMETIC,
|
||||
SPELL_BURNING_HOT_POLE_DANCE,
|
||||
SPELL_HAS_FULL_MIDSUMMER_SET,
|
||||
SPELL_RIBBON_DANCE
|
||||
});
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
|
||||
@@ -21,15 +21,14 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_hun_".
|
||||
*/
|
||||
|
||||
#include "Pet.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Pet.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum HunterSpells
|
||||
{
|
||||
@@ -85,12 +84,13 @@ class spell_hun_ancient_hysteria : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_INSANITY)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_MAGE_TEMPORAL_DISPLACEMENT)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EXHAUSTION)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_SATED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_HUNTER_INSANITY,
|
||||
SPELL_MAGE_TEMPORAL_DISPLACEMENT,
|
||||
SPELL_SHAMAN_EXHAUSTION,
|
||||
SPELL_SHAMAN_SATED
|
||||
});
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
@@ -132,10 +132,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_CHIMERA_SHOT_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SERPENT_STING))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_CHIMERA_SHOT_HEAL, SPELL_HUNTER_SERPENT_STING });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -175,10 +172,7 @@ class spell_hun_cobra_shot : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SERPENT_STING))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS, SPELL_HUNTER_SERPENT_STING });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -288,9 +282,7 @@ class spell_hun_improved_mend_pet : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_IMPROVED_MEND_PET))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_IMPROVED_MEND_PET });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -301,7 +293,7 @@ class spell_hun_improved_mend_pet : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_IMPROVED_MEND_PET, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_IMPROVED_MEND_PET, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -365,9 +357,7 @@ class spell_hun_invigoration : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_INVIGORATION_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_INVIGORATION_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -402,16 +392,14 @@ class spell_hun_last_stand_pet : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_LAST_STAND_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_PET_LAST_STAND_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
|
||||
caster->CastCustomSpell(caster, SPELL_HUNTER_PET_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
|
||||
caster->CastCustomSpell(caster, SPELL_HUNTER_PET_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, nullptr, nullptr, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -438,10 +426,7 @@ class spell_hun_lock_and_load : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_TRIGGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_LOCK_AND_LOAD_TRIGGER, SPELL_LOCK_AND_LOAD_MARKER });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -501,10 +486,7 @@ class spell_hun_masters_call : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_MASTERS_CALL_TRIGGERED) ||
|
||||
!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue()))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_MASTERS_CALL_TRIGGERED, uint32(spellInfo->Effects[EFFECT_0].CalcValue()) });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -553,9 +535,7 @@ class spell_hun_misdirection : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_MISDIRECTION_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_MISDIRECTION_PROC });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -572,7 +552,7 @@ class spell_hun_misdirection : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_MISDIRECTION_PROC, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_MISDIRECTION_PROC, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -635,16 +615,14 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckIfCorpseNear()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
float max_range = GetSpellInfo()->GetMaxRange(false);
|
||||
WorldObject* result = NULL;
|
||||
WorldObject* result = nullptr;
|
||||
// search for nearby enemy corpse in range
|
||||
Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY);
|
||||
Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
|
||||
@@ -694,9 +672,7 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -734,9 +710,7 @@ class spell_hun_rapid_recuperation : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_RAPID_RECUPERATION))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_RAPID_RECUPERATION });
|
||||
}
|
||||
|
||||
void HandleAbilityCast(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
@@ -754,7 +728,7 @@ class spell_hun_rapid_recuperation : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
int32 focus = aurEff->GetAmount();
|
||||
GetTarget()->CastCustomSpell(SPELL_HUNTER_RAPID_RECUPERATION, SPELLVALUE_BASE_POINT0, focus, GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_HUNTER_RAPID_RECUPERATION, SPELLVALUE_BASE_POINT0, focus, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -827,16 +801,14 @@ class spell_hun_ready_set_aim : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_FIRE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_FIRE });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetStackAmount() == 5)
|
||||
{
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_FIRE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_FIRE, true, nullptr, aurEff);
|
||||
GetTarget()->RemoveAura(GetId());
|
||||
}
|
||||
}
|
||||
@@ -901,10 +873,7 @@ class spell_hun_sniper_training : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_SNIPER_TRAINING_R1, SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 });
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
@@ -962,9 +931,7 @@ class spell_hun_steady_shot : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_STEADY_SHOT_FOCUS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_STEADY_SHOT_FOCUS });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -990,7 +957,6 @@ class spell_hun_steady_shot : public SpellScriptLoader
|
||||
};
|
||||
|
||||
// 53221 - 53221 - 53224 - Improved Steady Shot
|
||||
|
||||
class spell_hun_improved_steady_shot : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1008,12 +974,7 @@ class spell_hun_improved_steady_shot : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_STEADY_SHOT))
|
||||
return false;
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_IMPROVED_STEADY_SHOT_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_STEADY_SHOT, SPELL_HUNTER_IMPROVED_STEADY_SHOT_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1141,9 +1102,7 @@ class spell_hun_thrill_of_the_hunt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_THRILL_OF_THE_HUNT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_THRILL_OF_THE_HUNT });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1152,7 +1111,7 @@ class spell_hun_thrill_of_the_hunt : public SpellScriptLoader
|
||||
int32 focus = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), SpellSchoolMask(eventInfo.GetDamageInfo()->GetSchoolMask()));
|
||||
focus = CalculatePct(focus, aurEff->GetAmount());
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_HUNTER_THRILL_OF_THE_HUNT, &focus, NULL, NULL, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_HUNTER_THRILL_OF_THE_HUNT, &focus, nullptr, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1179,9 +1138,7 @@ class spell_hun_tnt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_LOCK_AND_LOAD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HUNTER_LOCK_AND_LOAD });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -1192,7 +1149,7 @@ class spell_hun_tnt : public SpellScriptLoader
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_LOCK_AND_LOAD, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_LOCK_AND_LOAD, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -21,15 +21,19 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_item_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "Battleground.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Map.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
// Generic script for handling item dummy effects which trigger another spell.
|
||||
class spell_item_trigger_spell : public SpellScriptLoader
|
||||
@@ -38,7 +42,7 @@ class spell_item_trigger_spell : public SpellScriptLoader
|
||||
uint32 _triggeredSpellId;
|
||||
|
||||
public:
|
||||
spell_item_trigger_spell(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
spell_item_trigger_spell(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
class spell_item_trigger_spell_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -51,9 +55,7 @@ class spell_item_trigger_spell : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _triggeredSpellId });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -92,15 +94,13 @@ class spell_item_aegis_of_preservation : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_AEGIS_HEAL });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -142,10 +142,11 @@ class spell_item_alchemists_stone : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ALCHEMISTS_STONE_EXTRA_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ALCHEMISTS_STONE_EXTRA_MANA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ALCHEMISTS_STONE_EXTRA_HEAL,
|
||||
SPELL_ALCHEMISTS_STONE_EXTRA_MANA
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -213,11 +214,12 @@ class spell_item_anger_capacitor : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOTE_OF_ANGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MANIFEST_ANGER_MAIN_HAND) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MANIFEST_ANGER_OFF_HAND))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MOTE_OF_ANGER,
|
||||
SPELL_MANIFEST_ANGER_MAIN_HAND,
|
||||
SPELL_MANIFEST_ANGER_OFF_HAND
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -312,18 +314,18 @@ class spell_item_aura_of_madness : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SOCIOPATH) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DELUSIONAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_KLEPTOMANIA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MEGALOMANIA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PARANOIA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MANIC) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_NARCISSISM) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MARTYR_COMPLEX) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DEMENTIA) ||
|
||||
!sObjectMgr->GetBroadcastText(SAY_MADNESS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SOCIOPATH,
|
||||
SPELL_DELUSIONAL,
|
||||
SPELL_KLEPTOMANIA,
|
||||
SPELL_MEGALOMANIA,
|
||||
SPELL_PARANOIA,
|
||||
SPELL_MANIC,
|
||||
SPELL_NARCISSISM,
|
||||
SPELL_MARTYR_COMPLEX,
|
||||
SPELL_DEMENTIA
|
||||
}) && sObjectMgr->GetBroadcastText(SAY_MADNESS);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -389,10 +391,11 @@ class spell_item_dementia : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DEMENTIA_POS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DEMENTIA_NEG))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DEMENTIA_POS,
|
||||
SPELL_DEMENTIA_NEG
|
||||
});
|
||||
}
|
||||
|
||||
void HandlePeriodicDummy(AuraEffect const* aurEff)
|
||||
@@ -430,9 +433,7 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PROTECTION_OF_ANCIENT_KINGS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PROTECTION_OF_ANCIENT_KINGS });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -535,9 +536,7 @@ class spell_item_deadly_precision_dummy : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DEADLY_PRECISION))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DEADLY_PRECISION });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -591,13 +590,14 @@ class spell_item_deathbringers_will : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(Strength) ||
|
||||
!sSpellMgr->GetSpellInfo(Agility) ||
|
||||
!sSpellMgr->GetSpellInfo(AttackPower) ||
|
||||
!sSpellMgr->GetSpellInfo(Critical) ||
|
||||
!sSpellMgr->GetSpellInfo(Haste))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
Strength,
|
||||
Agility,
|
||||
AttackPower,
|
||||
Critical,
|
||||
Haste
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -724,9 +724,7 @@ class spell_item_defibrillate : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (_failSpell && !sSpellMgr->GetSpellInfo(_failSpell))
|
||||
return false;
|
||||
return true;
|
||||
return !_failSpell || ValidateSpellInfo({ _failSpell });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -776,15 +774,13 @@ class spell_item_desperate_defense : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DESPERATE_RAGE });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -826,17 +822,14 @@ class spell_item_deviate_fish : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
for (uint32 spellId = SPELL_SLEEPY; spellId <= SPELL_HEALTHY_SPIRIT; ++spellId)
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SLEEPY, SPELL_INVIGORATE, SPELL_SHRINK, SPELL_PARTY_TIME, SPELL_HEALTHY_SPIRIT });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
uint32 spellId = urand(SPELL_SLEEPY, SPELL_HEALTHY_SPIRIT);
|
||||
caster->CastSpell(caster, spellId, true, NULL);
|
||||
caster->CastSpell(caster, spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -868,9 +861,7 @@ class spell_item_discerning_eye_beast_dummy : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DISCERNING_EYE_BEAST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DISCERNING_EYE_BEAST });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -942,9 +933,7 @@ class spell_item_fate_rune_of_unsurpassed_vigor : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_UNSURPASSED_VIGOR))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_UNSURPASSED_VIGOR });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -985,9 +974,7 @@ class spell_item_flask_of_the_north : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_SP) || !sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_AP) || !sSpellMgr->GetSpellInfo(SPELL_FLASK_OF_THE_NORTH_STR))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FLASK_OF_THE_NORTH_SP, SPELL_FLASK_OF_THE_NORTH_AP, SPELL_FLASK_OF_THE_NORTH_STR });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1020,7 +1007,7 @@ class spell_item_flask_of_the_north : public SpellScriptLoader
|
||||
break;
|
||||
}
|
||||
|
||||
caster->CastSpell(caster, possibleSpells[urand(0, (possibleSpells.size() - 1))], true, NULL);
|
||||
caster->CastSpell(caster, possibleSpells[urand(0, (possibleSpells.size() - 1))], true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1053,9 +1040,7 @@ class spell_item_frozen_shadoweave : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMEND))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHADOWMEND });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1101,9 +1086,7 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_SELF) || !sSpellMgr->GetSpellInfo(SPELL_GNOMISH_DEATH_RAY_TARGET))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GNOMISH_DEATH_RAY_SELF, SPELL_GNOMISH_DEATH_RAY_TARGET });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1148,9 +1131,7 @@ class spell_item_harm_prevention_belt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FORCEFIELD_COLLAPSE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FORCEFIELD_COLLAPSE });
|
||||
}
|
||||
|
||||
void HandleProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -1188,9 +1169,7 @@ class spell_item_healing_touch_refund : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HEALING_TOUCH_MANA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HEALING_TOUCH_MANA });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1242,12 +1221,13 @@ class spell_item_heartpierce : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(Energy) ||
|
||||
!sSpellMgr->GetSpellInfo(Mana) ||
|
||||
!sSpellMgr->GetSpellInfo(Rage) ||
|
||||
!sSpellMgr->GetSpellInfo(RunicPower))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
Energy,
|
||||
Mana,
|
||||
Rage,
|
||||
RunicPower
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1350,9 +1330,14 @@ class spell_item_make_a_wish : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_BLESSING) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_MIGHTY_MR_PINCHY) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_FURIOUS_MR_PINCHY) || !sSpellMgr->GetSpellInfo(SPELL_TINY_MAGICAL_CRAWDAD) || !sSpellMgr->GetSpellInfo(SPELL_MR_PINCHYS_GIFT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MR_PINCHYS_BLESSING,
|
||||
SPELL_SUMMON_MIGHTY_MR_PINCHY,
|
||||
SPELL_SUMMON_FURIOUS_MR_PINCHY,
|
||||
SPELL_TINY_MAGICAL_CRAWDAD,
|
||||
SPELL_MR_PINCHYS_GIFT
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1366,7 +1351,7 @@ class spell_item_make_a_wish : public SpellScriptLoader
|
||||
case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break;
|
||||
case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break;
|
||||
}
|
||||
caster->CastSpell(caster, spellId, true, NULL);
|
||||
caster->CastSpell(caster, spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1400,9 +1385,7 @@ class spell_item_mark_of_conquest : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_CONQUEST_ENERGIZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MARK_OF_CONQUEST_ENERGIZE });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1501,9 +1484,7 @@ class spell_item_necrotic_touch : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ITEM_NECROTIC_TOUCH_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ITEM_NECROTIC_TOUCH_PROC });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1555,9 +1536,12 @@ class spell_item_net_o_matic : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_NET_O_MATIC_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_NET_O_MATIC_TRIGGERED1,
|
||||
SPELL_NET_O_MATIC_TRIGGERED2,
|
||||
SPELL_NET_O_MATIC_TRIGGERED3
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1612,9 +1596,12 @@ class spell_item_noggenfogger_elixir : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1,
|
||||
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2,
|
||||
SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1689,9 +1676,7 @@ class spell_item_persistent_shield : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTENT_SHIELD_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PERSISTENT_SHIELD_TRIGGERED });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1745,9 +1730,7 @@ class spell_item_pet_healing : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HEALTH_LINK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_HEALTH_LINK });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1870,10 +1853,13 @@ class spell_item_savory_deviate_delight : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
for (uint32 spellId = SPELL_FLIP_OUT_MALE; spellId <= SPELL_YAAARRRR_FEMALE; ++spellId)
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_FLIP_OUT_MALE,
|
||||
SPELL_FLIP_OUT_FEMALE,
|
||||
SPELL_YAAARRRR_MALE,
|
||||
SPELL_YAAARRRR_FEMALE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1887,7 +1873,7 @@ class spell_item_savory_deviate_delight : public SpellScriptLoader
|
||||
// Yaaarrrr - pirate
|
||||
case 2: spellId = (caster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
|
||||
}
|
||||
caster->CastSpell(caster, spellId, true, NULL);
|
||||
caster->CastSpell(caster, spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2070,13 +2056,12 @@ class spell_item_shadowmourne : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_SOUL_FRAGMENT))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE,
|
||||
SPELL_SHADOWMOURNE_SOUL_FRAGMENT,
|
||||
SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -2089,14 +2074,14 @@ class spell_item_shadowmourne : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SHADOWMOURNE_SOUL_FRAGMENT, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SHADOWMOURNE_SOUL_FRAGMENT, true, nullptr, aurEff);
|
||||
|
||||
// this can't be handled in AuraScript of SoulFragments because we need to know victim
|
||||
if (Aura* soulFragments = GetTarget()->GetAura(SPELL_SHADOWMOURNE_SOUL_FRAGMENT))
|
||||
{
|
||||
if (soulFragments->GetStackAmount() >= 10)
|
||||
{
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE, true, nullptr, aurEff);
|
||||
soulFragments->Remove();
|
||||
}
|
||||
}
|
||||
@@ -2127,9 +2112,12 @@ class spell_item_shadowmourne_soul_fragment : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SHADOWMOURNE_VISUAL_LOW,
|
||||
SPELL_SHADOWMOURNE_VISUAL_HIGH,
|
||||
SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF
|
||||
});
|
||||
}
|
||||
|
||||
void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -2196,9 +2184,15 @@ class spell_item_six_demon_bag : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FROSTBOLT) || !sSpellMgr->GetSpellInfo(SPELL_POLYMORPH) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_FELHOUND_MINION) || !sSpellMgr->GetSpellInfo(SPELL_FIREBALL) || !sSpellMgr->GetSpellInfo(SPELL_CHAIN_LIGHTNING) || !sSpellMgr->GetSpellInfo(SPELL_ENVELOPING_WINDS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_FROSTBOLT,
|
||||
SPELL_POLYMORPH,
|
||||
SPELL_SUMMON_FELHOUND_MINION,
|
||||
SPELL_FIREBALL,
|
||||
SPELL_CHAIN_LIGHTNING,
|
||||
SPELL_ENVELOPING_WINDS
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2261,9 +2255,7 @@ class spell_item_swift_hand_justice_dummy : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SWIFT_HAND_OF_JUSTICE_HEAL });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -2305,9 +2297,7 @@ class spell_item_totem_of_flowing_water : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LESSER_HEALING_WAVE_MANA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_LESSER_HEALING_WAVE_MANA });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -2382,9 +2372,12 @@ class spell_item_underbelly_elixir : public SpellScriptLoader
|
||||
}
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED1) || !sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED2) || !sSpellMgr->GetSpellInfo(SPELL_UNDERBELLY_ELIXIR_TRIGGERED3))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_UNDERBELLY_ELIXIR_TRIGGERED1,
|
||||
SPELL_UNDERBELLY_ELIXIR_TRIGGERED2,
|
||||
SPELL_UNDERBELLY_ELIXIR_TRIGGERED3
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2396,7 +2389,7 @@ class spell_item_underbelly_elixir : public SpellScriptLoader
|
||||
case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break;
|
||||
case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break;
|
||||
}
|
||||
caster->CastSpell(caster, spellId, true, NULL);
|
||||
caster->CastSpell(caster, spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2480,9 +2473,12 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_HOLD_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT) || !sSpellMgr->GetSpellInfo(SPELL_AIR_RIFLE_SHOOT_SELF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_AIR_RIFLE_HOLD_VISUAL,
|
||||
SPELL_AIR_RIFLE_SHOOT,
|
||||
SPELL_AIR_RIFLE_SHOOT_SELF
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -2711,9 +2707,12 @@ class spell_item_vanquished_clutches : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CRUSHER) || !sSpellMgr->GetSpellInfo(SPELL_CONSTRICTOR) || !sSpellMgr->GetSpellInfo(SPELL_CORRUPTOR))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_CRUSHER,
|
||||
SPELL_CONSTRICTOR,
|
||||
SPELL_CORRUPTOR
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2897,15 +2896,17 @@ class spell_item_purify_helboar_meat : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_PURIFIED_HELBOAR_MEAT) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_TOXIC_HELBOAR_MEAT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SUMMON_PURIFIED_HELBOAR_MEAT,
|
||||
SPELL_SUMMON_TOXIC_HELBOAR_MEAT
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_SUMMON_PURIFIED_HELBOAR_MEAT : SPELL_SUMMON_TOXIC_HELBOAR_MEAT, true, NULL);
|
||||
caster->CastSpell(caster, roll_chance_i(50) ? SPELL_SUMMON_PURIFIED_HELBOAR_MEAT : SPELL_SUMMON_TOXIC_HELBOAR_MEAT, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2946,7 +2947,7 @@ class spell_item_crystal_prison_dummy_dnd : public SpellScriptLoader
|
||||
if (Creature* target = GetHitCreature())
|
||||
if (target->isDead() && !target->IsPet())
|
||||
{
|
||||
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, *target, G3D::Quat(), uint32(target->GetRespawnTime()-time(NULL)));
|
||||
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, *target, QuaternionData(), uint32(target->GetRespawnTime()-time(nullptr)));
|
||||
target->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
@@ -2983,11 +2984,14 @@ class spell_item_reindeer_transformation : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_310) || !sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_280)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_FLYING_REINDEER_60) || !sSpellMgr->GetSpellInfo(SPELL_REINDEER_100)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_REINDEER_60))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_FLYING_REINDEER_310,
|
||||
SPELL_FLYING_REINDEER_280,
|
||||
SPELL_FLYING_REINDEER_60,
|
||||
SPELL_REINDEER_100,
|
||||
SPELL_REINDEER_60
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3048,9 +3052,7 @@ class spell_item_nigh_invulnerability : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NIGH_INVULNERABILITY) || !sSpellMgr->GetSpellInfo(SPELL_COMPLETE_VULNERABILITY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_NIGH_INVULNERABILITY, SPELL_COMPLETE_VULNERABILITY });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3094,9 +3096,7 @@ class spell_item_poultryizer : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_POULTRYIZER_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_POULTRYIZER_BACKFIRE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_POULTRYIZER_SUCCESS, SPELL_POULTRYIZER_BACKFIRE });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3138,9 +3138,7 @@ class spell_item_socrethars_stone : public SpellScriptLoader
|
||||
}
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SOCRETHAR_TO_SEAT) || !sSpellMgr->GetSpellInfo(SPELL_SOCRETHAR_FROM_SEAT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SOCRETHAR_TO_SEAT, SPELL_SOCRETHAR_FROM_SEAT });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3189,9 +3187,9 @@ class spell_item_demon_broiled_surprise : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_DEMON_BROILED_SURPRISE) || !sObjectMgr->GetCreatureTemplate(NPC_ABYSSAL_FLAMEBRINGER) || !sObjectMgr->GetQuestTemplate(QUEST_SUPER_HOT_STEW))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CREATE_DEMON_BROILED_SURPRISE }) &&
|
||||
sObjectMgr->GetCreatureTemplate(NPC_ABYSSAL_FLAMEBRINGER) &&
|
||||
sObjectMgr->GetQuestTemplate(QUEST_SUPER_HOT_STEW);
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -3246,9 +3244,7 @@ class spell_item_complete_raptor_capture : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RAPTOR_CAPTURE_CREDIT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_RAPTOR_CAPTURE_CREDIT });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3259,7 +3255,7 @@ class spell_item_complete_raptor_capture : public SpellScriptLoader
|
||||
GetHitCreature()->DespawnOrUnsummon();
|
||||
|
||||
//cast spell Raptor Capture Credit
|
||||
caster->CastSpell(caster, SPELL_RAPTOR_CAPTURE_CREDIT, true, NULL);
|
||||
caster->CastSpell(caster, SPELL_RAPTOR_CAPTURE_CREDIT, true, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3340,9 +3336,13 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MOUNT_RAM_100) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_RAM_60) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_KODO_100) || !sSpellMgr->GetSpellInfo(SPELL_MOUNT_KODO_60))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MOUNT_RAM_100,
|
||||
SPELL_MOUNT_RAM_60,
|
||||
SPELL_MOUNT_KODO_100,
|
||||
SPELL_MOUNT_KODO_60
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3411,9 +3411,7 @@ class spell_item_nitro_boosts : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NITRO_BOOSTS_SUCCESS) || !sSpellMgr->GetSpellInfo(SPELL_NITRO_BOOSTS_BACKFIRE ))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_NITRO_BOOSTS_SUCCESS, SPELL_NITRO_BOOSTS_BACKFIRE });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3508,9 +3506,7 @@ class spell_item_teach_language : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LEARN_GNOMISH_BINARY) || !sSpellMgr->GetSpellInfo(SPELL_LEARN_GOBLIN_BINARY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_LEARN_GNOMISH_BINARY, SPELL_LEARN_GOBLIN_BINARY });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3554,9 +3550,7 @@ class spell_item_rocket_boots : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROCKET_BOOTS_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROCKET_BOOTS_PROC });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3566,7 +3560,7 @@ class spell_item_rocket_boots : public SpellScriptLoader
|
||||
bg->EventPlayerDroppedFlag(caster);
|
||||
|
||||
caster->GetSpellHistory()->ResetCooldown(SPELL_ROCKET_BOOTS_PROC);
|
||||
caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL);
|
||||
caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, nullptr);
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -3606,9 +3600,7 @@ class spell_item_pygmy_oil : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PYGMY_OIL_PYGMY_AURA) || !sSpellMgr->GetSpellInfo(SPELL_PYGMY_OIL_SMALLER_AURA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PYGMY_OIL_PYGMY_AURA, SPELL_PYGMY_OIL_SMALLER_AURA });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3692,9 +3684,9 @@ class spell_item_chicken_cover : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CHICKEN_NET) || !sSpellMgr->GetSpellInfo(SPELL_CAPTURE_CHICKEN_ESCAPE) || !sObjectMgr->GetQuestTemplate(QUEST_CHICKEN_PARTY) || !sObjectMgr->GetQuestTemplate(QUEST_FLOWN_THE_COOP))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CHICKEN_NET, SPELL_CAPTURE_CHICKEN_ESCAPE }) &&
|
||||
sObjectMgr->GetQuestTemplate(QUEST_CHICKEN_PARTY) &&
|
||||
sObjectMgr->GetQuestTemplate(QUEST_FLOWN_THE_COOP);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -3808,10 +3800,11 @@ class spell_item_shard_of_the_scale : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(HealProc) ||
|
||||
!sSpellMgr->GetSpellInfo(DamageProc))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
HealProc,
|
||||
DamageProc
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -3858,12 +3851,13 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_DRUID) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_PALADIN) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_PRIEST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_SHAMAN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SOUL_PRESERVER_DRUID,
|
||||
SPELL_SOUL_PRESERVER_PALADIN,
|
||||
SPELL_SOUL_PRESERVER_PRIEST,
|
||||
SPELL_SOUL_PRESERVER_SHAMAN
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -3945,12 +3939,9 @@ class spell_item_sunwell_neck : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sFactionStore.LookupEntry(FACTION_ALDOR) ||
|
||||
!sFactionStore.LookupEntry(FACTION_SCRYERS) ||
|
||||
!sSpellMgr->GetSpellInfo(Aldors) ||
|
||||
!sSpellMgr->GetSpellInfo(Scryers))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ Aldors, Scryers }) &&
|
||||
sFactionStore.LookupEntry(FACTION_ALDOR) &&
|
||||
sFactionStore.LookupEntry(FACTION_SCRYERS);
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -4043,11 +4034,8 @@ class spell_item_taunt_flag_targeting : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TAUNT_FLAG))
|
||||
return false;
|
||||
if (!sObjectMgr->GetBroadcastText(EMOTE_PLANTS_FLAG))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_TAUNT_FLAG }) &&
|
||||
sObjectMgr->GetBroadcastText(EMOTE_PLANTS_FLAG);
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
@@ -4116,9 +4104,7 @@ class spell_item_mind_control_cap : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_MIND_CONTROL_CAP) || !sSpellMgr->GetSpellInfo(SPELL_DULLARD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GNOMISH_MIND_CONTROL_CAP, SPELL_DULLARD });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -4171,9 +4157,7 @@ class spell_item_universal_remote : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CONTROL_MACHINE) || !sSpellMgr->GetSpellInfo(SPELL_MOBILITY_MALFUNCTION) || !sSpellMgr->GetSpellInfo(SPELL_TARGET_LOCK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CONTROL_MACHINE, SPELL_MOBILITY_MALFUNCTION, SPELL_TARGET_LOCK });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -4227,9 +4211,7 @@ class spell_item_zandalarian_charm : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _spellId });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -4421,12 +4403,13 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_NORMAL_STRENGTH) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_NORMAL_AGILITY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_HEROIC_STRENGTH) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_HEROIC_AGILITY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DEATH_CHOICE_NORMAL_STRENGTH,
|
||||
SPELL_DEATH_CHOICE_NORMAL_AGILITY,
|
||||
SPELL_DEATH_CHOICE_HEROIC_STRENGTH,
|
||||
SPELL_DEATH_CHOICE_HEROIC_AGILITY
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -4507,9 +4490,7 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_stackSpell) || !sSpellMgr->GetSpellInfo(_triggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _stackSpell, _triggerSpell });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -4555,7 +4536,7 @@ private:
|
||||
// 57345 - Darkmoon Card: Greatness
|
||||
enum DarkmoonCardSpells
|
||||
{
|
||||
SPELL_DARKMOON_CARD_STRENGHT = 60229,
|
||||
SPELL_DARKMOON_CARD_STRENGTH = 60229,
|
||||
SPELL_DARKMOON_CARD_AGILITY = 60233,
|
||||
SPELL_DARKMOON_CARD_INTELLECT = 60234,
|
||||
SPELL_DARKMOON_CARD_SPIRIT = 60235,
|
||||
@@ -4572,12 +4553,13 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_STRENGHT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_AGILITY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_INTELLECT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_SPIRIT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_DARKMOON_CARD_STRENGTH,
|
||||
SPELL_DARKMOON_CARD_AGILITY,
|
||||
SPELL_DARKMOON_CARD_INTELLECT,
|
||||
SPELL_DARKMOON_CARD_SPIRIT
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -4591,11 +4573,11 @@ public:
|
||||
float spi = caster->GetStat(STAT_SPIRIT);
|
||||
float stat = 0.0f;
|
||||
|
||||
uint32 spellTrigger = SPELL_DARKMOON_CARD_STRENGHT;
|
||||
uint32 spellTrigger = SPELL_DARKMOON_CARD_STRENGTH;
|
||||
|
||||
if (str > stat)
|
||||
{
|
||||
spellTrigger = SPELL_DARKMOON_CARD_STRENGHT;
|
||||
spellTrigger = SPELL_DARKMOON_CARD_STRENGTH;
|
||||
stat = str;
|
||||
}
|
||||
|
||||
@@ -4649,9 +4631,7 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CHARM_WITCH_DOCTOR_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CHARM_WITCH_DOCTOR_PROC });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -4698,10 +4678,11 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DRAIN_ENERGIZE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_MANA_DRAIN_LEECH))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MANA_DRAIN_ENERGIZE,
|
||||
SPELL_MANA_DRAIN_LEECH
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
|
||||
@@ -21,20 +21,21 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_mage_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Pet.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum MageSpells
|
||||
{
|
||||
SPELL_ARCANCE_POTENCY_RANK_1 = 31571,
|
||||
SPELL_ARCANCE_POTENCY_RANK_2 = 31572,
|
||||
SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1 = 57529,
|
||||
SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2 = 57531,
|
||||
SPELL_MAGE_ARCANE_POTENCY_RANK_1 = 31571,
|
||||
SPELL_MAGE_ARCANE_POTENCY_RANK_2 = 31572,
|
||||
SPELL_MAGE_ARCANE_POTENCY_TRIGGER_RANK_1 = 57529,
|
||||
SPELL_MAGE_ARCANE_POTENCY_TRIGGER_RANK_2 = 57531,
|
||||
|
||||
SPELL_MAGE_ARCANE_BLAST = 30451,
|
||||
SPELL_MAGE_ARCANE_MISSILES = 5143,
|
||||
@@ -131,12 +132,13 @@ class spell_mage_arcane_potency : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_RANK_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MAGE_ARCANE_POTENCY_RANK_1,
|
||||
SPELL_MAGE_ARCANE_POTENCY_RANK_2,
|
||||
SPELL_MAGE_ARCANE_POTENCY_TRIGGER_RANK_1,
|
||||
SPELL_MAGE_ARCANE_POTENCY_TRIGGER_RANK_2
|
||||
});
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -144,14 +146,14 @@ class spell_mage_arcane_potency : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
uint32 spellId = 0;
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_ARCANCE_POTENCY_RANK_1)
|
||||
spellId = SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1;
|
||||
else if (GetSpellInfo()->Id == SPELL_ARCANCE_POTENCY_RANK_2)
|
||||
spellId = SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2;
|
||||
if (GetSpellInfo()->Id == SPELL_MAGE_ARCANE_POTENCY_RANK_1)
|
||||
spellId = SPELL_MAGE_ARCANE_POTENCY_TRIGGER_RANK_1;
|
||||
else if (GetSpellInfo()->Id == SPELL_MAGE_ARCANE_POTENCY_RANK_2)
|
||||
spellId = SPELL_MAGE_ARCANE_POTENCY_TRIGGER_RANK_2;
|
||||
if (!spellId)
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
|
||||
|
||||
}
|
||||
|
||||
@@ -184,9 +186,7 @@ class spell_mage_blast_wave : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FLAMESTRIKE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_FLAMESTRIKE });
|
||||
}
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targetList)
|
||||
@@ -216,8 +216,7 @@ class spell_mage_blast_wave : public SpellScriptLoader
|
||||
AfterCast += SpellCastFn(spell_mage_blast_wave_SpellScript::HandleImprovedFlamestrike);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _targetCount =0;
|
||||
uint32 _targetCount = 0;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
@@ -238,15 +237,13 @@ class spell_mage_blazing_speed : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_BLAZING_SPEED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_BLAZING_SPEED });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_BLAZING_SPEED, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_BLAZING_SPEED, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -274,11 +271,11 @@ class spell_mage_blizzard : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MAGE_CHILLED_R1,
|
||||
SPELL_MAGE_CHILLED_R2
|
||||
});
|
||||
}
|
||||
|
||||
void AddChillEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -386,8 +383,7 @@ struct ConjureRefreshmentData
|
||||
uint32 spellId;
|
||||
};
|
||||
|
||||
uint8 const MAX_CONJURE_REFRESHMENT_SPELLS = 7;
|
||||
ConjureRefreshmentData const _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] =
|
||||
ConjureRefreshmentData const _conjureData[] =
|
||||
{
|
||||
{ 33, 43, 92739 },
|
||||
{ 44, 53, 92799 },
|
||||
@@ -397,6 +393,7 @@ ConjureRefreshmentData const _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] =
|
||||
{ 80, 84, 92822 },
|
||||
{ 85, 85, 92727 }
|
||||
};
|
||||
uint8 const MAX_CONJURE_REFRESHMENT_SPELLS = std::extent<decltype(_conjureData)>::value;
|
||||
|
||||
// 42955 - Conjure Refreshment
|
||||
class spell_mage_conjure_refreshment : public SpellScriptLoader
|
||||
@@ -411,7 +408,7 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i)
|
||||
if (!sSpellMgr->GetSpellInfo(_conjureData[i].spellId))
|
||||
if (!ValidateSpellInfo({ _conjureData[i].spellId }))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -480,10 +477,7 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_FROST_WARDING_TRIGGERED, SPELL_MAGE_FROST_WARDING_R1 });
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
|
||||
@@ -511,7 +505,7 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader
|
||||
{
|
||||
int32 bp = dmgInfo.GetDamage();
|
||||
dmgInfo.AbsorbDamage(bp);
|
||||
target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
|
||||
target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, nullptr, nullptr, true, nullptr, aurEff);
|
||||
absorbAmount = 0;
|
||||
PreventDefaultAction();
|
||||
}
|
||||
@@ -541,18 +535,9 @@ class spell_mage_focus_magic : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_mage_focus_magic_AuraScript);
|
||||
|
||||
public:
|
||||
spell_mage_focus_magic_AuraScript()
|
||||
{
|
||||
_procTarget = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FOCUS_MAGIC_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_FOCUS_MAGIC_PROC });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -564,7 +549,7 @@ class spell_mage_focus_magic : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_MAGE_FOCUS_MAGIC_PROC, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_MAGE_FOCUS_MAGIC_PROC, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -573,8 +558,7 @@ class spell_mage_focus_magic : public SpellScriptLoader
|
||||
OnEffectProc += AuraEffectProcFn(spell_mage_focus_magic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
Unit* _procTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -663,9 +647,7 @@ class spell_mage_glyph_of_ice_block : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_NOVA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_FROST_NOVA });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -735,9 +717,7 @@ class spell_mage_glyph_of_polymorph : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_SHADOW_WORD_DEATH))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_SHADOW_WORD_DEATH });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
@@ -774,9 +754,7 @@ class spell_mage_living_bomb : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_1].CalcValue())))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ uint32(spellInfo->Effects[EFFECT_1].CalcValue()) });
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -786,7 +764,7 @@ class spell_mage_living_bomb : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff);
|
||||
caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -856,9 +834,7 @@ class spell_mage_ignite : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IGNITE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_IGNITE });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -875,7 +851,7 @@ class spell_mage_ignite : public SpellScriptLoader
|
||||
|
||||
int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks());
|
||||
amount += eventInfo.GetProcTarget()->GetRemainingPeriodicAmount(eventInfo.GetActor()->GetGUID(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -918,7 +894,7 @@ class spell_mage_mage_ward : public SpellScriptLoader
|
||||
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
|
||||
{
|
||||
int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -971,7 +947,7 @@ class spell_mage_mana_shield : public SpellScriptLoader
|
||||
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
|
||||
{
|
||||
int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,9 +984,7 @@ class spell_mage_master_of_elements : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1026,7 +1000,7 @@ class spell_mage_master_of_elements : public SpellScriptLoader
|
||||
mana = CalculatePct(mana, aurEff->GetAmount());
|
||||
|
||||
if (mana > 0)
|
||||
GetTarget()->CastCustomSpell(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1076,7 +1050,7 @@ class spell_mage_nether_vortex : public SpellScriptLoader
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_MAGE_SLOW, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_MAGE_SLOW, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1104,9 +1078,7 @@ class spell_mage_permafrost : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_PERMAFROST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_PERMAFROST });
|
||||
}
|
||||
|
||||
bool DoCheck(ProcEventInfo& eventInfo)
|
||||
@@ -1119,7 +1091,7 @@ class spell_mage_permafrost : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
|
||||
int32 heal = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()));
|
||||
GetTarget()->CastCustomSpell(SPELL_MAGE_PERMAFROST, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_MAGE_PERMAFROST, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1147,16 +1119,17 @@ class spell_mage_polymorph : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_POLYMORPH_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_POLYMORPH_STUN_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_POLYMORPH_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MAGE_IMPROVED_POLYMORPH_RANK_1,
|
||||
SPELL_MAGE_IMPROVED_POLYMORPH_STUN_RANK_1,
|
||||
SPELL_MAGE_IMPROVED_POLYMORPH_MARKER
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_caster = NULL;
|
||||
_caster = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1175,8 +1148,8 @@ class spell_mage_polymorph : public SpellScriptLoader
|
||||
if (_caster->HasAura(SPELL_MAGE_IMPROVED_POLYMORPH_MARKER))
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_MAGE_IMPROVED_POLYMORPH_STUN_RANK_1, improvedPolymorph->GetSpellInfo()->GetRank()), true, NULL, aurEff);
|
||||
_caster->CastSpell(_caster, SPELL_MAGE_IMPROVED_POLYMORPH_MARKER, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), sSpellMgr->GetSpellWithRank(SPELL_MAGE_IMPROVED_POLYMORPH_STUN_RANK_1, improvedPolymorph->GetSpellInfo()->GetRank()), true, nullptr, aurEff);
|
||||
_caster->CastSpell(_caster, SPELL_MAGE_IMPROVED_POLYMORPH_MARKER, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1217,10 +1190,7 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
// check if spell ids exist in dbc
|
||||
for (uint32 i = 0; i < 6; i++)
|
||||
if (!sSpellMgr->GetSpellInfo(PolymorhForms[i]))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(PolymorhForms);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1266,9 +1236,7 @@ class spell_mage_replenish_mana : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleImprovedManaGem()
|
||||
@@ -1276,7 +1244,7 @@ class spell_mage_replenish_mana : public SpellScriptLoader
|
||||
if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_MANA_GEM, EFFECT_0))
|
||||
{
|
||||
int32 bp = CalculatePct(GetCaster()->GetMaxPower(POWER_MANA), aurEff->GetAmount());
|
||||
GetCaster()->CastCustomSpell(GetCaster(), SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED, &bp, &bp, NULL, true);
|
||||
GetCaster()->CastCustomSpell(GetCaster(), SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED, &bp, &bp, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1305,18 +1273,17 @@ class spell_mage_ring_of_frost : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_FREEZE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MAGE_RING_OF_FROST_SUMMON,
|
||||
SPELL_MAGE_RING_OF_FROST_FREEZE,
|
||||
SPELL_MAGE_RING_OF_FROST_DUMMY
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
ringOfFrost = NULL;
|
||||
ringOfFrost = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1380,11 +1347,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_FREEZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_RING_OF_FROST_SUMMON, SPELL_MAGE_RING_OF_FROST_FREEZE });
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
@@ -1415,9 +1378,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_RING_OF_FROST_DUMMY });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1451,12 +1412,13 @@ class spell_mage_time_warp : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_TEMPORAL_DISPLACEMENT)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_HUNTER_INSANITY)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EXHAUSTION)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_SATED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MAGE_TEMPORAL_DISPLACEMENT,
|
||||
SPELL_HUNTER_INSANITY,
|
||||
SPELL_SHAMAN_EXHAUSTION,
|
||||
SPELL_SHAMAN_SATED
|
||||
});
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
@@ -1499,9 +1461,7 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FINGERS_OF_FROST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_FINGERS_OF_FROST });
|
||||
}
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targetList)
|
||||
@@ -1558,9 +1518,7 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_MISSILES_AURASTATE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MAGE_ARCANE_MISSILES_AURASTATE });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -1609,16 +1567,13 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_MISSILES))
|
||||
return false;
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_MISSILES_DAMAGE))
|
||||
return false;
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_ARCANE_BLAST))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_MAGE_ARCANE_MISSILES,
|
||||
SPELL_MAGE_ARCANE_MISSILES_DAMAGE,
|
||||
SPELL_MAGE_ARCANE_BLAST
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1677,7 +1632,7 @@ public:
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_MAGE_EARLY_FROST_VISUAL , true, NULL, aurEff);
|
||||
caster->CastSpell(caster, SPELL_MAGE_EARLY_FROST_VISUAL , true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_pal_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
enum PaladinSpells
|
||||
{
|
||||
@@ -141,7 +142,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
|
||||
: float(defenseSkillValue) / float(reqDefForMaxHeal);
|
||||
|
||||
int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
|
||||
victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
|
||||
victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, nullptr, nullptr, true, nullptr, aurEff);
|
||||
victim->GetSpellHistory()->AddCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, std::chrono::minutes(2));
|
||||
}
|
||||
else if (remainingHealth < int32(allowedHealth))
|
||||
@@ -180,9 +181,7 @@ class spell_pal_aura_mastery : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AURA_MASTERY_IMMUNE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_AURA_MASTERY_IMMUNE });
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -220,9 +219,7 @@ class spell_pal_aura_mastery_immune : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_CONCENTRACTION_AURA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_CONCENTRACTION_AURA });
|
||||
}
|
||||
|
||||
bool CheckAreaTarget(Unit* target)
|
||||
@@ -254,10 +251,7 @@ class spell_pal_avenging_wrath : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_SANCTIFIED_WRATH, SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 });
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -266,7 +260,7 @@ class spell_pal_avenging_wrath : public SpellScriptLoader
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1, EFFECT_2))
|
||||
{
|
||||
int32 basepoints = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, &basepoints, &basepoints, NULL, true, NULL, aurEff);
|
||||
target->CastCustomSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, &basepoints, &basepoints, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,9 +294,13 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST,
|
||||
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -410,20 +408,11 @@ class spell_pal_divine_storm : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_pal_divine_storm_SpellScript);
|
||||
|
||||
public:
|
||||
spell_pal_divine_storm_SpellScript()
|
||||
{
|
||||
healPct = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 healPct;
|
||||
uint32 healPct = 0;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_DIVINE_STORM_DUMMY });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -460,18 +449,9 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
|
||||
|
||||
public:
|
||||
spell_pal_divine_storm_dummy_SpellScript()
|
||||
{
|
||||
_targetCount = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_DIVINE_STORM_HEAL });
|
||||
}
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targetList)
|
||||
@@ -485,10 +465,10 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
int32 heal = GetEffectValue() / _targetCount;
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_PALADIN_DIVINE_STORM_HEAL, &heal, NULL, NULL, true);
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_PALADIN_DIVINE_STORM_HEAL, &heal, nullptr, nullptr, true);
|
||||
}
|
||||
private:
|
||||
uint32 _targetCount;
|
||||
|
||||
uint32 _targetCount = 0;
|
||||
|
||||
void Register() override
|
||||
{
|
||||
@@ -551,16 +531,14 @@ class spell_pal_eye_for_an_eye : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -587,9 +565,7 @@ class spell_pal_grand_crusader : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AVENGERS_SHIELD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_AVENGERS_SHIELD });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -825,15 +801,13 @@ class spell_pal_item_healing_discount : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_ITEM_HEALING_TRANCE });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -861,9 +835,7 @@ class spell_pal_judgement : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_JUDGEMENT_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_JUDGEMENT_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -909,10 +881,7 @@ class spell_pal_lay_on_hands : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_FORBEARANCE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_FORBEARANCE, SPELL_PALADIN_IMMUNE_SHIELD_MARKER });
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -964,11 +933,7 @@ class spell_pal_light_s_beacon : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BEACON_OF_LIGHT)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BEACON_OF_LIGHT_HEAL)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_LIGHT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_BEACON_OF_LIGHT, SPELL_PALADIN_BEACON_OF_LIGHT_HEAL, SPELL_PALADIN_HOLY_LIGHT });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1026,9 +991,7 @@ class spell_pal_righteous_defense : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT });
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -1174,10 +1137,7 @@ class spell_pal_templar_s_verdict : public SpellScriptLoader
|
||||
|
||||
bool Validate (SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PURPOSE_PROC))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_DIVINE_PURPOSE_PROC });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -1241,9 +1201,7 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1259,7 +1217,7 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader
|
||||
int32 holy = GetTarget()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY);
|
||||
holy += eventInfo.GetProcTarget()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY);
|
||||
int32 bp = int32((ap * 0.022f + 0.044f * holy) * GetTarget()->GetAttackTime(BASE_ATTACK) / 1000);
|
||||
GetTarget()->CastCustomSpell(SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1337,12 +1295,11 @@ class spell_pal_hand_of_light : public SpellScriptLoader
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (eventInfo.GetProcSpell()->GetSpellInfo()->Id == SPELL_PALADIN_TEMPLARS_VERDICT ||
|
||||
eventInfo.GetProcSpell()->GetSpellInfo()->Id == SPELL_PALADIN_CRUSADER_STRIKE ||
|
||||
eventInfo.GetProcSpell()->GetSpellInfo()->Id == SPELL_PALADIN_DIVINE_STORM)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
return spellInfo &&
|
||||
(spellInfo->Id == SPELL_PALADIN_TEMPLARS_VERDICT ||
|
||||
spellInfo->Id == SPELL_PALADIN_CRUSADER_STRIKE ||
|
||||
spellInfo->Id == SPELL_PALADIN_DIVINE_STORM);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1353,7 +1310,7 @@ class spell_pal_hand_of_light : public SpellScriptLoader
|
||||
if (Unit* target = eventInfo.GetProcTarget())
|
||||
{
|
||||
uint32 damageAmount = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
|
||||
caster->CastCustomSpell(SPELL_PALADIN_HAND_OF_LIGHT, SPELLVALUE_BASE_POINT0, damageAmount, target, true, NULL, aurEff);
|
||||
caster->CastCustomSpell(SPELL_PALADIN_HAND_OF_LIGHT, SPELLVALUE_BASE_POINT0, damageAmount, target, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Unit.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Unit.h"
|
||||
|
||||
enum HunterPetCalculate
|
||||
{
|
||||
@@ -892,13 +894,6 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript);
|
||||
|
||||
public:
|
||||
spell_hun_pet_scaling_01_AuraScript()
|
||||
{
|
||||
_tempHealth = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
@@ -1006,8 +1001,7 @@ public:
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateDamageDoneAmount, EFFECT_2, SPELL_AURA_MOD_DAMAGE_DONE);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _tempHealth;
|
||||
uint32 _tempHealth = 0;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -1542,7 +1536,7 @@ public:
|
||||
float mod = 0.7f;
|
||||
|
||||
// Ravenous Dead
|
||||
AuraEffect const* aurEff = NULL;
|
||||
AuraEffect const* aurEff = nullptr;
|
||||
// Check just if owner has Ravenous Dead since it's effect is not an aura
|
||||
aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
|
||||
if (aurEff)
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_pri_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum PriestSpells
|
||||
{
|
||||
@@ -123,10 +124,7 @@ class spell_pri_body_and_soul : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_CURE_DISEASE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PRIEST_BODY_AND_SOUL_DISPEL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_CURE_DISEASE, SPELL_PRIEST_BODY_AND_SOUL_DISPEL });
|
||||
}
|
||||
|
||||
void HandleEffectSpeedProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -136,7 +134,7 @@ class spell_pri_body_and_soul : public SpellScriptLoader
|
||||
if (!(eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyFlags[0] & 0x1 || eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyFlags[2] & 0x80000))
|
||||
return;
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_BODY_AND_SOUL_SPEED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_BODY_AND_SOUL_SPEED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectDispelProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -147,7 +145,7 @@ class spell_pri_body_and_soul : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
if (roll_chance_i(aurEff->GetAmount()))
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_BODY_AND_SOUL_DISPEL, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_BODY_AND_SOUL_DISPEL, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -175,9 +173,7 @@ class spell_pri_circle_of_healing : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING });
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
@@ -217,13 +213,7 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ABSOLUTION))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_ABSOLUTION, SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL, SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC });
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -276,9 +266,7 @@ class spell_pri_divine_aegis : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_AEGIS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_DIVINE_AEGIS });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -298,7 +286,7 @@ class spell_pri_divine_aegis : public SpellScriptLoader
|
||||
|
||||
absorb = std::min(absorb, eventInfo.GetProcTarget()->getLevel() * 125);
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -361,9 +349,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -372,7 +358,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
|
||||
|
||||
SpellInfo const* triggeredSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL);
|
||||
int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks());
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -434,15 +420,13 @@ class spell_pri_item_greater_heal_refund : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_ITEM_EFFICIENCY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_ITEM_EFFICIENCY });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -478,9 +462,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -504,7 +486,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
|
||||
int32 healAmount = int32(target->CountPctFromMaxHealth(healPct));
|
||||
// remove the aura now, we don't want 40% healing bonus
|
||||
Remove(AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
target->CastCustomSpell(target, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL, &healAmount, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL, &healAmount, nullptr, nullptr, true);
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
}
|
||||
|
||||
@@ -569,9 +551,7 @@ class spell_pri_leap_of_faith_effect_trigger : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_LEAP_OF_FAITH_EFFECT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_LEAP_OF_FAITH_EFFECT });
|
||||
}
|
||||
|
||||
void HandleEffectDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -581,7 +561,7 @@ class spell_pri_leap_of_faith_effect_trigger : public SpellScriptLoader
|
||||
SpellCastTargets targets;
|
||||
targets.SetDst(destPos);
|
||||
targets.SetUnitTarget(GetCaster());
|
||||
GetHitUnit()->CastSpell(targets, sSpellMgr->GetSpellInfo(GetEffectValue()), NULL);
|
||||
GetHitUnit()->CastSpell(targets, sSpellMgr->GetSpellInfo(GetEffectValue()), nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -638,18 +618,9 @@ class spell_pri_mana_leech : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_pri_mana_leech_AuraScript);
|
||||
|
||||
public:
|
||||
spell_pri_mana_leech_AuraScript()
|
||||
{
|
||||
_procTarget = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MANA_LEECH_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_MANA_LEECH_PROC });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
@@ -661,7 +632,7 @@ class spell_pri_mana_leech : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_PRIEST_MANA_LEECH_PROC, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_PRIEST_MANA_LEECH_PROC, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -670,8 +641,7 @@ class spell_pri_mana_leech : public SpellScriptLoader
|
||||
OnEffectProc += AuraEffectProcFn(spell_pri_mana_leech_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
Unit* _procTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -868,11 +838,11 @@ class spell_pri_power_word_shield : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_R1))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED,
|
||||
SPELL_PRIEST_REFLECTIVE_SHIELD_R1
|
||||
});
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
|
||||
@@ -917,7 +887,7 @@ class spell_pri_power_word_shield : public SpellScriptLoader
|
||||
if (AuraEffect const* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0))
|
||||
{
|
||||
int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, nullptr, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,9 +951,7 @@ class spell_pri_renew : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_TOUCH))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_DIVINE_TOUCH });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -1001,7 +969,7 @@ class spell_pri_renew : public SpellScriptLoader
|
||||
uint32 heal = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), aurEff->GetAmount(), DOT);
|
||||
heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
|
||||
int32 basepoints0 = CalculatePct(int32(heal) * aurEff->GetTotalTicks(), empoweredRenewAurEff->GetAmount());
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_PRIEST_DIVINE_TOUCH, &basepoints0, NULL, NULL, true, NULL, aurEff);
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_PRIEST_DIVINE_TOUCH, &basepoints0, nullptr, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1063,10 +1031,11 @@ class spell_pri_shadowform : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH,
|
||||
SPELL_PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1105,9 +1074,7 @@ class spell_pri_vampiric_embrace : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1122,7 +1089,7 @@ class spell_pri_vampiric_embrace : public SpellScriptLoader
|
||||
int32 self = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()));
|
||||
int32 team = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount() / 2));
|
||||
|
||||
GetTarget()->CastCustomSpell((Unit*)NULL, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &team, &self, NULL, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell((Unit*)nullptr, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &team, &self, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1177,10 +1144,7 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_REPLENISHMENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, SPELL_GEN_REPLENISHMENT });
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* /*dispelInfo*/)
|
||||
@@ -1191,7 +1155,7 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() * 8;
|
||||
// backfire damage
|
||||
caster->CastCustomSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
caster->CastCustomSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, &damage, nullptr, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,7 +1166,7 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
eventInfo.GetProcTarget()->CastSpell((Unit*)NULL, SPELL_GEN_REPLENISHMENT, true, NULL, aurEff);
|
||||
eventInfo.GetProcTarget()->CastSpell((Unit*)nullptr, SPELL_GEN_REPLENISHMENT, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1243,7 +1207,7 @@ class spell_pri_echo_of_light : public SpellScriptLoader
|
||||
uint32 healAmount = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount());
|
||||
uint8 tickNumber = sSpellMgr->GetSpellInfo(SPELL_PRIEST_ECHO_OF_LIGHT)->GetMaxTicks();
|
||||
if (healAmount && tickNumber)
|
||||
caster->CastCustomSpell(SPELL_PRIEST_ECHO_OF_LIGHT, SPELLVALUE_BASE_POINT0, healAmount / tickNumber, target, true, NULL, aurEff);
|
||||
caster->CastCustomSpell(SPELL_PRIEST_ECHO_OF_LIGHT, SPELLVALUE_BASE_POINT0, healAmount / tickNumber, target, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_q#questID_".
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
class spell_generic_quest_update_entry_SpellScript : public SpellScript
|
||||
@@ -104,9 +104,7 @@ class spell_q2203_thaumaturgy_channel : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_THAUMATURGY_CHANNEL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_THAUMATURGY_CHANNEL });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -152,16 +150,14 @@ class spell_q5206_test_fetid_skull : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_RESONATING_SKULL) || !sSpellMgr->GetSpellInfo(SPELL_CREATE_BONE_DUST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CREATE_RESONATING_SKULL, SPELL_CREATE_BONE_DUST });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST;
|
||||
caster->CastSpell(caster, spellId, true, NULL);
|
||||
caster->CastSpell(caster, spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -316,9 +312,7 @@ class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3) || !sSpellMgr->GetSpellInfo(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3, SPELL_SCOURGING_CRYSTAL_CONTROLLER });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -354,9 +348,7 @@ class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScript
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3 });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -417,9 +409,7 @@ class spell_q11587_arcane_prisoner_rescue : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_MALE) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_ARCANE_PRISONER_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_ARCANE_PRISONER_KILL_CREDIT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_ARCANE_PRISONER_MALE, SPELL_SUMMON_ARCANE_PRISONER_FEMALE, SPELL_ARCANE_PRISONER_KILL_CREDIT });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -480,9 +470,15 @@ class spell_q11730_ultrasonic_screwdriver : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_004A8) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_SENTRYBOT_57K) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_DEFENDOTANK_66D) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_SCAVENGEBOT_005B6) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_55D_COLLECTATRON) || !sSpellMgr->GetSpellInfo(SPELL_ROBOT_KILL_CREDIT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SUMMON_SCAVENGEBOT_004A8,
|
||||
SPELL_SUMMON_SENTRYBOT_57K,
|
||||
SPELL_SUMMON_DEFENDOTANK_66D,
|
||||
SPELL_SUMMON_SCAVENGEBOT_005B6,
|
||||
SPELL_SUMMON_55D_COLLECTATRON,
|
||||
SPELL_ROBOT_KILL_CREDIT
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -592,9 +588,13 @@ class spell_q12634_despawn_fruit_tosser : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BANANAS_FALL_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_ORANGE_FALLS_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_PAPAYA_FALLS_TO_GROUND) || !sSpellMgr->GetSpellInfo(SPELL_SUMMON_ADVENTUROUS_DWARF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_BANANAS_FALL_TO_GROUND,
|
||||
SPELL_ORANGE_FALLS_TO_GROUND,
|
||||
SPELL_PAPAYA_FALLS_TO_GROUND,
|
||||
SPELL_SUMMON_ADVENTUROUS_DWARF
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -608,7 +608,7 @@ class spell_q12634_despawn_fruit_tosser : public SpellScriptLoader
|
||||
// sometimes, if you're lucky, you get a dwarf
|
||||
if (roll_chance_i(5))
|
||||
spellId = SPELL_SUMMON_ADVENTUROUS_DWARF;
|
||||
GetCaster()->CastSpell(GetCaster(), spellId, true, NULL);
|
||||
GetCaster()->CastSpell(GetCaster(), spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -642,7 +642,7 @@ class spell_q12683_take_sputum_sample : public SpellScriptLoader
|
||||
if (caster->HasAuraEffect(reqAuraId, 0))
|
||||
{
|
||||
uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
|
||||
caster->CastSpell(caster, spellId, true, NULL);
|
||||
caster->CastSpell(caster, spellId, true, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -744,9 +744,7 @@ class spell_q12937_relief_for_the_fallen : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGER_AID_OF_THE_EARTHEN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_TRIGGER_AID_OF_THE_EARTHEN });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -754,7 +752,7 @@ class spell_q12937_relief_for_the_fallen : public SpellScriptLoader
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (Creature* target = GetHitCreature())
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL);
|
||||
caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, nullptr);
|
||||
caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER);
|
||||
target->DespawnOrUnsummon();
|
||||
}
|
||||
@@ -790,9 +788,7 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MALE_DISGUISE) || !sSpellMgr->GetSpellInfo(SPELL_FEMALE_DISGUISE) || !sSpellMgr->GetSpellInfo(SPELL_GENERIC_DISGUISE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MALE_DISGUISE, SPELL_FEMALE_DISGUISE, SPELL_GENERIC_DISGUISE });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -1072,9 +1068,7 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER) || !sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -1684,16 +1678,14 @@ class spell_q12527_zuldrak_rat : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_GORGED_LURKING_BASILISK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_GORGED_LURKING_BASILISK });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount)
|
||||
{
|
||||
GetHitUnit()->CastSpell((Unit*) NULL, SPELL_SUMMON_GORGED_LURKING_BASILISK, true);
|
||||
GetHitUnit()->CastSpell((Unit*) nullptr, SPELL_SUMMON_GORGED_LURKING_BASILISK, true);
|
||||
if (Creature* basilisk = GetHitUnit()->ToCreature())
|
||||
basilisk->DespawnOrUnsummon();
|
||||
}
|
||||
@@ -1756,9 +1748,7 @@ class spell_q12730_quenching_mist : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FLICKERING_FLAMES))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FLICKERING_FLAMES });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -1799,10 +1789,7 @@ class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RIDE))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_RIDE });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1902,10 +1889,11 @@ class spell_q13011_bear_flank_master : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BEAR_FLANK_MASTER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_BEAR_FLANK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_CREATE_BEAR_FLANK,
|
||||
SPELL_BEAR_FLANK_FAIL
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -1951,9 +1939,7 @@ class spell_q13086_cannons_target : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue()))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ static_cast<uint32>(spellInfo->Effects[EFFECT_0].CalcValue()) });
|
||||
}
|
||||
|
||||
void HandleEffectDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2088,14 +2074,15 @@ class spell_q12690_burst_at_the_seams : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_DMG)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_DMG_2)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_BONE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_MEAT)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_BMEAT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_BURST_AT_THE_SEAMS,
|
||||
SPELL_BURST_AT_THE_SEAMS_DMG,
|
||||
SPELL_BURST_AT_THE_SEAMS_DMG_2,
|
||||
SPELL_BURST_AT_THE_SEAMS_BONE,
|
||||
SPELL_BURST_AT_THE_SEAMS_MEAT,
|
||||
SPELL_BURST_AT_THE_SEAMS_BMEAT
|
||||
});
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -2164,9 +2151,7 @@ class spell_q12308_escape_from_silverbrook : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_WORGEN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_WORGEN });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2242,12 +2227,13 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FORGE_CREDIT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TOWN_HALL_CREDIT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SCARLET_HOLD_CREDIT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_CHAPEL_CREDIT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_FORGE_CREDIT,
|
||||
SPELL_TOWN_HALL_CREDIT,
|
||||
SPELL_SCARLET_HOLD_CREDIT,
|
||||
SPELL_CHAPEL_CREDIT
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2272,7 +2258,7 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader
|
||||
return;
|
||||
}
|
||||
|
||||
GetCaster()->CastSpell((Unit*)NULL, spellId, true);
|
||||
GetCaster()->CastSpell((Unit*)nullptr, spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2338,7 +2324,7 @@ class spell_q12619_emblazon_runeblade : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, NULL, aurEff);
|
||||
caster->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2397,9 +2383,7 @@ class spell_q12919_gymers_grab : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RIDE_GYMER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_RIDE_GYMER });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -2476,9 +2460,7 @@ class spell_q13400_illidan_kill_master : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ILLIDAN_KILL_CREDIT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ILLIDAN_KILL_CREDIT });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -2518,9 +2500,7 @@ class spell_q14100_q14111_make_player_destroy_totems : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TOTEM_OF_THE_EARTHEN_RING))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_TOTEM_OF_THE_EARTHEN_RING });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -2559,11 +2539,7 @@ class spell_q10929_fumping : SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SAND_GNOME))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_BONE_SLICER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER });
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -2605,9 +2581,7 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RENEWED_LIFE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_RENEWED_LIFE });
|
||||
}
|
||||
|
||||
void HandleDummyEffect()
|
||||
|
||||
@@ -21,12 +21,17 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_rog_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Containers.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Item.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "Containers.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum RogueSpells
|
||||
{
|
||||
@@ -70,18 +75,9 @@ class spell_rog_blade_flurry : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_rog_blade_flurry_AuraScript);
|
||||
|
||||
public:
|
||||
spell_rog_blade_flurry_AuraScript()
|
||||
{
|
||||
_procTarget = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -93,11 +89,7 @@ class spell_rog_blade_flurry : public SpellScriptLoader
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
TC_LOG_ERROR("misc", "damage: %u procSpell: %u",
|
||||
eventInfo.GetDamageInfo()->GetDamage(), eventInfo.GetDamageInfo()->GetSpellInfo() ? eventInfo.GetDamageInfo()->GetSpellInfo()->Id : 0);
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), _procTarget, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), _procTarget, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -109,8 +101,7 @@ class spell_rog_blade_flurry : public SpellScriptLoader
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_blade_flurry_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
Unit* _procTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -129,20 +120,11 @@ class spell_rog_cheat_death : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_rog_cheat_death_AuraScript);
|
||||
|
||||
public:
|
||||
spell_rog_cheat_death_AuraScript()
|
||||
{
|
||||
absorbChance = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 absorbChance;
|
||||
uint32 absorbChance = 0;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_CHEAT_DEATH_COOLDOWN });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -201,15 +183,13 @@ class spell_rog_crippling_poison : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_CRIPPLING_POISON))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_CRIPPLING_POISON });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_CRIPPLING_POISON, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_CRIPPLING_POISON, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -263,13 +243,6 @@ class spell_rog_deadly_poison : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_rog_deadly_poison_SpellScript);
|
||||
|
||||
public:
|
||||
spell_rog_deadly_poison_SpellScript()
|
||||
{
|
||||
_stackAmount = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Load() override
|
||||
{
|
||||
// at this point CastItem must already be initialized
|
||||
@@ -347,7 +320,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
|
||||
AfterHit += SpellHitFn(spell_rog_deadly_poison_SpellScript::HandleAfterHit);
|
||||
}
|
||||
|
||||
uint8 _stackAmount;
|
||||
uint8 _stackAmount = 0;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
@@ -357,11 +330,12 @@ class spell_rog_deadly_poison : public SpellScriptLoader
|
||||
};
|
||||
|
||||
// 51690 - Killing Spree
|
||||
#define KillingSpreeScriptName "spell_rog_killing_spree"
|
||||
class spell_rog_killing_spree : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_killing_spree() : SpellScriptLoader(KillingSpreeScriptName) { }
|
||||
static char constexpr const ScriptName[] = "spell_rog_killing_spree";
|
||||
|
||||
spell_rog_killing_spree() : SpellScriptLoader(ScriptName) { }
|
||||
|
||||
class spell_rog_killing_spree_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -376,10 +350,8 @@ class spell_rog_killing_spree : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
|
||||
{
|
||||
if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName(KillingSpreeScriptName)))
|
||||
if (spell_rog_killing_spree_AuraScript* script = aura->GetScript<spell_rog_killing_spree_AuraScript>(ScriptName))
|
||||
script->AddTarget(GetHitUnit());
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -400,11 +372,12 @@ class spell_rog_killing_spree : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_TELEPORT)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ROGUE_KILLING_SPREE_TELEPORT,
|
||||
SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG,
|
||||
SPELL_ROGUE_KILLING_SPREE_DMG_BUFF
|
||||
});
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -455,6 +428,7 @@ class spell_rog_killing_spree : public SpellScriptLoader
|
||||
return new spell_rog_killing_spree_AuraScript();
|
||||
}
|
||||
};
|
||||
char constexpr const spell_rog_killing_spree::ScriptName[];
|
||||
|
||||
// 31666 - Master of Subtlety
|
||||
class spell_rog_master_of_subtlety : public SpellScriptLoader
|
||||
@@ -468,9 +442,7 @@ class spell_rog_master_of_subtlety : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -556,9 +528,7 @@ class spell_rog_overkill : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_OVERKILL_POWER_REGEN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_OVERKILL_POWER_REGEN });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -598,9 +568,7 @@ class spell_rog_preparation : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_GLYPH_OF_PREPARATION))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_GLYPH_OF_PREPARATION });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -644,9 +612,7 @@ class spell_rog_prey_on_the_weak : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_PREY_ON_THE_WEAK))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_PREY_ON_THE_WEAK });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -727,11 +693,12 @@ class spell_rog_recuperate : public SpellScriptLoader
|
||||
};
|
||||
|
||||
// -1943 - Rupture
|
||||
#define RuptureScriptName "spell_rog_rupture"
|
||||
class spell_rog_rupture : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rog_rupture() : SpellScriptLoader(RuptureScriptName) { }
|
||||
static char constexpr const ScriptName[] = "spell_rog_rupture";
|
||||
|
||||
spell_rog_rupture() : SpellScriptLoader(ScriptName) { }
|
||||
|
||||
class spell_rog_rupture_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -789,6 +756,7 @@ class spell_rog_rupture : public SpellScriptLoader
|
||||
return new spell_rog_rupture_AuraScript();
|
||||
}
|
||||
};
|
||||
char constexpr const spell_rog_rupture::ScriptName[];
|
||||
|
||||
// 63975 - Glyph of Backstab (triggered - serverside)
|
||||
class spell_rog_glyph_of_backstab_triggered : public SpellScriptLoader
|
||||
@@ -810,7 +778,7 @@ class spell_rog_glyph_of_backstab_triggered : public SpellScriptLoader
|
||||
// search our Rupture aura on target
|
||||
if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00100000, 0, 0, caster->GetGUID()))
|
||||
{
|
||||
RuptureAuraScript* ruptureAuraScript = dynamic_cast<RuptureAuraScript*>(aurEff->GetBase()->GetScriptByName(RuptureScriptName));
|
||||
RuptureAuraScript* ruptureAuraScript = aurEff->GetBase()->GetScript<RuptureAuraScript>(spell_rog_rupture::ScriptName);
|
||||
if (!ruptureAuraScript)
|
||||
return;
|
||||
|
||||
@@ -863,9 +831,7 @@ class spell_rog_shiv : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_SHIV_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_SHIV_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -899,14 +865,15 @@ class spell_rog_stealth : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_MASTER_OF_SUBTLETY_PASSIVE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ROGUE_MASTER_OF_SUBTLETY_PERIODIC) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ROGUE_OVERKILL_TALENT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ROGUE_OVERKILL_POWER_REGEN) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ROGUE_OVERKILL_PERIODIC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ROGUE_MASTER_OF_SUBTLETY_PASSIVE,
|
||||
SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT,
|
||||
SPELL_ROGUE_MASTER_OF_SUBTLETY_PERIODIC,
|
||||
SPELL_ROGUE_OVERKILL_TALENT,
|
||||
SPELL_ROGUE_OVERKILL_POWER_REGEN,
|
||||
SPELL_ROGUE_OVERKILL_PERIODIC
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -917,7 +884,7 @@ class spell_rog_stealth : public SpellScriptLoader
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_ROGUE_MASTER_OF_SUBTLETY_PASSIVE, EFFECT_0))
|
||||
{
|
||||
int32 basepoints0 = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT, &basepoints0, NULL, NULL, true);
|
||||
target->CastCustomSpell(target, SPELL_ROGUE_MASTER_OF_SUBTLETY_DAMAGE_PERCENT, &basepoints0, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
// Overkill
|
||||
@@ -961,20 +928,9 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_rog_tricks_of_the_trade_AuraScript);
|
||||
|
||||
public:
|
||||
spell_rog_tricks_of_the_trade_AuraScript()
|
||||
{
|
||||
_redirectTarget = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1006,8 +962,7 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
|
||||
OnEffectProc += AuraEffectProcFn(spell_rog_tricks_of_the_trade_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _redirectTarget;
|
||||
Unit* _redirectTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -1089,9 +1044,7 @@ class spell_rog_honor_among_thieves : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_sha_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Unit.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum ShamanSpells
|
||||
{
|
||||
@@ -94,9 +94,7 @@ class spell_sha_ancestral_awakening : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TIDAL_WAVES))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_TIDAL_WAVES });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -104,7 +102,7 @@ class spell_sha_ancestral_awakening : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
int32 heal = int32(CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount()));
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -132,9 +130,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC });
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
@@ -180,11 +176,12 @@ class spell_sha_bloodlust : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_SATED)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_HUNTER_INSANITY)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_MAGE_TEMPORAL_DISPLACEMENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SHAMAN_SATED,
|
||||
SPELL_HUNTER_INSANITY,
|
||||
SPELL_MAGE_TEMPORAL_DISPLACEMENT
|
||||
});
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
@@ -285,10 +282,7 @@ class spell_sha_earth_shield : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EARTH_SHIELD_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_EARTH_SHIELD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELL_SHAMAN_GLYPH_OF_EARTH_SHIELD });
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool & /*canBeRecalculated*/)
|
||||
@@ -326,7 +320,7 @@ class spell_sha_earth_shield : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff, GetCasterGUID());
|
||||
|
||||
/// @hack: due to currenct proc system implementation
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
@@ -360,10 +354,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHEN_POWER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM, SPELL_SHAMAN_TOTEM_EARTHEN_POWER });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -373,7 +364,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||
if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
||||
if (roll_chance_i(aur->GetBaseAmount()))
|
||||
GetTarget()->CastSpell((Unit*)NULL, SPELL_SHAMAN_TOTEM_EARTHEN_POWER, true);
|
||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_SHAMAN_TOTEM_EARTHEN_POWER, true);
|
||||
}
|
||||
|
||||
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -460,9 +451,7 @@ class spell_sha_feedback : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_MASTERY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_ELEMENTAL_MASTERY });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -533,10 +522,7 @@ class spell_sha_flame_shock : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_LAVA_FLOWS_R1, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 });
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* /*dispelInfo*/)
|
||||
@@ -551,7 +537,7 @@ class spell_sha_flame_shock : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
int32 basepoints = aurEff->GetAmount();
|
||||
caster->CastCustomSpell(caster, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true);
|
||||
caster->CastCustomSpell(caster, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -580,9 +566,7 @@ class spell_sha_focused_insight : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FOCUSED_INSIGHT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_FOCUSED_INSIGHT });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -591,7 +575,7 @@ class spell_sha_focused_insight : public SpellScriptLoader
|
||||
int32 basePoints0 = aurEff->GetAmount();
|
||||
int32 basePoints1 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_FOCUSED_INSIGHT, &basePoints0, &basePoints1, &basePoints1, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_FOCUSED_INSIGHT, &basePoints0, &basePoints1, &basePoints1, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -618,9 +602,7 @@ class spell_sha_glyph_of_healing_wave : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -634,7 +616,7 @@ class spell_sha_glyph_of_healing_wave : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
int32 heal = CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount());
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -663,7 +645,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL) != nullptr;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -713,11 +695,12 @@ class spell_sha_heroism : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EXHAUSTION)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_HUNTER_INSANITY)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_MAGE_TEMPORAL_DISPLACEMENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SHAMAN_EXHAUSTION,
|
||||
SPELL_HUNTER_INSANITY,
|
||||
SPELL_MAGE_TEMPORAL_DISPLACEMENT
|
||||
});
|
||||
}
|
||||
|
||||
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
|
||||
@@ -760,15 +743,13 @@ class spell_sha_item_lightning_shield : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -795,15 +776,13 @@ class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_MANA_SURGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_ITEM_MANA_SURGE });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -830,9 +809,7 @@ class spell_sha_item_mana_surge : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -841,7 +818,7 @@ class spell_sha_item_mana_surge : public SpellScriptLoader
|
||||
int32 mana = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), SpellSchoolMask(eventInfo.GetDamageInfo()->GetSchoolMask()));
|
||||
mana = int32(CalculatePct(mana, 35));
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_ITEM_MANA_SURGE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_SHAMAN_ITEM_MANA_SURGE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -868,9 +845,7 @@ class spell_sha_item_t10_elemental_2p_bonus : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_MASTERY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_ELEMENTAL_MASTERY });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -948,9 +923,7 @@ class spell_sha_lava_surge : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_SURGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_LAVA_SURGE });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -982,9 +955,7 @@ class spell_sha_lava_surge_proc : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_BURST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_LAVA_BURST });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -1053,9 +1024,7 @@ class spell_sha_nature_guardian : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_NATURE_GUARDIAN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_NATURE_GUARDIAN });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -1073,7 +1042,7 @@ class spell_sha_nature_guardian : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
int32 basePoints0 = GetTarget()->CountPctFromMaxHealth(aurEff->GetAmount());
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_NATURE_GUARDIAN, &basePoints0, NULL, NULL, true);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_NATURE_GUARDIAN, &basePoints0, nullptr, nullptr, true);
|
||||
|
||||
if (eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive())
|
||||
eventInfo.GetProcTarget()->getThreatManager().modifyThreatPercent(GetTarget(), -10);
|
||||
@@ -1107,9 +1076,7 @@ class spell_sha_rolling_thunder : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LIGHTNING_SHIELD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_LIGHTNING_SHIELD });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -1145,9 +1112,7 @@ class spell_sha_telluric_currents : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TELLURIC_CURRENTS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_TELLURIC_CURRENTS });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -1155,7 +1120,7 @@ class spell_sha_telluric_currents : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
int32 basePoints0 = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_TELLURIC_CURRENTS, &basePoints0, NULL, NULL, true);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_TELLURIC_CURRENTS, &basePoints0, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1211,9 +1176,7 @@ class spell_sha_tidal_waves : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TIDAL_WAVES))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_TIDAL_WAVES });
|
||||
}
|
||||
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -1222,7 +1185,7 @@ class spell_sha_tidal_waves : public SpellScriptLoader
|
||||
int32 basePoints0 = -aurEff->GetAmount();
|
||||
int32 basePoints1 = aurEff->GetAmount();
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_TIDAL_WAVES, &basePoints0, &basePoints1, NULL, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_TIDAL_WAVES, &basePoints0, &basePoints1, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1249,9 +1212,7 @@ public:
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEMIC_MASTERY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_TOTEMIC_MASTERY });
|
||||
}
|
||||
|
||||
void HandleDummy(AuraEffect const* /*aurEff*/)
|
||||
|
||||
@@ -21,11 +21,16 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_warl_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum WarlockSpells
|
||||
{
|
||||
@@ -101,9 +106,7 @@ class spell_warl_aftermath : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_AFTERMATH_STUN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_AFTERMATH_STUN });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -113,7 +116,7 @@ class spell_warl_aftermath : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
|
||||
if (eventInfo.GetProcTarget() && roll_chance_i(aurEff->GetAmount()))
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARLOCK_AFTERMATH_STUN, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARLOCK_AFTERMATH_STUN, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,9 +199,7 @@ class spell_warl_conflagrate : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMMOLATE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_IMMOLATE });
|
||||
}
|
||||
|
||||
void HandleHit(SpellEffIndex /*effIndex*/)
|
||||
@@ -231,9 +232,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_CREATE_HEALTHSTONE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_CREATE_HEALTHSTONE });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -271,9 +270,7 @@ class spell_warl_bane_of_doom : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_BANE_OF_DOOM_EFFECT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_BANE_OF_DOOM_EFFECT });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -291,7 +288,7 @@ class spell_warl_bane_of_doom : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
|
||||
GetCaster()->CastSpell(GetTarget(), SPELL_WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff);
|
||||
GetCaster()->CastSpell(GetTarget(), SPELL_WARLOCK_BANE_OF_DOOM_EFFECT, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -406,17 +403,14 @@ class spell_warl_demon_soul : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_IMP))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_FELHUNTER))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_FELGUARD))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARLOCK_DEMON_SOUL_IMP,
|
||||
SPELL_WARLOCK_DEMON_SOUL_FELHUNTER,
|
||||
SPELL_WARLOCK_DEMON_SOUL_FELGUARD,
|
||||
SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS,
|
||||
SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER
|
||||
});
|
||||
}
|
||||
|
||||
void OnHitTarget(SpellEffIndex /*effIndex*/)
|
||||
@@ -476,9 +470,14 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER,
|
||||
SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -498,7 +497,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
|
||||
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
|
||||
targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
|
||||
targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, nullptr, nullptr, true);
|
||||
break;
|
||||
}
|
||||
case CREATURE_FAMILY_FELGUARD:
|
||||
@@ -616,9 +615,7 @@ class spell_warl_fel_synergy : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_FEL_SYNERGY_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_FEL_SYNERGY_HEAL });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -631,7 +628,7 @@ class spell_warl_fel_synergy : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
|
||||
int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff); // TARGET_UNIT_PET
|
||||
GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, aurEff); // TARGET_UNIT_PET
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -659,15 +656,13 @@ class spell_warl_glyph_of_shadowflame : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARLOCK_GLYPH_OF_SHADOWFLAME, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -712,9 +707,7 @@ class spell_warl_haunt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_HAUNT_HEAL });
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -722,7 +715,7 @@ class spell_warl_haunt : public SpellScriptLoader
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 amount = aurEff->GetAmount();
|
||||
GetTarget()->CastCustomSpell(caster, SPELL_WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastCustomSpell(caster, SPELL_WARLOCK_HAUNT_HEAL, &amount, nullptr, nullptr, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +776,7 @@ class spell_warl_health_funnel : public SpellScriptLoader
|
||||
uint32 damage = caster->CountPctFromMaxHealth(aurEff->GetBaseAmount());
|
||||
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod<SPELLMOD_COST>(GetId(), damage);
|
||||
modOwner->ApplySpellMod(GetId(), SPELLMOD_COST, damage);
|
||||
|
||||
SpellNonMeleeDamage damageInfo(caster, caster, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask);
|
||||
damageInfo.damage = damage;
|
||||
@@ -845,17 +838,14 @@ class spell_warl_improved_soul_fire : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_SOUL_FIRE_PCT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_SOUL_FIRE_STATE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_IMPROVED_SOUL_FIRE_PCT, SPELL_WARLOCK_IMPROVED_SOUL_FIRE_STATE });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastCustomSpell(SPELL_WARLOCK_IMPROVED_SOUL_FIRE_PCT, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_IMPROVED_SOUL_FIRE_STATE, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_WARLOCK_IMPROVED_SOUL_FIRE_PCT, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_IMPROVED_SOUL_FIRE_STATE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -886,12 +876,9 @@ class spell_warl_life_tap : public SpellScriptLoader
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_LIFE_TAP_ENERGIZE, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -909,14 +896,14 @@ class spell_warl_life_tap : public SpellScriptLoader
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_IMPROVED_LIFE_TAP, 0))
|
||||
AddPct(mana, aurEff->GetAmount());
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
|
||||
caster->CastCustomSpell(target, SPELL_WARLOCK_LIFE_TAP_ENERGIZE, &mana, nullptr, nullptr, false);
|
||||
|
||||
// Mana Feed
|
||||
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_MANA_FEED, 0))
|
||||
{
|
||||
int32 manaFeedVal = aurEff->GetAmount();
|
||||
ApplyPct(manaFeedVal, mana);
|
||||
caster->CastCustomSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
|
||||
caster->CastCustomSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, nullptr, nullptr, true, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -954,11 +941,12 @@ class spell_warl_nether_ward_overrride : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_TALENT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_WARD) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SHADOW_WARD))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARLOCK_NETHER_TALENT,
|
||||
SPELL_WARLOCK_NETHER_WARD,
|
||||
SPELL_WARLOCK_SHADOW_WARD
|
||||
});
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
@@ -993,10 +981,7 @@ class spell_warl_seduction : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SUCCUBUS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PRIEST_SHADOW_WORD_DEATH))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_GLYPH_OF_SUCCUBUS, SPELL_PRIEST_SHADOW_WORD_DEATH });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -1067,15 +1052,13 @@ class spell_warl_shadow_trance_proc : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SHADOW_TRANCE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_SHADOW_TRANCE });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_SHADOW_TRANCE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_SHADOW_TRANCE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1138,14 +1121,12 @@ class spell_warl_soul_leech : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_REPLENISHMENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GEN_REPLENISHMENT });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)NULL, SPELL_GEN_REPLENISHMENT, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_GEN_REPLENISHMENT, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1172,11 +1153,12 @@ class spell_warl_soul_swap : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_CD_MARKER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP,
|
||||
SPELL_WARLOCK_SOUL_SWAP_CD_MARKER,
|
||||
SPELL_WARLOCK_SOUL_SWAP_OVERRIDE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleHit(SpellEffIndex /*effIndex*/)
|
||||
@@ -1201,7 +1183,9 @@ class spell_warl_soul_swap : public SpellScriptLoader
|
||||
class spell_warl_soul_swap_override : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_soul_swap_override() : SpellScriptLoader("spell_warl_soul_swap_override") { }
|
||||
static char constexpr const ScriptName[] = "spell_warl_soul_swap_override";
|
||||
|
||||
spell_warl_soul_swap_override() : SpellScriptLoader(ScriptName) { }
|
||||
|
||||
class spell_warl_soul_swap_override_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -1209,7 +1193,7 @@ class spell_warl_soul_swap_override : public SpellScriptLoader
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_swapCaster = NULL;
|
||||
_swapCaster = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1232,8 +1216,7 @@ class spell_warl_soul_swap_override : public SpellScriptLoader
|
||||
return new spell_warl_soul_swap_override_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
typedef spell_warl_soul_swap_override::spell_warl_soul_swap_override_AuraScript SoulSwapOverrideAuraScript;
|
||||
char constexpr const spell_warl_soul_swap_override::ScriptName[];
|
||||
|
||||
//! Soul Swap Copy Spells - 92795 - Simply copies spell IDs.
|
||||
class spell_warl_soul_swap_dot_marker : public SpellScriptLoader
|
||||
@@ -1245,6 +1228,8 @@ class spell_warl_soul_swap_dot_marker : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_warl_soul_swap_dot_marker_SpellScript);
|
||||
|
||||
typedef spell_warl_soul_swap_override::spell_warl_soul_swap_override_AuraScript SoulSwapOverrideAuraScript;
|
||||
|
||||
void HandleHit(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit* swapVictim = GetCaster();
|
||||
@@ -1255,11 +1240,11 @@ class spell_warl_soul_swap_dot_marker : public SpellScriptLoader
|
||||
flag96 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask;
|
||||
|
||||
Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras();
|
||||
SoulSwapOverrideAuraScript* swapSpellScript = NULL;
|
||||
SoulSwapOverrideAuraScript* swapSpellScript = nullptr;
|
||||
if (Aura* swapOverrideAura = warlock->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
|
||||
swapSpellScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverrideAura->GetScriptByName("spell_warl_soul_swap_override"));
|
||||
swapSpellScript = swapOverrideAura->GetScript<SoulSwapOverrideAuraScript>(spell_warl_soul_swap_override::ScriptName);
|
||||
|
||||
if (swapSpellScript == NULL)
|
||||
if (swapSpellScript == nullptr)
|
||||
return;
|
||||
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
|
||||
@@ -1295,20 +1280,23 @@ public:
|
||||
{
|
||||
PrepareSpellScript(spell_warl_soul_swap_exhale_SpellScript);
|
||||
|
||||
typedef spell_warl_soul_swap_override::spell_warl_soul_swap_override_AuraScript SoulSwapOverrideAuraScript;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_MOD_COST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARLOCK_SOUL_SWAP_MOD_COST,
|
||||
SPELL_WARLOCK_SOUL_SWAP_OVERRIDE
|
||||
});
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* currentTarget = GetExplTargetUnit();
|
||||
Unit* swapTarget = NULL;
|
||||
Unit* swapTarget = nullptr;
|
||||
if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
|
||||
if (SoulSwapOverrideAuraScript* swapScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverride->GetScriptByName("spell_warl_soul_swap_override")))
|
||||
if (SoulSwapOverrideAuraScript* swapScript = swapOverride->GetScript<SoulSwapOverrideAuraScript>(spell_warl_soul_swap_override::ScriptName))
|
||||
swapTarget = swapScript->GetOriginalSwapSource();
|
||||
|
||||
// Soul Swap Exhale can't be cast on the same target than Soul Swap
|
||||
@@ -1324,10 +1312,10 @@ public:
|
||||
bool hasGlyph = GetCaster()->HasAura(SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP);
|
||||
|
||||
std::list<uint32> dotList;
|
||||
Unit* swapSource = NULL;
|
||||
Unit* swapSource = nullptr;
|
||||
if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
|
||||
{
|
||||
SoulSwapOverrideAuraScript* swapScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverride->GetScriptByName("spell_warl_soul_swap_override"));
|
||||
SoulSwapOverrideAuraScript* swapScript = swapOverride->GetScript<SoulSwapOverrideAuraScript>(spell_warl_soul_swap_override::ScriptName);
|
||||
if (!swapScript)
|
||||
return;
|
||||
dotList = swapScript->GetDotList();
|
||||
@@ -1377,9 +1365,7 @@ class spell_warl_soulshatter : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOULSHATTER))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_SOULSHATTER });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -1415,9 +1401,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL });
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
@@ -1427,7 +1411,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() * 9;
|
||||
// backfire damage and silence
|
||||
caster->CastCustomSpell(dispelInfo->GetDispeller(), SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
caster->CastCustomSpell(dispelInfo->GetDispeller(), SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, nullptr, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,13 @@
|
||||
* Scriptnames of files in this file should be prefixed with "spell_warr_".
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum WarriorSpells
|
||||
{
|
||||
@@ -48,10 +50,10 @@ enum WarriorSpells
|
||||
SPELL_WARRIOR_RALLYING_CRY = 97463,
|
||||
SPELL_WARRIOR_REND = 94009,
|
||||
SPELL_WARRIOR_RETALIATION_DAMAGE = 22858,
|
||||
SPELL_WARRIOR_SECOUND_WIND_PROC_RANK_1 = 29834,
|
||||
SPELL_WARRIOR_SECOUND_WIND_PROC_RANK_2 = 29838,
|
||||
SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_1 = 29841,
|
||||
SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_2 = 29842,
|
||||
SPELL_WARRIOR_SECOND_WIND_PROC_RANK_1 = 29834,
|
||||
SPELL_WARRIOR_SECOND_WIND_PROC_RANK_2 = 29838,
|
||||
SPELL_WARRIOR_SECOND_WIND_TRIGGER_RANK_1 = 29841,
|
||||
SPELL_WARRIOR_SECOND_WIND_TRIGGER_RANK_2 = 29842,
|
||||
SPELL_WARRIOR_SHIELD_SLAM = 23922,
|
||||
SPELL_WARRIOR_SLAM = 50782,
|
||||
SPELL_WARRIOR_SUNDER_ARMOR = 58567,
|
||||
@@ -105,7 +107,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
|
||||
GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, nullptr, nullptr, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -131,10 +133,15 @@ class spell_warr_bloodthirst_heal : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_BLOODTHIRST_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleHeal(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE))
|
||||
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
|
||||
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE);
|
||||
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -161,18 +168,19 @@ class spell_warr_charge : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_CHARGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT,
|
||||
SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF,
|
||||
SPELL_WARRIOR_CHARGE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 chargeBasePoints0 = GetEffectValue();
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastCustomSpell(caster, SPELL_WARRIOR_CHARGE, &chargeBasePoints0, NULL, NULL, true);
|
||||
caster->CastCustomSpell(caster, SPELL_WARRIOR_CHARGE, &chargeBasePoints0, nullptr, nullptr, true);
|
||||
|
||||
// Juggernaut crit bonus
|
||||
if (caster->HasAura(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT))
|
||||
@@ -230,12 +238,13 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_1,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_2,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_RANK_3,
|
||||
SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -255,7 +264,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
|
||||
damage /= int32(ticks);
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, &damage, NULL, NULL, true);
|
||||
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, &damage, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,10 +432,7 @@ class spell_warr_lambs_to_the_slaughter : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_MORTAL_STRIKE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_REND))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_MORTAL_STRIKE, SPELL_WARRIOR_REND });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
@@ -461,16 +467,14 @@ class spell_warr_last_stand : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_LAST_STAND_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_LAST_STAND_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
|
||||
caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
|
||||
caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, nullptr, nullptr, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -536,9 +540,7 @@ class spell_warr_rallying_cry : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_RALLYING_CRY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_RALLYING_CRY });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -550,7 +552,7 @@ class spell_warr_rallying_cry : public SpellScriptLoader
|
||||
{
|
||||
int32 basePoints0 = int32(GetHitUnit()->CountPctFromMaxHealth(GetEffectValue()));
|
||||
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_RALLYING_CRY, &basePoints0, NULL, NULL, true);
|
||||
GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_RALLYING_CRY, &basePoints0, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -615,9 +617,7 @@ class spell_warr_retaliation : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_RETALIATION_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_RETALIATION_DAMAGE });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -629,7 +629,7 @@ class spell_warr_retaliation : public SpellScriptLoader
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARRIOR_RETALIATION_DAMAGE, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_WARRIOR_RETALIATION_DAMAGE, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -688,9 +688,7 @@ class spell_warr_slam : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SLAM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_SLAM });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
@@ -722,12 +720,13 @@ class spell_warr_second_wind_proc : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SECOUND_WIND_PROC_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SECOUND_WIND_PROC_RANK_2) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_1) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_2))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_WARRIOR_SECOND_WIND_PROC_RANK_1,
|
||||
SPELL_WARRIOR_SECOND_WIND_PROC_RANK_2,
|
||||
SPELL_WARRIOR_SECOND_WIND_TRIGGER_RANK_1,
|
||||
SPELL_WARRIOR_SECOND_WIND_TRIGGER_RANK_2
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -744,14 +743,14 @@ class spell_warr_second_wind_proc : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
uint32 spellId = 0;
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_WARRIOR_SECOUND_WIND_PROC_RANK_1)
|
||||
spellId = SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_1;
|
||||
else if (GetSpellInfo()->Id == SPELL_WARRIOR_SECOUND_WIND_PROC_RANK_2)
|
||||
spellId = SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_2;
|
||||
if (GetSpellInfo()->Id == SPELL_WARRIOR_SECOND_WIND_PROC_RANK_1)
|
||||
spellId = SPELL_WARRIOR_SECOND_WIND_TRIGGER_RANK_1;
|
||||
else if (GetSpellInfo()->Id == SPELL_WARRIOR_SECOND_WIND_PROC_RANK_2)
|
||||
spellId = SPELL_WARRIOR_SECOND_WIND_TRIGGER_RANK_2;
|
||||
if (!spellId)
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
|
||||
|
||||
}
|
||||
|
||||
@@ -807,9 +806,7 @@ class spell_warr_sudden_death : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_COLOSSUS_SMASH))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_COLOSSUS_SMASH });
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -841,18 +838,9 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_warr_sweeping_strikes_AuraScript);
|
||||
|
||||
public:
|
||||
spell_warr_sweeping_strikes_AuraScript()
|
||||
{
|
||||
_procTarget = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -870,12 +858,12 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
|
||||
if (spellInfo && (spellInfo->Id == SPELL_WARRIOR_BLADESTORM_PERIODIC_WHIRLWIND || (spellInfo->Id == SPELL_WARRIOR_EXECUTE && !_procTarget->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT))))
|
||||
{
|
||||
// If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2, true, nullptr, aurEff);
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 damage = eventInfo.GetDamageInfo()->GetDamage();
|
||||
GetTarget()->CastCustomSpell(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, nullptr, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -886,8 +874,7 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
|
||||
OnEffectProc += AuraEffectProcFn(spell_warr_sweeping_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
Unit* _procTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -909,9 +896,7 @@ class spell_warr_sword_and_board : public SpellScriptLoader
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SHIELD_SLAM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_SHIELD_SLAM });
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
@@ -974,15 +959,7 @@ class spell_warr_vigilance : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_VENGEANCE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_procTarget = NULL;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_WARRIOR_VENGEANCE });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -996,8 +973,8 @@ class spell_warr_vigilance : public SpellScriptLoader
|
||||
PreventDefaultAction();
|
||||
int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()));
|
||||
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_VIGILANCE_PROC, true, NULL, aurEff);
|
||||
_procTarget->CastCustomSpell(_procTarget, SPELL_WARRIOR_VENGEANCE, &damage, &damage, &damage, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_VIGILANCE_PROC, true, nullptr, aurEff);
|
||||
_procTarget->CastCustomSpell(_procTarget, SPELL_WARRIOR_VENGEANCE, &damage, &damage, &damage, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1016,8 +993,7 @@ class spell_warr_vigilance : public SpellScriptLoader
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _procTarget;
|
||||
Unit* _procTarget = nullptr;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
|
||||
Reference in new issue
Block a user