mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[9198] Replace targeted movegen by 2 new: chase/follow movegens.
NOTE: this is mostly just formal adding 2 movegens with very limited cleanups. Real result from adding 2 new movegens possible after apply more deep cleanups/fixes in UNIT_STAT_CHASE/UNIT_STAT_FOLLOW set. But this will need more cereful changes because we have currently sometime strange dependences and places for set for this flags. Similar cleanups required for other movegen related flags. Infact i have related patches but need more testing before apply step by step.
This commit is contained in:
parent
2e9bf5ad6a
commit
8a03785470
17 changed files with 232 additions and 138 deletions
|
|
@ -86,7 +86,7 @@ ReactorAI::UpdateAI(const uint32 /*time_diff*/)
|
|||
void
|
||||
ReactorAI::EnterEvadeMode()
|
||||
{
|
||||
if( !m_creature->isAlive() )
|
||||
if (!m_creature->isAlive())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking, he is dead [guid=%u]", m_creature->GetGUIDLow());
|
||||
m_creature->GetMotionMaster()->MovementExpired();
|
||||
|
|
@ -99,15 +99,15 @@ ReactorAI::EnterEvadeMode()
|
|||
|
||||
Unit* victim = ObjectAccessor::GetUnit(*m_creature, i_victimGuid );
|
||||
|
||||
if( !victim )
|
||||
if (!victim)
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking, no victim [guid=%u]", m_creature->GetGUIDLow());
|
||||
}
|
||||
else if( victim->HasStealthAura() )
|
||||
else if (victim->HasStealthAura())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking, victim is in stealth [guid=%u]", m_creature->GetGUIDLow());
|
||||
}
|
||||
else if( victim->isInFlight() )
|
||||
else if (victim->isInFlight())
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking, victim is in flight [guid=%u]", m_creature->GetGUIDLow());
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ ReactorAI::EnterEvadeMode()
|
|||
m_creature->CombatStop(true);
|
||||
m_creature->SetLootRecipient(NULL);
|
||||
|
||||
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
|
||||
if( m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
|
||||
// Remove ChaseMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue