Clear escortAI from duplicated functionality, which also fix escorts that stucks after combat.
Big THANKS to _manuel_ for testing --HG-- branch : trunk
This commit is contained in:
@@ -21,7 +21,6 @@ enum ePoints
|
|||||||
npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
|
npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
|
||||||
m_uiPlayerGUID(0),
|
m_uiPlayerGUID(0),
|
||||||
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
|
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
|
||||||
CanMelee(true),
|
|
||||||
m_uiPlayerCheckTimer(1000),
|
m_uiPlayerCheckTimer(1000),
|
||||||
m_uiWPWaitTimer(2500),
|
m_uiWPWaitTimer(2500),
|
||||||
m_uiEscortState(STATE_ESCORT_NONE),
|
m_uiEscortState(STATE_ESCORT_NONE),
|
||||||
@@ -303,7 +302,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
|
|||||||
|
|
||||||
void npc_escortAI::UpdateEscortAI(const uint32 uiDiff)
|
void npc_escortAI::UpdateEscortAI(const uint32 uiDiff)
|
||||||
{
|
{
|
||||||
if (!CanMelee && !UpdateVictim())
|
if (!UpdateVictim())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
|||||||
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
|
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
|
||||||
float GetMaxPlayerDistance() { return MaxPlayerDistance; }
|
float GetMaxPlayerDistance() { return MaxPlayerDistance; }
|
||||||
|
|
||||||
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
|
|
||||||
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
|
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
|
||||||
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
||||||
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
|
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
|
||||||
@@ -109,7 +108,6 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
|||||||
bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK)
|
bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK)
|
||||||
bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used)
|
bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used)
|
||||||
bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests.
|
bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests.
|
||||||
bool CanMelee;
|
|
||||||
bool DespawnAtEnd;
|
bool DespawnAtEnd;
|
||||||
bool DespawnAtFar;
|
bool DespawnAtFar;
|
||||||
bool ScriptWP;
|
bool ScriptWP;
|
||||||
|
|||||||
@@ -1138,7 +1138,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
|
|||||||
hyjal_trashAI::UpdateAI(diff);
|
hyjal_trashAI::UpdateAI(diff);
|
||||||
if (IsEvent || IsOverrun)
|
if (IsEvent || IsOverrun)
|
||||||
{
|
{
|
||||||
CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false);
|
CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanAttack(false);
|
||||||
npc_escortAI::UpdateAI(diff);
|
npc_escortAI::UpdateAI(diff);
|
||||||
}
|
}
|
||||||
if (IsEvent)
|
if (IsEvent)
|
||||||
@@ -1249,7 +1249,7 @@ struct mob_gargoyleAI : public hyjal_trashAI
|
|||||||
hyjal_trashAI::UpdateAI(diff);
|
hyjal_trashAI::UpdateAI(diff);
|
||||||
if (IsEvent || IsOverrun)
|
if (IsEvent || IsOverrun)
|
||||||
{
|
{
|
||||||
CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false);
|
CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanAttack(false);
|
||||||
npc_escortAI::UpdateAI(diff);
|
npc_escortAI::UpdateAI(diff);
|
||||||
}
|
}
|
||||||
if (IsEvent)
|
if (IsEvent)
|
||||||
|
|||||||
Reference in New Issue
Block a user