Core/SAI: Add the ability to set UNIT_FIELD_BYTES_1 in SAI (action 90)
This commit is contained in:
@@ -1227,6 +1227,15 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (!targets) return;
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
|
||||
if (IsUnit((*itr)))
|
||||
(*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 3, e.action.unitByte.byte);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType());
|
||||
break;
|
||||
|
||||
@@ -766,6 +766,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
|
||||
case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST:
|
||||
case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST:
|
||||
case SMART_ACTION_RANDOM_MOVE:
|
||||
case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
|
||||
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);
|
||||
|
||||
@@ -444,7 +444,9 @@ enum SMART_ACTION
|
||||
SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST = 88, // script9 id min, max
|
||||
SMART_ACTION_RANDOM_MOVE = 89, // maxDist
|
||||
|
||||
SMART_ACTION_END = 90,
|
||||
SMART_ACTION_SET_UNIT_FIELD_BYTES_1 = 90, // bytes, target
|
||||
|
||||
SMART_ACTION_END = 91,
|
||||
};
|
||||
|
||||
struct SmartAction
|
||||
@@ -785,6 +787,11 @@ struct SmartAction
|
||||
uint32 flag;
|
||||
} unitFlag;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 byte;
|
||||
} unitByte;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 seat;
|
||||
|
||||
Reference in New Issue
Block a user