local ITEM_IDS = {
[7850] = 7839,
[7838] = 7839,
[7839] = 7840,
[7840] = 7838,
[7838] = 7850
}
local attributes = {
"speed",
"attack",
"extraAttack",
"defense",
"extraDefense",
"armor",
"breakChance",
"hitChance",
"maxHitChance",
"lightLevel",
"lightColor",
"shootRange",
"attackSpeed",
"name", -- take out name if you don't want to set it with the same name
"plural",
"article",
"description",
"slotPosition",
"wieldPosition",
"wieldInfo",
"weight"
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not ITEM_IDS[item.itemid]) then
return false
end
local newItem = doCreateItemEx(ITEM_IDS[item.itemid], 1)
for i = 1, #attributes do
if getItemAttribute(item.uid, attributes[i]) and getItemAttribute(newItem.uid, attributes[i]) then
doItemSetAttribute(newItem.uid, attributes[i], getItemAttribute(item.uid, attributes[i]))
end
end
doRemoveItem(item.uid, 1)
doPlayerAddItemEx(cid, newItem, true)
return true
end