aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp70
-rw-r--r--src/server/scripts/Spells/spell_item.cpp28
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp46
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp10
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp19
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp23
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp49
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp6
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp20
9 files changed, 106 insertions, 165 deletions
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 0c1ac135092..2556d465842 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -179,7 +179,11 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE, SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE });
+ return ValidateSpellInfo(
+ {
+ SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE,
+ SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE
+ });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -350,7 +354,12 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo({ SPELL_TRICKY_TREAT_SPEED, SPELL_TRICKY_TREAT_TRIGGER, SPELL_UPSET_TUMMY });
+ return ValidateSpellInfo(
+ {
+ SPELL_TRICKY_TREAT_SPEED,
+ SPELL_TRICKY_TREAT_TRIGGER,
+ SPELL_UPSET_TUMMY
+ });
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -468,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
{
@@ -668,17 +677,18 @@ 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) { }
+ private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _triggeredSpellId });
@@ -773,13 +783,13 @@ 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),
+ 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;
@@ -789,7 +799,8 @@ class spell_pilgrims_bounty_on_plate : public SpellScriptLoader
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* /*spellInfo*/) override
+ private:
+ bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo(
{
@@ -892,19 +903,19 @@ 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
{
PrepareAuraScript(spell_pilgrims_bounty_a_serving_of_AuraScript);
- private:
uint32 _triggeredSpellId;
public:
spell_pilgrims_bounty_a_serving_of_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ private:
+ bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _triggeredSpellId });
}
@@ -1006,6 +1017,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:
@@ -1017,34 +1036,20 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- 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
- });
+ 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);
}
}
@@ -1552,7 +1557,12 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_HAS_FULL_MIDSUMMER_SET, SPELL_RIBBON_DANCE, SPELL_BURNING_HOT_POLE_DANCE });
+ return ValidateSpellInfo(
+ {
+ SPELL_HAS_FULL_MIDSUMMER_SET,
+ SPELL_RIBBON_DANCE,
+ SPELL_BURNING_HOT_POLE_DANCE
+ });
}
void PeriodicTick(AuraEffect const* /*aurEff*/)
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index bf39b8c83f0..61e551a055b 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -46,17 +46,18 @@ 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
{
PrepareSpellScript(spell_item_trigger_spell_SpellScript);
- private:
+
uint32 _triggeredSpellId;
public:
spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ _triggeredSpellId });
@@ -214,7 +215,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader
caster->RemoveAurasDueToSpell(SPELL_MOTE_OF_ANGER);
uint32 spellId = SPELL_MANIFEST_ANGER_MAIN_HAND;
if (Player* player = caster->ToPlayer())
- if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1))
+ if (player->GetWeaponForAttack(OFF_ATTACK, true) && roll_chance_i(50))
spellId = SPELL_MANIFEST_ANGER_OFF_HAND;
caster->CastSpell(target, spellId, true, nullptr, aurEff);
@@ -607,6 +608,7 @@ class spell_item_defibrillate : public SpellScriptLoader
public:
spell_item_defibrillate_SpellScript(uint8 chance, uint32 failSpell) : SpellScript(), _chance(chance), _failSpell(failSpell) { }
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return !_failSpell || ValidateSpellInfo({ _failSpell });
@@ -627,7 +629,6 @@ class spell_item_defibrillate : public SpellScriptLoader
OnEffectHitTarget += SpellEffectFn(spell_item_defibrillate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_RESURRECT);
}
- private:
uint8 _chance;
uint32 _failSpell;
};
@@ -2982,7 +2983,11 @@ class spell_item_shard_of_the_scale : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ HealProc, DamageProc });
+ return ValidateSpellInfo(
+ {
+ HealProc,
+ DamageProc
+ });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -3106,14 +3111,9 @@ class spell_item_sunwell_neck : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- if (!sFactionStore.LookupEntry(FACTION_ALDOR) ||
- !sFactionStore.LookupEntry(FACTION_SCRYERS))
- return false;
- return ValidateSpellInfo(
- {
- Aldors,
- Scryers
- });
+ return ValidateSpellInfo({ Aldors, Scryers }) &&
+ sFactionStore.LookupEntry(FACTION_ALDOR) &&
+ sFactionStore.LookupEntry(FACTION_SCRYERS);
}
bool CheckProc(ProcEventInfo& eventInfo)
@@ -3271,6 +3271,7 @@ public:
{
}
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ _stackSpell, _triggerSpell });
@@ -3301,7 +3302,6 @@ public:
OnEffectProc += AuraEffectProcFn(spell_item_trinket_stack_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
- private:
uint32 _stackSpell;
uint32 _triggerSpell;
};
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 75e873604c4..43ae326ade2 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -89,15 +89,8 @@ class spell_pal_ardent_defender : public SpellScriptLoader
{
PrepareAuraScript(spell_pal_ardent_defender_AuraScript);
- public:
- spell_pal_ardent_defender_AuraScript()
- {
- absorbPct = 0;
- healPct = 0;
- }
-
- private:
- uint32 absorbPct, healPct;
+ uint32 _absorbPct = 0;
+ uint32 _healPct = 0;
enum Spell
{
@@ -106,15 +99,13 @@ class spell_pal_ardent_defender : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
- if (!sSpellMgr->GetSpellInfo(PAL_SPELL_ARDENT_DEFENDER_HEAL))
- return false;
- return true;
+ return ValidateSpellInfo({ PAL_SPELL_ARDENT_DEFENDER_HEAL });
}
bool Load() override
{
- healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
- absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ _absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ _healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
}
@@ -124,7 +115,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
amount = -1;
}
- void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
{
Unit* victim = GetTarget();
int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
@@ -135,15 +126,13 @@ class spell_pal_ardent_defender : public SpellScriptLoader
// Cast healing spell, completely avoid damage
absorbAmount = dmgInfo.GetDamage();
- uint32 defenseSkillValue = victim->GetDefenseSkillValue();
+ float defenseSkillValue = victim->GetDefenseSkillValue();
// Max heal when defense skill denies critical hits from raid bosses
// Formula: max defense at level + 140 (raiting from gear)
- uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140;
- float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal)
- ? 1.0f
- : float(defenseSkillValue) / float(reqDefForMaxHeal);
+ float reqDefForMaxHeal = victim->GetMaxSkillValueForLevel() + 140.0f;
+ float defenseFactor = std::min(1.0f, defenseSkillValue / reqDefForMaxHeal);
- int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
+ int32 healAmount = int32(victim->CountPctFromMaxHealth(static_cast<uint32>(lroundf(_healPct * defenseFactor))));
victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, nullptr, nullptr, true, nullptr, aurEff);
victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(nullptr) + 120);
}
@@ -153,7 +142,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
? dmgInfo.GetDamage()
: allowedHealth - remainingHealth;
- absorbAmount = CalculatePct(damageToReduce, absorbPct);
+ absorbAmount = CalculatePct(damageToReduce, _absorbPct);
}
}
@@ -253,7 +242,11 @@ class spell_pal_avenging_wrath : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_PALADIN_SANCTIFIED_WRATH, SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 });
+ return ValidateSpellInfo(
+ {
+ SPELL_PALADIN_SANCTIFIED_WRATH,
+ SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1
+ });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -870,7 +863,11 @@ class spell_pal_item_t6_trinket : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_PALADIN_ENDURING_LIGHT, SPELL_PALADIN_ENDURING_JUDGEMENT });
+ return ValidateSpellInfo(
+ {
+ SPELL_PALADIN_ENDURING_LIGHT,
+ SPELL_PALADIN_ENDURING_JUDGEMENT
+ });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -925,6 +922,7 @@ class spell_pal_judgement : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_judgement_SpellScript);
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_JUDGEMENT_DAMAGE });
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 0ff0ebde0e5..e8743fa35fc 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1436,13 +1436,6 @@ public:
{
PrepareAuraScript(spell_dk_pet_scaling_01_AuraScript);
- public:
- spell_dk_pet_scaling_01_AuraScript()
- {
- _tempHealth = 0;
- }
-
- private:
bool Load() override
{
if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
@@ -1502,8 +1495,7 @@ public:
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_01_AuraScript::CalculateStrengthAmount, EFFECT_1, SPELL_AURA_MOD_STAT);
}
- private:
- uint32 _tempHealth;
+ uint32 _tempHealth = 0;
};
AuraScript* GetAuraScript() const override
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 6e663381abb..f4c9d83f36e 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -604,14 +604,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
{
PrepareAuraScript(spell_pri_guardian_spirit_AuraScript);
- public:
- spell_pri_guardian_spirit_AuraScript()
- {
- healPct = 0;
- }
-
- private:
- uint32 healPct;
+ uint32 healPct = 0;
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -869,13 +862,6 @@ 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
{
return ValidateSpellInfo({ SPELL_PRIEST_MANA_LEECH_PROC });
@@ -899,8 +885,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
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index ff4f58685c0..abf23c8da85 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -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 "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
@@ -1047,13 +1047,7 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/) override
{
- return ValidateSpellInfo(
- {
- SUMMON_ANGRY_KVALDIR,
- SUMMON_NORTH_SEA_MAKO,
- SUMMON_NORTH_SEA_THRESHER,
- SUMMON_NORTH_SEA_BLUE_SHARK
- });
+ return ValidateSpellInfo({ SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK });
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
@@ -1857,9 +1851,8 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader
enum BearFlankMaster
{
- SPELL_BEAR_FLANK_MASTER = 56565,
SPELL_CREATE_BEAR_FLANK = 56566,
- SPELL_BEAR_FLANK_FAIL = 56569
+ SPELL_BEAR_FLANK_FAIL = 56569
};
class spell_q13011_bear_flank_master : public SpellScriptLoader
@@ -1873,7 +1866,11 @@ class spell_q13011_bear_flank_master : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_BEAR_FLANK_MASTER, SPELL_CREATE_BEAR_FLANK });
+ return ValidateSpellInfo(
+ {
+ SPELL_CREATE_BEAR_FLANK,
+ SPELL_BEAR_FLANK_FAIL
+ });
}
bool Load() override
@@ -1919,7 +1916,7 @@ class spell_q13086_cannons_target : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
- return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
+ return ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
}
void HandleEffectDummy(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index e4595f56f27..23b05309a3d 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -74,13 +74,6 @@ 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
{
return ValidateSpellInfo({ SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK });
@@ -112,8 +105,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
@@ -132,14 +124,7 @@ 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
{
@@ -234,13 +219,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
@@ -318,7 +296,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
@@ -765,16 +743,13 @@ 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
{
- return ValidateSpellInfo({ SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC });
+ return ValidateSpellInfo(
+ {
+ SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST,
+ SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC
+ });
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -806,8 +781,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
@@ -890,10 +864,7 @@ public:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE
- });
+ return ValidateSpellInfo({ SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 54f2123b64b..5a3f44d8688 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -691,7 +691,11 @@ class spell_sha_item_t6_trinket : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SHAMAN_ENERGY_SURGE, SPELL_SHAMAN_POWER_SURGE });
+ return ValidateSpellInfo(
+ {
+ SPELL_SHAMAN_ENERGY_SURGE,
+ SPELL_SHAMAN_POWER_SURGE
+ });
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 3f59c6d2d7f..5f30a1399c0 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -1095,13 +1095,6 @@ 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
{
return ValidateSpellInfo({ SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 });
@@ -1138,8 +1131,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
@@ -1337,13 +1329,6 @@ class spell_warr_vigilance : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_vigilance_AuraScript);
- public:
- spell_warr_vigilance_AuraScript()
- {
- _procTarget = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_VENGEANCE });
@@ -1388,8 +1373,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