mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
fix(Scripts/BossAI): add optional variable to BossAI class to make sure the boss calls for help (#18630)
init
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -462,6 +462,8 @@ public:
|
||||
BossAI(Creature* creature, uint32 bossId);
|
||||
~BossAI() override {}
|
||||
|
||||
float callForHelpRange;
|
||||
|
||||
InstanceScript* const instance;
|
||||
|
||||
bool CanRespawn() override;
|
||||
|
||||
@@ -60,6 +60,7 @@ struct boss_high_astromancer_solarian : public BossAI
|
||||
{
|
||||
boss_high_astromancer_solarian(Creature* creature) : BossAI(creature, DATA_ASTROMANCER)
|
||||
{
|
||||
callForHelpRange = 105.0f;
|
||||
scheduler.SetValidator([this]
|
||||
{
|
||||
return !me->HasUnitState(UNIT_STATE_CASTING);
|
||||
@@ -118,7 +119,6 @@ struct boss_high_astromancer_solarian : public BossAI
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
BossAI::JustEngagedWith(who);
|
||||
me->CallForHelp(105.0f);
|
||||
me->GetMotionMaster()->Clear();
|
||||
|
||||
scheduler.Schedule(3650ms, [this](TaskContext context)
|
||||
|
||||
@@ -41,6 +41,7 @@ struct boss_void_reaver : public BossAI
|
||||
{
|
||||
boss_void_reaver(Creature* creature) : BossAI(creature, DATA_REAVER)
|
||||
{
|
||||
callForHelpRange = 105.0f;
|
||||
scheduler.SetValidator([this]
|
||||
{
|
||||
return !me->HasUnitState(UNIT_STATE_CASTING);
|
||||
@@ -82,7 +83,6 @@ struct boss_void_reaver : public BossAI
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
me->CallForHelp(105.0f);
|
||||
|
||||
scheduler.Schedule(10min, [this](TaskContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user