Postado Julho 11, 2014 10 anos Autor cara, se vc for usar esse script vc tem que deletar o outro dodge system.. Esse daqui é um arquivo.xml em mods, leia o tópico. A pedra que dá dodge percent nos itens é uma action sim, tá tudo escrito direitinho. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Julho 11, 2014 10 anos outra coisa aki quando ele usa varias vez ai tem uma vez q da falha né, ai na ora q da falha ele perdi o item né, tem como coloka pra ele não perder o item e quando da falha a porcentagem do dodge volta pra 0.0% tem como altera isso. rep + garantido.
Postado Julho 11, 2014 10 anos Autor function isHandItem(uid) -- NW based on Mock uid = uid or 0 if isInArray({1,2,3,4,5,6}, getItemWeaponType(uid)) then return true end return false end function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end function setItemDodgePercent(uid, percent) doItemSetAttribute(uid, "description", "[Dodge: "..percent.."%]") doItemSetAttribute(uid, "dodgePercent", percent) end function onUse(cid, item, fromPosition, itemEx, toPosition) level = 0 local upgrade = { [1] = {min = 1, max = 5, chance = 100}, [2] = {min = 5, max = 10, chance = 80}, [3] = {min = 10, max = 20, chance = 60}, [4] = {min = 20, max = 40, chance = 40}, [5] = {min = 40, max = 50, chance = 20} } function isWearing(uid) -- NW based on Mock uid = uid or 0 if isInArray({uid}, getPlayerSlotItem(cid, 1).uid) or isInArray({uid}, getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid) then return true end return false end if isHandItem(itemEx.uid) or isWearing(itemEx.uid) then local name = getItemName(itemEx.uid) local atual = math.floor(getItemDodgePercent(itemEx.uid)*10)/10 for i = 1, #upgrade do if string.find(tostring(name),"+".. i .."") then level = i end end if level >= #upgrade then doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your item is already on max level, you can't upgrade it any further.") return true end if math.random(0,100) <= upgrade[level + 1].chance then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You leveled your "..getItemNameById(itemEx.itemid).." to ".. level+1 ..".") setItemDodgePercent(itemEx.uid, atual + (math.random(upgrade[level+1].min,upgrade[level+1].max))/10) doItemSetAttribute(itemEx.uid,'name', getItemNameById(itemEx.itemid)..' +'..(level+1)) doSendMagicEffect(toPosition, math.random(28,30)) else setItemDodgePercent(itemEx.uid, 0) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your "..getItemNameById(item.itemid).." has failed and destroyed the dodge of your "..getItemNameById(itemEx.itemid).." in the process") doSendMagicEffect(toPosition, 4) end else doPlayerSendTextMessage(cid, 24,"You cant refine this item.") end return true end Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Julho 12, 2014 10 anos eu testei aqui e infelizmente não tem como haha daria pra colocar mas necessitaria de source editing... por lua oque dá pra fazer é criar um script que use a função que eu expliquei de criar itens já com o dodge pré definido ou então usar o script da pedra de dodge.. eu dei uma mexida nele e consegui quebrar uns galhos, ele tem muito que melhorar mas por ora ele tá 99% pronto pra ser colocado em algum server que utilize o dodge system. function isHandItem(uid) -- NW based on Mock uid = uid or 0 if isInArray({1,2,3,4,5,6}, getItemWeaponType(uid)) then return true end return false end function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end function setItemDodgePercent(uid, percent) doItemSetAttribute(uid, "description", "[Dodge: "..percent.."%]") doItemSetAttribute(uid, "dodgePercent", percent) end function onUse(cid, item, fromPosition, itemEx, toPosition) level = 0 local upgrade = { [1] = {min = 1, max = 5, chance = 100}, [2] = {min = 5, max = 10, chance = 80}, [3] = {min = 10, max = 20, chance = 60}, [4] = {min = 20, max = 40, chance = 40}, [5] = {min = 40, max = 50, chance = 20} } function isWearing(uid) -- NW based on Mock uid = uid or 0 if isInArray({uid}, getPlayerSlotItem(cid, 1).uid) or isInArray({uid}, getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid) then return true end return false end if isHandItem(itemEx.uid) or isWearing(itemEx.uid) then local name = getItemName(itemEx.uid) local atual = math.floor(getItemDodgePercent(itemEx.uid)*10)/10 for i = 1, #upgrade do if string.find(tostring(name),"+".. i .."") then level = i end end if level >= #upgrade then doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your item is already on max level, you can't upgrade it any further.") return true end if math.random(0,100) <= upgrade[level + 1].chance then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You leveled your "..getItemNameById(itemEx.itemid).." to ".. level+1 ..".") setItemDodgePercent(itemEx.uid, atual + (math.random(upgrade[level+1].min,upgrade[level+1].max))/10) doItemSetAttribute(itemEx.uid,'name', getItemNameById(itemEx.itemid)..' +'..(level+1)) doSendMagicEffect(toPosition, math.random(28,30)) else doRemoveItem(itemEx.uid, 1) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your "..getItemNameById(item.itemid).." has failed and destroyed your "..getItemNameById(itemEx.itemid).." in the process") doSendMagicEffect(toPosition, 4) end else doPlayerSendTextMessage(cid, 24,"You cant refine this item.") end return true end Note que pra colocar dodge num item ele tem que: Estar equipado se for qualquer tipo de armadura (legs, boots, helmet, armor) ou livremente (se for weapon/shield).. Necklaces, rings e pendants não são possíveis de colocar dodge.. se vc quiser que seja edita essa função dentro do script pros slots de ring e necklace mas eu não aconselharia a fazer isso. function isWearing(uid) -- NW based on Mock uid = uid or 0 if isInArray({uid}, getPlayerSlotItem(cid, 1).uid) or isInArray({uid}, getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid) then return true end return false end e no xml coloque: <action itemid="8306" script=upgraderock.lua"/> como faço para colocar só em shield, legs, shield e legs?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.