From 6edf08c7647c68860b72e51cbab968e7774de823 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Mon, 24 Oct 2016 19:21:49 +0200 Subject: [PATCH] revert this --- ...d_from_335_was_2016_10_08_07_world_335.sql | 2 + ...world_from_335_was_2016_10_14_05_world.sql | 2 +- src/server/scripts/Spells/spell_hunter.cpp | 73 +++++-------------- 3 files changed, 20 insertions(+), 57 deletions(-) diff --git a/sql/updates/world/4.3.4/2016_10_24_26_world_from_335_was_2016_10_08_07_world_335.sql b/sql/updates/world/4.3.4/2016_10_24_26_world_from_335_was_2016_10_08_07_world_335.sql index d2d0a865af6..f8ac5660af1 100644 --- a/sql/updates/world/4.3.4/2016_10_24_26_world_from_335_was_2016_10_08_07_world_335.sql +++ b/sql/updates/world/4.3.4/2016_10_24_26_world_from_335_was_2016_10_08_07_world_335.sql @@ -1,3 +1,5 @@ +/* DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_lock_and_load_dummy'; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (56342, 'spell_hun_lock_and_load_dummy'); +*/ diff --git a/sql/updates/world/4.3.4/2016_10_24_46_world_from_335_was_2016_10_14_05_world.sql b/sql/updates/world/4.3.4/2016_10_24_46_world_from_335_was_2016_10_14_05_world.sql index e42d5e46ce7..41201dd82c9 100644 --- a/sql/updates/world/4.3.4/2016_10_24_46_world_from_335_was_2016_10_14_05_world.sql +++ b/sql/updates/world/4.3.4/2016_10_24_46_world_from_335_was_2016_10_14_05_world.sql @@ -1,6 +1,6 @@ UPDATE `creature_template` SET `unit_flags`=33554432 WHERE `entry`=38222; UPDATE `creature_template` SET `speed_run`=0.571429 WHERE `entry`=38222; -UPDATE `spell_dbc` SET `DurationIndex`=29, `Effect1`=6, `EffectImplicitTargetA1`=1, `EffectApplyAuraName1`=61, `EffectBasePoints1`=100 WHERE `Id`=71290; +-- UPDATE `spell_dbc` SET `DurationIndex`=29, `Effect1`=6, `EffectImplicitTargetA1`=1, `EffectApplyAuraName1`=61, `EffectBasePoints1`=100 WHERE `Id`=71290; DELETE FROM `linked_respawn`WHERE `guid`=201129 AND `linkedGuid`=201129; DELETE FROM `creature_template_addon` WHERE `entry` IN (38009,38010,38136); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 80e3742ddc7..1b56f543f42 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -442,34 +442,27 @@ class spell_hun_lock_and_load : public SpellScriptLoader { if (eventInfo.GetActor()->HasAura(SPELL_LOCK_AND_LOAD_MARKER)) return false; + return true; } - bool CheckTrapProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_TRAP_ACTIVATION)) - return false; - - // Do not proc on traps for immolation/explosive trap - DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo || !(damageInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST)) - return false; - - return roll_chance_i(aurEff->GetAmount()); - } - - bool CheckPeriodicProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_PERIODIC)) - return false; - - return roll_chance_i(aurEff->GetAmount()); - } - - void HandleProc(ProcEventInfo& eventInfo) + template + void HandleProcs(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); + if (!(eventInfo.GetTypeMask() & mask)) + return; + + // Additional check: do not proc on traps for immolation/explosive trap + // (But still do it for the periodic damage part) + if (mask == PROC_FLAG_DONE_TRAP_ACTIVATION) + if (!(eventInfo.GetDamageInfo()->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST)) + return; + + if (!roll_chance_i(aurEff->GetAmount())) + return; + Unit* caster = eventInfo.GetActor(); caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_TRIGGER, true); caster->CastSpell(caster, SPELL_LOCK_AND_LOAD_MARKER, true); @@ -479,10 +472,8 @@ class spell_hun_lock_and_load : public SpellScriptLoader { DoCheckProc += AuraCheckProcFn(spell_hun_lock_and_load_AuraScript::CheckProc); - DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_lock_and_load_AuraScript::CheckTrapProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); - DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_lock_and_load_AuraScript::CheckPeriodicProc, EFFECT_1, SPELL_AURA_DUMMY); - - OnProc += AuraProcFn(spell_hun_lock_and_load_AuraScript::HandleProc); + OnEffectProc += AuraEffectProcFn(spell_hun_lock_and_load_AuraScript::HandleProcs, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + OnEffectProc += AuraEffectProcFn(spell_hun_lock_and_load_AuraScript::HandleProcs, EFFECT_1, SPELL_AURA_DUMMY); } }; @@ -492,35 +483,6 @@ class spell_hun_lock_and_load : public SpellScriptLoader } }; -// 56342 - Lock and Load (Rank 1) -class spell_hun_lock_and_load_dummy : public SpellScriptLoader -{ - public: - spell_hun_lock_and_load_dummy() : SpellScriptLoader("spell_hun_lock_and_load_dummy") { } - - class spell_hun_lock_and_load_dummy_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_lock_and_load_dummy_AuraScript); - - bool DummyCheck(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) - { - // Prevents Aura proc from this dummy effect - // Only rank 1 has this aura - return false; - } - - void Register() override - { - DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_lock_and_load_dummy_AuraScript::DummyCheck, EFFECT_2, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_hun_lock_and_load_dummy_AuraScript(); - } -}; - // 53271 - Masters Call class spell_hun_masters_call : public SpellScriptLoader { @@ -1193,7 +1155,6 @@ void AddSC_hunter_spell_scripts() new spell_hun_invigoration(); new spell_hun_last_stand_pet(); new spell_hun_lock_and_load(); - new spell_hun_lock_and_load_dummy(); new spell_hun_masters_call(); new spell_hun_misdirection(); new spell_hun_misdirection_proc();