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

Azi great script awsome job works perfect.
1 question is there anyway to add (magiclevelpoints) to be upgradeable also
If yes any idea how, Ive been messing with it with no luck at all.
Any help would be great thanks.
 
Hi, a question;

Which % i should add to the break chance if i want that players will have to try harder when turning items to +7 after +6 it will get harder i mean.

:)
 
It upgrade wands & rods & distance weapons (not ammo) too?

And what about the "new" enchanting system with the enchanted small stones? like "Fire Mistyic Blade +5" :O

:)
 
It's your problem then. Updating distro to latest version is one of hoster's duty. If you don't want to do it - don't count for help then! Live on your own.

Its not his proplem
Its you're proplem because ur an idiot
u know why?
he mean 2.1 or 2.2
then
he cant update his scripts that easy
and 2.2 is the stablest version and its 842
You're welcome:blink: ^_^
 
Here it is:
Code:
config = {
    brokeChance = 10,
    upgradePercent = 10,
    maxUpgrade = 100,
    notAllowed = {}
}
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 > 100 then
            if isItemMoveable(itemEx.itemid) == TRUE and isItemRune(itemEx.itemid) == FALSE and isCorpse(itemEx.uid) == FALSE and isContainer(itemEx.uid) == FALSE and isItemStackable(itemEx.itemid) == FALSE and isItemFluidContainer(itemEx.itemid) == FALSE and isInArray(config.notAllowed, itemEx.itemid) == FALSE 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)+((getItemAttack(itemEx.uid)/100)*config.upgradePercent))+1)
                    end        
                    if getItemExtraAttack(itemEx.uid) > 0 then
                        setExtraItemAttack(itemEx.uid, (getExtraItemAttack(itemEx.uid)+((getExtraItemAttack(itemEx.uid)/100)*config.upgradePercent))+1)
                    end            
                    if getItemDefense(itemEx.uid) > 0 then
                        setItemDefense(itemEx.uid, (getItemDefense(itemEx.uid)+((getItemDefense(itemEx.uid)/100)*config.upgradePercent))+1)
                    end            
                    if getItemExtraDefense(itemEx.uid) > 0 then
                        setItemExtraDefense(itemEx.uid, (getItemExtraDefense(itemEx.uid)+((getItemExtraDefense(itemEx.uid)/100)*config.upgradePercent))+1)
                    end        
                    if getItemArmor(itemEx.uid) > 0 then
                        setItemArmor(itemEx.uid, (getItemArmor(itemEx.uid)+((getItemArmor(itemEx.uid)/100)*config.upgradePercent))+1)
                    end        
                    if getItemAttackSpeed(itemEx.uid) > 0 then
                        setItemAttackSpeed(itemEx.uid, (getItemAttackSpeed(itemEx.uid)+((getItemAttackSpeed(itemEx.uid)/100)*config.upgradePercent))+1)
                    end        
                    if getItemHitChance(itemEx.uid) > 0 then
                        setItemHitChance(itemEx.uid, (getItemHitChance(itemEx.uid)+((getItemHitChance(itemEx.uid)/100)*config.upgradePercent))+1)
                    end
                else
                    doPlayerSendTextMessage(cid, 22, getItemNameById(itemEx.itemid).." 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

@to Azi
since 0.3.4 returns are using only boolean values, so now you HAVE to use:
Lua:
return TRUE
return FALSE
if(something == TRUE) then
if(something == FALSE) then

instead of

Lua:
return 1
return 0
if(something == 1) then
if(something == 0) then
 
I cant use.
21:19 Item upgrading to level 1 fail! You lose item!
That works, But i cant upgrade a weapon, help please.

I use tfs 0.2.1 mystic spirit
 
[07/06/2009 21:19:28] data/actions/scripts/vipsystem/upgrade.lua:18: attempt to call global 'getItemNameById' (a nil value)
[07/06/2009 21:19:28] stack traceback:
[07/06/2009 21:19:28] data/actions/scripts/vipsystem/upgrade.lua:18: in function <data/actions/scripts/vipsystem/upgrade.lua:8>
 
[07/06/2009 23:18:54] Lua Script Error: [Action Interface]
[07/06/2009 23:18:54] data/actions/scripts/upgrade.lua:eek:nUse

[07/06/2009 23:18:55] data/actions/scripts/upgrade.lua:16: attempt to call global 'getItemNameById' (a nil value)
[07/06/2009 23:18:55] stack traceback:
[07/06/2009 23:18:55] data/actions/scripts/upgrade.lua:16: in function <data/actions/scripts/upgrade.lua:7>

my error im using TFS 0.2
 
Back
Top