Ir para conteúdo
  • Cadastre-se

(Resolvido)da uma ajudinha ai os fodão!


Ir para solução Resolvido por Vodkart,

Posts Recomendados

  • Sub-Admin

fala galera da pesada eu estou tentando remover o maldito price desse script quero deixar a boost level, aparecer nome dos item, npc, summon e pokemon capturados da um help ai só pra quem manja mais do que eu kkkk

 

"System Look"

 

-- tabela adicionado ao configuration só procura por price = ..--

function onLook(cid, thing, position, lookDistance)
                                                                                                                 
local str = {}
local iname = getItemInfo(thing.itemid)
                                                                                         
if not isCreature(thing.uid) then
   if not iname or not iname.name then return true end
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then --alterado aki      
      local owner = getItemAttribute(thing.uid, "firstpoke")
      local pokename = getItemAttribute(thing.uid, "poke")  
      if shinys[pokename] then
         pokename = shinys[pokename]
      end
         
      local ballName = iname.name
      if getItemAttribute(thing.uid, 'ball') then
         ballName = getItemAttribute(thing.uid, 'ball').. " ball"
      end
      table.insert(str, "You see "..iname.article.." "..ballName..".") 
      if getItemAttribute(thing.uid, "unique") then                   
         table.insert(str, " It's an unique item.")  
      end
      table.insert(str, "\nContains "..getArticle(pokename).." "..pokename)
         
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, " ("..getItemAttribute(thing.uid, "nick")..")")
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
      if boost > 0 then
         table.insert(str, " +"..boost)
      end
      if prices[pokename] then
         table.insert(str, ". $Price: ".. prices[pokename].."")
      else
         table.insert(str, ". Price: unsellable")
      end
      table.insert(str, ".")
         
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false        
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then    
      local name = iname.name
            name = string.gsub(name, "fainted ", "")
            name = string.gsub(name, "defeated ", "")
            name = doCorrectPokemonName(name)
      if shinys[name] then
         name = shinys[name]
      end
      name = "fainted "..name:lower()
          
      table.insert(str, "You see "..iname.article.." "..name..". ")    
      if isContainer(thing.uid) then
         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      end
      table.insert(str, "\n")
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   elseif isContainer(thing.uid) then    --containers
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else  
         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
         
      local price = prices[doCorrectString(iname.name)]
      if price then
         local finalPrice = thing.type > 1 and thing.type * price or price
         table.insert(str, " Price: $".. finalPrice ..".")
      end
         
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")    
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") 
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   else  
      local p = getThingPos(thing.uid)
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      if getItemAttribute(thing.uid, "unique") then
         table.insert(str, " It's an unique item.")
      end
      local price = prices[doCorrectString(iname.name)]
      if price then
         local finalPrice = thing.type > 1 and thing.type * price or price
         table.insert(str, " Price: $".. finalPrice ..".")
      end
      table.insert(str, "\n"..iname.description)
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return true
   end
end

if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end

if isPlayer(thing.uid) then      --player
local player = thing.uid
local vip = getPlayerPremiumDays(player) > 1 and "Premuim" or "Not Premuim"
  local msg = ""..getCreatureName(player).."-Level "..getPlayerLevel(player).."-"..vip..""
--doShowLookPlayer(cid, player, msg)
return false
end

if getCreatureName(thing.uid) == "Evolution" then return false end

if not isSummon(thing.uid) then   --monstros
  
   local pokename = getCreatureName(thing.uid)
   if shinys[pokename] then
          pokename = shinys[pokename]
   end
   table.insert(str, "You see a wild "..string.lower(pokename)..".\n")
   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false

elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons

   local pokename = getCreatureName(thing.uid)
   if shinys[pokename] then
          pokename = shinys[pokename]
   end
          
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   if getCreatureMaster(thing.uid) == cid then
          local myball = getPlayerSlotItem(cid, 8).uid
          table.insert(str, "You see your "..string.lower(pokename)..".")
          if boostlevel > 0 then
                 table.insert(str, "\nBoost level: +"..boostlevel..".")
          end
          table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(pokename)..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end

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

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites
  • Solução

