• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X Upgrade System - Error sometimes

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,402
Solutions
17
Reaction score
150
Location
Brazil
I have one craft + upgrade system, works well but upgrade item got error sometimes in console. Can you guys please can help me to fix this?

1634169128354.png

Follow files:

lib\upgradesystem.lua
Lua:
--[[

PERFECT UPGRADE SYSTEM
            2.0

Criado por Oneshot

É proibido a venda ou a cópia sem os devidos créditos desse script.

]]--

UpgradeHandler = {
levels = {
    [1] = {90, false, false},
    [2] = {80, false, false},
    [3] = {70, true, false},
    [4] = {55, true, false},
    [5] = {40, true, false},
    [6] = {30, true, false},
    [7] = {20, true, false},
    [8] = {10, true, false},
    [9] = {5, true, false},
    [10] = {3, true, false}
},
broadcast = 5,
attributes = {
    ["attack"] = 2,
    ["defense"] = 1,
    ["armor"] = 1
},
message = {
    console = "Trying to refine %s to level +%s with %s%% success rate.",
    success = "You have upgraded %s to level +%s",
    fail = "You have failed in upgrade of %s to level +%s",
    downgrade = "The upgrade level of %s has downgraded to +%s",
    erase = "The upgrade level of %s has been erased.",
    maxlevel = "The targeted %s is already on max upgrade level.",
    notupgradeable = "This item is not upgradeable.",
    broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!",
    invalidtool = "This is not a valid upgrade tool.",
    toolrange = "This upgrade tool can only be used in items with level between +%s and +%s"
},
tools = {
    [5114] = {range = {0, 10}, info = {chance = 0, removeable = true}},
},

isEquipment = function(self)
    local weaponType = self:getItemWeaponType()
    return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0)
end,

setItemName = function(self, name)
    return doItemSetAttribute(self.item.uid, "name", name)
end,

chance = function(self)
    local chances = {}
    chances.upgrade = (self.levels[self.item.level + 1][1] or 100)
    chances.downgrade = (self.item.level * 5)
    chances.erase = (self.item.level * 3)

    return chances
end
}

function UpgradeHandler:new(item)
local obj, ret = {}
obj.item = {}

obj.item.level = 0
obj.item.uid = item.uid
for key, value in pairs(getItemInfo(item.itemid)) do
    obj.item[key] = value
end

ret = setmetatable(obj, {__index = function(self, index)
    if _G[index] then
        return (setmetatable({callback = _G[index]}, {__call = function(self, ...)
            return self.callback(item.uid, ...)
        end}))
    else
        return UpgradeHandler[index]
    end
end})

if ret:isEquipment() then
    ret:update()
    return ret
end
return false
end

function UpgradeHandler:update()
self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0)
end

function UpgradeHandler:refine(uid, item)
if not self.item then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable)
    return "miss"
end   

local tool = self.tools[item.itemid]

if(tool == nil) then
    doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool)
    return "miss"
end

if(self.item.level > #self.levels) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name))
    return "miss"
end

if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range)))
    return "miss"
end

local chance = (self:chance().upgrade + tool.info.chance)
doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance)))

if(tool.info.removeable == true) then
    doRemoveItem(item.uid, 1)
end

if chance * 100 > math.random(1, 10000) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1)))
    if (self.item.level + 1) >= self.broadcast then
        doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1)))
    end

    self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1")))
    for key, value in pairs(self.attributes) do
        if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
            doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value)
        end
    end
    return "success"
else
    if(self.levels[self.item.level][3] == true and (self:chance().erase * 100) > math.random(1, 10000)) then
        doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.erase:format(self.item.name))
        self:setItemName(self.item.name)
        for key, value in pairs(self.attributes) do
            if self.item[key] > 0 then
                doItemSetAttribute(self.item.uid, key, self.item[key])
            end
        end
    elseif(self.levels[self.item.level][2] == true and (self:chance().downgrade * 100) > math.random(1, 10000)) then
        doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1)))
        self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 1))))
        for key, value in pairs(self.attributes) do
            if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
                doItemSetAttribute(self.item.uid, key, (self.item[key] + value * (self.item.level - 1)))
            end
        end
    else
        doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.fail:format(self.item.name, (self.item.level + 1)))
    end
    return "fail"
end
end

actions\scripts\upgrade.lua

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid == itemEx.uid then  
    return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end

if isCreature(itemEx.uid) then   
    return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end

local obj = UpgradeHandler:new(itemEx)

if(obj == false) then
    return doPlayerSendCancel(cid, UpgradeHandler.message.notupgradeable)
end

