mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 19:31:59 +01: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;
|
||||
|
||||
@@ -768,6 +768,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
|
||||
case SMART_ACTION_CROSS_CAST:
|
||||
case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST:
|
||||
case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST:
|
||||
case SMART_ACTION_RANDOM_MOVE:
|
||||
break;
|
||||
default:
|
||||
sLog.outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
|
||||
@@ -442,8 +442,9 @@ enum SMART_ACTION
|
||||
SMART_ACTION_CROSS_CAST = 86, // spellID, castFlags, CasterTargetType, CasterTarget param1, CasterTarget param2, CasterTarget param3, ( + the origonal target fields as Destination target), CasterTargets will cast spellID on all Targets (use with caution if targeting multiple * multiple units)
|
||||
SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST = 87, // script9 ids 1-9
|
||||
SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST = 88, // script9 id min, max
|
||||
SMART_ACTION_RANDOM_MOVE = 89, // maxDist
|
||||
|
||||
SMART_ACTION_END = 89,
|
||||
SMART_ACTION_END = 90,
|
||||
};
|
||||
|
||||
struct SmartAction
|
||||
|
||||
Reference in New Issue
Block a user