-- tabela adicionado ao configuration só procura por price = ..--
function onLook(cid, thing, position, lookDistance)
                                                                                                                 
local str = {}
local iname = getItemInfo(thing.itemid)
                                                                                         
if not isCreature(thing.uid) then
   if not iname or not iname.name then return true end
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then --alterado aki      
      local owner = getItemAttribute(thing.uid, "firstpoke")
      local pokename = getItemAttribute(thing.uid, "poke")  
      if shinys[pokename] then
         pokename = shinys[pokename]
      end
         
      local ballName = iname.name
      if getItemAttribute(thing.uid, 'ball') then
         ballName = getItemAttribute(thing.uid, 'ball').. " ball"
      end
      table.insert(str, "You see "..iname.article.." "..ballName..".") 
      if getItemAttribute(thing.uid, "unique") then                   
         table.insert(str, " It's an unique item.")  
      end
      table.insert(str, "\nContains "..getArticle(pokename).." "..pokename)
         
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, " ("..getItemAttribute(thing.uid, "nick")..")")
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
      if boost > 0 then
         table.insert(str, " +"..boost)
      end
      table.insert(str, ".")
         
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false        
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then    
      local name = iname.name
            name = string.gsub(name, "fainted ", "")
            name = string.gsub(name, "defeated ", "")
            name = doCorrectPokemonName(name)
      if shinys[name] then
         name = shinys[name]
      end
      name = "fainted "..name:lower()
          
      table.insert(str, "You see "..iname.article.." "..name..". ")    
      if isContainer(thing.uid) then
         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      end
      table.insert(str, "\n")
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   elseif isContainer(thing.uid) then    --containers
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else  
         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
     
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")    
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") 
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   else  
      local p = getThingPos(thing.uid)
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      if getItemAttribute(thing.uid, "unique") then
         table.insert(str, " It's an unique item.")
      end
      table.insert(str, "\n"..iname.description)
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return true
   end
end
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if isPlayer(thing.uid) then      --player
local player = thing.uid
local vip = getPlayerPremiumDays(player) > 1 and "Premuim" or "Not Premuim"
  local msg = ""..getCreatureName(player).."-Level "..getPlayerLevel(player).."-"..vip..""
--doShowLookPlayer(cid, player, msg)
return false
end
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then   --monstros
  
   local pokename = getCreatureName(thing.uid)
   if shinys[pokename] then
          pokename = shinys[pokename]
   end
   table.insert(str, "You see a wild "..string.lower(pokename)..".\n")
   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons
   local pokename = getCreatureName(thing.uid)
   if shinys[pokename] then
          pokename = shinys[pokename]
   end
          
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   if getCreatureMaster(thing.uid) == cid then
          local myball = getPlayerSlotItem(cid, 8).uid
          table.insert(str, "You see your "..string.lower(pokename)..".")
          if boostlevel > 0 then
                 table.insert(str, "\nBoost level: +"..boostlevel..".")
          end
          table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(pokename)..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • Sub-Admin

vou testar!


-- tabela adicionado ao configuration só procura por price = ..--
function onLook(cid, thing, position, lookDistance)
                                                                                                                 
local str = {}
local iname = getItemInfo(thing.itemid)
                                                                                         
if not isCreature(thing.uid) then
   if not iname or not iname.name then return true end
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then --alterado aki      
      local owner = getItemAttribute(thing.uid, "firstpoke")
      local pokename = getItemAttribute(thing.uid, "poke")  
      if shinys[pokename] then
         pokename = shinys[pokename]
      end
         
      local ballName = iname.name
      if getItemAttribute(thing.uid, 'ball') then
         ballName = getItemAttribute(thing.uid, 'ball').. " ball"
      end
      table.insert(str, "You see "..iname.article.." "..ballName..".") 
      if getItemAttribute(thing.uid, "unique") then                   
         table.insert(str, " It's an unique item.")  
      end
      table.insert(str, "\nContains "..getArticle(pokename).." "..pokename)
         
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, " ("..getItemAttribute(thing.uid, "nick")..")")
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
      if boost > 0 then
         table.insert(str, " +"..boost)
      end
      table.insert(str, ".")
         
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false        
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then    
      local name = iname.name
            name = string.gsub(name, "fainted ", "")
            name = string.gsub(name, "defeated ", "")
            name = doCorrectPokemonName(name)
      if shinys[name] then
         name = shinys[name]
      end
      name = "fainted "..name:lower()
          
      table.insert(str, "You see "..iname.article.." "..name..". ")    
      if isContainer(thing.uid) then
         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      end
      table.insert(str, "\n")
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   elseif isContainer(thing.uid) then    --containers
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else  
         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
     
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")    
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") 
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
   else  
      local p = getThingPos(thing.uid)
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      if getItemAttribute(thing.uid, "unique") then
         table.insert(str, " It's an unique item.")
      end
      table.insert(str, "\n"..iname.description)
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return true
   end
