*Fix build.
--HG-- branch : trunk
This commit is contained in:
@@ -71,7 +71,6 @@ void SpellAI::EnterCombat(Unit *who)
|
||||
else if(AISpellInfo[*i].condition == AICOND_COMBAT)
|
||||
events.ScheduleEvent(*i, AISpellInfo[*i].cooldown + rand()%AISpellInfo[*i].cooldown);
|
||||
}
|
||||
i_creature.ResetDamageByPlayers();
|
||||
}
|
||||
|
||||
void SpellAI::UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -41,12 +41,6 @@ ReactorAI::MoveInLineOfSight(Unit *)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
ReactorAI::IsVisible(Unit *) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
ReactorAI::UpdateAI(const uint32 /*time_diff*/)
|
||||
{
|
||||
@@ -54,8 +48,6 @@ ReactorAI::UpdateAI(const uint32 /*time_diff*/)
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
i_victimGuid = m_creature->getVictim()->GetGUID();
|
||||
|
||||
if( m_creature->isAttackReady() )
|
||||
{
|
||||
if( m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
@@ -65,54 +57,3 @@ ReactorAI::UpdateAI(const uint32 /*time_diff*/)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ReactorAI::EnterEvadeMode()
|
||||
{
|
||||
if( !m_creature->isAlive() )
|
||||
{
|
||||
DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", m_creature->GetGUIDLow());
|
||||
m_creature->GetMotionMaster()->MovementExpired();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
i_victimGuid = 0;
|
||||
m_creature->CombatStop(true);
|
||||
m_creature->DeleteThreatList();
|
||||
return;
|
||||
}
|
||||
|
||||
Unit* victim = ObjectAccessor::GetUnit(*m_creature, i_victimGuid );
|
||||
|
||||
if( !victim )
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", m_creature->GetGUIDLow());
|
||||
}
|
||||
else if( victim->HasStealthAura() )
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking cuz his victim is stealth [guid=%u]", m_creature->GetGUIDLow());
|
||||
}
|
||||
else if( victim->isInFlight() )
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking cuz his victim is fly away [guid=%u]", m_creature->GetGUIDLow());
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking due to target %s [guid=%u]", victim->isAlive() ? "out run him" : "is dead", m_creature->GetGUIDLow());
|
||||
}
|
||||
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
i_victimGuid = 0;
|
||||
m_creature->CombatStop(true);
|
||||
m_creature->SetLootRecipient(NULL);
|
||||
i_creature.ResetDamageByPlayers();
|
||||
|
||||
if(!m_creature->GetCharmerOrOwner())
|
||||
{
|
||||
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
|
||||
if( m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
else if (m_creature->GetOwner() && m_creature->GetOwner()->isAlive())
|
||||
m_creature->GetMotionMaster()->MoveFollow(m_creature->GetOwner(),PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,17 +29,12 @@ class TRINITY_DLL_DECL ReactorAI : public CreatureAI
|
||||
{
|
||||
public:
|
||||
|
||||
explicit ReactorAI(Creature *c) : CreatureAI(c), i_victimGuid(0) {}
|
||||
explicit ReactorAI(Creature *c) : CreatureAI(c) {}
|
||||
|
||||
void MoveInLineOfSight(Unit *);
|
||||
void EnterEvadeMode();
|
||||
bool IsVisible(Unit *) const;
|
||||
|
||||
void UpdateAI(const uint32);
|
||||
static int Permissible(const Creature *);
|
||||
|
||||
private:
|
||||
uint64 i_victimGuid;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user