diff options
35 files changed, 547 insertions, 165 deletions
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 24f7d90817d..69c188a61dc 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -162,6 +162,13 @@ class spell_shadow_portal : public SpellScriptLoader { PrepareSpellScript(spell_shadow_portal_SpellScript); + public: + spell_shadow_portal_SpellScript() + { + _instance = nullptr; + } + + private: bool Load() override { _instance = GetCaster()->GetInstanceScript(); @@ -222,7 +229,6 @@ class spell_shadow_portal : public SpellScriptLoader OnEffectHitTarget += SpellEffectFn(spell_shadow_portal_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY); } - private: InstanceScript* _instance; }; @@ -285,6 +291,13 @@ class spell_shadow_portal_rooms : public SpellScriptLoader { PrepareSpellScript(spell_shadow_portal_rooms_SpellScript); + public: + spell_shadow_portal_rooms_SpellScript() + { + _instance = nullptr; + } + + private: bool Load() override { _instance = GetCaster()->GetInstanceScript(); @@ -358,7 +371,6 @@ class spell_shadow_portal_rooms : public SpellScriptLoader OnEffectHit += SpellEffectFn(spell_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } - private: InstanceScript* _instance; }; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 79449723a16..fdb5a3a5fe7 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -238,16 +238,17 @@ class spell_ahn_kahet_swarm : public SpellScriptLoader { PrepareSpellScript(spell_ahn_kahet_swarm_SpellScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + public: + spell_ahn_kahet_swarm_SpellScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_SWARM_BUFF)) - return false; - return true; + _targetCount = 0; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spellInfo*/) override { - _targetCount = 0; + if (!sSpellMgr->GetSpellInfo(SPELL_SWARM_BUFF)) + return false; return true; } @@ -278,7 +279,6 @@ class spell_ahn_kahet_swarm : public SpellScriptLoader OnEffectHit += SpellEffectFn(spell_ahn_kahet_swarm_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - private: uint32 _targetCount; }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index a645f3ca666..63b47da0807 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -703,6 +703,14 @@ class spell_powering_up : public SpellScriptLoader { PrepareSpellScript(spell_powering_up_SpellScript); + public: + spell_powering_up_SpellScript() + { + spellId = 0; + poweringUp = 0; + } + + private: uint32 spellId; uint32 poweringUp; @@ -760,6 +768,13 @@ class spell_valkyr_essences : public SpellScriptLoader { PrepareAuraScript(spell_valkyr_essences_AuraScript); + public: + spell_valkyr_essences_AuraScript() + { + spellId = 0; + } + + private: uint32 spellId; bool Load() override diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 3ac5ec3070a..3ee7c9ce650 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -256,12 +256,13 @@ class spell_garfrost_permafrost : public SpellScriptLoader { PrepareSpellScript(spell_garfrost_permafrost_SpellScript); - bool Load() override + public: + spell_garfrost_permafrost_SpellScript() { prevented = false; - return true; } + private: void PreventHitByLoS() { if (Unit* target = GetHitUnit()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index c2b1b91a200..c8894179ca3 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -421,6 +421,14 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader { PrepareAuraScript(spell_tyrannus_overlord_brand_AuraScript); + public: + spell_tyrannus_overlord_brand_AuraScript() + { + oldAI = nullptr; + oldAIState = false; + } + + private: bool Load() override { return GetCaster() && GetCaster()->GetEntry() == NPC_TYRANNUS; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index e1b39e24b47..f3fae3b14a0 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1219,13 +1219,13 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader { PrepareSpellScript(spell_deathbringer_blood_nova_targeting_SpellScript); - bool Load() override + public: + spell_deathbringer_blood_nova_targeting_SpellScript() { - // initialize variable - target = NULL; - return true; + target = nullptr; } + private: void FilterTargetsInitial(std::list<WorldObject*>& targets) { if (targets.empty()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 74a09887dd2..43490de493c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -1922,6 +1922,13 @@ class spell_igb_on_gunship_deck : public SpellScriptLoader { PrepareAuraScript(spell_igb_on_gunship_deck_AuraScript); + public: + spell_igb_on_gunship_deck_AuraScript() + { + _teamInInstance = 0; + } + + private: bool Load() override { if (InstanceScript* instance = GetOwner()->GetInstanceScript()) @@ -2031,6 +2038,13 @@ class spell_igb_incinerating_blast : public SpellScriptLoader { PrepareSpellScript(spell_igb_incinerating_blast_SpellScript); + public: + spell_igb_incinerating_blast_SpellScript() + { + _energyLeft = 0; + } + + private: void StoreEnergy() { _energyLeft = GetCaster()->GetPower(POWER_ENERGY) - 10; @@ -2370,9 +2384,15 @@ class spell_igb_check_for_players : public SpellScriptLoader { PrepareSpellScript(spell_igb_check_for_players_SpellScript); - bool Load() override + public: + spell_igb_check_for_players_SpellScript() { _playerCount = 0; + } + + private: + bool Load() override + { return GetCaster()->GetTypeId() == TYPEID_UNIT; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 7ab8c956757..2e360e19b75 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -698,12 +698,13 @@ class spell_marrowgar_bone_slice : public SpellScriptLoader { PrepareSpellScript(spell_marrowgar_bone_slice_SpellScript); - bool Load() override + public: + spell_marrowgar_bone_slice_SpellScript() { _targetCount = 0; - return true; } + private: void ClearSpikeImmunities() { GetCaster()->GetAI()->DoAction(ACTION_CLEAR_SPIKE_IMMUNITIES); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 2e353e5f9dc..8f5ca0b4322 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -858,6 +858,13 @@ class spell_putricide_ooze_channel : public SpellScriptLoader { PrepareSpellScript(spell_putricide_ooze_channel_SpellScript); + public: + spell_putricide_ooze_channel_SpellScript() + { + _target = nullptr; + } + + private: bool Validate(SpellInfo const* spell) override { if (!spell->ExcludeTargetAuraSpell) @@ -871,7 +878,6 @@ class spell_putricide_ooze_channel : public SpellScriptLoader // this will let use safely use ToCreature() casts in entire script bool Load() override { - _target = NULL; return GetCaster()->GetTypeId() == TYPEID_UNIT; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 205b90fa159..5e55256ae59 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -507,12 +507,13 @@ class spell_rotface_mutated_infection : public SpellScriptLoader { PrepareSpellScript(spell_rotface_mutated_infection_SpellScript); - bool Load() override + public: + spell_rotface_mutated_infection_SpellScript() { - _target = NULL; - return true; + _target = nullptr; } + private: void FilterTargets(std::list<WorldObject*>& targets) { // remove targets with this aura already diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 551ec9ad0a2..9324379e9d6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1044,10 +1044,15 @@ class spell_sindragosa_s_fury : public SpellScriptLoader { PrepareSpellScript(spell_sindragosa_s_fury_SpellScript); - bool Load() override + public: + spell_sindragosa_s_fury_SpellScript() { _targetCount = 0; + } + private: + bool Load() override + { // This script should execute only in Icecrown Citadel if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap()) if (instance->GetInstanceScript()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 5addfd672b4..a5978d8f8fa 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2101,12 +2101,13 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_necrotic_plague_SpellScript); - bool Load() override + public: + spell_the_lich_king_necrotic_plague_SpellScript() { _hadAura = false; - return true; } + private: void SelectTarget(std::list<Unit*>& targets) { targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); @@ -2141,12 +2142,13 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader { PrepareAuraScript(spell_the_lich_king_necrotic_plague_AuraScript); - bool Load() override + public: + spell_the_lich_king_necrotic_plague_AuraScript() { _lastAmount = 0; - return true; } + private: void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) @@ -2518,16 +2520,17 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_valkyr_target_search_SpellScript); - bool Validate(SpellInfo const* /*spell*/) override + public: + spell_the_lich_king_valkyr_target_search_SpellScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_ICE_BURST)) - return false; - return true; + _target = nullptr; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spell*/) override { - _target = NULL; + if (!sSpellMgr->GetSpellInfo(SPELL_ICE_BURST)) + return false; return true; } @@ -2643,6 +2646,13 @@ class spell_the_lich_king_vile_spirits : public SpellScriptLoader { PrepareAuraScript(spell_the_lich_king_vile_spirits_AuraScript); + public: + spell_the_lich_king_vile_spirits_AuraScript() + { + _is25Man = false; + } + + private: bool Load() override { _is25Man = GetUnitOwner()->GetMap()->Is25ManRaid(); @@ -2705,9 +2715,15 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa { PrepareSpellScript(spell_the_lich_king_vile_spirit_move_target_search_SpellScript); + public: + spell_the_lich_king_vile_spirit_move_target_search_SpellScript() + { + _target = nullptr; + } + + private: bool Load() override { - _target = NULL; return GetCaster()->GetTypeId() == TYPEID_UNIT; } @@ -2894,6 +2910,13 @@ class spell_the_lich_king_restore_soul : public SpellScriptLoader { PrepareSpellScript(spell_the_lich_king_restore_soul_SpellScript); + public: + spell_the_lich_king_restore_soul_SpellScript() + { + _instance = nullptr; + } + + private: bool Load() override { _instance = GetCaster()->GetInstanceScript(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 5b3dd67072a..1caed4ed788 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1158,6 +1158,13 @@ class spell_dreamwalker_decay_periodic_timer : public SpellScriptLoader { PrepareAuraScript(spell_dreamwalker_decay_periodic_timer_AuraScript); + public: + spell_dreamwalker_decay_periodic_timer_AuraScript() + { + _decayRate = 0; + } + + private: bool Load() override { _decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000; @@ -1385,6 +1392,13 @@ class spell_dreamwalker_nightmare_cloud : public SpellScriptLoader { PrepareAuraScript(spell_dreamwalker_nightmare_cloud_AuraScript); + public: + spell_dreamwalker_nightmare_cloud_AuraScript() + { + _instance = nullptr; + } + + private: bool Load() override { _instance = GetOwner()->GetInstanceScript(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index c2007730cdc..22fa44541a1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1880,12 +1880,13 @@ class spell_frost_giant_death_plague : public SpellScriptLoader { PrepareSpellScript(spell_frost_giant_death_plague_SpellScript); - bool Load() override + public: + spell_frost_giant_death_plague_SpellScript() { _failed = false; - return true; } + private: // First effect void CountTargets(std::list<WorldObject*>& targets) { diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index eb01dfab141..3127bbe359f 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -2459,6 +2459,13 @@ class spell_alexstrasza_gift_beam_visual : public SpellScriptLoader { PrepareAuraScript(spell_alexstrasza_gift_beam_visual_AuraScript); + public: + spell_alexstrasza_gift_beam_visual_AuraScript() + { + _alexstraszaGift = nullptr; + } + + private: bool Load() override { return GetCaster()->GetTypeId() == TYPEID_UNIT; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index bd5b61e227f..261a6c96f77 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -1206,9 +1206,15 @@ class spell_algalon_big_bang : public SpellScriptLoader { PrepareSpellScript(spell_algalon_big_bang_SpellScript); - bool Load() override + public: + spell_algalon_big_bang_SpellScript() { _targetCount = 0; + } + + private: + bool Load() override + { return GetCaster()->GetTypeId() == TYPEID_UNIT && GetCaster()->IsAIEnabled; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 959cb73a996..a240bc89a5e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1688,12 +1688,13 @@ class spell_pursue : public SpellScriptLoader { PrepareSpellScript(spell_pursue_SpellScript); - bool Load() override + public: + spell_pursue_SpellScript() { - _target = NULL; - return true; + _target = nullptr; } + private: void FilterTargets(std::list<WorldObject*>& targets) { targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster())); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 880eeba206b..6156d423b89 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -1748,16 +1748,17 @@ class spell_mimiron_fire_search : public SpellScriptLoader { PrepareSpellScript(spell_mimiron_fire_search_SpellScript); - bool Validate(SpellInfo const* /*spell*/) override + public: + spell_mimiron_fire_search_SpellScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_WATER_SPRAY)) - return false; - return true; + _noTarget = false; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spell*/) override { - _noTarget = false; + if (!sSpellMgr->GetSpellInfo(SPELL_WATER_SPRAY)) + return false; return true; } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index b6c836eb0cd..151e199b749 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -225,12 +225,13 @@ class spell_koralon_meteor_fists_damage : public SpellScriptLoader { PrepareSpellScript(spell_koralon_meteor_fists_damage_SpellScript); - bool Load() override + public: + spell_koralon_meteor_fists_damage_SpellScript() { _chainTargets = 0; - return true; } + private: void FilterTargets(std::list<WorldObject*>& targets) { _chainTargets = targets.size(); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index e4cff7323b1..ec65aa26f17 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -812,12 +812,13 @@ class spell_close_rift : public SpellScriptLoader { PrepareAuraScript(spell_close_rift_AuraScript); - bool Load() override + public: + spell_close_rift_AuraScript() { _counter = 0; - return true; } + private: bool Validate(SpellInfo const* /*spell*/) override { return sSpellMgr->GetSpellInfo(SPELL_DESPAWN_RIFT) != nullptr; diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index a96cf3ac254..dc0d9bcb28a 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -218,7 +218,21 @@ public: struct npc_mature_netherwing_drakeAI : public ScriptedAI { - npc_mature_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) { } + npc_mature_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + uiPlayerGUID.Clear(); + + bCanEat = false; + bIsEating = false; + + EatTimer = 5000; + CastTimer = 5000; + } ObjectGuid uiPlayerGUID; @@ -230,13 +244,7 @@ public: void Reset() override { - uiPlayerGUID.Clear(); - - bCanEat = false; - bIsEating = false; - - EatTimer = 5000; - CastTimer = 5000; + Initialize(); } void SpellHit(Unit* pCaster, SpellInfo const* spell) override @@ -486,7 +494,17 @@ public: struct npc_dragonmaw_peonAI : public ScriptedAI { - npc_dragonmaw_peonAI(Creature* creature) : ScriptedAI(creature) { } + npc_dragonmaw_peonAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + PlayerGUID.Clear(); + Tapped = false; + PoisonTimer = 0; + } ObjectGuid PlayerGUID; bool Tapped; @@ -494,9 +512,7 @@ public: void Reset() override { - PlayerGUID.Clear(); - Tapped = false; - PoisonTimer = 0; + Initialize(); } void SpellHit(Unit* caster, const SpellInfo* spell) override @@ -720,7 +736,21 @@ public: struct npc_overlord_morghorAI : public ScriptedAI { - npc_overlord_morghorAI(Creature* creature) : ScriptedAI(creature) { } + npc_overlord_morghorAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + PlayerGUID.Clear(); + IllidanGUID.Clear(); + + ConversationTimer = 0; + Step = 0; + + Event = false; + } ObjectGuid PlayerGUID; ObjectGuid IllidanGUID; @@ -732,13 +762,7 @@ public: void Reset() override { - PlayerGUID.Clear(); - IllidanGUID.Clear(); - - ConversationTimer = 0; - Step = 0; - - Event = false; + Initialize(); me->SetUInt32Value(UNIT_NPC_FLAGS, 2); } @@ -1264,7 +1288,22 @@ public: struct npc_torloth_the_magnificentAI : public ScriptedAI { - npc_torloth_the_magnificentAI(Creature* creature) : ScriptedAI(creature) { } + npc_torloth_the_magnificentAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + SpellTimer1 = 0; + SpellTimer2 = 0; + SpellTimer3 = 0; + } + + void Initialize() + { + AnimationTimer = 4000; + AnimationCount = 0; + LordIllidanGUID.Clear(); + AggroTargetGUID.Clear(); + Timers = false; + } uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3; @@ -1277,11 +1316,7 @@ public: void Reset() override { - AnimationTimer = 4000; - AnimationCount = 0; - LordIllidanGUID.Clear(); - AggroTargetGUID.Clear(); - Timers = false; + Initialize(); me->AddUnitState(UNIT_STATE_ROOT); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -1569,7 +1604,19 @@ public: struct npc_illidari_spawnAI : public ScriptedAI { - npc_illidari_spawnAI(Creature* creature) : ScriptedAI(creature) { } + npc_illidari_spawnAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + SpellTimer1 = 0; + SpellTimer2 = 0; + SpellTimer3 = 0; + } + + void Initialize() + { + LordIllidanGUID.Clear(); + Timers = false; + } ObjectGuid LordIllidanGUID; uint32 SpellTimer1, SpellTimer2, SpellTimer3; @@ -1577,8 +1624,7 @@ public: void Reset() override { - LordIllidanGUID.Clear(); - Timers = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index c2e7df19ca1..a1ae917cbba 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -87,15 +87,19 @@ public: { npc_raliq_the_drunkAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = creature->getFaction(); + Initialize(); + } + + void Initialize() + { + Uppercut_Timer = 5000; } - uint32 m_uiNormFaction; uint32 Uppercut_Timer; void Reset() override { - Uppercut_Timer = 5000; + Initialize(); me->RestoreFaction(); } @@ -161,13 +165,21 @@ public: struct npc_salsalabimAI : public ScriptedAI { - npc_salsalabimAI(Creature* creature) : ScriptedAI(creature) { } + npc_salsalabimAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + MagneticPull_Timer = 15000; + } uint32 MagneticPull_Timer; void Reset() override { - MagneticPull_Timer = 15000; + Initialize(); me->RestoreFaction(); } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 223a144e33b..a019555d3c9 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -68,7 +68,17 @@ public: struct npc_unkor_the_ruthlessAI : public ScriptedAI { - npc_unkor_the_ruthlessAI(Creature* creature) : ScriptedAI(creature) { } + npc_unkor_the_ruthlessAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + CanDoQuest = false; + UnkorUnfriendly_Timer = 0; + Pulverize_Timer = 3000; + } bool CanDoQuest; uint32 UnkorUnfriendly_Timer; @@ -76,9 +86,7 @@ public: void Reset() override { - CanDoQuest = false; - UnkorUnfriendly_Timer = 0; - Pulverize_Timer = 3000; + Initialize(); me->SetStandState(UNIT_STAND_STATE_STAND); me->setFaction(FACTION_HOSTILE); } @@ -397,9 +405,17 @@ public: { npc_floonAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); m_uiNormFaction = creature->getFaction(); } + void Initialize() + { + Silence_Timer = 2000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 9000; + } + uint32 m_uiNormFaction; uint32 Silence_Timer; uint32 Frostbolt_Timer; @@ -407,9 +423,7 @@ public: void Reset() override { - Silence_Timer = 2000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 9000; + Initialize(); if (me->getFaction() != m_uiNormFaction) me->setFaction(m_uiNormFaction); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 36bf8389cc2..929ffe60364 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -85,6 +85,13 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader { PrepareAuraScript(spell_dk_anti_magic_shell_raid_AuraScript); + public: + spell_dk_anti_magic_shell_raid_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override @@ -127,6 +134,14 @@ 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; + } + + private: uint32 absorbPct, hpPct; bool Load() override { @@ -184,6 +199,13 @@ 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; bool Load() override @@ -235,6 +257,13 @@ class spell_dk_blood_boil : public SpellScriptLoader { PrepareSpellScript(spell_dk_blood_boil_SpellScript); + public: + spell_dk_blood_boil_SpellScript() + { + _executed = false; + } + + private: bool Validate(SpellInfo const* /*spellInfo*/) override { if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_BOIL_TRIGGERED)) @@ -244,7 +273,6 @@ class spell_dk_blood_boil : public SpellScriptLoader bool Load() override { - _executed = false; return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT; } @@ -281,16 +309,17 @@ class spell_dk_blood_gorged : public SpellScriptLoader { PrepareAuraScript(spell_dk_blood_gorged_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + public: + spell_dk_blood_gorged_AuraScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL)) - return false; - return true; + _procTarget = nullptr; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spellInfo*/) override { - _procTarget = NULL; + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL)) + return false; return true; } @@ -384,6 +413,13 @@ class spell_dk_corpse_explosion : public SpellScriptLoader { PrepareSpellScript(spell_dk_corpse_explosion_SpellScript); + public: + spell_dk_corpse_explosion_SpellScript() + { + _target = nullptr; + } + + private: bool Validate(SpellInfo const* spellInfo) override { if (!sSpellMgr->GetSpellInfo(SPELL_DK_CORPSE_EXPLOSION_TRIGGERED) @@ -394,12 +430,6 @@ class spell_dk_corpse_explosion : public SpellScriptLoader return true; } - bool Load() override - { - _target = NULL; - return true; - } - void CheckTarget(WorldObject*& target) { if (CorpseExplosionCheck(GetCaster()->GetGUID(), true)(target)) @@ -1204,6 +1234,14 @@ class spell_dk_raise_dead : public SpellScriptLoader { PrepareSpellScript(spell_dk_raise_dead_SpellScript); + public: + spell_dk_raise_dead_SpellScript() + { + _result = SPELL_CAST_OK; + _corpse = false; + } + + private: bool Validate(SpellInfo const* spellInfo) override { if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].CalcValue()) @@ -1216,8 +1254,6 @@ class spell_dk_raise_dead : public SpellScriptLoader bool Load() override { - _result = SPELL_CAST_OK; - _corpse = false; return GetCaster()->GetTypeId() == TYPEID_PLAYER; } @@ -1399,14 +1435,16 @@ class spell_dk_scourge_strike : public SpellScriptLoader class spell_dk_scourge_strike_SpellScript : public SpellScript { PrepareSpellScript(spell_dk_scourge_strike_SpellScript); - float multiplier; - bool Load() override + public: + spell_dk_scourge_strike_SpellScript() { multiplier = 1.0f; - return true; } + private: + float multiplier; + bool Validate(SpellInfo const* /*spellInfo*/) override { if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCOURGE_STRIKE_TRIGGERED)) @@ -1463,6 +1501,13 @@ class spell_dk_spell_deflection : public SpellScriptLoader { PrepareAuraScript(spell_dk_spell_deflection_AuraScript); + public: + spell_dk_spell_deflection_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override @@ -1534,6 +1579,13 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader { PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript); + public: + spell_dk_will_of_the_necropolis_AuraScript() + { + absorbPct = 0; + } + + private: bool Validate(SpellInfo const* spellInfo) override { SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index dbcc7716f32..7a49e156971 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -421,6 +421,13 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader { PrepareAuraScript(spell_dru_moonkin_form_passive_AuraScript); + public: + spell_dru_moonkin_form_passive_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override @@ -521,6 +528,13 @@ class spell_dru_primal_tenacity : public SpellScriptLoader { PrepareAuraScript(spell_dru_primal_tenacity_AuraScript); + public: + spell_dru_primal_tenacity_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override @@ -613,6 +627,13 @@ class spell_dru_savage_defense : public SpellScriptLoader { PrepareAuraScript(spell_dru_savage_defense_AuraScript); + public: + spell_dru_savage_defense_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index e5ef3d5b7b7..b2efa1052e8 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -47,6 +47,13 @@ class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader { PrepareAuraScript(spell_gen_absorb0_hitlimit1_AuraScript); + public: + spell_gen_absorb0_hitlimit1_AuraScript() + { + limit = 0; + } + + private: uint32 limit; bool Load() override @@ -775,6 +782,13 @@ 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) || @@ -787,12 +801,6 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader return true; } - bool Load() override - { - prevItem = 0; - return true; - } - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* caster = GetCaster(); @@ -1392,9 +1400,15 @@ class spell_gen_dungeon_credit : public SpellScriptLoader { PrepareSpellScript(spell_gen_dungeon_credit_SpellScript); - bool Load() override + public: + spell_gen_dungeon_credit_SpellScript() { _handled = false; + } + + private: + bool Load() override + { return GetCaster()->GetTypeId() == TYPEID_UNIT; } @@ -2406,11 +2420,17 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader { PrepareAuraScript(spell_gen_on_tournament_mount_AuraScript); + public: + spell_gen_on_tournament_mount_AuraScript() + { + _pennantSpellId = 0; + } + + private: uint32 _pennantSpellId; bool Load() override { - _pennantSpellId = 0; return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; } diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 41ffbaf9cf8..4e8d47381e7 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -301,12 +301,9 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader uint32 const _triggeredSpellId; public: - spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { } - - bool Load() override + spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { _handled = false; - return true; } void HandleTriggerSpell(AuraEffect const* /*aurEff*/) diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index a19a24d47e9..24e893ed445 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -278,16 +278,17 @@ class spell_mage_focus_magic : public SpellScriptLoader { PrepareAuraScript(spell_mage_focus_magic_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + public: + spell_mage_focus_magic_AuraScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FOCUS_MAGIC_PROC)) - return false; - return true; + _procTarget = nullptr; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spellInfo*/) override { - _procTarget = NULL; + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FOCUS_MAGIC_PROC)) + return false; return true; } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 2d32341757f..fae6e9a86bf 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -99,6 +99,14 @@ 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; enum Spell @@ -465,6 +473,13 @@ class spell_pal_divine_storm : public SpellScriptLoader { PrepareSpellScript(spell_pal_divine_storm_SpellScript); + public: + spell_pal_divine_storm_SpellScript() + { + healPct = 0; + } + + private: uint32 healPct; bool Validate(SpellInfo const* /*spellInfo*/) override @@ -508,6 +523,13 @@ 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)) @@ -696,6 +718,13 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader { PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); + public: + spell_pal_hand_of_sacrifice_AuraScript() + { + remainingAmount = 0; + } + + private: int32 remainingAmount; bool Load() override diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 775f9f505f9..9f2a73174bb 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -229,11 +229,17 @@ public: { PrepareAuraScript(spell_warl_pet_scaling_01_AuraScript); + public: + spell_warl_pet_scaling_01_AuraScript() + { + _tempBonus = 0; + } + + private: bool Load() override { if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) return false; - _tempBonus = 0; return true; } @@ -366,11 +372,17 @@ public: { PrepareAuraScript(spell_warl_pet_scaling_02_AuraScript); + public: + spell_warl_pet_scaling_02_AuraScript() + { + _tempBonus = 0; + } + + private: bool Load() override { if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) return false; - _tempBonus = 0; return true; } @@ -882,6 +894,13 @@ 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()) @@ -1478,11 +1497,17 @@ 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) return false; - _tempHealth = 0; return true; } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index ba3d6ce490a..d70d7b09b8b 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -263,6 +263,13 @@ class spell_pri_guardian_spirit : public SpellScriptLoader { PrepareAuraScript(spell_pri_guardian_spirit_AuraScript); + public: + spell_pri_guardian_spirit_AuraScript() + { + healPct = 0; + } + + private: uint32 healPct; bool Validate(SpellInfo const* /*spellInfo*/) override @@ -451,16 +458,17 @@ class spell_pri_mana_leech : public SpellScriptLoader { PrepareAuraScript(spell_pri_mana_leech_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + public: + spell_pri_mana_leech_AuraScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MANA_LEECH_PROC)) - return false; - return true; + _procTarget = nullptr; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spellInfo*/) override { - _procTarget = NULL; + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MANA_LEECH_PROC)) + return false; return true; } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 9c9a75d853b..7b0a02b4c96 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -52,16 +52,17 @@ class spell_rog_blade_flurry : public SpellScriptLoader { PrepareAuraScript(spell_rog_blade_flurry_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + public: + spell_rog_blade_flurry_AuraScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK)) - return false; - return true; + _procTarget = nullptr; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spellInfo*/) override { - _procTarget = NULL; + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK)) + return false; return true; } @@ -107,6 +108,13 @@ class spell_rog_cheat_death : public SpellScriptLoader { PrepareAuraScript(spell_rog_cheat_death_AuraScript); + public: + spell_rog_cheat_death_AuraScript() + { + absorbChance = 0; + } + + private: uint32 absorbChance; bool Validate(SpellInfo const* /*spellInfo*/) override @@ -170,9 +178,15 @@ class spell_rog_deadly_poison : public SpellScriptLoader { PrepareSpellScript(spell_rog_deadly_poison_SpellScript); - bool Load() override + public: + spell_rog_deadly_poison_SpellScript() { _stackAmount = 0; + } + + private: + bool Load() override + { // at this point CastItem must already be initialized return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); } @@ -364,6 +378,13 @@ class spell_rog_nerves_of_steel : public SpellScriptLoader { PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript); + public: + spell_rog_nerves_of_steel_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override @@ -613,6 +634,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 { if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST)) @@ -622,12 +650,6 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader return true; } - bool Load() override - { - _redirectTarget = NULL; - return true; - } - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index bba1f4e298b..99570ad1b75 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -122,6 +122,13 @@ class spell_sha_astral_shift : public SpellScriptLoader { PrepareAuraScript(spell_sha_astral_shift_AuraScript); + public: + spell_sha_astral_shift_AuraScript() + { + absorbPct = 0; + } + + private: uint32 absorbPct; bool Load() override @@ -209,13 +216,14 @@ class spell_sha_chain_heal : public SpellScriptLoader { PrepareSpellScript(spell_sha_chain_heal_SpellScript); - bool Load() override + public: + spell_sha_chain_heal_SpellScript() { firstHeal = true; riptide = false; - return true; } + private: void HandleHeal(SpellEffIndex /*effIndex*/) { if (firstHeal) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 4571798506e..de72ec8c643 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -71,12 +71,13 @@ class spell_warl_banish : public SpellScriptLoader { PrepareSpellScript(spell_warl_banish_SpellScript); - bool Load() override + public: + spell_warl_banish_SpellScript() { _removed = false; - return true; } + private: void HandleBanish() { if (Unit* target = GetHitUnit()) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 9709532f56f..dba4da8bde5 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -681,16 +681,17 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader { PrepareAuraScript(spell_warr_sweeping_strikes_AuraScript); - bool Validate(SpellInfo const* /*spellInfo*/) override + public: + spell_warr_sweeping_strikes_AuraScript() { - if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2)) - return false; - return true; + _procTarget = nullptr; } - bool Load() override + private: + bool Validate(SpellInfo const* /*spellInfo*/) override { - _procTarget = NULL; + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2)) + return false; return true; } @@ -745,6 +746,13 @@ 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 { if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_VIGILANCE)) @@ -758,12 +766,6 @@ class spell_warr_vigilance : public SpellScriptLoader return true; } - bool Load() override - { - _procTarget = NULL; - return true; - } - void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); |