end
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if isPlayer(thing.uid) then      --player
local player = thing.uid
local vip = getPlayerPremiumDays(player) > 1 and "Premuim" or "Not Premuim"
  local msg = ""..getCreatureName(player).."-Level "..getPlayerLevel(player).."-"..vip..""
--doShowLookPlayer(cid, player, msg)
return false
end
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then   --monstros
  
   local pokename = getCreatureName(thing.uid)
   if shinys[pokename] then
          pokename = shinys[pokename]
   end
   table.insert(str, "You see a wild "..string.lower(pokename)..".\n")
   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons
   local pokename = getCreatureName(thing.uid)
   if shinys[pokename] then
          pokename = shinys[pokename]
   end
          
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   if getCreatureMaster(thing.uid) == cid then
          local myball = getPlayerSlotItem(cid, 8).uid
          table.insert(str, "You see your "..string.lower(pokename)..".")
          if boostlevel > 0 then
                 table.insert(str, "\nBoost level: +"..boostlevel..".")
          end
          table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(pokename)..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end

mano só aparece look da boost no pokemon sabe resolver ?  06:25 You see your shiny flygon.

Boost level: +10.

 

[27/05/2015 06:25:14] [Error - CreatureScript Interface]
[27/05/2015 06:25:14] data/creaturescripts/scripts/look.lua:onLook
[27/05/2015 06:25:14] Description:
[27/05/2015 06:25:14] data/creaturescripts/scripts/look.lua:34: attempt to call global 'isPokeball' (a nil value)
[27/05/2015 06:25:14] stack traceback:
[27/05/2015 06:25:14]  data/creaturescripts/scripts/look.lua:34: in function <data/creaturescripts/scripts/look.lua:27>

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

seu servidor não tem a função 'isPokeball'

 

tenta adc na sua lib essa função(obs n sei o id das suas pokeball)

function isPokeball(item)
if not item then return false end
if item >= 11826 and item <= 11837 then
return true
end
if item >= 11737 and item <= 11748 then
return true
end
if item >= 12596 and item <= 12610 then
return true
end
return false
end
Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • Sub-Admin

n tem é pq estou fazendo do zero e tirei hoje só pra mexer com o look. vou adc na lib vamos ver


 

seu servidor não tem a função 'isPokeball'

 

tenta adc na sua lib essa função(obs n sei o id das suas pokeball)

function isPokeball(item)
if not item then return false end
if item >= 11826 and item <= 11837 then
return true
end
if item >= 11737 and item <= 11748 then
return true
end
if item >= 12596 and item <= 12610 then
return true
end
return false
end

ta dando isso agora eu adicionei os ids das minha ball agora mudo o erro

 

[27/05/2015 07:03:19] [Error - CreatureScript Interface]
[27/05/2015 07:03:19] data/creaturescripts/scripts/look.lua:onLook
[27/05/2015 07:03:19] Description:
[27/05/2015 07:03:19] data/creaturescripts/scripts/look.lua:118: attempt to call global 'sendMsgToPlayer' (a nil value)
[27/05/2015 07:03:19] stack traceback:
[27/05/2015 07:03:19]  data/creaturescripts/scripts/look.lua:118: in function <data/creaturescripts/scripts/look.lua:27>

 

 

 

adicionei assim 