local status = obj:refine(cid, item)
if status == "success" then
    doSendAnimatedText(toPosition, "Success!", COLOR_GREEN)
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
elseif status == "fail" then
    doSendAnimatedText(toPosition, "Fail!", COLOR_RED)
    doSendMagicEffect(toPosition, CONST_ME_POFF)
else
    doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end
 
Last edited:

I have one craft + upgrade system, works well but upgrade item got error sometimes in console. Can you guys please can help me to fix this?

View attachment 62799

Follow files:

lib\upgradesystem.lua
Lua:
--[[

PERFECT UPGRADE SYSTEM
            2.0

Criado por Oneshot

É proibido a venda ou a cópia sem os devidos créditos desse script.

]]--

UpgradeHandler = {
levels = {
    [1] = {90, false, false},
    [2] = {80, false, false},
    [3] = {70, true, false},
    [4] = {55, true, false},
    [5] = {40, true, false},
    [6] = {30, true, false},
    [7] = {20, true, false},
    [8] = {10, true, false},
    [9] = {5, true, false},
    [10] = {3, true, false}
},
broadcast = 5,
attributes = {
    ["attack"] = 2,
    ["defense"] = 1,
    ["armor"] = 1
},
message = {
    console = "Trying to refine %s to level +%s with %s%% success rate.",
    success = "You have upgraded %s to level +%s",
    fail = "You have failed in upgrade of %s to level +%s",
    downgrade = "The upgrade level of %s has downgraded to +%s",
    erase = "The upgrade level of %s has been erased.",
    maxlevel = "The targeted %s is already on max upgrade level.",
    notupgradeable = "This item is not upgradeable.",
    broadcast = "The player %s was successful in upgrading %s to level +%s.\nCongratulations!!",
    invalidtool = "This is not a valid upgrade tool.",
    toolrange = "This upgrade tool can only be used in items with level between +%s and +%s"
},
tools = {
    [5114] = {range = {0, 10}, info = {chance = 0, removeable = true}},
},

isEquipment = function(self)
    local weaponType = self:getItemWeaponType()
    return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0)
end,

setItemName = function(self, name)
    return doItemSetAttribute(self.item.uid, "name", name)
end,

chance = function(self)
    local chances = {}
    chances.upgrade = (self.levels[self.item.level + 1][1] or 100)
    chances.downgrade = (self.item.level * 5)
    chances.erase = (self.item.level * 3)

    return chances
end
}

function UpgradeHandler:new(item)
local obj, ret = {}
obj.item = {}

obj.item.level = 0
obj.item.uid = item.uid
for key, value in pairs(getItemInfo(item.itemid)) do
    obj.item[key] = value
end

ret = setmetatable(obj, {__index = function(self, index)
    if _G[index] then
        return (setmetatable({callback = _G[index]}, {__call = function(self, ...)
            return self.callback(item.uid, ...)
        end}))
    else
        return UpgradeHandler[index]
    end
end})

if ret:isEquipment() then
    ret:update()
    return ret
end
return false
end

function UpgradeHandler:update()
self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0)
end

function UpgradeHandler:refine(uid, item)
if not self.item then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable)
    return "miss"
end  

local tool = self.tools[item.itemid]

if(tool == nil) then
    doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool)
    return "miss"
end

if(self.item.level > #self.levels) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name))
    return "miss"
end

if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range)))
    return "miss"
end

local chance = (self:chance().upgrade + tool.info.chance)
doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance)))

if(tool.info.removeable == true) then
    doRemoveItem(item.uid, 1)
end

if chance * 100 > math.random(1, 10000) then
    doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1)))
    if (self.item.level + 1) >= self.broadcast then
        doBroadcastMessage(self.message.broadcast:format(getCreatureName(uid), self.item.name, (self.item.level + 1)))
    end

    self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1")))
    for key, value in pairs(self.attributes) do
        if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
            doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value)
        end
    end
    return "success"
else
    if(self.levels[self.item.level][3] == true and (self:chance().erase * 100) > math.random(1, 10000)) then
        doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.erase:format(self.item.name))
        self:setItemName(self.item.name)
        for key, value in pairs(self.attributes) do
            if self.item[key] > 0 then
                doItemSetAttribute(self.item.uid, key, self.item[key])
            end
        end
    elseif(self.levels[self.item.level][2] == true and (self:chance().downgrade * 100) > math.random(1, 10000)) then
        doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1)))
        self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 1))))
        for key, value in pairs(self.attributes) do
            if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
                doItemSetAttribute(self.item.uid, key, (self.item[key] + value * (self.item.level - 1)))
            end
        end
    else
        doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.fail:format(self.item.name, (self.item.level + 1)))
    end
    return "fail"
