diff --git a/data/sql/updates/pending_db_world/rev_1658289715488941700.sql b/data/sql/updates/pending_db_world/rev_1658289715488941700.sql new file mode 100644 index 000000000..c6301315d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658289715488941700.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 26180 AND `ScriptName` = 'spell_huhuran_wyvern_sting'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (26180, 'spell_huhuran_wyvern_sting'); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index 3b5be7146..bdd58744e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -24,6 +24,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "temple_of_ahnqiraj.h" enum Huhuran @@ -36,7 +37,8 @@ enum Huhuran SPELL_POISONBOLT = 26052, SPELL_NOXIOUSPOISON = 26053, SPELL_WYVERNSTING = 26180, - SPELL_ACIDSPIT = 26050 + SPELL_ACIDSPIT = 26050, + SPELL_WYVERN_STING_DAMAGE = 26233 }; class boss_huhuran : public CreatureScript @@ -76,10 +78,6 @@ public: Berserk = false; } - void EnterCombat(Unit* /*who*/) override - { - } - void UpdateAI(uint32 diff) override { //Return since we have no target @@ -100,8 +98,7 @@ public: // Wyvern Timer if (Wyvern_Timer <= diff) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - DoCast(target, SPELL_WYVERNSTING); + DoCastAOE(SPELL_WYVERNSTING); Wyvern_Timer = urand(15000, 32000); } else Wyvern_Timer -= diff; @@ -155,7 +152,27 @@ public: }; }; +// 26180 - Wyvern Sting +class spell_huhuran_wyvern_sting : public AuraScript +{ + PrepareAuraScript(spell_huhuran_wyvern_sting); + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + caster->CastCustomSpell(SPELL_WYVERN_STING_DAMAGE, SPELLVALUE_BASE_POINT0, 3000, GetUnitOwner(), true); + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_huhuran_wyvern_sting::HandleRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_boss_huhuran() { new boss_huhuran(); + RegisterSpellScript(spell_huhuran_wyvern_sting); }