Postado Dezembro 5, 2019 5 anos Agora, DouGlaS Mapper disse: @Ramon RBN SIM - You see a steel helmet [Dodge: 5/5] (Arm:6). It weighs 46.00 oz. [Dodge: 5%] - You see a brass armor [Dodge: 3/5] (Arm:8). It weighs 80.00 oz. [Dodge: 1.6%] - You see brass legs [Dodge: 4/5] (Arm:5). It weighs 38.00 oz. [Dodge: 2.5%] - You see leather boots [Dodge: 5/5] (Arm:1). It weighs 9.00 oz. [Dodge: 8.1%] - You see a beholder shield [Dodge: 4/5] (Def:28). It weighs 47.00 oz. [Dodge: 2.8%] - You see a scarf [Dodge: 2/5] (Arm:1). It weighs 2.00 oz. [Dodge: 1%] - You see a crystal ring [Dodge: 2/5]. It weighs 0.90 oz. [Dodge: 0.7%] Oque ta aparecendo no LOOK: nPosition: [X:157] [Y:51] [Z:7]. [Frags: 0], [Critical: 200/200], [Dodge: 6%] Qual script que você usa para aparecer no look do item?
Postado Dezembro 5, 2019 5 anos Autor @Ramon RBN Essa: 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) dodge = 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 = 25, max = 35, chance = 40}, [5] = {min = 35, 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}, -- HELMET -- getPlayerSlotItem(cid, 2).uid) or isInArray({uid}, -- Aol -- getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, -- ARMOR -- getPlayerSlotItem(cid, 9).uid) or isInArray({uid}, -- RING -- getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, -- LEGS -- getPlayerSlotItem(cid, 8).uid) then -- BOOTS -- 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),"Dodge: " .. i .."") then dodge = i end end if dodge >= #upgrade then doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Este item ja esta no maximo de Dodge possivel!") return true end if math.random(0,100) <= upgrade[dodge + 1].chance then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Sucesso ao usar sua Dodge Stone!") setItemDodgePercent(itemEx.uid, atual + (math.random(upgrade[dodge+1].min,upgrade[dodge+1].max))/10) doItemSetAttribute(itemEx.uid,'name', getItemNameById(itemEx.itemid)..' [Dodge: ' ..dodge+1 .."/5]") doSendMagicEffect(toPosition, math.random(28,30)) else doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Sua Dodge Stone Falhou :(") doSendMagicEffect(toPosition, 4) end else doPlayerSendTextMessage(cid, 24,"You cant refine this item.") end return true end
Postado Dezembro 5, 2019 5 anos Tente uma dessas duas formas, talvez de certo: function getDodge(cid) local total = 0 for i = 1, 10 do total = total + (getItemAttribute(getPlayerSlotItem(cid, i), "dodgePercent") or 0) end return total end function getDodge(cid) local total = 0 for i = 1, 10 do total = total + (getItemAttribute(getPlayerSlotItem(cid, i).itemid, "dodgePercent") or 0) end return total end
Postado Dezembro 5, 2019 5 anos Autor @Ramon RBN Nem uma delas foi kkkk ambas mostram o dodge 0 no look e da esse ero na distro quando do look: [5/12/2019 11:56:46] [Error - CreatureScript Interface] [5/12/2019 11:56:46] data/creaturescripts/scripts/fraglook.lua:onLook [5/12/2019 11:56:46] Description: [5/12/2019 11:56:46] (LuaInterface::luaGetItemAttribute) Item not found
Postado Dezembro 5, 2019 5 anos 3 minutos atrás, DouGlaS Mapper disse: @Ramon RBN Nem uma delas foi kkkk ambas mostram o dodge 0 no look e da esse ero na distro quando do look: [5/12/2019 11:56:46] [Error - CreatureScript Interface] [5/12/2019 11:56:46] data/creaturescripts/scripts/fraglook.lua:onLook [5/12/2019 11:56:46] Description: [5/12/2019 11:56:46] (LuaInterface::luaGetItemAttribute) Item not found function getDodge(cid) local total = 0 for i = 1, 10 do item = getPlayerSlotItem(cid, i).itemid if item.itemid > 0 then total = total + (getItemAttribute(item, "dodgePercent") or 0) end end return total end Agora vai
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.