function isPokeball(item)
if not item then return false end
if item >= 2222 and item <= 2224 then
return true
end
if item >= 2220 and item <= 2221 then
return true
end
if item >= 2227 and item <= 2227 then
return true
end
if item >= 2653 and item <= 2654 then
return true
end
if item >= 2658 and item <= 2658 then
return true
end
if item >= 2651 and item <= 2652 then
return true
end
if item >= 2657 and item <= 2657 then
return true
end
return false
end

 

 

ai adicionei + isso 

 

function getPokeballsInContainer(container) -- Function By Kydrai
if not isContainer(container) then return {} end
local items = {}
if isContainer(container) and getContainerSize(container) > 0 then
  for slot=0, (getContainerSize(container)-1) do
   local item = getContainerItem(container, slot)
    if isContainer(item.uid) then
     local itemsbag = getPokeballsInContainer(item.uid)
     for i=0, #itemsbag do
      table.insert(items, itemsbag)
     end
    elseif isPokeball(item.itemid) then
     table.insert(items, item.uid)
    end
  end
end
return items
end

 

ja apareceu progresso!

 

07:10 You see a pokeball being used.
Contains a This is Shiny Flygon's pokeball. +10.

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

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

agr diz que não a função 'sendMsgToPlayer'

 

adc na lib

 

function sendMsgToPlayer(cid, tpw, msg)      --alterado v1.7 \/\/\/
if not isCreature(cid) or not tpw or not msg then return true end
return doPlayerSendTextMessage(cid, tpw, msg)
end
Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • Sub-Admin

 

agr diz que não a função 'sendMsgToPlayer'

 

adc na lib

 

function sendMsgToPlayer(cid, tpw, msg)      --alterado v1.7 \/\/\/
if not isCreature(cid) or not tpw or not msg then return true end
return doPlayerSendTextMessage(cid, tpw, msg)
end

 

[27/05/2015 07:33:46] [Error - CreatureScript Interface]

[27/05/2015 07:33:46] data/creaturescripts/scripts/look.lua:onLook

[27/05/2015 07:33:46] Description:

[27/05/2015 07:33:46] data/creaturescripts/scripts/look.lua:131: attempt to call global 'doShowLookPlayer' (a nil value)

[27/05/2015 07:33:46] stack traceback:

[27/05/2015 07:33:46]  data/creaturescripts/scripts/look.lua:131: in function <data/creaturescripts/scripts/look.lua:27>

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

vai procurando as funções no google que falta e adc na sua lib

 

function doShowLookPlayer(cid, target, msg)
doPlayerSendCancel(cid, "ShowLook/"..getPlayerStorageValue(target, 21121).."/"..msg.."")
end

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

tenta este:

function onLook(cid, thing, position, lookDistance)

                                                                                                                 

local str = {}

local iname = getItemInfo(thing.itemid)

                                                                                         

if not isCreature(thing.uid) then

   if not iname or not iname.name then return true end

   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then --alterado aki      

      local owner = getItemAttribute(thing.uid, "firstpoke")

      local pokename = getItemAttribute(thing.uid, "poke")  

      if shinys[pokename] then

         pokename = shinys[pokename]

      end

         

      local ballName = iname.name

      if getItemAttribute(thing.uid, 'ball') then

         ballName = getItemAttribute(thing.uid, 'ball').. " ball"

      end

      table.insert(str, "You see "..iname.article.." "..ballName..".") 

      if getItemAttribute(thing.uid, "unique") then                   

         table.insert(str, " It's an unique item.")  

      end

      table.insert(str, "\nContains "..getArticle(pokename).." "..pokename)

         

      if getItemAttribute(thing.uid, "nick") then

         table.insert(str, " ("..getItemAttribute(thing.uid, "nick")..")")

      end

      local boost = getItemAttribute(thing.uid, "boost") or 0

      if boost > 0 then

         table.insert(str, " +"..boost)

      end

      table.insert(str, ".")

         

      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))

      return false        

   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then    

      local name = iname.name

            name = string.gsub(name, "fainted ", "")

            name = string.gsub(name, "defeated ", "")

            name = doCorrectPokemonName(name)

      if shinys[name] then

         name = shinys[name]

      end

      name = "fainted "..name:lower()

          

      table.insert(str, "You see "..iname.article.." "..name..". ")    

      if isContainer(thing.uid) then

         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")

      end

      table.insert(str, "\n")

      if getItemAttribute(thing.uid, "gender") == SEX_MALE then

         table.insert(str, "It is male.")

      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then

         table.insert(str, "It is female.")

      else

         table.insert(str, "It is genderless.")

      end

      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))

      return false

   elseif isContainer(thing.uid) then    --containers

      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then

         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")

         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")

         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")

      else  

         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")

      end
         

      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then

         table.insert(str, "\nItemID: ["..thing.itemid.."]")    

         local pos = getThingPos(thing.uid)

         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") 

      end

      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))

      return false

   else  

      local p = getThingPos(thing.uid)

      table.insert(str, "You see ")

      if thing.type > 1 then

         table.insert(str, thing.type.." "..iname.plural..".")

      else

         table.insert(str, iname.article.." "..iname.name..".")

      end

      if getItemAttribute(thing.uid, "unique") then

         table.insert(str, " It's an unique item.")

      end

      table.insert(str, "\n"..iname.description)

      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then

         table.insert(str, "\nItemID: ["..thing.itemid.."]")

         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")

      end

      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))

      return true

   end

