diff --git a/data/sql/updates/pending_db_world/najentus-spine-removal.sql b/data/sql/updates/pending_db_world/najentus-spine-removal.sql new file mode 100644 index 000000000..30e5e21e4 --- /dev/null +++ b/data/sql/updates/pending_db_world/najentus-spine-removal.sql @@ -0,0 +1,2 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 40354; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (40354, 'spell_najentus_remove_spines'); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 14a9b547c..8256a2ad3 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -19,6 +19,7 @@ #include "ScriptedCreature.h" #include "SpellScriptLoader.h" #include "black_temple.h" +#include "Player.h" #include "SpellScript.h" enum Yells @@ -39,7 +40,8 @@ enum Spells SPELL_TIDAL_SHIELD = 39872, SPELL_IMPALING_SPINE = 39837, SPELL_SUMMON_IMPALING_SPINE = 39929, - SPELL_BERSERK = 26662 + SPELL_BERSERK = 26662, + SPELL_REMOVE_SPINES = 40354 }; enum Events @@ -48,6 +50,11 @@ enum Events EVENT_ENRAGE = 2 }; +enum Misc +{ + ITEM_NAJENTUS_SPINE = 32408 +}; + struct boss_najentus : public BossAI { boss_najentus(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS), _canTalk(true) { } @@ -56,6 +63,7 @@ struct boss_najentus : public BossAI { _Reset(); me->m_Events.CancelEventGroup(EVENT_ENRAGE); + DoCastSelf(SPELL_REMOVE_SPINES); } void JustEngagedWith(Unit* who) override @@ -64,6 +72,7 @@ struct boss_najentus : public BossAI BossAI::JustEngagedWith(who); Talk(SAY_AGGRO); + DoCastSelf(SPELL_REMOVE_SPINES); me->m_Events.AddEventAtOffset([this] { Talk(SAY_ENRAGE); @@ -157,9 +166,31 @@ class spell_najentus_hurl_spine : public SpellScript } }; +class spell_najentus_remove_spines : public SpellScript +{ + PrepareSpellScript(spell_najentus_remove_spines); + + void RemoveSpines() + { + if (Unit* caster = GetCaster()) + { + caster->GetMap()->DoForAllPlayers([&](Player* player) + { + player->DestroyItemCount(ITEM_NAJENTUS_SPINE, 5, true); + }); + } + } + + void Register() override + { + OnCast += SpellCastFn(spell_najentus_remove_spines::RemoveSpines); + } +}; + void AddSC_boss_najentus() { RegisterBlackTempleCreatureAI(boss_najentus); RegisterSpellScript(spell_najentus_needle_spine); RegisterSpellScript(spell_najentus_hurl_spine); + RegisterSpellScript(spell_najentus_remove_spines); }