diff options
Diffstat (limited to 'src/game/MotionMaster.cpp')
-rw-r--r-- | src/game/MotionMaster.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 52b9ba56e3e..da811ab02ed 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -365,7 +365,37 @@ MotionMaster::MoveCharge(float x, float y, float z, float speed) } void -MotionMaster::MoveFleeing(Unit* enemy) +MotionMaster::MoveSeekAssistance(float x, float y, float z) +{ + if(i_owner->GetTypeId()==TYPEID_PLAYER) + { + sLog.outError("Player (GUID: %u) attempt to seek assistance",i_owner->GetGUIDLow()); + } + else + { + DEBUG_LOG("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", + i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z ); + Mutate(new AssistanceMovementGenerator(x,y,z), MOTION_SLOT_ACTIVE); + } +} + +void +MotionMaster::MoveSeekAssistanceDistract(uint32 time) +{ + if(i_owner->GetTypeId()==TYPEID_PLAYER) + { + sLog.outError("Player (GUID: %u) attempt to call distract after assistance",i_owner->GetGUIDLow()); + } + else + { + DEBUG_LOG("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", + i_owner->GetEntry(), i_owner->GetGUIDLow(), time ); + Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); + } +} + +void +MotionMaster::MoveFleeing(Unit* enemy, uint32 time) { if(!enemy) return; @@ -382,11 +412,15 @@ MotionMaster::MoveFleeing(Unit* enemy) } else { - DEBUG_LOG("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)", + DEBUG_LOG("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", i_owner->GetEntry(), i_owner->GetGUIDLow(), enemy->GetTypeId()==TYPEID_PLAYER ? "player" : "creature", - enemy->GetTypeId()==TYPEID_PLAYER ? enemy->GetGUIDLow() : ((Creature*)enemy)->GetDBTableGUIDLow() ); - Mutate(new FleeingMovementGenerator<Creature>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); + enemy->GetTypeId()==TYPEID_PLAYER ? enemy->GetGUIDLow() : ((Creature*)enemy)->GetDBTableGUIDLow(), + time ? " for a limited time" : ""); + if (time) + Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time), MOTION_SLOT_CONTROLLED); + else + Mutate(new FleeingMovementGenerator<Creature>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); } } |