Skip to content

Commit

Permalink
AI: Resolve errors with combat timers
Browse files Browse the repository at this point in the history
Refactored existing use of enterevademode
Split reset of timer between just respawned - all timers
evade - ooc/combat timers

Closes #676
  • Loading branch information
killerwife committed May 20, 2024
1 parent 762f49f commit 537d728
Show file tree
Hide file tree
Showing 33 changed files with 58 additions and 86 deletions.
2 changes: 1 addition & 1 deletion src/game/AI/BaseAI/CreatureAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ CreatureAI::CreatureAI(Creature* creature, uint32 combatActions) :

void CreatureAI::Reset()
{
ResetTimersOnEvade();

m_currentRangedMode = m_rangedMode;
m_attackDistance = m_chaseDistance;
}
Expand Down
1 change: 1 addition & 0 deletions src/game/AI/ScriptDevAI/base/follower_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void FollowerAI::CorpseRemoved(uint32& /*respawnDelay*/)

void FollowerAI::EnterEvadeMode()
{
ResetTimersOnEvade();
m_creature->RemoveAllAurasOnEvade();
m_creature->CombatStopWithPets(true);

Expand Down
2 changes: 2 additions & 0 deletions src/game/AI/ScriptDevAI/include/sc_creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ void ScriptedAI::EnterEvadeMode()
{
UnitAI::EnterEvadeMode();

ResetTimersOnEvade();
Reset();
}

/// This function calls Reset() to reset variables as expected
void ScriptedAI::JustRespawned()
{
ResetAllTimers();
Reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct boss_felblood_kaelthasAI : public CombatAI
AddCustomAction(KAEL_GRAVITY_LAPSE_SCRIPT, true, [&]()
{
HandleGravityLapse();
});
}, TIMER_COMBAT_COMBAT);
AddCustomAction(KAEL_OUTRO, true, [&]()
{
HandleOutro();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,8 @@ struct boss_gothikAI : public ScriptedAI
if (m_instance)
m_instance->SetData(TYPE_GOTHIK, FAIL);

m_creature->SetRespawnDelay(30, true);
m_creature->ForcedDespawn();
m_creature->Respawn();

ScriptedAI::EnterEvadeMode();
}

void JustReachedHome() override
{
if (m_instance)
m_instance->SetData(TYPE_GOTHIK, FAIL);

SetCombatMovement(false);
}

void UpdateAI(const uint32 diff) override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ struct boss_heiganAI : public CombatAI
AddCombatAction(HEIGAN_TELEPORT_PLAYERS, 35u * IN_MILLISECONDS, 45u * IN_MILLISECONDS);
AddCombatAction(HEIGAN_TAUNT, 25u * IN_MILLISECONDS, 90u * IN_MILLISECONDS);
AddCustomAction(HEIGAN_ERUPTION, true, [&]() { StartEruptions(m_phase == PHASE_GROUND ? SPELL_PLAGUE_WAVE_SLOW : SPELL_PLAGUE_WAVE_FAST); });
AddCustomAction(HEIGAN_GROUND_PHASE, true, [&]() { HandleGroundPhase(); });
AddCustomAction(HEIGAN_PLATFORM_PHASE, true, [&]() { HandlePlatformPhase(); });
AddCustomAction(HEIGAN_GROUND_PHASE, true, [&]() { HandleGroundPhase(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(HEIGAN_PLATFORM_PHASE, true, [&]() { HandlePlatformPhase(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(HEIGAN_DOOR, true, [&]() { CloseEntrance(); });
AddCustomAction(HEIGAN_CHANNELING, true, [&]() { HandleChanneling(); });
AddCustomAction(HEIGAN_CHANNELING, true, [&]() { HandleChanneling(); }, TIMER_COMBAT_COMBAT);
}

ScriptedInstance* m_instance;
Expand Down Expand Up @@ -159,12 +159,12 @@ struct boss_heiganAI : public CombatAI

void EnterEvadeMode() override
{
ScriptedAI::EnterEvadeMode();

if (m_instance)
m_instance->SetData(TYPE_HEIGAN, FAIL);

StopEruptions();

ScriptedAI::EnterEvadeMode();
}

void HandleGroundPhase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ struct npc_icecrown_guardianAI : public ScriptedAI

void EnterEvadeMode() override
{
m_creature->RemoveAurasDueToSpell(SPELL_BLOOD_TAP);
m_creature->RemoveAurasDueToSpell(SPELL_BLOOD_TAP);

ScriptedAI::EnterEvadeMode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ struct boss_nothAI : public CombatAI
AddCombatAction(NOTH_BLINK, 25u * IN_MILLISECONDS);
AddCombatAction(NOTH_CURSE, 4u * IN_MILLISECONDS);
AddCombatAction(NOTH_SUMMON, 12u * IN_MILLISECONDS);
AddCustomAction(NOTH_BALCONY_PHASE, true, [&]() { HandleBalconyPhase(); });
AddCustomAction(NOTH_GROUND_PHASE, true, [&]() { HandleGroundPhase(); });
AddCustomAction(NOTH_BALCONY_PHASE, true, [&]() { HandleBalconyPhase(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(NOTH_GROUND_PHASE, true, [&]() { HandleGroundPhase(); }, TIMER_COMBAT_COMBAT);
AddOnKillText(SAY_SLAY1, SAY_SLAY1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ struct boss_sapphironAI : public CombatAI
AddCombatAction(SAPPHIRON_FROST_BREATH, true);
AddCombatAction(SAPPHIRON_ICEBOLT, true);
AddCombatAction(SAPPHIRON_BERSERK, 15u * MINUTE * IN_MILLISECONDS);
AddCustomAction(SAPPHIRON_AIR_PHASE, true, [&]() { HandleAirPhase(); });
AddCustomAction(SAPPHIRON_LANDING_PHASE, true, [&]() { HandleLandingPhase(); });
AddCustomAction(SAPPHIRON_GROUND_PHASE, true, [&]() { HandleGroundPhase(); });
AddCustomAction(SAPPHIRON_AIR_PHASE, true, [&]() { HandleAirPhase(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(SAPPHIRON_LANDING_PHASE, true, [&]() { HandleLandingPhase(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(SAPPHIRON_GROUND_PHASE, true, [&]() { HandleGroundPhase(); }, TIMER_COMBAT_COMBAT);
}

ScriptedInstance* m_instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct boss_scarlet_commander_mograineAI : public CombatAI
AddCustomAction(MOGRAINE_ACTION_LAY_ON_HANDS, false, [&]()
{
HandleLayOnHandsTimer();
});
}, TIMER_COMBAT_COMBAT);
AddCustomAction(MOGRAINE_ACTION_REVIVED, true, [&]()
{
HandleRevivedTimer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct boss_alythessAI : public CombatAI
AddCombatAction(ALYTHESS_CONFLAGRATION, 15000u);
AddCombatAction(ALYTHESS_BLAZE, 1000u);
AddCombatAction(ALYTHESS_FLAME_SEAR, 10000u);
AddCustomAction(ALYTHESS_DELAY, true, [&]() { HandleEmpowerDelay(); });
AddCustomAction(ALYTHESS_DELAY, true, [&]() { HandleEmpowerDelay(); }, TIMER_COMBAT_COMBAT);
AddOnKillText(SAY_ALYTHESS_KILL_1, SAY_ALYTHESS_KILL_2);
}

Expand Down Expand Up @@ -311,7 +311,7 @@ struct boss_sacrolashAI : public CombatAI
AddCombatAction(SACROLASH_CONFOUNDING_BLOW, 25000, 27000);
AddCombatAction(SACROLASH_SHADOW_BLADES, 10000, 11000);
AddCombatAction(SACROLASH_SUMMON_SHADOW_IMAGE, 10000u);
AddCustomAction(ALYTHESS_DELAY, true, [&]() { HandleEmpowerDelay(); });
AddCustomAction(ALYTHESS_DELAY, true, [&]() { HandleEmpowerDelay(); }, TIMER_COMBAT_COMBAT);
AddOnKillText(SAY_SACROLASH_KILL_1, SAY_SACROLASH_KILL_2);
m_creature->GetCombatManager().SetLeashingCheck([](Unit*, float x, float y, float) -> bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ struct boss_muruAI : public CombatAI
AddTimerlessCombatAction(MURU_TRANSITION, false);
AddCombatAction(MURU_DARK_FIENDS, true);
AddCombatAction(MURU_HUMANOIDS, 15000u);
AddCustomAction(MURU_SPAWN_ENTROPIUS, true, [&]() { HandleSpawnEntropius(); });
AddCustomAction(MURU_ATTACK_SPAWNS, true, [&]() { HandleSpawnAttack(); });
AddCustomAction(MURU_SPAWN_ENTROPIUS, true, [&]() { HandleSpawnEntropius(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(MURU_ATTACK_SPAWNS, true, [&]() { HandleSpawnAttack(); }, TIMER_COMBAT_COMBAT);
SetDeathPrevention(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ struct boss_zuljinAI : public CombatAI
AddCustomAction(ZULJIN_SPIRIT_ACQUIRED, true, [&]()
{
SpiritAcquired();
});
}, TIMER_COMBAT_COMBAT);
AddCustomAction(ZULJIN_FIRE_WALL_DELAY, true, [&]()
{
if (m_creature->IsInCombat() && !m_creature->GetCombatManager().IsEvadingHome())
m_instance->DoUseDoorOrButton(GO_FIRE_DOOR);
});
}, TIMER_COMBAT_COMBAT);
m_creature->SetWalk(true);
m_creature->GetCombatManager().SetLeashingCheck([&](Unit*, float /*x*/, float y, float /*z*/)
{
Expand Down Expand Up @@ -221,8 +221,6 @@ struct boss_zuljinAI : public CombatAI
if (Creature* spirit = m_instance->GetSingleCreatureFromStorage(aZuljinPhase.spiritId))
spirit->RemoveAurasDueToSpell(SPELL_SPIRIT_DRAINED);

m_creature->SetHealthPercent(100.f); // TODO: Remove this hack once evade issues are resolved

CombatAI::EnterEvadeMode();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void hyjalAI::Reset()

void hyjalAI::EnterEvadeMode()
{
ResetTimersOnEvade();
m_creature->RemoveAllAurasOnEvade();
m_creature->CombatStop(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ struct boss_onyxiaAI : public CombatAI
AddCombatAction(ONYXIA_KNOCK_AWAY, 20000, 30000);
AddCombatAction(ONYXIA_FIREBALL, true);
AddCombatAction(ONYXIA_MOVEMENT, true);
AddCustomAction(ONYXIA_SUMMON_WHELPS, true, [&]() { SummonWhelps(); });
AddCustomAction(ONYXIA_PHASE_TRANSITIONS, true, [&]() { PhaseTransition(); });
AddCustomAction(ONYXIA_SUMMON_WHELPS, true, [&]() { SummonWhelps(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(ONYXIA_PHASE_TRANSITIONS, true, [&]() { PhaseTransition(); }, TIMER_COMBAT_COMBAT);
m_creature->SetWalk(false); // onyxia should run when flying
AddOnKillText(SAY_KILL);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct boss_buruAI : public CombatAI
AddCombatAction(BURU_CREEPING_PLAGUE, true);
AddCombatAction(BURU_GATHERING_SPEED, 9000u);
AddCombatAction(BURU_FULL_SPEED, 60000u);
AddCustomAction(BURU_PHASE_2_TRANSITION_STEP, true, [&]() { HandlePhaseTwo(); });
AddCustomAction(BURU_PHASE_2_TRANSITION_STEP, true, [&]() { HandlePhaseTwo(); }, TIMER_COMBAT_COMBAT);
}

uint8 m_uiPhase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ struct boss_cthunAI : public CombatAI
// There are 30 seconds offset between Giant Eye and Giant Claw Tentacles which are both on a 60 seconds period handled by periodic spells
AddCombatAction(CTHUN_CLAWTENTACLEDELAY, 10000u);
AddCombatAction(CTHUN_EYETENTACLEDELAY, 40000u);
AddCustomAction(CTHUN_EMERGE, true, [&]() { HandleEmerge(); });
AddCustomAction(CTHUN_WEAKENED_END, true, [&]() { HandleEndWeaken(); });
AddCustomAction(CTHUN_EMERGE, true, [&]() { HandleEmerge(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(CTHUN_WEAKENED_END, true, [&]() { HandleEndWeaken(); }, TIMER_COMBAT_COMBAT);
// Set active in order to be used during the instance progress
m_creature->SetActiveObjectState(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct boss_skeramAI : public CombatAI
AddCombatAction(SKERAM_ARCANE_EXPLOSION, 6000, 12000);
AddCombatAction(SKERAM_TRUE_FULFILMENT, uint32(15) * IN_MILLISECONDS);
AddCombatAction(SKERAM_EARTH_SHOCK, 1200u);
AddCustomAction(SKERAM_BLINK_DELAY, true, [&]() { HandleBlinkDelay(); });
AddCustomAction(SKERAM_BLINK_DELAY, true, [&]() { HandleBlinkDelay(); }, TIMER_COMBAT_COMBAT);
AddOnKillText(SAY_SLAY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct boss_twin_emperorsAI : public CombatAI
{
AddCombatAction(EMPEROR_BERSERK, 15u * MINUTE * IN_MILLISECONDS);
AddCombatAction(EMPEROR_BUG_ABILITY, urand(7000, 14000));
AddCustomAction(EMPEROR_TELEPORT_DELAY, true, [&]() { HandleDelayedAttack(); });
AddCustomAction(EMPEROR_TELEPORT_DELAY, true, [&]() { HandleDelayedAttack(); }, TIMER_COMBAT_COMBAT);
}

instance_temple_of_ahnqiraj* m_instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ struct boss_viscidusAI : public CombatAI
AddCombatAction(VISCIDUS_TOXIN, 30000u);
AddCombatAction(VISCIDUS_POISON_SHOCK, 7000, 12000);
AddCombatAction(VISCIDUS_POISON_BOLT_VOLLEY, 10000, 15000);
AddCustomAction(VISCIDUS_EXPLODE, true, [&]() { HandleExplode(); });
AddCustomAction(VISCIDUS_REJOIN, true, [&]() { HandleRejoin(); });
AddCustomAction(VISCIDUS_EXPLODE, true, [&]() { HandleExplode(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(VISCIDUS_REJOIN, true, [&]() { HandleRejoin(); }, TIMER_COMBAT_COMBAT);
m_creature->GetCombatManager().SetLeashingCheck([&](Unit* /*unit*/, float /*x*/, float /*y*/, float /*z*/) -> bool
{
return m_creature->GetDistance(resetPoint.m_fX, resetPoint.m_fY, resetPoint.m_fZ, DIST_CALC_COMBAT_REACH) < 10.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ struct boss_murmurAI : public CombatAI
boss_murmurAI(Creature* creature) : CombatAI(creature, MURMUR_ACTION_MAX),
m_instance(static_cast<ScriptedInstance*>(creature->GetInstanceData())), m_bIsRegularMode(creature->GetMap()->IsRegularDifficulty())
{
AddCustomAction(MURMUR_OOC_RP_ATTACK, true, [&]() { HandleOocAttack(); });
AddCustomAction(MURMUR_OOC_CASTER_ATTACK, true, [&]() { HandleOocCasterAttack(); });
AddCustomAction(MURMUR_OOC_RP_ATTACK, true, [&]() { HandleOocAttack(); }, TIMER_COMBAT_OOC);
AddCustomAction(MURMUR_OOC_CASTER_ATTACK, true, [&]() { HandleOocCasterAttack(); }, TIMER_COMBAT_OOC);
}

ScriptedInstance* m_instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,7 @@ struct boss_maievAI : public CombatAI, private DialogueHelper
// Custom evade - don't allow her to return to home position
void EnterEvadeMode() override
{
ResetTimersOnEvade();
m_creature->RemoveAllAurasOnEvade();
m_creature->CombatStop(true);
m_creature->LoadCreatureAddon(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct boss_teron_gorefiendAI : public CombatAI
m_instance->SetData(TYPE_GOREFIEND, FAIL);
DespawnSummons();
DoCastSpellIfCan(nullptr, SPELL_DESTROY_ALL_SPIRITS);
ScriptedAI::EnterEvadeMode();
CombatAI::EnterEvadeMode();
}

void Aggro(Unit* /*pWho*/) override
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/scripts/outland/boss_terokk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct boss_terokkAI : public CombatAI
Creature* target = GetClosestCreatureWithEntry(m_creature, NPC_SKYGUARD_TARGET, 70.f);
if (Creature* ace = m_creature->GetMap()->GetCreature(m_aces[1]))
ace->AI()->DoCastSpellIfCan(target, SPELL_ANCIENT_FLAMES);
});
}, TIMER_COMBAT_COMBAT);
AddTimerlessCombatAction(TEROKK_COMBAT_ACTION_SPAWN_ACE, true);
AddTimerlessCombatAction(TEROKK_COMBAT_ACTION_PHASE_2, true);
AddCombatAction(TEROKK_COMBAT_ACTION_DIVINE_SHIELD, GetInitialActionTimer(TEROKK_COMBAT_ACTION_DIVINE_SHIELD));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ struct boss_lady_vashjAI : public CombatAI
AddCombatAction(VASHJ_ACTION_SHOOT, 2000u);
AddCombatAction(VASHJ_ACTION_FORKED_LIGHTNING, true);
AddTimerlessCombatAction(VASHJ_ACTION_MELEE_MODE, true);
AddCustomAction(VASHJ_INTRO, true, [&]() { HandleIntroText(); });
AddCustomAction(VASHJ_COILFANG_ELITE, true, [&]() { HandleCoilfangElite(); });
AddCustomAction(VASHJ_COILFANG_STRIDER, true, [&]() { HandleCoilfangStrider(); });
AddCustomAction(VASHJ_SPOREBAT, true, [&]() { HandleSporebat(); });
AddCustomAction(VASHJ_ENCHANTED_ELEMENTAL, true, [&]() { HandleEnchantedElemental(); });
AddCustomAction(VASHJ_TAINTED_ELEMENTAL, true, [&]() { HandleTaintedElemental(); });
AddCustomAction(VASHJ_INTRO, true, [&]() { HandleIntroText(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(VASHJ_COILFANG_ELITE, true, [&]() { HandleCoilfangElite(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(VASHJ_COILFANG_STRIDER, true, [&]() { HandleCoilfangStrider(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(VASHJ_SPOREBAT, true, [&]() { HandleSporebat(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(VASHJ_ENCHANTED_ELEMENTAL, true, [&]() { HandleEnchantedElemental(); }, TIMER_COMBAT_COMBAT);
AddCustomAction(VASHJ_TAINTED_ELEMENTAL, true, [&]() { HandleTaintedElemental(); }, TIMER_COMBAT_COMBAT);
SetRangedMode(true, 40.f, TYPE_PROXIMITY);
AddMainSpell(SPELL_SHOOT);
AddDistanceSpell(SPELL_ENTANGLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct boss_ahuneAI : public CombatAI
boss_ahuneAI(Creature* creature) : CombatAI(creature, AHUNE_ACTION_MAX)
{
AddCustomAction(AHUNE_ATTACK, 3000u, [&]() { HandleAttackDelay(); });
AddCustomAction(AHUNE_EMERGE, true, [&]() { HandleEmerge(); });
AddCustomAction(AHUNE_EMERGE, true, [&]() { HandleEmerge(); }, TIMER_COMBAT_COMBAT);
AddCombatAction(AHUNE_SUBMERGE, 90000u);
AddCombatAction(AHUNE_COLD_SLAP, 2000u);
AddCombatAction(AHUNE_HAILSTONE, 1000u);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct boss_omor_the_unscarredAI : public CombatAI
AddCombatAction(OMOR_TREACHERY, 12300, 23300);
AddCombatAction(OMOR_ORBITAL_STRIKE, 25000u);
AddCombatAction(OMOR_SHADOW_BOLT, 0u);
AddCustomAction(OMOR_PULL_BACK, true, [&]() {HandlePullBack(); });
AddCustomAction(OMOR_PULL_BACK, true, [&]() { HandlePullBack(); }, TIMER_COMBAT_COMBAT);
SetCombatMovement(false);
SetRangedMode(true, 100.f, TYPE_PROXIMITY);
AddOnKillText(SAY_KILL_1, SAY_KILL_2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ struct boss_grand_warlock_nethekurseAI : public CombatAI
m_instance(static_cast<ScriptedInstance*>(creature->GetInstanceData())), m_isRegularMode(creature->GetMap()->IsRegularDifficulty()),
m_introOnce(false), m_peonRPCD(false)
{
AddCustomAction(NETHEKURSE_TAUNT_PEONS, true, [&]() { DoTauntPeons(); });
AddCustomAction(NETHEKURSE_START_FIGHT, true, [&]() { DoStartFight(); });
AddCustomAction(NETHEKURSE_PEON_RP_CD, true, [&]() { DoPeonCD(); });
AddCustomAction(NETHEKURSE_TAUNT_PEONS, true, [&]() { DoTauntPeons(); }, TIMER_COMBAT_OOC);
AddCustomAction(NETHEKURSE_START_FIGHT, true, [&]() { DoStartFight(); }, TIMER_COMBAT_OOC);
AddCustomAction(NETHEKURSE_PEON_RP_CD, true, [&]() { DoPeonCD(); }, TIMER_COMBAT_OOC);
AddOnKillText(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3, SAY_SLAY_4);
SetReactState(REACT_DEFENSIVE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ struct npc_shivan_assassinAI : public CombatAI
m_instance->SetData(TYPE_SHARTUUL, EVENT_FAIL);
}

void EnterEvadeMode() override
{
CombatAI::EnterEvadeMode();
}

void JustReachedHome() override
{
if (m_instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ struct boss_dalliahAI : public CombatAI

if (m_instance)
m_instance->SetData(TYPE_DALLIAH, IN_PROGRESS);

m_creature->SetCombatStartPosition(Position(aDalliahStartPos[0], aDalliahStartPos[1], aDalliahStartPos[2]));
}

void JustDied(Unit* /*who*/) override
Expand All @@ -91,20 +93,10 @@ struct boss_dalliahAI : public CombatAI

void EnterEvadeMode() override
{
m_creature->RemoveAllAurasOnEvade();
m_creature->CombatStop(true);
m_creature->LoadCreatureAddon(true);

// should evade to the attack position
if (m_creature->IsAlive())
m_creature->GetMotionMaster()->MovePoint(1, aDalliahStartPos[0], aDalliahStartPos[1], aDalliahStartPos[2]);
CombatAI::EnterEvadeMode();

if (m_instance)
m_instance->SetData(TYPE_DALLIAH, FAIL);

m_creature->SetLootRecipient(nullptr);

Reset();
}

void MovementInform(uint32 moveType, uint32 pointId) override
Expand Down
Loading

1 comment on commit 537d728

@cpevors
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that this at least solved my issues with Vashj. Thank you!

Please sign in to comment.