[7668] Cleanup In CreatureAI function descriptions and AttackStart/AttackedBy use.
commitf29802afb81fe9a74a682e95d0a8205d19ac9f24
authorVladimirMangos <vladimir@getmangos.com>
Tue, 14 Apr 2009 03:21:04 +0000 (14 07:21 +0400)
committerVladimirMangos <vladimir@getmangos.com>
Tue, 14 Apr 2009 06:14:10 +0000 (14 10:14 +0400)
tree83ba6def7341b99bc40dc8062d88571466f0f88f
parent2808fe3372c8ebdb219a39528baa3e516bba3455
[7668] Cleanup In CreatureAI function descriptions and AttackStart/AttackedBy use.

* 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.
src/bindings/universal/ScriptMgr.h
src/game/CreatureAI.cpp
src/game/CreatureAI.h
src/game/NullCreatureAI.h
src/game/PetAI.h
src/game/Spell.cpp
src/game/SpellAuras.cpp
src/game/SpellEffects.cpp
src/game/TotemAI.cpp
src/game/Unit.cpp
src/shared/revision_nr.h