• 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!

Skill Upgrading Stones for Equipment

nevereq

Member
Joined
Apr 16, 2011
Messages
51
Reaction score
5
I've found only this one, but i dont know how to change anything... maybe someone got simplier version?

Lua:
Hello! Im looking for Upgrade system with different types of upgrade. / or few scripts.
- ID:[aaaa] - adds 1mlvl to the item
- ID:[bbbb] - adds 1dist to the item
- ID:[cccc] - adds 1melee to the item
- ID:[dddd] - adds 1attack to the weapon
- ID:[eeee] - adds 1%hp to the item
 If someone knows/have one of those upgrading systems post it here. If You have some working upgrade system which could be base for this system also post it here and we can do it together. :) Ty Otlanders!

I also need Utito tempo for mages, which add mlvl for 30sec.

anyone? some ideas?

local conf = {}
 
conf["level"] = {
 [1] = {successParcent = 100, downrageLevel = 0},
 [2] = {successParcent = 90, downrageLevel = 1},
 [3] = {successParcent = 80, downrageLevel = 2},
 [4] = {successParcent = 70, downrageLevel = 3},
 [5] = {successParcent = 60, downrageLevel = 4},
 [6] = {successParcent = 50, downrageLevel = 5},
 [7] = {successParcent = 40, downrageLevel = 0},
 [8] = {successParcent = 30, downrageLevel = 0},
 [9] = {successParcent = 20, downrageLevel = 0},
 [10] = {successParcent = 10, downrageLevel = 0},
}
conf["upgrade"] = {
    attack = 5,
    extraAttack = 10,
    defense = 5,
    extraDefense = 10,
    armor = 5,
    hitChance = 5,
}
 
local upgrading = {
    upValue = function (value, level, parcent)
        if(not(value>0))then return 0 end
        for i=1,level do
            value = math.ceil(((value/100)*parcent)+value)+1
        end
        return (value > 0) and value or 0
    end,
 
    getLevel = function (item)
        local name = string.explode(getItemName(item), '+')
        return (#name == 1) and 0 or math.abs(name[2])
    end,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local getItem = getItemInfo(itemEx.itemid)
    if((getItem.weaponType > 0 or getItem.armor > 0) and not isItemStackable(itemEx.itemid))then
        local level = upgrading.getLevel(itemEx.uid)
        if(level < #conf["level"])then
            local nLevel = (conf["level"][(level+1)].successParcent >= math.random(1,100)) and (level+1) or conf["level"][level].downrageLevel
            if(nLevel > level)then
                doSendMagicEffect(toPosition, 117)
                doPlayerSendTextMessage(cid, 22, "Upgraded was successful!")
            else
                doSendMagicEffect(toPosition, 117)
                doPlayerSendTextMessage(cid, 22, "Upgrading fail!")
            end
            doItemSetAttribute(itemEx.uid, "name", getItem.name..((nLevel>0) and "+"..nLevel or ""))
            doItemSetAttribute(itemEx.uid, "attack",  upgrading.upValue(getItem.attack, nLevel, conf["upgrade"].attack))
            doItemSetAttribute(itemEx.uid, "extraattack", upgrading.upValue(getItem.extraAttack, nLevel, conf["upgrade"].extraAttack))
            doItemSetAttribute(itemEx.uid, "defense", upgrading.upValue(getItem.defense,nLevel, conf["upgrade"].defense))
            doItemSetAttribute(itemEx.uid, "extradefense", upgrading.upValue(getItem.extraDefense, nLevel, conf["upgrade"].extraDefense))
            doItemSetAttribute(itemEx.uid, "armor", upgrading.upValue(getItem.armor, nLevel, conf["upgrade"].armor))
            doItemSetAttribute(itemEx.uid, "hitChance", upgrading.upValue(getItem.hitChance,nLevel, conf["upgrade"].hitChance))
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendTextMessage(cid, 19, "Sorry this item is on max level.")
        end
    else
        doPlayerSendTextMessage(cid, 19, "You cannot upgrade this item.")
    end
end
 
Last edited:
you can probably do it for attack only cause there is no an attribute like health or mlvl.
doItemSetAttribute in this function you can do it.
 
Back
Top