diff options
| -rw-r--r-- | sql/updates/world/2013_07_21_00_world_spell_script_misc_434.sql | 13 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 42 |
4 files changed, 56 insertions, 16 deletions
diff --git a/sql/updates/world/2013_07_21_00_world_spell_script_misc_434.sql b/sql/updates/world/2013_07_21_00_world_spell_script_misc_434.sql new file mode 100644 index 00000000000..1e0dfb24d50 --- /dev/null +++ b/sql/updates/world/2013_07_21_00_world_spell_script_misc_434.sql @@ -0,0 +1,13 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=-19572; +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(-19572,'spell_hun_improved_mend_pet'); + +DELETE FROM `spell_ranks` WHERE `first_spell_id`=19572; +INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES +(19572, 19572, 1), +(19572, 19573, 2); + +DELETE FROM `spell_proc_event` WHERE `entry` IN (19572,19573); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(19572, 0, 9, 8388608, 0, 0, 0x4000, 0, 0, 100, 0), +(19573, 0, 9, 8388608, 0, 0, 0x4000, 0, 0, 100, 0); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3c3c1be3c62..edec9dc9f95 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5834,21 +5834,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - case SPELLFAMILY_HUNTER: - { - switch (dummySpell->SpellIconID) - { - case 267: // Improved Mend Pet - { - if (!roll_chance_i(triggerAmount)) - return false; - - triggered_spell_id = 24406; - break; - } - } - break; - } case SPELLFAMILY_PALADIN: { // Light's Beacon - Beacon of Light diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3dabd772ed3..b96ee4db5bd 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -203,7 +203,7 @@ class spell_gen_alchemist_stone : public SpellScriptLoader spellId = ALECHEMIST_STONE_HEAL; else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_ENERGIZE)) spellId = ALECHEMIST_STONE_MANA; - TC_LOG_ERROR(LOG_FILTER_GENERAL, "spellId: %u, procSpell: %u", spellId, eventInfo.GetDamageInfo()->GetSpellInfo()->Id); + if (!spellId) return; diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 0630491bb8c..19d8cde542a 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -39,6 +39,7 @@ enum HunterSpells SPELL_HUNTER_CHIMERA_SHOT_VIPER = 53358, SPELL_HUNTER_CHIMERA_SHOT_SCORPID = 53359, SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER = 56851, + SPELL_HUNTER_IMPROVED_MEND_PET = 24406, SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398, SPELL_HUNTER_LOCK_AND_LOAD = 56453, SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305, @@ -273,6 +274,46 @@ class spell_hun_disengage : public SpellScriptLoader } }; +// -19572 - Improved Mend Pet +class spell_hun_improved_mend_pet : public SpellScriptLoader +{ + public: + spell_hun_improved_mend_pet() : SpellScriptLoader("spell_hun_improved_mend_pet") { } + + class spell_hun_improved_mend_pet_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_improved_mend_pet_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_IMPROVED_MEND_PET)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return roll_chance_i(GetEffect(EFFECT_0)->GetAmount()); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_IMPROVED_MEND_PET, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_hun_improved_mend_pet_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_hun_improved_mend_pet_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_hun_improved_mend_pet_AuraScript(); + } +}; // 53412 - Invigoration class spell_hun_invigoration : public SpellScriptLoader { @@ -939,6 +980,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_ascpect_of_the_viper(); new spell_hun_chimera_shot(); new spell_hun_disengage(); + new spell_hun_improved_mend_pet(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); new spell_hun_masters_call(); |
