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:
@@ -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))
|
||||||
|
{
|
||||||
|
_skeletonSpawnPos = target->GetPosition();
|
||||||
|
me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_RAIN_OF_BONES, true);
|
||||||
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
|
_skeletonscheduler.Schedule(50ms, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
//spawns skeletons every second until skeletonCount is reached
|
//spawns skeletons every 2 seconds until skeletonCount is reached
|
||||||
if(_skeletonSpawnCounter < _skeletonCount)
|
if(_skeletonSpawnCounter < _skeletonCount)
|
||||||
{
|
{
|
||||||
DoCastVictim(SPELL_SUMMON_SKELETON, true);
|
me->CastSpell(_skeletonSpawnPos.GetPositionX(), _skeletonSpawnPos.GetPositionY(), _skeletonSpawnPos.GetPositionZ(), SPELL_SUMMON_SKELETON, true);
|
||||||
_skeletonSpawnCounter++;
|
_skeletonSpawnCounter++;
|
||||||
context.Repeat(2s);
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user