From 9c9556d75c9856c42e1340f1f5ef77e6180076ad Mon Sep 17 00:00:00 2001 From: iDenyDeX Date: Mon, 22 Sep 2014 20:52:22 +0200 Subject: Core/Spell - Fix Remove Aura "The Eye of Acherus" Fixed remove aura "The Eye of Acherus" http://www.wowhead.com/spell=51852 after use "Recall Eye of Acherus" http://www.wowhead.com/spell=52694 . Earlier, after using the player remained under the aura. --- src/server/scripts/Spells/spell_quest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 9c65567fe7f..a59594935b5 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2101,6 +2101,11 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader }; // 52694 - Recall Eye of Acherus +enum Recall_Eye_of_Acherus +{ + THE_EYE_OF_ACHERUS = 51852 +}; + class spell_q12641_recall_eye_of_acherus : public SpellScriptLoader { public: @@ -2116,6 +2121,7 @@ class spell_q12641_recall_eye_of_acherus : public SpellScriptLoader { player->StopCastingCharm(); player->StopCastingBindSight(); + player->RemoveAura(THE_EYE_OF_ACHERUS); } } -- cgit v1.2.3 From 44bcfb86f5da0a5a374fc5b07431836b3c0f51c7 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 23 Sep 2014 21:30:47 +0200 Subject: Core/Spells: Fix Ram Racing mechanic To/Do: Fix Quests and your lazy ass :/ --- sql/updates/world/2014_09_23_03_world.sql | 28 ++++ src/server/scripts/Spells/spell_holiday.cpp | 213 ++++++++++++++++++++++++++++ 2 files changed, 241 insertions(+) create mode 100644 sql/updates/world/2014_09_23_03_world.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2014_09_23_03_world.sql b/sql/updates/world/2014_09_23_03_world.sql new file mode 100644 index 00000000000..366b9cd1197 --- /dev/null +++ b/sql/updates/world/2014_09_23_03_world.sql @@ -0,0 +1,28 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +42924, +43310, +42992, +42993, +42994, +43052, +43450 +); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(42924, 'spell_brewfest_giddyup'), +(43310, 'spell_brewfest_ram'), +(42992, 'spell_brewfest_ram'), +(42993, 'spell_brewfest_ram'), +(42994, 'spell_brewfest_ram'), +(43052, 'spell_brewfest_ram_fatigue'), +(43450, 'spell_brewfest_apple_trap'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=42924; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=43450; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 42924, 0, 0, 1, 0, 43332, 0, 0, 1, 172, 0, '', 'Cast Gore Bladder only if Cosmetic - Underwater Blood (no sound) aura is active'), +(13, 1, 43450, 0, 0, 1, 0, 43052, 0, 0, 0, 0, 0, '', 'Brewfest - apple trap - friendly DND targets only if does have aura Ram Fatigue'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-43883 AND `spell_effect`=-43052; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=43450 AND `spell_effect`=-43052; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(-43883, -43052, 0, 'Rental racing ram removed removes Ram Fatigue'); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 85bf85fa2d2..a001360fed9 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -444,6 +444,214 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader } }; +enum RamBlaBla +{ + SPELL_RENTAL_RACING_RAM = 43883, + SPELL_RENTAL_RACING_RAM_AURA = 42146, + SPELL_RAM_LEVEL_NEUTRAL = 43310, + SPELL_RAM_TROT = 42992, + SPELL_RAM_CANTER = 42993, + SPELL_RAM_GALLOP = 42994, + SPELL_RAM_FATIGUE = 43052, + SPELL_EXHAUSTED_RAM = 43332, + + // Quest + SPELL_BREWFEST_QUEST_SPEED_BUNNY_GREEN = 43345, + SPELL_BREWFEST_QUEST_SPEED_BUNNY_YELLOW = 43346, + SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED = 43347 +}; + +// 42924 - Giddyup! +class spell_brewfest_giddyup : public SpellScriptLoader +{ + public: + spell_brewfest_giddyup() : SpellScriptLoader("spell_brewfest_giddyup") { } + + class spell_brewfest_giddyup_AuraScript : public AuraScript + { + PrepareAuraScript(spell_brewfest_giddyup_AuraScript); + + void OnChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target->HasAura(SPELL_RENTAL_RACING_RAM)) + { + target->RemoveAura(GetId()); + return; + } + + if (target->HasAura(SPELL_EXHAUSTED_RAM)) + return; + + switch (GetStackAmount()) + { + case 1: // green + target->RemoveAura(SPELL_RAM_LEVEL_NEUTRAL); + target->RemoveAura(SPELL_RAM_CANTER); + target->CastSpell(target, SPELL_RAM_TROT, true); + break; + case 6: // yellow + target->RemoveAura(SPELL_RAM_TROT); + target->RemoveAura(SPELL_RAM_GALLOP); + target->CastSpell(target, SPELL_RAM_CANTER, true); + break; + case 11: // red + target->RemoveAura(SPELL_RAM_CANTER); + target->CastSpell(target, SPELL_RAM_GALLOP, true); + break; + default: + break; + } + + if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT) + { + target->RemoveAura(SPELL_RAM_TROT); + target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true); + } + } + + void OnPeriodic(AuraEffect const* /*aurEff*/) + { + GetTarget()->RemoveAuraFromStack(GetId()); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_brewfest_giddyup_AuraScript::OnChange, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_giddyup_AuraScript::OnChange, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_giddyup_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_brewfest_giddyup_AuraScript(); + } +}; + +// 43310 - Ram Level - Neutral +// 42992 - Ram - Trot +// 42993 - Ram - Canter +// 42994 - Ram - Gallop +class spell_brewfest_ram : public SpellScriptLoader +{ + public: + spell_brewfest_ram() : SpellScriptLoader("spell_brewfest_ram") { } + + class spell_brewfest_ram_AuraScript : public AuraScript + { + PrepareAuraScript(spell_brewfest_ram_AuraScript); + + void OnPeriodic(AuraEffect const* aurEff) + { + Unit* target = GetTarget(); + if (target->HasAura(SPELL_EXHAUSTED_RAM)) + return; + + switch (GetId()) + { + case SPELL_RAM_LEVEL_NEUTRAL: + if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE)) + aura->ModStackAmount(-4); + break; + case SPELL_RAM_TROT: // green + if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE)) + aura->ModStackAmount(-2); + if (aurEff->GetTickNumber() == 4) + target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_GREEN, true); + break; + case SPELL_RAM_CANTER: + target->CastCustomSpell(SPELL_RAM_FATIGUE, SPELLVALUE_AURA_STACK, 1, target, TRIGGERED_FULL_MASK); + if (aurEff->GetTickNumber() == 4) + target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_YELLOW, true); + break; + case SPELL_RAM_GALLOP: + target->CastCustomSpell(SPELL_RAM_FATIGUE, SPELLVALUE_AURA_STACK, target->HasAura(SPELL_RAM_FATIGUE) ? 4 : 5 /*Hack*/, target, TRIGGERED_FULL_MASK); + if (aurEff->GetTickNumber() == 4) + target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED, true); + break; + default: + break; + } + + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_ram_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_brewfest_ram_AuraScript(); + } +}; + +// 43052 - Ram Fatigue +class spell_brewfest_ram_fatigue : public SpellScriptLoader +{ + public: + spell_brewfest_ram_fatigue() : SpellScriptLoader("spell_brewfest_ram_fatigue") { } + + class spell_brewfest_ram_fatigue_AuraScript : public AuraScript + { + PrepareAuraScript(spell_brewfest_ram_fatigue_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + + if (GetStackAmount() == 101) + { + target->RemoveAura(SPELL_RAM_LEVEL_NEUTRAL); + target->RemoveAura(SPELL_RAM_TROT); + target->RemoveAura(SPELL_RAM_CANTER); + target->RemoveAura(SPELL_RAM_GALLOP); + + target->CastSpell(target, SPELL_EXHAUSTED_RAM, true); + } + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_brewfest_ram_fatigue_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_brewfest_ram_fatigue_AuraScript(); + } +}; + +// 43450 - Brewfest - apple trap - friendly DND +class spell_brewfest_apple_trap : public SpellScriptLoader +{ + public: + spell_brewfest_apple_trap() : SpellScriptLoader("spell_brewfest_apple_trap") { } + + class spell_brewfest_apple_trap_AuraScript : public AuraScript + { + PrepareAuraScript(spell_brewfest_apple_trap_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAura(SPELL_RAM_FATIGUE); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_brewfest_apple_trap_AuraScript::OnApply, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_brewfest_apple_trap_AuraScript(); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -461,4 +669,9 @@ void AddSC_holiday_spell_scripts() // Winter Veil new spell_winter_veil_mistletoe(); new spell_winter_veil_px_238_winter_wondervolt(); + // Brewfest + new spell_brewfest_giddyup(); + new spell_brewfest_ram(); + new spell_brewfest_ram_fatigue(); + new spell_brewfest_apple_trap(); } -- cgit v1.2.3 From 4c25454b77dcf86a890169232d2719792f817949 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 23 Sep 2014 21:50:45 +0200 Subject: Core/Spells: Added missing stuff in 44bcfb86f5da0a5a374fc5b07431836b3c0f51c7 --- sql/updates/world/2014_09_23_04_world.sql | 5 +++++ src/server/scripts/Spells/spell_holiday.cpp | 31 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 sql/updates/world/2014_09_23_04_world.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2014_09_23_04_world.sql b/sql/updates/world/2014_09_23_04_world.sql new file mode 100644 index 00000000000..26f1bfafdb6 --- /dev/null +++ b/sql/updates/world/2014_09_23_04_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +43332 +); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(43332, 'spell_brewfest_exhausted_ram'); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index a001360fed9..fdf069dd18d 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -446,6 +446,7 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader enum RamBlaBla { + SPELL_GIDDYUP = 42924, SPELL_RENTAL_RACING_RAM = 43883, SPELL_RENTAL_RACING_RAM_AURA = 42146, SPELL_RAM_LEVEL_NEUTRAL = 43310, @@ -608,6 +609,7 @@ class spell_brewfest_ram_fatigue : public SpellScriptLoader target->RemoveAura(SPELL_RAM_TROT); target->RemoveAura(SPELL_RAM_CANTER); target->RemoveAura(SPELL_RAM_GALLOP); + target->RemoveAura(SPELL_GIDDYUP); target->CastSpell(target, SPELL_EXHAUSTED_RAM, true); } @@ -652,6 +654,34 @@ class spell_brewfest_apple_trap : public SpellScriptLoader } }; +// 43332 - Exhausted Ram +class spell_brewfest_exhausted_ram : public SpellScriptLoader +{ + public: + spell_brewfest_exhausted_ram() : SpellScriptLoader("spell_brewfest_exhausted_ram") { } + + class spell_brewfest_exhausted_ram_AuraScript : public AuraScript + { + PrepareAuraScript(spell_brewfest_exhausted_ram_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true); + } + + void Register() override + { + OnEffectRemove += AuraEffectApplyFn(spell_brewfest_exhausted_ram_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_brewfest_exhausted_ram_AuraScript(); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -674,4 +704,5 @@ void AddSC_holiday_spell_scripts() new spell_brewfest_ram(); new spell_brewfest_ram_fatigue(); new spell_brewfest_apple_trap(); + new spell_brewfest_exhausted_ram(); } -- cgit v1.2.3 From c3805aa5123a58c5c5778652d80b119c2cbc630c Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Wed, 24 Sep 2014 22:21:44 +0200 Subject: Misc/Events: - Fix Quest "There and Back Again" (only Horde-side) - Fix Quest "Now This is Ram Racing... Almost." (only Horde-side) - Fix more spell mechanics for racing ram To/Do: Fix gossips and some optimize --- sql/updates/world/2014_09_24_01_world.sql | 43 +++++++++++++++++++++ src/server/scripts/Spells/spell_holiday.cpp | 59 +++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 sql/updates/world/2014_09_24_01_world.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2014_09_24_01_world.sql b/sql/updates/world/2014_09_24_01_world.sql new file mode 100644 index 00000000000..e94e17d08df --- /dev/null +++ b/sql/updates/world/2014_09_24_01_world.sql @@ -0,0 +1,43 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24497,24527,24510); +UPDATE `creature_template` SET `unit_flags`=512 WHERE `entry`=24527; +UPDATE `creature_template` SET `unit_flags`=768 WHERE `entry`=24510; + + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=24497; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(24497, 0, 0, 0, 19, 0, 100, 0, 11409, 0, 0, 0, 11, 42149, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ram Master Ray - On Quest ''Now This is Ram Racing... Almost.'' Taken - Cast ''Rental Racing Ram'''), +(24497, 0, 1, 0, 20, 0, 100, 0, 11409, 0, 0, 0, 11, 44358, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ram Master Ray - On Quest ''Now This is Ram Racing... Almost.'' Taken - Cast ''Rental Racing Ram'''), +(24497, 0, 2, 0, 19, 0, 100, 0, 11412, 0, 0, 0, 11, 42149, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ram Master Ray - On Quest ''There and Back Again'' Taken - Cast ''Rental Racing Ram'''), +(24497, 0, 3, 0, 20, 0, 100, 0, 11412, 0, 0, 0, 11, 44358, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ram Master Ray - On Quest ''There and Back Again'' Taken - Cast ''Rental Racing Ram'''); + + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=24527; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(24527, 0, 0, 0, 10, 0, 100, 0, 1, 25, 1000, 1000, 11, 43660, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Bok Dropcertain - Within 0-50 Range - Cast ''Brewfest - Throw Keg - DND'''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=24527; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 24527, 0, 0, 1, 0, 43883, 0, 0, 0, 0, 0, '', ''), +(22, 1, 24527, 0, 0, 2, 0, 33797, 1, 0, 1, 0, 0, '', ''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=43662; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 43662, 0, 0, 31, 0, 3, 24510, 0, 0, 0, 0, '', ''); + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=24510; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(24510, 0, 0, 0, 10, 0, 100, 0, 1, 25, 1000, 1000, 11, 43714, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Driz Tumblequick - Within 0-50 Range - Cast ''Brewfest - Throw Keg - DND'''), +(24510, 0, 1, 0, 8, 0, 100, 0, 43662, 0, 0, 0, 85, 44601, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Driz Tumblequick - On SpellHit - Cast ''Brewfest - Relay Race - Intro - Assign Kill Credit'''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=24510; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 24510, 0, 0, 1, 0, 43883, 0, 0, 0, 0, 0, '', ''), +(22, 1, 24510, 0, 0, 2, 0, 33797, 1, 0, 0, 0, 0, '', ''); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +43714, +43876 +); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(43714, 'spell_brewfest_relay_race_intro_force_player_to_throw'), +(43876, 'spell_brewfest_dismount_ram'); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index fdf069dd18d..41ffbaf9cf8 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -682,6 +682,63 @@ class spell_brewfest_exhausted_ram : public SpellScriptLoader } }; +// 43714 - Brewfest - Relay Race - Intro - Force - Player to throw- DND +class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScriptLoader +{ + public: + spell_brewfest_relay_race_intro_force_player_to_throw() : SpellScriptLoader("spell_brewfest_relay_race_intro_force_player_to_throw") { } + + class spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript : public SpellScript + { + PrepareSpellScript(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript); + + void HandleForceCast(SpellEffIndex effIndex) + { + 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)); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript(); + } +}; + +// 43876 - Dismount Ram +class spell_brewfest_dismount_ram : public SpellScriptLoader +{ + public: + spell_brewfest_dismount_ram() : SpellScriptLoader("spell_brewfest_dismount_ram") { } + + class spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript : public SpellScript + { + PrepareSpellScript(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->RemoveAura(SPELL_RENTAL_RACING_RAM); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript(); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -705,4 +762,6 @@ void AddSC_holiday_spell_scripts() new spell_brewfest_ram_fatigue(); new spell_brewfest_apple_trap(); new spell_brewfest_exhausted_ram(); + new spell_brewfest_relay_race_intro_force_player_to_throw(); + new spell_brewfest_dismount_ram(); } -- cgit v1.2.3 From 16a884d999d17290955f3c2721b78a13c8795293 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Thu, 25 Sep 2014 21:10:00 +0200 Subject: Core/Misc: Refactor scripts to fix static analysis warnings Eighth batch of fixes targeting 80 issues reported by Coverity --- .../Scholomance/boss_darkmaster_gandling.cpp | 16 +++- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 14 +-- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 15 +++ .../PitOfSaron/boss_forgemaster_garfrost.cpp | 5 +- .../PitOfSaron/boss_scourgelord_tyrannus.cpp | 8 ++ .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 8 +- .../boss_icecrown_gunship_battle.cpp | 22 ++++- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 5 +- .../IcecrownCitadel/boss_professor_putricide.cpp | 8 +- .../Northrend/IcecrownCitadel/boss_rotface.cpp | 7 +- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 7 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 45 ++++++--- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 14 +++ .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 5 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 7 ++ .../Ulduar/Ulduar/boss_algalon_the_observer.cpp | 8 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 7 +- .../Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 13 +-- .../Northrend/VaultOfArchavon/boss_koralon.cpp | 5 +- src/server/scripts/Northrend/zone_storm_peaks.cpp | 5 +- .../scripts/Outland/zone_shadowmoon_valley.cpp | 104 +++++++++++++++------ src/server/scripts/Outland/zone_shattrath_city.cpp | 22 ++++- .../scripts/Outland/zone_terokkar_forest.cpp | 28 ++++-- src/server/scripts/Spells/spell_dk.cpp | 88 +++++++++++++---- src/server/scripts/Spells/spell_druid.cpp | 21 +++++ src/server/scripts/Spells/spell_generic.cpp | 36 +++++-- src/server/scripts/Spells/spell_holiday.cpp | 5 +- src/server/scripts/Spells/spell_mage.cpp | 13 +-- src/server/scripts/Spells/spell_paladin.cpp | 29 ++++++ src/server/scripts/Spells/spell_pet.cpp | 31 +++++- src/server/scripts/Spells/spell_priest.cpp | 20 ++-- src/server/scripts/Spells/spell_rogue.cpp | 48 +++++++--- src/server/scripts/Spells/spell_shaman.cpp | 12 ++- src/server/scripts/Spells/spell_warlock.cpp | 5 +- src/server/scripts/Spells/spell_warrior.cpp | 26 +++--- 35 files changed, 547 insertions(+), 165 deletions(-) (limited to 'src/server/scripts/Spells') 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& 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& 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& 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& 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& 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& 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(); -- cgit v1.2.3 From a6a23a73af92f02531aa28256536daeabb439766 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 27 Sep 2014 01:19:20 +0200 Subject: Misc/Brewfest: Fix Quest "11407 - Bark for Drohn''s Distillery!" / "11408 -Bark for T''chali''s Voodoo Brewery!" --- sql/updates/world/2014_09_27_00_world.sql | 60 ++++++++++++++++++++++++++ src/server/scripts/Spells/spell_holiday.cpp | 65 +++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 sql/updates/world/2014_09_27_00_world.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2014_09_27_00_world.sql b/sql/updates/world/2014_09_27_00_world.sql new file mode 100644 index 00000000000..26eb32a1ac6 --- /dev/null +++ b/sql/updates/world/2014_09_27_00_world.sql @@ -0,0 +1,60 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +43259, +43260, +43261, +43262 +); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(43259, 'spell_brewfest_barker_bunny'), +(43260, 'spell_brewfest_barker_bunny'), +(43261, 'spell_brewfest_barker_bunny'), +(43262, 'spell_brewfest_barker_bunny'); + +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (4801,4802,4803,4804); +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(4801, 'SmartTrigger'), +(4802, 'SmartTrigger'), +(4803, 'SmartTrigger'), +(4804, 'SmartTrigger'); + +DELETE FROM `smart_scripts` WHERE `source_type`=2 AND `entryorguid`=4801; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(4801, 2, 0, 0, 46, 0, 100, 0, 4801, 0, 0, 0, 85, 43259, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Cast ''Brewfest - Barker Bunny 1'''); + +DELETE FROM `smart_scripts` WHERE `source_type`=2 AND `entryorguid`=4802; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(4802, 2, 0, 0, 46, 0, 100, 0, 4802, 0, 0, 0, 85, 43260, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Cast ''Brewfest - Barker Bunny 2'''); + +DELETE FROM `smart_scripts` WHERE `source_type`=2 AND `entryorguid`=4803; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(4803, 2, 0, 0, 46, 0, 100, 0, 4803, 0, 0, 0, 85, 43261, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Cast ''Brewfest - Barker Bunny 3'''); + +DELETE FROM `smart_scripts` WHERE `source_type`=2 AND `entryorguid`=4804; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(4804, 2, 0, 0, 46, 0, 100, 0, 4804, 0, 0, 0, 85, 43262, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Cast ''Brewfest - Barker Bunny 4'''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (4801,4802,4803,4804); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 4801, 2, 0, 1, 0, 43883, 0, 0, 0, 0, 0, '', 'SAI triggers only if player does not have Aura "Rental Racing Ram"'), +(22, 1, 4801, 2, 0, 9, 0, 11407, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4801, 2, 1, 9, 0, 11408, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for T''chali''s Voodoo Brewery!" taken'), +(22, 1, 4801, 2, 0, 28, 0, 11412, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4801, 2, 1, 28, 0, 11412, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for T''chali''s Voodoo Brewery!" taken'), + +(22, 1, 4802, 2, 0, 1, 0, 43883, 0, 0, 0, 0, 0, '', 'SAI triggers only only if player does not have Aura "Rental Racing Ram"'), +(22, 1, 4802, 2, 0, 9, 0, 11407, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4802, 2, 1, 9, 0, 11408, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for T''chali''s Voodoo Brewery!" taken'), +(22, 1, 4802, 2, 0, 28, 0, 11407, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4802, 2, 1, 28, 0, 11408, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for T''chali''s Voodoo Brewery!" taken'), + +(22, 1, 4803, 2, 0, 1, 0, 43883, 0, 0, 0, 0, 0, '', 'SAI triggers only only if player does not have Aura "Rental Racing Ram"'), +(22, 1, 4803, 2, 0, 9, 0, 11407, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4803, 2, 1, 9, 0, 11408, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for T''chali''s Voodoo Brewery!" taken'), +(22, 1, 4803, 2, 0, 28, 0, 11412, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4803, 2, 1, 28, 0, 11412, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for T''chali''s Voodoo Brewery!" taken'), + +(22, 1, 4804, 2, 0, 1, 0, 43883, 0, 0, 0, 0, 0, '', 'SAI triggers only only if player does not have Aura "Rental Racing Ram"'), +(22, 1, 4804, 2, 0, 9, 0, 11407, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4804, 2, 1, 9, 0, 11408, 0, 0, 0, 0, 0, '', 'SAI triggers only if player not have "Bark for T''chali''s Voodoo Brewery!" taken'), +(22, 1, 4804, 2, 0, 28, 0, 11407, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for Drohn''s Distillery!" taken'), +(22, 1, 4804, 2, 1, 28, 0, 11408, 0, 0, 1, 0, 0, '', 'SAI triggers only if player does not have "Bark for T''chali''s Voodoo Brewery!" taken'); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 4e8d47381e7..2d993e771db 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -736,6 +736,70 @@ class spell_brewfest_dismount_ram : public SpellScriptLoader } }; +enum RamBlub +{ + QUEST_BARK_FOR_DROHNS_DISTILLERY = 11407, + QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY = 11408, + + SAY_DROHN_DISTILLERY_1 = 23520, + SAY_DROHN_DISTILLERY_2 = 23521, + SAY_DROHN_DISTILLERY_3 = 23522, + SAY_DROHN_DISTILLERY_4 = 23523, + + SAY_TCHALIS_VOODOO_1 = 23524, + SAY_TCHALIS_VOODOO_2 = 23525, + SAY_TCHALIS_VOODOO_3 = 23526, + SAY_TCHALIS_VOODOO_4 = 23527 +}; + +// 43259 Brewfest - Barker Bunny 1 +// 43260 Brewfest - Barker Bunny 2 +// 43261 Brewfest - Barker Bunny 3 +// 43262 Brewfest - Barker Bunny 4 +class spell_brewfest_barker_bunny : public SpellScriptLoader +{ + public: + spell_brewfest_barker_bunny() : SpellScriptLoader("spell_brewfest_barker_bunny") { } + + class spell_brewfest_barker_bunny_AuraScript : public AuraScript + { + PrepareAuraScript(spell_brewfest_barker_bunny_AuraScript); + + bool Load() override + { + return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Player* target = GetTarget()->ToPlayer(); + + uint32 BroadcastTextId = 0; + + if (target->GetQuestStatus(QUEST_BARK_FOR_DROHNS_DISTILLERY) == QUEST_STATUS_INCOMPLETE || + target->GetQuestStatus(QUEST_BARK_FOR_DROHNS_DISTILLERY) == QUEST_STATUS_COMPLETE) + BroadcastTextId = RAND(SAY_DROHN_DISTILLERY_1, SAY_DROHN_DISTILLERY_2, SAY_DROHN_DISTILLERY_3, SAY_DROHN_DISTILLERY_4); + + if (target->GetQuestStatus(QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY) == QUEST_STATUS_INCOMPLETE || + target->GetQuestStatus(QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY) == QUEST_STATUS_COMPLETE) + BroadcastTextId = RAND(SAY_TCHALIS_VOODOO_1, SAY_TCHALIS_VOODOO_2, SAY_TCHALIS_VOODOO_3, SAY_TCHALIS_VOODOO_4); + + if (BroadcastTextId) + target->Talk(BroadcastTextId, CHAT_MSG_SAY, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_brewfest_barker_bunny_AuraScript::OnApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_brewfest_barker_bunny_AuraScript(); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -761,4 +825,5 @@ void AddSC_holiday_spell_scripts() new spell_brewfest_exhausted_ram(); new spell_brewfest_relay_race_intro_force_player_to_throw(); new spell_brewfest_dismount_ram(); + new spell_brewfest_barker_bunny(); } -- cgit v1.2.3