lucasatak 14 Postado Setembro 22, 2009 Share Postado Setembro 22, 2009 (editado) Sistema de Refinamento ! Nome: Sistema de Refinamento ! Versão: 8.5x Tipo do script: Action. Servidor Testado: The Forgotten Server 0.3.5 Autor: jordanhenry (Otland) & kakareco Vamos lá , 1° coisa a fazer é ir em data\actions\scripts copie e cole qualquer arquivo, renomei-o para upgrade.lua, abra-o, apague tudo oque tiver dentro e coloque: local messagetype = MESSAGE_EVENT_ORANGElocal fetishs = { [7800] = {chance = 100, amount = 10, set = setItemAttack, get = getItemAttack, name = "attack"}, [7801] = {chance = 100, amount = 10, set = setItemAttack, get = getItemAttack, name = "attack"}, [7802] = {chance = 100, amount = 10, set = setItemAttack, get = getItemAttack, name = "attack"}, [7803] = {chance = 100, amount = 10, set = setItemAttack, get = getItemAttack, name = "attack", destroy = TRUE}, [7804] = {chance = 100, amount = 10, set = setItemAttack, get = getItemAttack, name = "attack", destroy = TRUE}, [7805] = {chance = 100, amount = 10, set = setItemDefense, get = getItemDefense, name = "defense"}, [7806] = {chance = 100, amount = 10, set = setItemDefense, get = getItemDefense, name = "defense"}, [7807] = {chance = 100, amount = 10, set = setItemDefense, get = getItemDefense, name = "defense"}, [7808] = {chance = 100, amount = 10, set = setItemDefense, get = getItemDefense, name = "defense", destroy = TRUE}, [7809] = {chance = 100, amount = 10, set = setItemDefense, get = getItemDefense, name = "defense", destroy = TRUE}, [7810] = {chance = 100, amount = 10, set = setItemArmor, get = getItemArmor, name = "armor"}, [7811] = {chance = 100, amount = 10, set = setItemArmor, get = getItemArmor, name = "armor"}, [7812] = {chance = 100, amount = 10, set = setItemArmor, get = getItemArmor, name = "armor"}, [7813] = {chance = 100, amount = 10, set = setItemArmor, get = getItemArmor, name = "armor", destroy = TRUE}, [7814] = {chance = 100, amount = 10, set = setItemArmor, get = getItemArmor, name = "armor", destroy = TRUE}, [7815] = {chance = 100, amount = 10, set = setItemShootRange, get = getItemShootRange, name = "range"}, [7816] = {chance = 100, amount = 10, set = setItemShootRange, get = getItemShootRange, name = "range"}, [7817] = {chance = 100, amount = 10, set = setItemShootRange, get = getItemShootRange, name = "range"}, [7818] = {chance = 100, amount = 10, set = setItemShootRange, get = getItemShootRange, name = "range", destroy = TRUE}, [7819] = {chance = 20, amount = 10, set = setItemShootRange, get = getItemShootRange, name = "range", destroy = TRUE}, [7850] = {chance = 100, amount = 10, set = setItemAttack, get = getItemAttack, name = "attack"}, -- only given when access >= 5 [7851] = {chance = 100, amount = 10, set = setItemDefense, get = getItemDefense, name = "defense"}, -- only given when access >= 5 [7852] = {chance = 100, amount = 10, set = setItemArmor, get = getItemArmor, name = "armor"}, -- only given when access >= 5 [7853] = {chance = 100, amount = 10, set = setItemShootRange, get = getItemShootRange, name = "range"} -- only given when access >= 5 } local minmax = { min1 = 7800, -- minimum of the random fetishs for access < 5 max1 = 7819, -- maximum of the random fetishs for access < 5 min2 = 7850, -- minimum of the random fetishs for access >= 5 max2 = 7853, -- maximum of the random fetishs for access >= 5 } -- WARNING: look further down and your eyes will burn. -- function onUse(cid, item, fromPosition, itemEx, toPosition) if item.actionid == 0 then local new = getPlayerAccess(cid) >= 5 and math.random(minmax.min2, minmax.max2) or math.random(minmax.min1, minmax.max1) local text = "You remove the dust and revealed that it is a "..fetishs[new].chance.."% fetish for "..fetishs[new].name.." +"..fetishs[new].amount.."."..(fetishs[new].destroy ~= nil and " It has a slight chance of breaking your item." or "") doPlayerSendTextMessage(cid, messagetype, text) doSetItemActionId(item.uid, new) doSetItemSpecialDescription(item.uid, text) setItemName(item.uid, fetishs[new].chance.."% fetish for "..fetishs[new].name.." +"..fetishs[new].amount) elseif fetishs[item.actionid] ~= nil then if fetishs[item.actionid].get(itemEx.uid) > 0 then if itemEx.actionid < 110 then local amount = math.max(0, itemEx.actionid - 100) local chance = math.random(0, 100) local text = fetishs[item.actionid].name.." upgrade on "..getItemNameById(itemEx.itemid).." failed." if chance <= fetishs[item.actionid].chance then fetishs[item.actionid].set(itemEx.uid, (fetishs[item.actionid].get(itemEx.uid)+fetishs[item.actionid].amount)) text = getItemNameById(itemEx.itemid).." "..fetishs[item.actionid].name.." +"..fetishs[item.actionid].amount.."." elseif fetishs[item.actionid].destroy ~= nil or fetishs[item.actionid].destroy == TRUE then if math.random(0, 1) == 1 then doRemoveItem(itemEx.uid) text = getItemNameById(itemEx.itemid).." has been destroyed." end end doPlayerSendTextMessage(cid, messagetype, text) doSetItemActionId(itemEx.uid, 100+(amount+1)) setItemName(itemEx.uid, getItemNameById(itemEx.itemid).." (Level "..(amount+1)..")") doSendMagicEffect(toPosition, (chance <= fetishs[item.actionid].chance and 13 or 2)) doSendAnimatedText(toPosition, (chance <= fetishs[item.actionid].chance and "Success!" or "Failed!"),(chance <= fetishs[item.actionid].chance and TEXTCOLOR_WHITE or TEXTCOLOR_RED)) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "This weapon has already been upgraded 10 times.") end else doPlayerSendCancel(cid, "This item may not be upgraded.") end else doPlayerSendCancel(cid, "Sorry, not possible.") end return TRUE end Salve e fexe. Agora em actions.xml adicione as linhas: <!--Upgrade--> <action fromid="9743" toid="9744" event="script" value="upgrade.lua"/> Salve e fexe. EXPLICANDO: *chance = 100 : Chance de sucesso para refinar o equipamento ou arma. *amount = 10 : O quanto aumentará se obtiver sucesso. *set = setItemAttack : O tipo que ele aumenta.(defense,attack,Armor,Range e etc...)*destroy = TRUE : O iten quebra e em FALSE nao OBS Item Usado é tipo o Life Crystal,qualquer coisa mude o id do item Creditos: 90% para jordanhenry (Otland) e modificado por jajajiji 10% para o kakareco, por ter trazido ao xtibia e por ter modificado algumas coisas. Quero que use a fan bar deles em Espero ter ajudado! Editado Setembro 22, 2009 por lucasatak Link para o comentário Compartilhar em outros sites More sharing options...
Kakareco 2 Postado Setembro 22, 2009 Share Postado Setembro 22, 2009 ~~Vlw ae lucasatak~~. Link para o comentário Compartilhar em outros sites More sharing options...
icaro2512 0 Postado Setembro 22, 2009 Share Postado Setembro 22, 2009 Parabens mano!!! Eu estava procurando esse sistema a decada!! Testando aque... tomare que funfe!! Link para o comentário Compartilhar em outros sites More sharing options...
lucasatak 14 Postado Setembro 22, 2009 Autor Share Postado Setembro 22, 2009 Caso nao funcione,veja qual a versao do seu .exe e depois me fale,e se nao funcionar mesmo assim,eu e kakareco tentaremos resolver para você. Link para o comentário Compartilhar em outros sites More sharing options...
icaro2512 0 Postado Setembro 22, 2009 Share Postado Setembro 22, 2009 Aqui acontece o seguinte, ele usa aparece a mensagem "22:09 You remove the dust and revealed that it is a 100% fetish for range +10." mas o item continua com o msm ataque... fiz algo errado? Link para o comentário Compartilhar em outros sites More sharing options...
lucasatak 14 Postado Setembro 22, 2009 Autor Share Postado Setembro 22, 2009 Não kra,mais é o seguinte,ele nao funciona com todas as armas,quando funcionar vai aparecer assim : "Sucess" e estará refinado. Link para o comentário Compartilhar em outros sites More sharing options...
Ivomec 0 Postado Setembro 23, 2009 Share Postado Setembro 23, 2009 Script bom,apesar de existir mais complexos e mais simples de fazer. Link para o comentário Compartilhar em outros sites More sharing options...
Victinho21 0 Postado Outubro 7, 2009 Share Postado Outubro 7, 2009 aew lucas, vlw aew, muito bom mesmo, primeira vez q vejo algo assim. ^^ bom trabalho Link para o comentário Compartilhar em outros sites More sharing options...
babyloco 1 Postado Outubro 24, 2009 Share Postado Outubro 24, 2009 Nossa muito bom mesmo otimo para realçar o RPG nos OT muito bom APROVADO Link para o comentário Compartilhar em outros sites More sharing options...
rooxy1997 0 Postado Novembro 9, 2009 Share Postado Novembro 9, 2009 Muito BOM ! Gostei Muito !! Parabéns, todos os seus Tutoriais estão muito bom ! PARABÉNS ! :smile_positivo: Link para o comentário Compartilhar em outros sites More sharing options...
Ayame 0 Postado Novembro 17, 2009 Share Postado Novembro 17, 2009 ai qndo voce aparecer por akie podia me explikar direito como funciona isso? nao entendi muito bem ! Link para o comentário Compartilhar em outros sites More sharing options...
xiahoudunbr 1 Postado Novembro 21, 2009 Share Postado Novembro 21, 2009 alguem pode me ajudar ? mudei o ID aki pra 9971 .. e não da certo... temcomo explica como funciona ... abrass Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados