Core/SmartAI: added ACTION_RANDOM_MOVE
--HG-- branch : trunk
This commit is contained in:
1 parent
c1ec8c80de
commit
e3c6723a8d
3 files changed
+12
-1
No files matched your search
@@ -1149,6 +1149,15 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
|
||||
(*itr)->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_RANDOM_MOVE:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (!targets) return;
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
|
||||
if (IsCreature((*itr)))
|
||||
(*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sLog.outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType());
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user