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

View File

@@ -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