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

Action Item's Upgrading by Jewels! : )

Hello.
How does this exactly works? i use the item and it only says You cannot upgrade this item
thx
 
because you cannot upgrade:
* not moveable items
* runes
* stackable items
* containers
* corpses
 
dont work. i clik on the blue gem and says:
13:53 You successfuly upgraded blue gem to 1 level.
i supose to clik on the blue gem(jewel) and clik in the weapon for upgrade it. but when i clik in the blue gem upgrade blue gem
 
PHP:
Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaSetItemName(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaDoSetItemActionId(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemAttack(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemExtraAttack(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemDefense(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemExtraDefense(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemArmor(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemAttackSpeed(). Item not found

Lua Script Error: [Action Interface] 
data/actions/scripts/jewel.lua:onUse

luaGetItemHitChance(). Item not found
 
dont work. i clik on the blue gem and says:
13:53 You successfuly upgraded blue gem to 1 level.
i supose to clik on the blue gem(jewel) and clik in the weapon for upgrade it. but when i clik in the blue gem upgrade blue gem

Azi say:
because you cannot upgrade:
* not moveable items
:|
 
@Azi
If the upgrading fail the item will be destroyed , right?

Could you maybe make it so , when the upgrade fail it will return it to the normal state?
 
dont work. i clik on the blue gem and says:
13:53 You successfuly upgraded blue gem to 1 level.
i supose to clik on the blue gem(jewel) and clik in the weapon for upgrade it. but when i clik in the blue gem upgrade blue gem

Azi say:
because you cannot upgrade:
* not moveable items
:|

the item is moveable >.< blue gem id:2158
but i solved my problem work if the item is stacable

@topic
very nice action 10/10
 
Hahaha here you script is working man ty, i changed name "Upgrade" to Aging equal priston tale game. xP nice script and nice work... Ouupois ! i did it again.. Again Nice Work.

Cya :*
 
Can you make it so when u upgrade it changes the name of the item? example 19:41 You see a magic plate armor [15/20] upgrades +20 (Arm:417).
 
Can you make it so when u upgrade it changes the name of the item? example 19:41 You see a magic plate armor [15/20] upgrades +20 (Arm:417).

hmm, what is "upgrades +20" ? : )
[upgrades / maxUpgrades] ? :D
 
How do I change, the stats the weapon/armor is gaining?

Like when i'm enchanting magic sword 48 atk.
I don't want it to have 73 atk when it's +1 I want it to have 49 atk.. How do I fix this?
 
How do I change, the stats the weapon/armor is gaining?

Like when i'm enchanting magic sword 48 atk.
I don't want it to have 73 atk when it's +1 I want it to have 49 atk.. How do I fix this?

PHP:
-- Azi's item upgrading system --
config = {
    brokeChance = 50, -- % chance to broke upgrading item
    upgradePercent = 1, -- % of rise upgrading item atributtes
    maxUpgrade = 5, -- maximum level of item
    notAllowed = {} -- items id between comma which you cannot upgrade it
}
function onUse(cid, item, fromPosition, itemEx, toPosition)

    local getUpgraded = itemEx.actionid-10000
    if getUpgraded < 0 then
    getUpgraded = 0
    end
    if getUpgraded < config.maxUpgrade then
        if itemEx.itemid > 0 then
            if isItemMoveable(itemEx.itemid) == 1 and isItemRune(itemEx.itemid) == 0 and isCorpse(itemEx.uid) == 0 and isContainer(itemEx.uid) == 0 and isItemStackable(itemEx.itemid) == 0 and isItemFluidContainer(itemEx.itemid) == 0 and isInArray(config.notAllowed, itemEx.itemid) == 0 then
                if config.brokeChance <= math.random(1,100) then
                    setItemName(itemEx.uid, getItemNameById(itemEx.itemid) .. "+" .. (getUpgraded+1))
                    doSetItemActionId(itemEx.uid, 10000+(getUpgraded+1))
                    doSendMagicEffect(toPosition, 30)
                    doPlayerSendTextMessage(cid, 22, "You successfuly upgraded " .. getItemNameById(itemEx.itemid) .. " to " .. (getUpgraded+1) .. " level.")
                    if getItemAttack(itemEx.uid) > 0 then
                        setItemAttack(itemEx.uid, getItemAttack(itemEx.uid)+(math.ceil((getItemAttack(itemEx.uid)/100)*config.upgradePercent)))
                    end
                    if getItemExtraAttack(itemEx.uid) > 0 then
                        setExtraItemAttack(itemEx.uid, getExtraItemAttack(itemEx.uid)+(math.ceil((getExtraItemAttack(itemEx.uid)/100)*config.upgradePercent)))
                    end
                    if getItemDefense(itemEx.uid) > 0 then
                        setItemDefense(itemEx.uid, getItemDefense(itemEx.uid)+(math.ceil((getItemDefense(itemEx.uid)/100)*config.upgradePercent)))
                    end
                    if getItemExtraDefense(itemEx.uid) > 0 then
                        setItemExtraDefense(itemEx.uid, getItemExtraDefense(itemEx.uid)+(math.ceil((getItemExtraDefense(itemEx.uid)/100)*config.upgradePercent)))
                    end
                    if getItemArmor(itemEx.uid) > 0 then
                        setItemArmor(itemEx.uid, getItemArmor(itemEx.uid)+(math.ceil((getItemArmor(itemEx.uid)/100)*config.upgradePercent)))
                    end
                    if getItemAttackSpeed(itemEx.uid) > 0 then
                        setItemAttackSpeed(itemEx.uid, getItemAttackSpeed(itemEx.uid)+(math.ceil((getItemAttackSpeed(itemEx.uid)/100)*config.upgradePercent)))
                    end
                    if getItemHitChance(itemEx.uid) > 0 then
                        setItemHitChance(itemEx.uid, getItemHitChance(itemEx.uid)+(math.ceil((getItemHitChance(itemEx.uid)/100)*config.upgradePercent)))
                    end
                else
                    doPlayerSendTextMessage(cid, 22, "Item upgrading to level " .. (getUpgraded+1) .. " fail! You lose item!")
                    doRemoveItem(itemEx.uid, 1)
                    doSendMagicEffect(toPosition, 34)
                end
                doRemoveItem(item.uid, 1)
            else
                doPlayerSendCancel(cid, "You cannot upgrade this item!")
            end
        end
    else
        doPlayerSendCancel(cid, "This item is already upgraded to maximum item level.")
    end
        return TRUE
end
math.ceil and 1% upgrade :)
 
Sombody can add one condition (requirement?), when upgardeing item isn't put on topf the anvil (id: 2555), it can't be upgarded.

#Sorry, but I don't write very well in english.
 
Back
Top