bodycarcoo11
Mapper
Hello,
Most of you know who am I the rest don't and it won't change the fact that i came with a good contribution for 0.4 TFS servers that can make it easily to replicate systems you are interested in, Tfs 0.4 lacks the function item:loadAttributes() or item:getAttributes() so we made it in a simple way to copy/paste the attributes you want
to add more attributes add it in attributes table, attributes in the table will be saved from the item that passed through the funciton (needless to say item.uid)
good luck.
Most of you know who am I the rest don't and it won't change the fact that i came with a good contribution for 0.4 TFS servers that can make it easily to replicate systems you are interested in, Tfs 0.4 lacks the function item:loadAttributes() or item:getAttributes() so we made it in a simple way to copy/paste the attributes you want
Lua:
attributes = {
"attack",
"defense",
"armor",
"criticalhitdamage",
"criticalhitdamage",
"damageincrease",
"damagereduction",
"dodge",
"healingincrease",
"damagepenetration",
"lifeleech",
"manaleech",
}
function loadItemAttributes(item, attributes)
for key, value in ipairs(attributes) do
if getItemAttribute(item.uid, key) == nil then
doItemSetAttribute(item, key, value)
end
end
end
function saveItemAttributes(item)
local data = {}
for _, key in ipairs(attributes) do
local value = getItemAttribute(item.uid, key)
local itemInfo = getItemInfo(item.itemid)
local itemValue = itemInfo and itemInfo[key]
if value ~= nil then
data[key] = value
elseif itemValue ~= nil then
data[key] = itemValue
end
end
return data
end
to add more attributes add it in attributes table, attributes in the table will be saved from the item that passed through the funciton (needless to say item.uid)
good luck.