end
end

actions\scripts\upgrade.lua

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid == itemEx.uid then 
    return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end

if isCreature(itemEx.uid) then  
    return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end

local obj = UpgradeHandler:new(itemEx)

if(obj == false) then
    return doPlayerSendCancel(cid, UpgradeHandler.message.notupgradeable)
end

local status = obj:refine(cid, item)
if status == "success" then
    doSendAnimatedText(toPosition, "Success!", COLOR_GREEN)
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
elseif status == "fail" then
    doSendAnimatedText(toPosition, "Fail!", COLOR_RED)
    doSendMagicEffect(toPosition, CONST_ME_POFF)
else
    doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end

I'm having the same problem .. did you find any solution?
 
It works well with me in xml and tfs
But you must add the elements in the same way through a program
otitemeditor
from items.Otb




<!-- Upgrade System -->
<action itemid="7760" script="upgrade.lua" />
<action itemid="7761" script="upgrade Items.lua" />
Lua:
function Upgrade(cid,item,gemscount,oldwand,newwand,item2)

  if item2.itemid == oldwand then   
        rand = math.random(1,10)
        position=getPlayerPosition(cid)
         if getPlayerItemCount(cid,item.itemid) >= gemscount then

        doPlayerRemoveItem(cid,item.itemid,gemscount)
            if rand > 10  then
                doPlayerSendTextMessage(cid,19,"Your Upgrade Has Been Failed")
                doSendAnimatedText(position,"Failed",TEXTCOLOR_RED)
                doSendMagicEffect(position,2)
            else

                doPlayerAddItem(cid,newwand,1)
                doPlayerSendTextMessage(cid,19,"Congratulations! Your Items Has Been Successfully Upgraded")
                doSendAnimatedText(position,"Upgrad",TEXTCOLOR_RED)
                doSendMagicEffect(position,28)
                
            end
            doRemoveItem(item2.uid,1)
         end
  end

end

