mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
*Check reactstate in UpdateVictim.
--HG-- branch : trunk
This commit is contained in:
@@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL boss_gothikAI : public BossAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!UpdateVictimByReact() || !CheckInRoom())
|
||||
if(!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
@@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_nothAI : public BossAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!UpdateVictimByReact() || !CheckInRoom())
|
||||
if(!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
@@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI
|
||||
if(!phase)
|
||||
return;
|
||||
|
||||
if(!UpdateVictimByReact() || !CheckInRoom())
|
||||
if(!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
@@ -134,12 +134,12 @@ bool CreatureAI::UpdateVictimWithGaze()
|
||||
return me->getVictim();
|
||||
}
|
||||
|
||||
bool CreatureAI::UpdateVictimByReact()
|
||||
bool CreatureAI::UpdateVictim()
|
||||
{
|
||||
if(!me->isInCombat())
|
||||
return false;
|
||||
|
||||
if(me->HasReactState(REACT_AGGRESSIVE))
|
||||
if(!me->HasReactState(REACT_PASSIVE))
|
||||
{
|
||||
if(Unit *victim = me->SelectVictim())
|
||||
AttackStart(victim);
|
||||
@@ -154,15 +154,6 @@ bool CreatureAI::UpdateVictimByReact()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CreatureAI::UpdateVictim()
|
||||
{
|
||||
if(!me->isInCombat())
|
||||
return false;
|
||||
if(Unit *victim = me->SelectVictim())
|
||||
AttackStart(victim);
|
||||
return me->getVictim();
|
||||
}
|
||||
|
||||
bool CreatureAI::_EnterEvadeMode()
|
||||
{
|
||||
if(me->IsInEvadeMode() || !me->isAlive())
|
||||
|
||||
@@ -71,7 +71,6 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
|
||||
Creature * const m_creature;
|
||||
|
||||
bool UpdateVictim();
|
||||
bool UpdateVictimByReact();
|
||||
bool UpdateVictimWithGaze();
|
||||
|
||||
void SelectNearestTarget(Unit *who);
|
||||
|
||||
Reference in New Issue
Block a user