*Disable charmed/possessed creature AI.

*Use general react states to replace charminfo react states.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-05 18:48:56 -06:00
parent 769c835f26
commit 8787c00ca3
17 changed files with 103 additions and 96 deletions

View File

@@ -47,7 +47,6 @@ PetAI::PetAI(Creature *c) : CreatureAI(c), i_pet(*c), i_tracker(TIME_INTERVAL_LO
void PetAI::MoveInLineOfSight(Unit *u)
{
if( !i_pet.getVictim() && i_pet.GetCharmInfo() &&
i_pet.GetCharmInfo()->HasReactState(REACT_AGGRESSIVE) &&
i_pet.IsHostileTo( u ) && i_pet.canAttack(u) &&
u->isInAccessiblePlaceFor(&i_pet))
{
@@ -181,7 +180,7 @@ void PetAI::UpdateAI(const uint32 diff)
}
else if(owner && i_pet.GetCharmInfo())
{
if(owner->isInCombat() && !(i_pet.GetCharmInfo()->HasReactState(REACT_PASSIVE) || i_pet.GetCharmInfo()->HasCommandState(COMMAND_STAY)))
if(owner->isInCombat() && !(i_pet.HasReactState(REACT_PASSIVE) || i_pet.GetCharmInfo()->HasCommandState(COMMAND_STAY)))
{
AttackStart(owner->getAttackerForHelper());
}