[Pets] The next Bestial Swiftness improvement
Looks like the only issue left: the pet returns to the master at normal "follow" speed after combat.
This commit is contained in:
parent
51828bdbba
commit
5982813b4e
@ -2073,11 +2073,11 @@ void Pet::UpdateSpeed(UnitMoveType mtype, bool forced, float ratio)
|
|||||||
case MOVE_WALK:
|
case MOVE_WALK:
|
||||||
break;
|
break;
|
||||||
case MOVE_RUN:
|
case MOVE_RUN:
|
||||||
if (hasUnitState(UNIT_STAT_FOLLOW) && HasSpell(19596)) // Bestial Swiftness: prevent while following
|
if (!m_attacking && owner->HasAura(19596)) // Bestial Swiftness: prevent while following
|
||||||
{
|
{
|
||||||
AuraList const& auras = GetAurasByType(SPELL_AURA_MOD_INCREASE_SPEED);
|
AuraList const& auras = GetAurasByType(SPELL_AURA_MOD_INCREASE_SPEED);
|
||||||
for (AuraList::const_iterator it = auras.begin(); it != auras.end(); ++it)
|
for (AuraList::const_iterator it = auras.begin(); it != auras.end(); ++it)
|
||||||
if ((*it)->GetId() != 19582) // exclude aura influenced by Bestial Swiftness
|
if ((*it)->GetId() != 19582) // exclude the aura influenced by Bestial Swiftness
|
||||||
main_speed_mod = std::max((*it)->GetBasePoints(), main_speed_mod);
|
main_speed_mod = std::max((*it)->GetBasePoints(), main_speed_mod);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -85,6 +85,7 @@ void PetAI::AttackStart(Unit* u)
|
|||||||
// thus with the following clear the original TMG gets invalidated and crash, doh
|
// thus with the following clear the original TMG gets invalidated and crash, doh
|
||||||
// hope it doesn't start to leak memory without this :-/
|
// hope it doesn't start to leak memory without this :-/
|
||||||
// i_pet->Clear();
|
// i_pet->Clear();
|
||||||
|
m_creature->UpdateSpeed(MOVE_RUN, false);
|
||||||
HandleMovementOnAttackStart(u);
|
HandleMovementOnAttackStart(u);
|
||||||
inCombat = true;
|
inCombat = true;
|
||||||
}
|
}
|
||||||
@ -117,6 +118,7 @@ void PetAI::_stopAttack()
|
|||||||
if (owner && m_creature->GetCharmInfo() && m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
|
if (owner && m_creature->GetCharmInfo() && m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
|
||||||
{
|
{
|
||||||
m_creature->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
m_creature->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||||
|
m_creature->UpdateSpeed(MOVE_RUN, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user