From b42ca49329138c2a15747d594884e0af95764cc6 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Mon, 13 May 2024 21:39:17 +0200 Subject: [PATCH] fix(Karazhan/Nightbane): Rain of Bones cast on one random player/pet, summon Skeletons at that location (#18892) * replace skeletonspawn scheduler with spellscript * Revert "replace skeletonspawn scheduler with spellscript" This reverts commit 974bcb805be57c3175d63d91afe656c0bc327a9e. * random target and remember position * target position instead of player * make pets valid targets for rain of bones * change 100 to 100.0f --- .../Karazhan/boss_nightbane.cpp | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 9ac6fe245..ec7bd7bfe 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -172,17 +172,21 @@ struct boss_nightbane : public BossAI scheduler.Schedule(2s, GROUP_FLYING, [this](TaskContext) { DoResetThreatList(); - DoCastVictim(SPELL_RAIN_OF_BONES); - _skeletonscheduler.Schedule(50ms, [this](TaskContext context) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f)) { - //spawns skeletons every second until skeletonCount is reached - if(_skeletonSpawnCounter < _skeletonCount) + _skeletonSpawnPos = target->GetPosition(); + me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_RAIN_OF_BONES, true); + _skeletonscheduler.Schedule(50ms, [this](TaskContext context) { - DoCastVictim(SPELL_SUMMON_SKELETON, true); - _skeletonSpawnCounter++; - context.Repeat(2s); - } - }); + //spawns skeletons every 2 seconds until skeletonCount is reached + if(_skeletonSpawnCounter < _skeletonCount) + { + me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_SUMMON_SKELETON, true); + _skeletonSpawnCounter++; + context.Repeat(2s); + } + }); + } }).Schedule(20s, GROUP_FLYING, [this](TaskContext context) { DoCastRandomTarget(SPELL_DISTRACTING_ASH); @@ -383,6 +387,7 @@ private: uint32 _movePhase; uint8 _skeletonCount; uint8 _skeletonSpawnCounter; + Position _skeletonSpawnPos; }; class go_blackened_urn : public GameObjectScript