diff options
author | megamage <none@none> | 2009-01-30 18:10:05 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-30 18:10:05 -0600 |
commit | 8fee06f041fbfbc7e22eccc03a8f12bd7a649999 (patch) | |
tree | 9512260148dabb87926131a225831e72980a250d /src/game/GuardAI.cpp | |
parent | 03234a0657eca4836b1015556973629893c76958 (diff) |
*AI structure update.
--HG--
branch : trunk
Diffstat (limited to 'src/game/GuardAI.cpp')
-rw-r--r-- | src/game/GuardAI.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index 273fa32272b..d3c3d9a7330 100644 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -33,7 +33,7 @@ int GuardAI::Permissible(const Creature *creature) return PERMIT_BASE_NO; } -GuardAI::GuardAI(Creature *c) : i_creature(*c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK) +GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_creature(*c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK) { } @@ -110,7 +110,7 @@ void GuardAI::EnterEvadeMode() void GuardAI::UpdateAI(const uint32 /*diff*/) { // update i_victimGuid if i_creature.getVictim() !=0 and changed - if(!i_creature.SelectHostilTarget() || !i_creature.getVictim()) + if(!UpdateVictim()) return; i_victimGuid = i_creature.getVictim()->GetGUID(); @@ -131,20 +131,6 @@ bool GuardAI::IsVisible(Unit *pl) const && pl->isVisibleForOrDetect(&i_creature,true); } -void GuardAI::AttackStart(Unit *u) -{ - if( !u ) - return; - - // DEBUG_LOG("Creature %s tagged a victim to kill [guid=%u]", i_creature.GetName(), u->GetGUIDLow()); - if(i_creature.Attack(u,true)) - { - i_creature.AddThreat(u, 0.0f); - i_victimGuid = u->GetGUID(); - i_creature.GetMotionMaster()->MoveChase(u); - } -} - void GuardAI::JustDied(Unit *killer) { if(Player* pkiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) |