From b9a62115b17381a7e8371c1df1ebfd4a4165ac59 Mon Sep 17 00:00:00 2001 From: untaught Date: Mon, 14 Apr 2014 19:48:13 +0200 Subject: Core/Spells: fixed Relic of the Earthen Ring Closes #11282 --- src/server/scripts/Spells/spell_quest.cpp | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 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 d1b32570795..f436803cb89 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2276,6 +2276,46 @@ class spell_q13400_illidan_kill_master : public SpellScriptLoader } }; +enum RelicOfTheEarthenRing +{ + SPELL_TOTEM_OF_THE_EARTHEN_RING = 66747 +}; + +// 66744 - Make Player Destroy Totems +class spell_q14100_q14111_make_player_destroy_totems : public SpellScriptLoader +{ + public: + spell_q14100_q14111_make_player_destroy_totems() : SpellScriptLoader("spell_q14100_q14111_make_player_destroy_totems") { } + + class spell_q14100_q14111_make_player_destroy_totems_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q14100_q14111_make_player_destroy_totems_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_TOTEM_OF_THE_EARTHEN_RING)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetHitPlayer()) + player->CastSpell(player, SPELL_TOTEM_OF_THE_EARTHEN_RING, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_q14100_q14111_make_player_destroy_totems_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q14100_q14111_make_player_destroy_totems_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2331,4 +2371,5 @@ void AddSC_quest_spell_scripts() new spell_q12919_gymers_grab(); new spell_q12919_gymers_throw(); new spell_q13400_illidan_kill_master(); + new spell_q14100_q14111_make_player_destroy_totems(); } -- cgit v1.2.3 From 533cbf20bb20000ce8d20dfe376bd1b4d533b116 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Mon, 14 Apr 2014 21:12:05 +0200 Subject: Core/Spells: addition to b9a62115b17381a7e8371c1df1ebfd4a4165ac59 --- src/server/scripts/Spells/spell_quest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 f436803cb89..b9fd07293cd 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2301,7 +2301,7 @@ class spell_q14100_q14111_make_player_destroy_totems : public SpellScriptLoader void HandleScriptEffect(SpellEffIndex /*effIndex*/) { if (Player* player = GetHitPlayer()) - player->CastSpell(player, SPELL_TOTEM_OF_THE_EARTHEN_RING, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); + player->CastSpell(player, SPELL_TOTEM_OF_THE_EARTHEN_RING, TRIGGERED_FULL_MASK); // ignore reagent cost, consumed by quest } void Register() OVERRIDE -- cgit v1.2.3 From 574fa30ea6924902af1d845e667f38c043b32e94 Mon Sep 17 00:00:00 2001 From: Unholychick Date: Fri, 18 Apr 2014 20:21:05 +0200 Subject: Core/Spells: Convert Avenging Wrath to spellscript Closes #11896 Closes #3464 --- .../2014_04_18_00_world_spell_script_names.sql | 7 +++ src/server/game/Entities/Unit/Unit.cpp | 9 ---- src/server/scripts/Spells/spell_paladin.cpp | 50 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 sql/updates/world/2014_04_18_00_world_spell_script_names.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2014_04_18_00_world_spell_script_names.sql b/sql/updates/world/2014_04_18_00_world_spell_script_names.sql new file mode 100644 index 00000000000..a1cf5402219 --- /dev/null +++ b/sql/updates/world/2014_04_18_00_world_spell_script_names.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pal_avenging_wrath'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(31884,'spell_pal_avenging_wrath'); + +-- +DELETE FROM `spell_proc_event` WHERE `entry`=-53375; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9cc214b7390..06628de4050 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6363,15 +6363,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere CastSpell(this, 57669, true, castItem, triggeredByAura); break; } - // Sanctified Wrath - if (dummySpell->SpellIconID == 3029) - { - triggered_spell_id = 57318; - target = this; - basepoints0 = triggerAmount; - CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); - return true; - } // Righteous Vengeance if (dummySpell->SpellIconID == 3025) { diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index b5265561d85..2b1cafbdd26 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -66,6 +66,9 @@ enum PaladinSpells SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790, + SPELL_PALADIN_SANCTIFIED_WRATH = 57318, + SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 = 53375, + SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742, SPELL_PALADIN_CONCENTRACTION_AURA = 19746, @@ -236,6 +239,52 @@ class spell_pal_aura_mastery_immune : public SpellScriptLoader } }; +// 31884 - Avenging Wrath +class spell_pal_avenging_wrath : public SpellScriptLoader +{ + public: + spell_pal_avenging_wrath() : SpellScriptLoader("spell_pal_avenging_wrath") { } + + class spell_pal_avenging_wrath_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_avenging_wrath_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH) + || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1)) + return false; + return true; + } + + void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1, EFFECT_2)) + { + int32 basepoints = aurEff->GetAmount(); + target->CastCustomSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, &basepoints, &basepoints, NULL, true, NULL, aurEff); + } + } + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_PALADIN_SANCTIFIED_WRATH); + } + + void Register() OVERRIDE + { + OnEffectApply += AuraEffectApplyFn(spell_pal_avenging_wrath_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_pal_avenging_wrath_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_avenging_wrath_AuraScript(); + } +}; + // 37877 - Blessing of Faith class spell_pal_blessing_of_faith : public SpellScriptLoader { @@ -1233,6 +1282,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_ardent_defender(); new spell_pal_aura_mastery(); new spell_pal_aura_mastery_immune(); + new spell_pal_avenging_wrath(); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); new spell_pal_divine_sacrifice(); -- cgit v1.2.3