Antiemoxlr 3 Postado Fevereiro 15, 2010 Share Postado Fevereiro 15, 2010 Eu tenho esse Systema de Upgrade Token Mas.. eu keria Modificalo e Nao consigo eu keria q o nome +1 vise na frente do armor por exemplo +1 Demon Armor Mas nao consigo eu keria uma coisa assim tb tipoOoOo q quando vc Usa O upgrade ele vira +1 demon armor (arm:18). com uma especial descrisao com o nome do player q usou este item +1 demon armor(arm:18). It Belong To nome do player e quando vc usase o upgrade ele da +1 de todos os skills e em Boots q desem mais speed poresemplo 1 upgrade adiciona +10% de Speed em Uma Boots...... local conf = {} -- // config // -- conf.maxItemLevel = 15 -- max item level conf.successChance = 50 -- succes upgrade chance conf["upgrade"] = { -- how many parcent attributes are rised? attack = 5, -- attack % extraAttack = 10, -- extra Attack % defence = 5, -- defence % extraDefence = 10, -- extra defence % armor = 5, -- armor % attackSpeed = 3, -- attack speed % hitChance = 5, -- hit chance % shootRange = 2, -- shoot range % } --// end // -- function getItemInfo(item) local attr = {} local name = string.explode(getItemName(item), '+'); if #name == 1 then attr.name = name[1] attr.level = math.abs(0) else attr.level = math.abs(name[2]) attr.name = name[1] end attr.attack = (getItemAttack(item) > 0) and getItemAttack(item) or 0 attr.extraAttack = (getItemExtraAttack(item) > 0) and getItemExtraAttack(item) or 0 attr.defence = (getItemDefense(item) > 0) and getItemDefense(item) or 0 attr.extraDefence = (getItemExtraDefense(item) > 0) and getItemExtraDefense(item) or 0 attr.armor = (getItemArmor(item) > 0) and getItemArmor(item) or 0 attr.attackSpeed = (getItemAttackSpeed(item) > 0) and getItemAttackSpeed(item) or 0 attr.hitChance = (getItemHitChance(item) > 0) and getItemHitChance(item) or 0 attr.shootRange = (getItemShootRange(item) > 0) and getItemShootRange(item) or 0 attr.weight = (getItemWeight(item) > 0) and getItemWeight(item) or 0 return attr end function upgradeValue(value, parcent) local newValue = math.ceil(((value/100)*parcent)+value) return (newValue > 0) and newValue or 0 end function onUse(cid, item, fromPosition, itemEx, toPosition) if toPosition.x == 65535 then local upgradingItem = getItemInfo(itemEx.uid) if (upgradingItem.attack > 0 or upgradingItem.defence > 0 or upgradingItem.armor > 0 or upgradingItem.shootRange > 1) then if (upgradingItem.level < conf.maxItemLevel) then if conf.successChance >= math.random(1,100) then setItemName(itemEx.uid, upgradingItem.name.." + "..(upgradingItem.level+1)) setItemAttack(itemEx.uid, upgradeValue(upgradingItem.attack, conf["upgrade"].attack)) setItemExtraAttack(itemEx.uid, upgradeValue(upgradingItem.extraAttack, conf["upgrade"].extraAttack)) setItemDefense(itemEx.uid, upgradeValue(upgradingItem.defence, conf["upgrade"].defence)) setItemExtraDefense(itemEx.uid, upgradeValue(upgradingItem.extraDefence, conf["upgrade"].extraDefence)) setItemArmor(itemEx.uid, upgradeValue(upgradingItem.armor, conf["upgrade"].armor)) setItemAttackSpeed(itemEx.uid, upgradeValue(upgradingItem.attackSpeed, conf["upgrade"].attackSpeed)) setItemHitChance(itemEx.uid, upgradeValue(upgradingItem.hitChance, conf["upgrade"].hitChance)) setItemShootRange(itemEx.uid, upgradeValue(upgradingItem.shootRange, conf["upgrade"].shootRange)) doSendMagicEffect(toPosition, 30) doPlayerSendTextMessage(cid, 22, "Upgraded was successful, your item has become stronger!") else doRemoveItem(itemEx.uid, itemEx.type) doSendMagicEffect(toPosition, 2) doPlayerSendTextMessage(cid, 22, "Upgrading fail... you lost upgraded item!") end doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "This item is on max level!") end else doPlayerSendCancel(cid, "You cannot upgrade this item!") end else doPlayerSendCancel(cid, "You can upgrading items only in inventory!") end return TRUE; end ---------------------------------------------------- Se poderem me ajudar nisso eu agradeso em 100% e ajudo com divugasao do ot e com site fake do ot Link para o comentário Compartilhar em outros sites More sharing options...
DevilMoon 125 Postado Fevereiro 18, 2010 Share Postado Fevereiro 18, 2010 ok vamos la tente assim... http://www.sotserv.blogspot.com/ entre neste site vá a scripters > do lado direito e clica upgrade iten +1 la explica como fazer o iten fika assim como tu quer n botei o link logo pq aki sei la ta 1 lerdesa e n abre os coisas de ka > mais entra e tenta ai ok axei vamos la agora fiz do meu geito huahuahua tipow neste sistema tem q melhorando com joias ... joias que tu nem usa no jogo como as gem ... vá em Actions/scripts/upgrade.lua -- Azis item upgrading system -- config = { brokeChance = 10, -- % chance to broke upgrading item upgradePercent = 10, -- % of rise upgrading item atributtes maxUpgrade = 100, -- 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 > 100 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)+((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 e o tag bota em Action.xml <action itemid="2147" script="upgrade.lua"/> Espero Que Tenha Ajudado :S Link para o comentário Compartilhar em outros sites More sharing options...
Antiemoxlr 3 Postado Fevereiro 18, 2010 Autor Share Postado Fevereiro 18, 2010 valew mesmo ;d Link para o comentário Compartilhar em outros sites More sharing options...
Henrique Moura 193 Postado Fevereiro 18, 2010 Share Postado Fevereiro 18, 2010 Agradeço pela colaboração com o membro, e você ganhará um ponto de reputação. Tópico fechado, Grato. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados