Skip to content

Commit

Permalink
fix(Karazhan/Nightbane): Rain of Bones cast on one random player/pet,…
Browse files Browse the repository at this point in the history
… summon Skeletons at that location (#18892)

* replace skeletonspawn scheduler with spellscript

* Revert "replace skeletonspawn scheduler with spellscript"

This reverts commit 974bcb8.

* random target and remember position

* target position instead of player

* make pets valid targets for rain of bones

* change 100 to 100.0f
  • Loading branch information
sogladev committed May 13, 2024
1 parent e4b4686 commit b42ca49
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -383,6 +387,7 @@ struct boss_nightbane : public BossAI
uint32 _movePhase;
uint8 _skeletonCount;
uint8 _skeletonSpawnCounter;
Position _skeletonSpawnPos;
};

class go_blackened_urn : public GameObjectScript
Expand Down

0 comments on commit b42ca49

Please sign in to comment.