function onUse(cid, item, frompos, item2, topos)
-- Arch Gems <Start>
    if item.itemid == 7761 and getPlayerItemCount(cid,7761) >= 1 then
        Upgrade(cid,item,1,2504,2437,item2) --legs blessed +1
     Upgrade(cid,item,1,2437,2648,item2) --legs Blessed +2
         Upgrade(cid,item,1,2648,2404,item2) --legs Blessed +3
     Upgrade(cid,item,1,2503,2508,item2) --armor blessed +1
     Upgrade(cid,item,1,2508,2533,item2) --armor blessed +2
         Upgrade(cid,item,1,2533,2500,item2) --armor blessed +3
     Upgrade(cid,item,1,2502,2506,item2) --helmet blessed +1
     Upgrade(cid,item,1,2506,2474,item2) --helmet Blessed +2
         Upgrade(cid,item,1,2474,7370,item2) --helmet Blessed +3
     Upgrade(cid,item,1,2641,3982,item2) --boots blessed +1
     Upgrade(cid,item,1,3982,2658,item2) --boots blessed +2
         Upgrade(cid,item,1,2658,2643,item2) --boots blessed +3
     Upgrade(cid,item,1,7458,2343,item2) --refill helmet +1
     Upgrade(cid,item,1,2343,7902,item2) --refill helmet +2
         Upgrade(cid,item,1,7902,2342,item2) --refill helmet +3
     Upgrade(cid,item,1,7897,2650,item2) --refill armor +1
     Upgrade(cid,item,1,2650,7882,item2) --refill armor +2
         Upgrade(cid,item,1,7882,7883,item2) --refill armor +3
     Upgrade(cid,item,1,7730,7896,item2) --refill Legs +1
     Upgrade(cid,item,1,7896,7854,item2) --refill Legs +2
         Upgrade(cid,item,1,7854,7855,item2) --refill Legs +3
     Upgrade(cid,item,1,2358,7872,item2) --refill boots +1
     Upgrade(cid,item,1,7872,7892,item2) --refill boots +2
         Upgrade(cid,item,1,7892,2350,item2) --refill boots +3
     Upgrade(cid,item,1,2127,5785,item2) --Abdala Donate Ring +1
     Upgrade(cid,item,1,5785,7856,item2) --Abdala Donate Ring +2
         Upgrade(cid,item,1,7856,7857,item2) --Abdala Donate Ring +3
     Upgrade(cid,item,1,2122,7967,item2) --Abdala Ice Ring +1
     Upgrade(cid,item,1,7967,7963,item2) --Abdala Ice Ring +2
         Upgrade(cid,item,1,7963,7873,item2) --Abdala Ice Ring +3
     Upgrade(cid,item,1,2538,2529,item2) --Abdala Donate Shield  +1
     Upgrade(cid,item,1,2529,7881,item2) --Abdala Donate Shield  +2
         Upgrade(cid,item,1,7881,2537,item2) --Abdala Donate Shield  +3
     Upgrade(cid,item,1,2664,2128,item2) --Abdala Donate helmet +1
     Upgrade(cid,item,1,2128,7462,item2) --Abdala Donate helmet +2
         Upgrade(cid,item,1,7462,2662,item2) --Abdala Donate helmet +3
     Upgrade(cid,item,1,2505,2653,item2) --Abdala Donate Armor +1
     Upgrade(cid,item,1,2653,6095,item2) --Abdala Donate Armor +2
         Upgrade(cid,item,1,6095,2485,item2) --Abdala Donate Armor +3
     Upgrade(cid,item,1,2507,2501,item2) --Abdala Donate Legs +1
     Upgrade(cid,item,1,2501,5918,item2) --Abdala Donate Legs +2
         Upgrade(cid,item,1,5918,7477,item2) --Abdala Donate Legs +3

     Upgrade(cid,item,1,5462,2636,item2) --Abdala Donate boots +1
     Upgrade(cid,item,1,2636,2635,item2) --Abdala Donate boots +2
         Upgrade(cid,item,1,2635,2634,item2) --Abdala Donate boots +3
     Upgrade(cid,item,1,2471,2467,item2) --Golden Helmet +1
     Upgrade(cid,item,1,2467,2482,item2) --Golden Helmet +2
         Upgrade(cid,item,1,2482,2486,item2) --Golden Helmet +3

     Upgrade(cid,item,1,5917,5924,item2) --Abdala Ice Helmet  +1
     Upgrade(cid,item,1,5924,6100,item2) --Abdala Ice Helmet  +2
         Upgrade(cid,item,1,6100,6099,item2) --Abdala Ice Helmet  +3

     Upgrade(cid,item,1,3968,3967,item2) --Abdala Ice Armor +1
     Upgrade(cid,item,1,3967,3969,item2) --Abdala Ice Armor +2
         Upgrade(cid,item,1,3969,3970,item2) --Abdala Ice Armor +3

     Upgrade(cid,item,1,3983,3974,item2) --Abdala Ice Legs +1
     Upgrade(cid,item,1,3974,3975,item2) --Abdala Ice Legs +2
         Upgrade(cid,item,1,3975,4863,item2) --Abdala Ice Legs +3

     Upgrade(cid,item,1,2644,2639,item2) --Abdala Ice Boots +1
     Upgrade(cid,item,1,2639,2638,item2) --Abdala Ice Boots +2
         Upgrade(cid,item,1,2638,2637,item2) --Abdala Ice Boots +3

     Upgrade(cid,item,1,6391,7877,item2) --Abdala Ice Shiled +1
     Upgrade(cid,item,1,7877,7878,item2) --Abdala Ice Shiled +2
         Upgrade(cid,item,1,7878,7879,item2) --Abdala Ice Shiled +3

end
    -- Light Gems <End/>
end



this upgrade for items ^^
this upgrade for\/ for weapon



function Upgrade(cid,item,gemscount,oldwand,newwand,item2)

  if item2.itemid == oldwand then   
        rand = math.random(1,10)
        position=getPlayerPosition(cid)
         if getPlayerItemCount(cid,item.itemid) >= gemscount then

        doPlayerRemoveItem(cid,item.itemid,gemscount)
            if rand > 10  then
                doPlayerSendTextMessage(cid,19,"Your Upgrade Has Been Failed")
                doSendAnimatedText(position,"Failed",TEXTCOLOR_RED)
                doSendMagicEffect(position,2)
            else

                doPlayerAddItem(cid,newwand,1)
                doPlayerSendTextMessage(cid,19,"Congratulations! Your Weapon Has Been Successfully Upgraded")
                doSendAnimatedText(position,"Succeed",TEXTCOLOR_RED)
                doSendMagicEffect(position,28)
                
            end
            doRemoveItem(item2.uid,1)
         end
  end

end

