*Assign possessed AI and pet AI to charmed creatures.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-12 14:15:44 -06:00
parent ab6e9bd7b4
commit 1fbfc6da64
15 changed files with 118 additions and 259 deletions

View File

@@ -169,30 +169,6 @@ void ScriptedAI::DoStartNoMovement(Unit* victim)
m_creature->StopMoving();
}
void ScriptedAI::DoMeleeAttackIfReady()
{
//Make sure our attack is ready and we aren't currently casting before checking distance
if (m_creature->isAttackReady() && !m_creature->hasUnitState(UNIT_STAT_CASTING))
{
//If we are within range melee the target
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
}
}
if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->hasUnitState(UNIT_STAT_CASTING))
{
//If we are within range melee the target
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
m_creature->resetAttackTimer(OFF_ATTACK);
}
}
}
void ScriptedAI::DoStopAttack()
{
if (m_creature->getVictim() != NULL)

View File

@@ -113,9 +113,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
//Start no movement on victim
void DoStartNoMovement(Unit* victim);
//Do melee swing of current victim if in rnage and ready and not casting
void DoMeleeAttackIfReady();
//Stop attack of current victim
void DoStopAttack();