Ir para conteúdo

Featured Replies

Postado
if math.random(0,100) <= upgrade[level + 1].chance then 
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Voce elevou seu "..getItemNameById(itemEx.itemid).." para ".. 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(item.uid, 1)
doItemSetAttribute(itemEx.uid,'name', getItemNameById(itemEx.itemid)..' +'..(level-1))
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Seu "..getItemNameById(item.itemid).."falhou e seu "..getItemNameById(itemEx.itemid).." perdeu 1 level no processo.")
doSendMagicEffect(toPosition, 4)
end


como que eu faço pra colocar pra aumentar "arm" e "def" ?

Editado por azzouks (veja o histórico de edições)

  • Respostas 61
  • Visualizações 11.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Fala galera do TK, hoje vim trazer pra vocês à pedidos do grande @azzouks uma versão do meu Dodge System por equips. Explicação: É um sistema onde vc pode colocar uma % de esquiva nos itens e ao usá

  • Mais bonito que isso só o VittinG! Excelente lindão, continue sempre assim, reputado.

  • function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end function setItemDodgePercent(uid, percent) doItemSetAttribute(uid, "description", "[Dodge: "..percent.

Posted Images

Postado
  • Autor

usa outro script uhauhauha meu server tá com as funções getItemArmor e getItemAttribute bugadas então não tem como eu ficar testando pra ver se consigo fazer isso.. se quiser isso vai ter que usar outro sistema de upgrade, o meu é só de dodge

Postado

tem como na hora  ele desvia com o Dodge ai aparece o nome Dodge saindo do player ?

 

colokando nesse script abaixo.

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

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo