Skip to content

Commit

Permalink
Scripts: Fix rbac permission for skipping default boss sequencing check
Browse files Browse the repository at this point in the history
  • Loading branch information
Shauren committed Jan 14, 2020
1 parent 2b024e8 commit e660c8b
Show file tree
Hide file tree
Showing 202 changed files with 403 additions and 444 deletions.
4 changes: 2 additions & 2 deletions src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,12 @@ void BossAI::_JustReachedHome()
me->setActive(false);
}

void BossAI::_JustEngagedWith()
void BossAI::_JustEngagedWith(Unit* who)
{
if (instance)
{
// bosses do not respawn, check only on enter combat
if (!instance->CheckRequiredBosses(_bossId))
if (!instance->CheckRequiredBosses(_bossId, who->ToPlayer()))
{
EnterEvadeMode(EVADE_REASON_SEQUENCE_BREAK);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/AI/ScriptedAI/ScriptedCreature.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,15 @@ class TC_GAME_API BossAI : public ScriptedAI
virtual void ScheduleTasks() { }

void Reset() override { _Reset(); }
void JustEngagedWith(Unit* /*who*/) override { _JustEngagedWith(); }
void JustEngagedWith(Unit* who) override { _JustEngagedWith(who); }
void JustDied(Unit* /*killer*/) override { _JustDied(); }
void JustReachedHome() override { _JustReachedHome(); }

bool CanAIAttack(Unit const* target) const override;

protected:
void _Reset();
void _JustEngagedWith();
void _JustEngagedWith(Unit* who);
void _JustDied();
void _JustReachedHome();
void _DespawnAtEvade(Seconds delayToRespawn, Creature* who = nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class boss_drakkisath : public CreatureScript
_Reset();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_FIRE_NOVA, 6s);
events.ScheduleEvent(EVENT_CLEAVE, 8000);
events.ScheduleEvent(EVENT_CONFLIGURATION, 15s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class boss_gizrul_the_slavener : public CreatureScript
me->GetMotionMaster()->MovePath(GIZRUL_PATH, false);
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_FATAL_BITE, 17s, 20s);
events.ScheduleEvent(EVENT_INFECTED_BITE, 10s, 12s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class boss_gyth : public CreatureScript
}
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8s, 16s);
events.ScheduleEvent(EVENT_FREEZE, 8s, 16s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class boss_halycon : public CreatureScript
Initialize();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_REND, 17s, 20s);
events.ScheduleEvent(EVENT_THRASH, 10s, 12s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class boss_highlord_omokk : public CreatureScript
_Reset();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_FRENZY, 20000);
events.ScheduleEvent(EVENT_KNOCK_AWAY, 18000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class boss_lord_valthalak : public CreatureScript
Initialize();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_SUMMON_SPECTRAL_ASSASSIN, 6s, 8s);
events.ScheduleEvent(EVENT_SHADOW_WRATH, 9s, 18s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class boss_mother_smolderweb : public CreatureScript
_Reset();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_CRYSTALIZE, 20 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_MOTHERS_MILK, 10s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class boss_overlord_wyrmthalak : public CreatureScript
Initialize();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_BLAST_WAVE, 20s);
events.ScheduleEvent(EVENT_SHOUT, 2s);
events.ScheduleEvent(EVENT_CLEAVE, 6s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class quartermaster_zigris : public CreatureScript
_Reset();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_SHOOT, 1s);
events.ScheduleEvent(EVENT_STUN_BOMB, 16s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ class boss_rend_blackhand : public CreatureScript
portcullisGUID.Clear();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_WHIRLWIND, 13s, 15s);
events.ScheduleEvent(EVENT_CLEAVE, 15s, 17s);
events.ScheduleEvent(EVENT_MORTAL_STRIKE, 17s, 19s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class boss_shadow_hunter_voshgajin : public CreatureScript
//DoCast(me, SPELL_ICEARMOR, true);
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 2s);
events.ScheduleEvent(EVENT_HEX, 8 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_CLEAVE, 14s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ struct boss_the_beast : public BossAI
}
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_FLAME_BREAK, 12s);
events.ScheduleEvent(EVENT_IMMOLATE, 3s);
events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 23s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class boss_urok_doomhowl : public CreatureScript
_Reset();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(SPELL_REND, 17s, 20s);
events.ScheduleEvent(SPELL_STRIKE, 10s, 12s);
Talk(SAY_AGGRO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class boss_warmaster_voone : public CreatureScript
_Reset();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_SNAP_KICK, 8s);
events.ScheduleEvent(EVENT_CLEAVE, 14 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_UPPERCUT, 20s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class boss_broodlord : public CreatureScript
{
boss_broodlordAI(Creature* creature) : BossAI(creature, DATA_BROODLORD_LASHLAYER) { }

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);

events.ScheduleEvent(EVENT_CLEAVE, 8s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ class boss_chromaggus : public CreatureScript
Initialize();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.ScheduleEvent(EVENT_SHIMMER, 0);
events.ScheduleEvent(EVENT_BREATH_1, 30000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class boss_ebonroc : public CreatureScript
{
boss_ebonrocAI(Creature* creature) : BossAI(creature, DATA_EBONROC) { }

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.ScheduleEvent(EVENT_SHADOWFLAME, 10s, 20s);
events.ScheduleEvent(EVENT_WINGBUFFET, 30s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class boss_firemaw : public CreatureScript
{
boss_firemawAI(Creature* creature) : BossAI(creature, DATA_FIREMAW) { }

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.ScheduleEvent(EVENT_SHADOWFLAME, 10s, 20s);
events.ScheduleEvent(EVENT_WINGBUFFET, 30s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class boss_flamegor : public CreatureScript
{
boss_flamegorAI(Creature* creature) : BossAI(creature, DATA_FLAMEGOR) { }

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.ScheduleEvent(EVENT_SHADOWFLAME, 10s, 20s);
events.ScheduleEvent(EVENT_WINGBUFFET, 30s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class boss_victor_nefarius : public CreatureScript

void BeginEvent(Player* target)
{
_JustEngagedWith();
_JustEngagedWith(target);

Talk(SAY_GAMESBEGIN_2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class boss_vaelastrasz : public CreatureScript
Initialize();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);

DoCast(me, SPELL_ESSENCEOFTHERED);
me->SetHealth(me->CountPctFromMaxHealth(30));
Expand Down
4 changes: 2 additions & 2 deletions src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class boss_curator : public CreatureScript
Talk(SAY_DEATH);
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);

events.ScheduleEvent(EVENT_HATEFUL_BOLT, 12s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class boss_maiden_of_virtue : public CreatureScript
_JustDied();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);

DoCastSelf(SPELL_HOLYGROUND, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ class boss_nightbane : public CreatureScript
instance->HandleGameObject(instance->GetGuidData(DATA_MASTERS_TERRACE_DOOR_2), open);
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
Talk(YELL_AGGRO);
SetupGroundPhase();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class boss_terestian_illhoof : public CreatureScript
events.ScheduleEvent(EVENT_ENRAGE, 10min);
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ struct boss_felblood_kaelthas : public BossAI
_firstGravityLapse = true;
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.SetPhase(PHASE_ONE);
events.ScheduleEvent(EVENT_FIREBALL, 1ms, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_FLAME_STRIKE, 44s, 0, PHASE_ONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ class boss_selin_fireheart : public CreatureScript
crystal->KillSelf();
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.SetPhase(PHASE_NORMAL);
events.ScheduleEvent(EVENT_FEL_EXPLOSION, 2100ms, 0, PHASE_NORMAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ class boss_vexallus : public CreatureScript
Talk(SAY_KILL);
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
_JustEngagedWith();
BossAI::JustEngagedWith(who);

events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 8s);
events.ScheduleEvent(EVENT_ARCANE_SHOCK, 5s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ struct boss_arcanist_doan : public BossAI
_healthAbove50Pct = true;
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);

events.ScheduleEvent(EVENT_SILENCE, 15s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ struct boss_azshir_the_sleepless : public BossAI
_siphon = false;
}

void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_CALL_OF_GRAVE, 30s);
events.ScheduleEvent(EVENT_TERRIFY, 20s);
}
Expand Down
Loading

0 comments on commit e660c8b

Please sign in to comment.