Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
14 minutos atrás, xWhiteWolf disse:

faz um evento onLook ou modifica na source pra quando dar look fazer um for pegando todos os itens equipados e usando essa função aqui neles:


function getItemDodgePercent(itemuid)
return getItemAttribute(itemuid, "dodgePercent") or 0
end

o dodge mostrado tem que ser a soma dos dodges de cada item equipado.

 

Eu tenho um sistema de look no meu servidor, ele mostra os Frags/Deaths/Critical e tbm mostra o Dodge so que daquele seu sistema de dodge por storage... teria como eu configurar esse para aparecer o Dodge em porcentagem para esse sistema de Dodge nos itens ? 

Estou usando o sistema de colocar dodge nos itens por 1 pedra e usando o System Mod para calcular a porcentagem de Dodge e executar o comando para ativar o Dodge... Porém so me falta agora aparecer no look do personagem que não estou conseguindo fazer... Segue o meu sistema de LOOK SYSTEM:

function getDeaths(cid)
   local query, d = db.getResult("SELECT `player_id` FROM `player_killers` WHERE `player_id` = " ..getPlayerGUID(cid)), 0
   if (query:getID() ~= -1) then
      repeat
         d = d+1
      until not query:next()
      query:free()
   end
   return d  
end

function getPlayerFrags(cid)
    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {date = result:getDataInt("date")}
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end
 
    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }
    return size.day + size.week + size.month
end

function onLook(cid, thing, position, lookDistance)
   if isPlayer(thing.uid) and thing.uid ~= cid then
      return doPlayerSetSpecialDescription(thing.uid, '\n'.. '[Frags: ' .. getPlayerFrags(thing.uid) .. ' / Deaths: ' .. getDeaths(thing.uid) .. '], [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48902)) or 0))..']')
   elseif thing.uid == cid then
      local string = 'You see yourself.'
      if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
         string = string..' You are '.. getPlayerGroupName(cid) ..'.'
      elseif getPlayerVocation(cid) ~= 0 then
         string = string..' You are '.. getPlayerVocationName(cid) ..'.'
      else
         string = string..' You have no vocation.'
      end
               

      if getPlayerGuildId(cid) > 0 then
         string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
         string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
      end
      
      string = string..'\n'.. '[Frags: ' .. getPlayerFrags(cid) .. ' / Deaths: ' .. getDeaths(cid) .. ']'

      if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
         string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
         string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
      end

      if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
         string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
      end
      return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
   end
   return 1
end

 

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

Top Posters In This Topic

Most Popular Posts

  • 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.

  • 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

Posted Images

Postado
  • Autor

seu dodge mostrado é isso aqui 

[Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48902)) or 0))..']')


ele tem que ser isso aqui:

local function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end
local dodge = 0
for i = 1, 10 do
local item = getgetPlayerSlotItem(thing.uid, i).uid
dodge = dodge + math.max(0, getItemDodgePercent(item))
end
[Dodge: '..dodge..']')

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

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
  • Autor
1 hour ago, Calidoress said:

puedes postear el codigo completo para realizar la edetacion en la source?

no es necesario hacer edicion en la source, tiene que colocar el codigo en los mods de tu servidor

 

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

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
Em 24/08/2017 em 19:45, xWhiteWolf disse:

seu dodge mostrado é isso aqui 


[Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48902)) or 0))..']')


ele tem que ser isso aqui:

local function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end
local dodge = 0
for i = 1, 10 do
local item = getgetPlayerSlotItem(thing.uid, i).uid
dodge = dodge + math.max(0, getItemDodgePercent(item))
end
[Dodge: '..dodge..']')

 

Como eu coloco essa parte no meu System de Look ? 
Tentei diversas formas e todas deram erro... pode me dizer como e onde colocar ? ou pegar meu sistema que disponibilizei anteriormente e alterar para mim ?

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