This helps improve clarity by preventing confusion between the refNum and the combination of a refNum and an mpNum that is now called the uniqueIndex.
23 lines
534 B
Lua
23 lines
534 B
Lua
dataTableBuilder = {}
|
|
|
|
dataTableBuilder.BuildAIData = function(action, targetPid, targetUniqueIndex,
|
|
posX, posY, posZ, distance, duration, shouldRepeat)
|
|
|
|
local ai = {}
|
|
ai.action = action
|
|
ai.posX, ai.posY, ai.posZ = posX, posY, posZ
|
|
ai.distance = distance
|
|
ai.duration = duration
|
|
ai.shouldRepeat = shouldRepeat
|
|
|
|
if targetPid ~= nil then
|
|
ai.targetPlayer = Players[targetPid].accountName
|
|
else
|
|
ai.targetUniqueIndex = targetUniqueIndex
|
|
end
|
|
|
|
return ai
|
|
end
|
|
|
|
return dataTableBuilder
|