fix(Scripts/BossAI): add optional variable to BossAI class to make sure the boss calls for help (#18630)

init
This commit is contained in:
Dan
2024-03-30 15:31:41 +01:00
committed by GitHub
parent 88be6d8150
commit a870173558
4 changed files with 12 additions and 2 deletions

View File

@@ -571,6 +571,7 @@ BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature),
summons(creature),
_bossId(bossId)
{
callForHelpRange = 0.0f;
if (instance)
SetBoundary(instance->GetBossBoundary(bossId));
@@ -630,6 +631,13 @@ void BossAI::_JustEngagedWith()
me->setActive(true);
DoZoneInCombat();
ScheduleTasks();
if (callForHelpRange)
{
ScheduleTimedEvent(0s, [&]
{
me->CallForHelp(callForHelpRange);
}, 2s);
}
if (instance)
{
// bosses do not respawn, check only on enter combat