aboutsummaryrefslogtreecommitdiff
path: root/src/game/NullCreatureAI.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-12 14:22:59 -0600
committermegamage <none@none>2009-03-12 14:22:59 -0600
commit16ee4a46c271bd7c234ffa7579f5f90cf2007772 (patch)
tree6d547d8228472fcc97ead5dfcdd8a9aaf8f70233 /src/game/NullCreatureAI.cpp
parent6e12d3f1b9f40f3f95390245f3fcbb30fbd8657f (diff)
parent1fbfc6da645058a6da3073dafde0e6bca621e31c (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/NullCreatureAI.cpp')
-rw-r--r--src/game/NullCreatureAI.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/game/NullCreatureAI.cpp b/src/game/NullCreatureAI.cpp
index 33218251718..2745dd3ea8d 100644
--- a/src/game/NullCreatureAI.cpp
+++ b/src/game/NullCreatureAI.cpp
@@ -27,6 +27,30 @@ void PassiveAI::UpdateAI(const uint32)
EnterEvadeMode();
}
+void PossessedAI::UpdateAI(const uint32 diff)
+{
+ if(me->getVictim())
+ {
+ if(!me->canAttack(me->getVictim()))
+ me->AttackStop();
+ else
+ DoMeleeAttackIfReady();
+ }
+}
+
+void PossessedAI::JustDied(Unit *u)
+{
+ // We died while possessed, disable our loot
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+}
+
+void PossessedAI::KilledUnit(Unit* victim)
+{
+ // We killed a creature, disable victim's loot
+ if (victim->GetTypeId() == TYPEID_UNIT)
+ victim->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+}
+
void CritterAI::DamageTaken(Unit *done_by, uint32 &)
{
if(!me->hasUnitState(UNIT_STAT_FLEEING))
@@ -39,4 +63,3 @@ void CritterAI::EnterEvadeMode()
me->SetControlled(false, UNIT_STAT_FLEEING);
CreatureAI::EnterEvadeMode();
}
-