end
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs

   table.insert(str, "You see "..getCreatureName(thing.uid)..".")

   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))

   return false

end
if isPlayer(thing.uid) then      --player

local player = thing.uid

local vip = getPlayerPremiumDays(player) > 1 and "Premuim" or "Not Premuim"

  local msg = ""..getCreatureName(player).."-Level "..getPlayerLevel(player).."-"..vip..""

--doShowLookPlayer(cid, player, msg)

return false

end
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then   --monstros

  

   local pokename = getCreatureName(thing.uid)

   if shinys[pokename] then

          pokename = shinys[pokename]

   end

   table.insert(str, "You see a wild "..string.lower(pokename)..".\n")

   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")

   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))

   return false
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons
   local pokename = getCreatureName(thing.uid)

   if shinys[pokename] then

          pokename = shinys[pokename]

   end

          

   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0

   if getCreatureMaster(thing.uid) == cid then

          local myball = getPlayerSlotItem(cid, 8).uid

          table.insert(str, "You see your "..string.lower(pokename)..".")

          if boostlevel > 0 then

                 table.insert(str, "\nBoost level: +"..boostlevel..".")

          end

          table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")

          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))

   else

          doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(pokename)..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")

   end

   return false

end

return true

end

wq3bBzt.png
Pokémon Dust Evolution
 
É aonde começa sua nova aventura!! 

 

Facebook

 
Verifique Atualizações

 

Link para o post
Compartilhar em outros sites
  • Sub-Admin

já arrumei obrigado a todos você resultado.

sistemas coloquei

*boost stone

Look system diferente que era esse ai mais editei tbm adicionei funções fora que você me postaram e o resultado foi esse.

 

09:53 você está vendo uma super ball being used.
Está ocupada com a This is Rattata's pokeball. BOOST: +1.

09:53 You see Alexxx (Level 1). He is a pokemon trainer.
Health: [150 / 150], Mana: [0 / 6].
IP: 127.0.0.1, Client: 854.
Position: [X: 1052] [Y: 1055] [Z: 7].

09:53 You see Nurse Joy.
Health: [150 / 150].
Position: [X: 1054] [Y: 1053] [Z: 7].

09:53 You see a mill board.
ItemID: [969]
Position: [1055][1055][7]
09:53 You see a mill board.
ItemID: [969].
Position: [X: 1055] [Y: 1055] [Z: 7].

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

 

seu servidor não tem a função 'isPokeball'

 

tenta adc na sua lib essa função(obs n sei o id das suas pokeball)

function isPokeball(item)
if not item then return false end
if item >= 11826 and item <= 11837 then
return true
end
if item >= 11737 and item <= 11748 then
return true
end
if item >= 12596 and item <= 12610 then
return true
end
return false
end

 

mim ajudar a colocar essa função na LIB? só tem essa parte com esse atributo no items.xml 

só que dar esse erro ao ligar

