Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Scripts/Karazhan) Nightbane take off phase handling #18934

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
nightbane fly skip ground phase
use conditional schedule takeoff instead

invincibility fix and timing

no need to delay ScheduleGround
  • Loading branch information
sogladev committed May 20, 2024
commit 92695ae8a6d944a03efcfce95ac4e298f477004e
34 changes: 26 additions & 8 deletions src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ struct boss_nightbane : public BossAI
_intro = true;
Phase = 1;
_movePhase = 0;
_triggerCountTakeOffWhileFlying = 0;
_flightPhasesCompleted = 0;

ScheduleHealthCheckEvent({ 75, 50, 25 }, [&]{
TakeOff();
Expand All @@ -111,7 +113,7 @@ struct boss_nightbane : public BossAI

void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageEffectType, SpellSchoolMask spellSchoolMask) override
{
if (_flying || Phase == 2)
if (_flightPhasesCompleted < 3)
{
if (damage >= me->GetHealth())
{
Expand Down Expand Up @@ -254,9 +256,22 @@ struct boss_nightbane : public BossAI
_movePhase = id + 1;
else
{
Phase = 1;
_flying = false;
_movement = true;
_flightPhasesCompleted++;
if (_triggerCountTakeOffWhileFlying > 0)
{
_triggerCountTakeOffWhileFlying--;
scheduler.Schedule(2s, [this](TaskContext)
{
TakeOff(true);
});
}
else
{
Phase = 1;
_movement = true;
ScheduleGround();
}
return;
}
}
Expand Down Expand Up @@ -284,8 +299,13 @@ struct boss_nightbane : public BossAI
}
}

void TakeOff()
void TakeOff(bool justLanded = false)
{
if ((_flying || Phase == 2) && !justLanded)
{
_triggerCountTakeOffWhileFlying++;
return;
}
Talk(YELL_FLY_PHASE);
scheduler.CancelGroup(GROUP_GROUND);

Expand All @@ -309,10 +329,6 @@ struct boss_nightbane : public BossAI

_flying = true;
scheduler.CancelGroup(GROUP_FLYING);
scheduler.Schedule(2s, [this](TaskContext)
{
ScheduleGround();
});
});
}

Expand Down Expand Up @@ -388,6 +404,8 @@ struct boss_nightbane : public BossAI
uint8 _skeletonCount;
uint8 _skeletonSpawnCounter;
Position _skeletonSpawnPos;
uint8 _triggerCountTakeOffWhileFlying;
uint8 _flightPhasesCompleted;
};

class go_blackened_urn : public GameObjectScript
Expand Down
Loading