function onUse(cid, item, frompos, item2, topos)
-- Arch Gems <Start>
    if item.itemid == 7760 and getPlayerItemCount(cid,7760) >= 1 then
        Upgrade(cid,item,1,2424,7773,item2) --Abdala Donate wand +1
       Upgrade(cid,item,1,7773,7754,item2) --Abdala Donate wand +2
         Upgrade(cid,item,1,7754,7775,item2) --Abdala Donate wand +3

       Upgrade(cid,item,1,2446,7746,item2) --Abdala Donate Sword +1
       Upgrade(cid,item,1,7746,2449,item2) --Abdala Donate Sowrd +2
         Upgrade(cid,item,1,2449,7768,item2) --Abdala Donate Sowrd +3

       Upgrade(cid,item,1,2438,7763,item2) --Doom sword +1
       Upgrade(cid,item,1,7763,7744,item2) --Doom sword +2
         Upgrade(cid,item,1,7744,7765,item2) --Doom sword +3

       Upgrade(cid,item,1,5907,7870,item2) --Ice Arrow +1
       Upgrade(cid,item,1,7870,7371,item2) --Ice Arrow +2
         Upgrade(cid,item,1,7371,7369,item2) --Ice Arrow +3

       Upgrade(cid,item,1,7429,7770,item2) --Druid +1
       Upgrade(cid,item,1,7770,7751,item2) --Druid +2
         Upgrade(cid,item,1,7751,7752,item2) --Druid +3

       Upgrade(cid,item,1,2352,2356,item2) --Arrow +1
       Upgrade(cid,item,1,2356,2359,item2) --Arrow +2
         Upgrade(cid,item,1,2359,2371,item2) --Arrow +3

       Upgrade(cid,item,1,7367,7772,item2) --Power +1
       Upgrade(cid,item,1,7772,7753,item2) --Power +2
         Upgrade(cid,item,1,7753,7750,item2) --Power +3

       Upgrade(cid,item,1,2184,7776,item2) --Crstal +1
       Upgrade(cid,item,1,7776,7757,item2) --Crstal +2
         Upgrade(cid,item,1,7757,7769,item2) --Crstal +3

       Upgrade(cid,item,1,7387,7774,item2) --Sorc +1
       Upgrade(cid,item,1,7774,7755,item2) --Sorc +2
         Upgrade(cid,item,1,7755,7771,item2) --Sorc +3

       Upgrade(cid,item,1,2450,7766,item2) --Vip Sword +1
       Upgrade(cid,item,1,7766,7747,item2) --Vip Sword +2
         Upgrade(cid,item,1,7747,7749,item2) --Vip Sword +3

       Upgrade(cid,item,1,5947,5942,item2) --Donate bow +1
       Upgrade(cid,item,1,5942,5952,item2) --Donate bow +2
         Upgrade(cid,item,1,5952,6097,item2) --Donate bow +3

       Upgrade(cid,item,1,2445,7777,item2) --Ice wand +1
       Upgrade(cid,item,1,7777,7758,item2) --Ice wand +2
         Upgrade(cid,item,1,7758,7745,item2) --Ice wand +3


end
    -- Light Gems <End/>
end
 
Still gotting error:

2022-06-09 12:31:48 - [Error - Action Interface]
2022-06-09 12:31:48 - data/actions/scripts/upgrade.lua:eek:nUse
2022-06-09 12:31:48 - Description:
2022-06-09 12:31:48 - data/lib/upgradesystem.lua:142: attempt to index field '?' (a nil value)
2022-06-09 12:31:48 - stack traceback:
2022-06-09 12:31:48 - data/lib/upgradesystem.lua:142: in function 'refine'
2022-06-09 12:31:48 - data/actions/scripts/upgrade.lua:17: in function <data/actions/scripts/upgrade.lua:1>
 
Still gotting error:

2022-06-09 12:31:48 - [Error - Action Interface]
2022-06-09 12:31:48 - data/actions/scripts/upgrade.lua:eek:nUse
2022-06-09 12:31:48 - Description:
2022-06-09 12:31:48 - data/lib/upgradesystem.lua:142: attempt to index field '?' (a nil value)
2022-06-09 12:31:48 - stack traceback:
2022-06-09 12:31:48 - data/lib/upgradesystem.lua:142: in function 'refine'
2022-06-09 12:31:48 - data/actions/scripts/upgrade.lua:17: in function <data/actions/scripts/upgrade.lua:1>
I told you what to do lol The system I told you about is not added to this file .,,.>data/lib/upgradesystem.lua !!!!!!!!!
 
sorry, dont understand this way. I have understood your script its a different system...what i have to change?
You must add the items in items.otb to the same shape as the item you want and depending on how much development you want
If it is +5, you have to add 5 elements of the same shape
And you will add them in items xml According to the id you chose from itemsotb
And the text I sent you will upgrade the items
After changing the id in it to the id that you added
 
Back
Top