diff --git a/data/sql/updates/pending_db_world/rev_1566945787997948952.sql b/data/sql/updates/pending_db_world/rev_1566945787997948952.sql new file mode 100644 index 000000000..acb11ed38 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1566945787997948952.sql @@ -0,0 +1,43 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1566945787997948952'); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN +(19597,19677,19676,19678,19679,19680,19684,19681,19682,19683,19685,19686,30647,30648,30652,30100,30103,30104, + 19548,19674,19687,19688,19689,19692,19693,19694,19696,19697,19699,19700,30646,30653,30654,30099,30102,30105); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) +VALUES +(19597,'spell_hun_taming_the_beast'), -- Tame Ice Claw Bear (NPC 1196, Quest 6085) +(19548,'spell_hun_tame_beast'), +(19677,'spell_hun_taming_the_beast'), -- Tame Large Crag Boar (NPC 1126, Quest 6064) +(19674,'spell_hun_tame_beast'), +(19676,'spell_hun_taming_the_beast'), -- Tame Snow Leopard (NPC 1201, Quest 6084) +(19687,'spell_hun_tame_beast'), +(19678,'spell_hun_taming_the_beast'), -- Tame Adult Plainstrider (NPC 2956, Quest 6061) +(19688,'spell_hun_tame_beast'), +(19679,'spell_hun_taming_the_beast'), -- Tame Prairie Stalker (NPC 2959, Quest 6087) +(19689,'spell_hun_tame_beast'), +(19680,'spell_hun_taming_the_beast'), -- Tame Swoop (NPC 2970, Quest 6088) +(19692,'spell_hun_tame_beast'), +(19684,'spell_hun_taming_the_beast'), -- Tame Webwood Lurker (NPC 1998, Quest 6063) +(19693,'spell_hun_tame_beast'), +(19681,'spell_hun_taming_the_beast'), -- Tame Dire Mottled Boar (NPC 3099, Quest 6062) +(19694,'spell_hun_tame_beast'), +(19682,'spell_hun_taming_the_beast'), -- Tame Surf Crawler (NPC 3107, Quest 6083) +(19696,'spell_hun_tame_beast'), +(19683,'spell_hun_taming_the_beast'), -- Tame Armored Scorpid (NPC 3126, Quest 6082) +(19697,'spell_hun_tame_beast'), +(19685,'spell_hun_taming_the_beast'), -- Tame Nightsaber Stalker (NPC 2043, Quest 6101) +(19699,'spell_hun_tame_beast'), +(19686,'spell_hun_taming_the_beast'), -- Tame Strigid Screecher (NPC 1996, Quest 6102) +(19700,'spell_hun_tame_beast'), +(30647,'spell_hun_taming_the_beast'), -- Tame Barbed Crawler (NPC 17217, Quest 9591) +(30646,'spell_hun_tame_beast'), +(30648,'spell_hun_taming_the_beast'), -- Tame Greater Timberstrider (NPC 17374, Quest 9592) +(30653,'spell_hun_tame_beast'), +(30652,'spell_hun_taming_the_beast'), -- Tame Nightstalker (NPC 17203, Quest 9593) +(30654,'spell_hun_tame_beast'), +(30100,'spell_hun_taming_the_beast'), -- Tame Crazed Dragonhawk (NPC 15650, Quest 9484) +(30099,'spell_hun_tame_beast'), +(30103,'spell_hun_taming_the_beast'), -- Tame Elder Springpaw (NPC 15652, Quest 9486) +(30102,'spell_hun_tame_beast'), +(30104,'spell_hun_taming_the_beast'), -- Tame Mistbat (NPC 16353, Quest 9485) +(30105,'spell_hun_tame_beast'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 7546a63e9..7e100844f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4997,7 +4997,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool // AT REMOVE else { - if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive()) + if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive() && aurApp->GetRemoveMode() != AURA_REMOVE_BY_CANCEL) { uint32 finalSpelId = 0; switch (GetId()) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 067f97e07..184d47c0c 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -307,6 +307,35 @@ class spell_hun_generic_scaling : public SpellScriptLoader } }; +// Taming the Beast quests (despawn creature after dismiss) +class spell_hun_taming_the_beast : public SpellScriptLoader +{ + public: + spell_hun_taming_the_beast() : SpellScriptLoader("spell_hun_taming_the_beast") { } + + class spell_hun_taming_the_beast_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_taming_the_beast_AuraScript); + + void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + if (Creature* creature = target->ToCreature()) + creature->DespawnOrUnsummon(); + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_hun_taming_the_beast_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_taming_the_beast_AuraScript(); + } +}; + // Theirs @@ -1180,6 +1209,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_wyvern_sting(); new spell_hun_animal_handler(); new spell_hun_generic_scaling(); + new spell_hun_taming_the_beast(); // Theirs new spell_hun_aspect_of_the_beast();