Files
ashlar/scripts/dataTableBuilder.lua
David Cernat 5b242a516f Revert "add scale in createObject (#106)"
This reverts commit 58fa94e838.

Rickoff's changes did not work as intended by him, because the condition he added for sending ObjectScale packets was never true due to it relying on an uninitialized variable. It's better to just handle object scales in a different function anyway.

# Conflicts:
#	scripts/dataTableBuilder.lua
2022-03-22 00:07:09 +02:00

36 lines
922 B
Lua

dataTableBuilder = {}
dataTableBuilder.BuildAIData = function(targetPid, targetUniqueIndex, action,
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
-- Use with logicHandler.CreateObject() functions
dataTableBuilder.BuildObjectData = function(refId, count, charge, enchantmentCharge, soul)
local objectData = {}
objectData.refId = refId
objectData.count = count or 1
objectData.charge = charge or -1
objectData.enchantmentCharge = enchantmentCharge or -1
objectData.soul = soul or ""
return objectData
end
return dataTableBuilder