diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-10-07 00:14:46 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2016-10-07 00:14:46 -0300 |
commit | dbba3ad5a50a424e54c677b8201c3171ca3fb1b5 (patch) | |
tree | 834bcad95e029a0289d051775e6db05bbd10d92e /src/server | |
parent | 3b6fd226bedb689847dadaeeba36a588ee9bc928 (diff) |
Core/Scripts: Fix some runtime errors
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/scripts/Pet/pet_hunter.cpp | 29 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 29 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 112 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 33 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 29 |
5 files changed, 187 insertions, 45 deletions
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 7f6654bd6dd..5b4b26e599e 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -152,6 +152,34 @@ class npc_pet_hunter_snake_trap : public CreatureScript } }; +// 57627 - Charge +class spell_pet_charge : public SpellScriptLoader +{ + public: + spell_pet_charge() : SpellScriptLoader("spell_pet_charge") { } + + class spell_pet_charge_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pet_charge_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_pet_charge_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pet_charge_AuraScript(); + } +}; + // -53178 - Guard Dog class spell_pet_guard_dog : public SpellScriptLoader { @@ -301,6 +329,7 @@ class spell_pet_culling_the_herd : public SpellScriptLoader void AddSC_hunter_pet_scripts() { new npc_pet_hunter_snake_trap(); + new spell_pet_charge(); new spell_pet_guard_dog(); new spell_pet_silverback(); new spell_pet_culling_the_herd(); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index b3612ec6428..658a04f0593 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -2068,6 +2068,34 @@ class spell_dk_rime : public SpellScriptLoader } }; +// 56817 - Rune strike proc (Serverside spell) +class spell_dk_rune_strike_proc : public SpellScriptLoader +{ + public: + spell_dk_rune_strike_proc() : SpellScriptLoader("spell_dk_rune_strike_proc") { } + + class spell_dk_rune_strike_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_rune_strike_proc_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_rune_strike_proc_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_rune_strike_proc_AuraScript(); + } +}; + // 59754 Rune Tap - Party class spell_dk_rune_tap_party : public SpellScriptLoader { @@ -3028,6 +3056,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_presence(); new spell_dk_raise_dead(); new spell_dk_rime(); + new spell_dk_rune_strike_proc(); new spell_dk_rune_tap_party(); new spell_dk_scent_of_blood(); new spell_dk_scent_of_blood_trigger(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 3e03316d9e4..49baab54bf0 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -201,68 +201,90 @@ class spell_dru_dash : public SpellScriptLoader } }; +// -48516 - Eclipse class spell_dru_eclipse : public SpellScriptLoader { -public: - spell_dru_eclipse() : SpellScriptLoader("spell_dru_eclipse") { } - - class spell_dru_eclipse_AuraScript : public AuraScript - { - PrepareAuraScript(spell_dru_eclipse_AuraScript); + public: + spell_dru_eclipse() : SpellScriptLoader("spell_dru_eclipse") { } - bool Validate(SpellInfo const* /*spellInfo*/) override + class spell_dru_eclipse_AuraScript : public AuraScript { - if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_LUNAR_PROC)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) - return false; - return true; - } + PrepareAuraScript(spell_dru_eclipse_AuraScript); - bool CheckProc(ProcEventInfo& eventInfo) - { - if (!eventInfo.GetSpellInfo()) - return false; + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_LUNAR_PROC)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) + return false; + return true; + } - if (eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_LUNAR_PROC) || eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) - return false; + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_LUNAR_PROC) || eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) + return false; - // Triggered by Wrath? - if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 1) - return roll_chance_f(GetSpellInfo()->ProcChance * 0.6f) && _lunarProcCooldownEnd <= std::chrono::steady_clock::now(); + return true; + } - return _solarProcCooldownEnd <= std::chrono::steady_clock::now(); - } + bool CheckSolar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 4)) // Starfire + return false; - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 1) + return _solarProcCooldownEnd <= std::chrono::steady_clock::now(); + } + + bool CheckLunar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { - _lunarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(aurEff->GetAmount()); - eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 1)) // Wrath + return false; + + // Reduced lunar proc chance (60% of normal) + if (!roll_chance_i(60)) + return false; + + return _lunarProcCooldownEnd <= std::chrono::steady_clock::now(); } - else + + void ProcSolar(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - _solarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(aurEff->GetAmount()); + PreventDefaultAction(); + + _solarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(30); eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_SOLAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); } - } - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_dru_eclipse_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } + void ProcLunar(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); - std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); - std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); - }; + _lunarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(30); + eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); + } - AuraScript* GetAuraScript() const override - { - return new spell_dru_eclipse_AuraScript(); - } + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_dru_eclipse_AuraScript::CheckProc); + + DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_eclipse_AuraScript::CheckSolar, EFFECT_0, SPELL_AURA_DUMMY); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_eclipse_AuraScript::CheckLunar, EFFECT_1, SPELL_AURA_DUMMY); + + OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::ProcSolar, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::ProcLunar, EFFECT_1, SPELL_AURA_DUMMY); + } + + std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); + std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_eclipse_AuraScript(); + } }; // 5229 - Enrage diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 0db0be0ef9c..6610c60e7d9 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -281,6 +281,38 @@ class spell_item_arcane_shroud : public SpellScriptLoader } }; +// Item - 12846: Argent Dawn Commission +// Item - 13209: Seal of the Dawn +// Item - 19812: Rune of the Dawn + +// 17670 - Argent Dawn Commission +class spell_item_argent_dawn_commission : public SpellScriptLoader +{ + public: + spell_item_argent_dawn_commission() : SpellScriptLoader("spell_item_argent_dawn_commission") { } + + class spell_item_argent_dawn_commission_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_argent_dawn_commission_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_argent_dawn_commission_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_argent_dawn_commission_AuraScript(); + } +}; + enum AuraOfMadness { SPELL_SOCIOPATH = 39511, // Sociopath: +35 strength(Paladin, Rogue, Druid, Warrior) @@ -4386,6 +4418,7 @@ void AddSC_item_spell_scripts() new spell_item_alchemists_stone(); new spell_item_anger_capacitor<8>("spell_item_tiny_abomination_in_a_jar"); new spell_item_anger_capacitor<7>("spell_item_tiny_abomination_in_a_jar_hero"); + new spell_item_argent_dawn_commission(); new spell_item_aura_of_madness(); new spell_item_dementia(); new spell_item_blessing_of_ancient_kings(); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 2b6b6facc33..25502522c65 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -1049,6 +1049,34 @@ class spell_warr_t3_prot_8p_bonus : public SpellScriptLoader } }; +// 32216 - Victorious +class spell_warr_victorious : public SpellScriptLoader +{ + public: + spell_warr_victorious() : SpellScriptLoader("spell_warr_victorious") { } + + class spell_warr_victorious_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_victorious_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warr_victorious_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warr_victorious_AuraScript(); + } +}; + // 50720 - Vigilance class spell_warr_vigilance : public SpellScriptLoader { @@ -1201,6 +1229,7 @@ void AddSC_warrior_spell_scripts() new spell_warr_sweeping_strikes(); new spell_warr_sword_and_board(); new spell_warr_t3_prot_8p_bonus(); + new spell_warr_victorious(); new spell_warr_vigilance(); new spell_warr_vigilance_trigger(); } |