[7668] Cleanup In CreatureAI function descriptions and AttackStart/AttackedBy use. Author: VladimirMangos

* Use AI::AttackStart calls only in case explicit request creature attack from core or AI code "attack it if can".
      Like taunt, pet handler attack command.
    * Use AI::AttackedBy for reaction at hostile action "do something at hostile action"
      Like non-dot damage, swing, negative spell landing, or fade fear/etc.
      And provided by default call AttackStart if no current target.

    This fix some problems, like:
    * Civilian will react propertly at attack by another creature (not pet or player).
    * Will not cases (at least triggred by core) when attack target start run to attacker before any real hostile action apply.

*Note: AttackBy is still disabled until proved useful to TC.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-14 21:07:52 -05:00
parent 3a65800218
commit ceae9b8e0f
7 changed files with 68 additions and 62 deletions
-7
View File
@@ -101,12 +101,6 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
i_victimGuid = 0;
}
bool
TotemAI::IsVisible(Unit *) const
{
return false;
}
void
TotemAI::AttackStart(Unit *)
{
@@ -120,4 +114,3 @@ TotemAI::AttackStart(Unit *)
((Player*)m_creature->GetOwner())->GetSession()->SendPacket(&data);
}
}