mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-13 19:43:19 -04:00
Core/SmartAI: added ACTION_RANDOM_MOVE
--HG-- branch : trunk
This commit is contained in:
@@ -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