Thorn
Spriting since 2013
hiii, in my server i have two kind of upgrader stones, 1 (upgrader stone) is from +1 to +5........the second one (energy stone updrader) is from +5 to +10
every upgrade you make, the posibility to success decrease, which is ok, but the thing i'd like to request is a new upgrader stone that has 100% of success
here are the scripts of the two stone, idk if it's necesary but anyway:
oooh and another thing i'd like a lot is that the upgrade limit would be increased to +20 not +10
plzzzz if you help me with this i would be really thankful 
every upgrade you make, the posibility to success decrease, which is ok, but the thing i'd like to request is a new upgrader stone that has 100% of success
here are the scripts of the two stone, idk if it's necesary but anyway:
LUA:
local conf = {}
conf["level"] = {
-- [item_level] = {successParcent=PARCENT FOR UPGRADING SUCCESS, downrageLevel = IF UPGRADING FAIL - ITEM WAS DECRASED TO LEVEL HERE}
[1] = {successParcent = 85, downrageLevel = 0},
[2] = {successParcent = 75, downrageLevel = 1},
[3] = {successParcent = 65, downrageLevel = 2},
[4] = {successParcent = 55, downrageLevel = 3},
[5] = {successParcent = 50, downrageLevel = 0},
[6] = {successParcent = 30, downrageLevel = 0},
[7] = {successParcent = 25, downrageLevel = 0},
[8] = {successParcent = 20, downrageLevel = 0},
[9] = {successParcent = 15, downrageLevel = 0}
}
conf["upgrade"] = { -- how many parcent attributes are rised?
attack = 10, -- attack %
extraAttack = 0, -- extra Attack %
defense = 0, -- defence %
extraDefense = 0, -- extra defence %
armor = 20, -- armor %
hitChance = 50, -- hit chance %
}
-- // do not touch // --
-- Upgrading system v.3.1 by Azi [Ersiu] --
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, 30)
doPlayerSendTextMessage(cid, 22, "Congratz! El refinado a sido todo un Exito, Tu item ahora es mas fuerte!")
else
doSendMagicEffect(toPosition, 2)
doPlayerSendTextMessage(cid, 22, "Argh! El Refinado fallo... TU ITEM A PERDIDO FUERZA!")
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
LUA:
local conf = {}
conf["level"] = {
-- [item_level] = {successParcent=PARCENT FOR UPGRADING SUCCESS, downrageLevel = IF UPGRADING FAIL - ITEM WAS DECRASED TO LEVEL HERE}
[1] = {successParcent = 0, downrageLevel = 0},
[2] = {successParcent = 0, downrageLevel = 1},
[3] = {successParcent = 0, downrageLevel = 2},
[4] = {successParcent = 0, downrageLevel = 3},
[5] = {successParcent = 90, downrageLevel = 4},
[6] = {successParcent = 75, downrageLevel = 5},
[7] = {successParcent = 65, downrageLevel = 6},
[8] = {successParcent = 55, downrageLevel = 7},
[9] = {successParcent = 45, downrageLevel = 8},
[10] = {successParcent = 35, downrageLevel = 9}
}
conf["upgrade"] = { -- how many parcent attributes are rised?
attack = 10, -- attack %
extraAttack = 0, -- extra Attack %
defense = 0, -- defence %
extraDefense = 0, -- extra defence %
armor = 20, -- armor %
hitChance = 50, -- hit chance %
}
-- // do not touch // --
-- Upgrading system v.3.1 by Azi [Ersiu] --
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, 30)
doPlayerSendTextMessage(cid, 22, "Congratz! El refinado a sido todo un Exito, Tu item ahora es mas fuerte!")
else
doSendMagicEffect(toPosition, 2)
doPlayerSendTextMessage(cid, 22, "Argh! El Refinado fallo... TU ITEM A PERDIDO FUERZA!")
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
oooh and another thing i'd like a lot is that the upgrade limit would be increased to +20 not +10