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
This commit is contained in:
Jelle Meeus
2024-05-13 21:39:17 +02:00
committed by GitHub
parent e4b46863e8
commit b42ca49329
@@ -172,17 +172,21 @@ struct boss_nightbane : public BossAI
scheduler.Schedule(2s, GROUP_FLYING, [this](TaskContext) scheduler.Schedule(2s, GROUP_FLYING, [this](TaskContext)
{ {
DoResetThreatList(); DoResetThreatList();
DoCastVictim(SPELL_RAIN_OF_BONES); if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
{ {
//spawns skeletons every second until skeletonCount is reached _skeletonSpawnPos = target->GetPosition();
if(_skeletonSpawnCounter < _skeletonCount) me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_RAIN_OF_BONES, true);
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
{ {
DoCastVictim(SPELL_SUMMON_SKELETON, true); //spawns skeletons every 2 seconds until skeletonCount is reached
_skeletonSpawnCounter++; if(_skeletonSpawnCounter < _skeletonCount)
context.Repeat(2s); {
} me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_SUMMON_SKELETON, true);
}); _skeletonSpawnCounter++;
context.Repeat(2s);
}
});
}
}).Schedule(20s, GROUP_FLYING, [this](TaskContext context) }).Schedule(20s, GROUP_FLYING, [this](TaskContext context)
{ {
DoCastRandomTarget(SPELL_DISTRACTING_ASH); DoCastRandomTarget(SPELL_DISTRACTING_ASH);
@@ -383,6 +387,7 @@ private:
uint32 _movePhase; uint32 _movePhase;
uint8 _skeletonCount; uint8 _skeletonCount;
uint8 _skeletonSpawnCounter; uint8 _skeletonSpawnCounter;
Position _skeletonSpawnPos;
}; };
class go_blackened_urn : public GameObjectScript class go_blackened_urn : public GameObjectScript