[27/05/2015 10:06:47] [Warning - Items::loadFromXml] Unknown key value ispokeball
[27/05/2015 10:06:47] [Warning - Items::loadFromXml] Unknown key value ispokeball
[27/05/2015 10:06:47] [Warning - Items::loadFromXml] Unknown key value ispokeball
[27/05/2015 10:06:47] [Warning - Items::loadFromXml] Unknown key value ispokeball

 

essa parte achei no items.xml

<item id="10975" article="a" name="Bulbasaur's pokeball">
 <attribute key="ispokeball" value="1"/>
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="feet" />
    </item>
 
    <item id="10976" article="a" name="Bulbasaur's pokeball being used">
 <attribute key="ispokeball" value="1"/>
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="feet" />
    </item>
 
    <item id="10977" article="a" name="Bulbasaur's discharged pokeball">
 <attribute key="ispokeball" value="1"/>
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="feet" />
    </item>
Link para o post
Compartilhar em outros sites
Change it.transformToFree to it.isPokeball
 
Like this:
 
else if(tmpStrValue == "isPokeball")
{
    if(readXMLInteger(itemAttributesNode, "value", intValue))
        it.isPokeball = intValue;
}
 
And declare isPokeball in items.h under Ammo_t ammoType add
 
bool isPokeball;
 
and in items.cpp under decayTime = 0; add
 
isPokeball = false;
 
credito: acubens

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
Change it.transformToFree to it.isPokeball   Like this:

pelo que entendi está pedindo para trocar "it.transformToFree" por "it.isPokeball" que arquivo é esse pra trocar? 

items.h ou items.cpp? 

achei essas funções no some fuctions de outro servidor, não poderia ajudar em nada? 

 

if isContainer(container) and getContainerSize(container) > 0 then      
for slot=0, (getContainerSize(container)-1) do
local item = getContainerItem(container, slot)
if isContainer(item.uid) then
local itemsbag = getPokeballsInContainer(item.uid)
for i=0, #itemsbag do
if not isInArray(items, itemsbag[i]) then
                           table.insert(items, itemsbag[i])
                        end
end
elseif isPokeball(item.itemid) then
   for a, b in pairs (pokeballs) do
                        if item.itemid == b.on then
                           if duel and getPlayerLevel(cid) >= (pokes[getItemAttribute(item.uid, "poke")].level + getPokeballBoost(item)) then    
         table.insert(items, item.uid)                                            --alterado v1.8
                           elseif not duel then
                              table.insert(items, item.uid)
                           end
                   end
                    end
end
end
end
return items
end

 

function isPokeball(item)
return isItemPokeball(item)
end              

 

function getItemsInContainerById(container, itemid) -- Function By Kydrai
local items = {}
if isContainer(container) and getContainerSize(container) > 0 then
   for slot=0, (getContainerSize(container)-1) do
       local item = getContainerItem(container, slot)
       if isContainer(item.uid) then
          local itemsbag = getItemsInContainerById(item.uid, itemid)
          for i=0, #itemsbag do
              table.insert(items, itemsbag[i])
          end
       else
          if itemid == item.itemid then
             table.insert(items, item.uid)
          end
       end
   end
end
return items
end
 
function getPokeballsInContainer(container) -- Function By Kydrai
if not isContainer(container) then return {} end
local items = {}
if isContainer(container) and getContainerSize(container) > 0 then
for slot=0, (getContainerSize(container)-1) do
local item = getContainerItem(container, slot)
if isContainer(item.uid) then
local itemsbag = getPokeballsInContainer(item.uid)
for i=0, #itemsbag do
table.insert(items, itemsbag[i])
end
elseif isPokeball(item.itemid) then
table.insert(items, item.uid)
end
end
end
return items
end

achei essa parte no beds.cpp 

else if(it.transformToFree)
{
const ItemType& newType = Item::items[it.transformToFree];
if(newType.type == ITEM_TYPE_BED)
g_game.transformItem(this, it.transformToFree);
}
}

 

e no items.cpp

else if(tmpStrValue == "transformto")
{
if(readXMLInteger(itemAttributesNode, "value", intValue))
it.transformToFree = intValue;
}
Editado por TopllDanStar (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo