diff --git a/data/sql/updates/pending_db_world/rev_1756862808168107100.sql b/data/sql/updates/pending_db_world/rev_1756862808168107100.sql new file mode 100644 index 000000000..a758fe749 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1756862808168107100.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND (`SourceGroup` = 0) AND (`SourceEntry` = 44407); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 44407, 0, 0, 31, 1, 3, 24747, 0, 0, 0, 0, '', 'Hawk Hunting must target Fjord Hawk'); + +UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 24747; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 24747) AND (`source_type` = 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_hawk_hunting'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(44407, 'spell_hawk_hunting'); diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 2b0efc76f..c6405cc18 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -22,6 +22,7 @@ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "SpellInfo.h" +#include "SpellScript.h" class npc_attracted_reef_bull : public CreatureScript { @@ -393,6 +394,36 @@ public: } }; +enum HawkHunting +{ + SPELL_HAWK_HUNTING_ITEM = 44408 +}; + +// 44407 - Spell hawk Hunting +class spell_hawk_hunting : public SpellScript +{ + PrepareSpellScript(spell_hawk_hunting); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HAWK_HUNTING_ITEM }); + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (!GetCaster()) + return; + + GetCaster()->CastSpell(GetCaster(), SPELL_HAWK_HUNTING_ITEM, true); + GetHitUnit()->ToCreature()->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_hawk_hunting::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_howling_fjord() { new npc_attracted_reef_bull(); @@ -400,4 +431,5 @@ void AddSC_howling_fjord() new npc_apothecary_hanes(); new npc_plaguehound_tracker(); new npc_razael_and_lyana(); + RegisterSpellScript(spell_hawk_hunting); }