Pesquisar na Comunidade
Mostrando resultados para as tags ''rings''.
Encontrado 1 registro
-
[22542] string of mending [13877] broken ring of ending [22516] ring of ending Data/actions/actions.xml: <action itemid="22542" script="string of mending.lua"/> Data/actions/scripts/string of mending.lua: ---- string of mending id "22542"----- local breakChance = 60 local brokenItems = { [13877] = {22516} -----Broken Ring Id "13877" Ring of ending "22516" } function onUse(cid, item, fromPosition, itemEx, toPosition) if brokenItems[itemEx.itemid] ~= nil then if math.random(100) <= breakChance then doRemoveItem(itemEx.uid) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You broke it.") doSendMagicEffect(getCreaturePosition(cid),17) else local newId = brokenItems[itemEx.itemid][math.random(#brokenItems[itemEx.itemid])] doTransformItem(itemEx.uid,newId) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You removed the broken Part, revealing a "..getItemName(newId)) doSendMagicEffect(getCreaturePosition(cid),48) end doRemoveItem(item.uid,1) return TRUE end return FALSE end Usando funções Tfs 1.x string of mending.lua ---- string of mending id "22542"----- local ITEMS = { [13877] = { -----Broken Ring Id "13877" Ring of ending "22516" {"ring of ending", 1.97} ----- 1.97 es la probabilidad de crear el item } } function onUse(cid, item, fromPosition, itemEx, toPosition) local cadena = ITEMS[itemEx.itemid] if cadena == nil then return false end local iEx = Item(itemEx.uid) local random, chance = math.random() * 100, 0 for i = 1, #cadena do chance = chance + cadena[i][2] if random <= chance then iEx:transform(cadena[i][1]) iEx:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) Item(item.uid):remove(1) return true end end iEx:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) Item(item.uid):remove(1) iEx:remove() return true end more Info Tibia Wiki