Ir para conteúdo
  • 0
J u g g e r

Scripting Erro ao usar PokeDex em si mesmo

Pergunta

J u g g e r    1
J u g g e r

Base:

POU - Open Source (0.3.6)

Qual erro está surgindo/O que você procura?

[Error - Action Interface]
data/actions/scripts/pokedex.lua:onUse
Description:
data/actions/scripts/pokedex.lua:36: attempt to index field '?' (a number value)
stack traceback:
        data/actions/scripts/pokedex.lua:36: in function <data/actions/scripts/pokedex.lua:3>

Você tem o código disponível? Se tiver publique-o aqui:

local rate = 20

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) then
return true
end

local poke = getCreatureName(item2.uid)

	if isMonster(item2.uid) then
       local this = newpokedex[getCreatureName(item2.uid)]
	   local myball = 0
	   if isSummon(item2.uid) then
	      myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
       end
       if not getPlayerInfoAboutPokemon(cid, poke).dex then
	      local exp = this.level * rate
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..getCreatureName(item2.uid).." in your pokedex!")
	      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
          doSendMagicEffect(getThingPos(cid), 210)
          doPlayerAddExperience(cid, exp)
          doAddPokemonInDexList(cid, poke)
       else
          doShowPokedexRegistration(cid, item2, myball)
       end
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
                                    --alterado v1.7 \/\/
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end                                                      --alterado v1.6

	local player = getRecorderPlayer(toPos, cid)

	if cid == player then
	    doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
	end

return true
end 


Agradeço quem puder ajudar! <3

Compartilhar este post


Link para o post
Compartilhar em outros sites

7 respostass a esta questão

Recommended Posts

  • 0
J u g g e r    1
J u g g e r
Em 26/06/2018 em 09:31, Stark-san disse:

Bem aqui está o lua para Dxp, esse lua do Dxp achei em uma antiga base no qual estive trabalhando, não lembro de muita coisa nas configurações dela.. Mas espero que ajude.

DXP:

  Mostrar conteúdo oculto


local function checkDex(cid)
local unlock = 0
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(cid, oldpokedex[i][1]).dex then
		   unlock = unlock + 1
		end
	end
return unlock
end

local rate = 50
local rewards = {
[10] = {{2160, 1}, {11638, 1}, {12344, 5}},
[20] = {{2160, 1}, {11638, 1}, {12344, 5}},
[30] = {{2160, 1}, {11638, 1}, {12344, 5}},
[40] = {{2160, 1}, {11639, 1}, {12344, 10}},
[50] = {{2160, 2}, {11639, 1}, {12344, 10}},
[60] = {{2160, 2}, {11639, 1}, {12344, 15}},
[70] = {{2160, 2}, {11640, 1}, {12344, 15}},
[80] = {{2160, 2}, {11640, 1}, {12344, 20}},
[90] = {{2160, 3}, {11640, 1}, {12344, 20}},
[100] = {{2160, 3}, {11640, 1}, {12344, 25}},
[120] = {{2160, 3}, {11640, 1}, {12344, 30}},
[150] = {{2160, 3}, {11641, 1}, {12344, 30}},
[180] = {{2160, 3}, {11641, 1}, {12344, 30}},
[210] = {{2160, 5}, {11641, 1}, {12344, 30}},
[250] = {{2160, 5}, {11641, 1}, {12344, 30}},
}
local sto = 63999

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) or isWatchingTv(cid) then
return true
end

local poke = getCreatureName(item2.uid)

	if isMonster(item2.uid) then
	local name = doCorrectString(getCreatureName(item2.uid))
       local this = newpokedex[name]
	   local myball = 0
	   if isSummon(item2.uid) then
	      myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
       end
       if not getPlayerInfoAboutPokemon(cid, poke).dex then
	      local exp = this.level * rate
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked ".. getCreatureName(item2.uid).." in your pokedex!")
	      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
          doSendMagicEffect(getThingPos(cid), 210)
          doPlayerAddExperience(cid, exp)
          doAddPokemonInDexList(cid, poke)
       else
		  local name = doCorrectString(getCreatureName(item2.uid))
          doShowPokedexRegistration(cid, name, myball, item2)
       end
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
                                    --alterado v1.7 \/\/
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end                                                      --alterado v1.6

	local player = getRecorderPlayer(toPos, cid)

	if cid == player then
	    doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
	if getPlayerVocation(cid) == 9 then
		doPlayerSetVocation(cid, 10)
	end	
end

return true
end

Na sua pasta Lib adicione este código no arquivo "pokedex system.lua"



local skills = specialabilities                                    --alterado v1.9 \/ peguem tudo!

function doAddPokemonInDexList(cid, poke)
if getPlayerInfoAboutPokemon(cid, poke).dex then return true end
	poke = doCorrectString(poke)
	local a = newpokedex[poke]                                              
	local b = getPlayerStorageValue(cid, a.storage)
	setPlayerStorageValue(cid, a.storage, b.." dex,")
end

function getPokemonEvolutionDescription(name, next)
	local kev = poevo[name]
	local stt = {}
	if isInArray(specialevo, name) then
       if name == "Poliwhirl" then
          if next then
             return "\nPoliwrath or Politoed, requires level 65."
          end   
          table.insert(stt, "Evolve Stone: Water Stone and Punch Stone or Water Stone and Earth Stone\n\n")
          table.insert(stt, "Evolutions:\nPoliwrath, requires level 65.\nPolitoed, requires level 65.")
       elseif name == "Gloom" then
          if next then
             return "\nVileplume or Bellossom, requires level 50."
          end
          table.insert(stt, "Evolve Stone: 2 Leaf Stone or Leaf Stone and Venom Stone\n\n")
          table.insert(stt, "Evolutions:\nVileplume, requires level 50.\nBellossom, requires level 50.")
       elseif name == "Slowpoke" then
          if next then
             return "\nSlowbro, requires level 45.\nSlowking, requires level 100."
          end
          table.insert(stt, "Evolve Stone: Enigma Stone or Ancient Stone\n\n")
          table.insert(stt, "Evolutions:\nSlowbro, requires level 45.\nSlowking, requires level 100.")
       elseif name == "Eevee" then
          if next then
             return "\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55."
          end
          table.insert(stt, "Evolve Stone: Water Stone or Thunder Stone or Fire Stone or Darkness Stone or Enigma Stone\n\n")
          table.insert(stt, "Evolutions:\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55.")
       elseif name == "Tyrogue" then
          if next then
             return "\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60."
          end
          table.insert(stt, "Evolve Stone: Punch Stone\n\n")   
          table.insert(stt, "Evolutions:\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60.")
       end
    elseif kev then
       if next then
          table.insert(stt, "\n"..kev.evolution..", requires level "..kev.level..".")
          return table.concat(stt)
       end
       local id = tonumber(kev.stoneid)
       local id2 = tonumber(kev.stoneid2)
       local stone = ""
       if tonumber(kev.count) == 2 then
          stone = doConvertStoneIdToString(id).." (2x)"
       else
          stone = id2 == 0 and doConvertStoneIdToString(id) or doConvertStoneIdToString(id).." and "..doConvertStoneIdToString(id2)
       end
       table.insert(stt, "Evolve Stone: "..stone.."\n\n")
       table.insert(stt, "Evolutions:\n"..kev.evolution..", requeris level "..kev.level..".")
       table.insert(stt, getPokemonEvolutionDescription(kev.evolution, true))
    else
        if not next then
           table.insert(stt, "Evolutions:\nIt doen't evolve.")
        end
    end   
return table.concat(stt)
end

local function getMoveDexDescr(name, number)
	local x = movestable[name]
	if not x then return "" end
	
	local z = "\n"
	local tables = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12}
	local y = tables[number]
	if not y then return "" end

local txt = ""..z..""..y.name.." - m"..number.." - level "..y.level.." - "..(y.t) 
return txt
end      
                                                                                                                                 --alterado v1.8
local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "control mind", "transform", "levitate_fly"}
local passivas = {
["Shock Counter"] = {"Electabuzz", "Shiny Electabuzz", "Elekid", "Raikou", tpw = "electric"},
["Lava-Counter"] = {"Magmar", "Magby", "Entei", tpw = "fire"},
["Counter Helix"] = {"Scyther", "Shiny Scyther", tpw = "bug"},
["Giroball"] = {"Pineco", "Forretress", tpw = "steel"},
["Counter Claw"] = {"Scizor", tpw = "bug"},
["Counter Spin"] = {"Hitmontop", "Shiny Hitmontop", tpw = "fighting"},
["Demon Kicker"] = {"Hitmonlee", "Shiny Hitmonlee", tpw = "fighting"},
["Demon Puncher"] = {"Hitmonchan", "Shiny Hitmonchan", tpw = "unknow"},               --alterado v1.6
["Stunning Confusion"] = {"Psyduck", "Golduck", "Wobbuffet", tpw = "psychic"},
["Groundshock"] = {"Kangaskhan", tpw = "normal"},
["Electric Charge"] = {"Pikachu", "Raichu", "Shiny Raichu", tpw = "electric"},
["Melody"] = {"Wigglytuff", tpw = "normal"},
["Dragon Fury"] = {"Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", tpw = "dragon"},
["Fury"] = {"Persian", "Raticate", "Shiny Raticate", tpw = "normal"},
["Mega Drain"] = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela", tpw = "grass"},
["Spores Reaction"] = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume", tpw = "grass"},
["Amnesia"] = {"Wooper", "Quagsire", "Swinub", "Piloswine", tpw = "psychic"},
["Zen Mind"] = {"Slowking", tpw = "psychic"}, 
["Mirror Coat"] = {"Wobbuffet", tpw = "psychic"},
["Lifesteal"] = {"Zubat", "Golbat", "Crobat", "Shiny Zubat", "Shiny Golbat", "Shiny Crobat", tpw = "poison"},
["Evasion"] = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Ledian", "Ledyba", "Sneasel", tpw = "normal"},
["Foresight"] = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Hitmontop", "Hitmonlee", "Hitmonchan", tpw = "fighting"},
["Levitate"] = {"Gengar", "Haunter", "Gastly", "Misdreavus", "Weezing", "Koffing", "Unown", "Shiny Gengar", tpw = "ghost"},

["Bone Spin"] = {"Cubone", "Marowak", "Shiny Cubone", "Shiny Marowak", tpw = "rock"},
}


function doShowPokedexRegistration(cid, pokemon, ball, item2)


local myball = ball
local name = pokemon 

local v = fotos[name]
local stt = {}

table.insert(stt, "Name: "..name.."\n")

if pokes[name].type2 and pokes[name].type2 ~= "no type" then
   table.insert(stt, "Type: "..pokes[name].type.."/"..pokes[name].type2)
else
    table.insert(stt, "Type: "..pokes[name].type)
end

if virtual then
   table.insert(stt, "\nRequired level: "..pokes[name].level.."\n")
else
   table.insert(stt, "\nRequired level: ".. getPokemonLevelD(name) .."\n")  --alterado v1.9
end

table.insert(stt, "\n"..getPokemonEvolutionDescription(name).."\n")

table.insert(stt, "\nMoves:")
table.insert(stt, "\nPoke-Status:\nOffense: "..getPlayerStorageValue(item2.uid,1001).."\nDefense: "..getPlayerStorageValue(item2.uid,1002).."\nSpeed: "..getPlayerStorageValue(item2.uid,1003).."\nVitality: "..getPlayerStorageValue(item2.uid,1004).."\nSpecial-Attack: "..getPlayerStorageValue(item2.uid,1005).."\n")

if name == "Ditto" then
   table.insert(stt, "\nIt doesn't use any moves until transformed.")
else
   for a = 1, 15 do
      table.insert(stt, getMoveDexDescr(name, a))
   end
end

for e, f in pairs(passivas) do
   if isInArray(passivas[e], name) then
      local tpw = passivas[e].tpw
      if name == "Pineco" and passivas[e] == "Giroball" then
         tpw = "bug"
      end
      table.insert(stt, "\n"..e.." - passive - "..tpw)
   end
end
            
table.insert(stt, "\n\nAbility:\n") 
local abilityNONE = true                   --alterado v1.8 \/
			
for b, c in pairs(skills) do
   if isInArray(skillcheck, b) then
      if isInArray(c, name) then
         table.insert(stt, (b == "levitate_fly" and "Levitate" or doCorrectString(b)).."\n")
         abilityNONE = false
      end
   end
end
if abilityNONE then
   table.insert(stt, "None")
end
		
if string.len(table.concat(stt)) > 8192 then
   print("Error while making pokedex info with pokemon named "..name..".\n   Pokedex registration has more than 8192 letters (it has "..string.len(stt).." letters), it has been blocked to prevent fatal error.")
   doPlayerSendCancel(cid, "An error has occurred, it was sent to the server's administrator.") 
return true
end	

doShowTextDialog(cid, v, table.concat(stt))
end

 

 

O problema esta no código fonte desta base, então resolvi trocar a mesma para esta:

 

Editado por Behmen

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
Stark-san    0
Stark-san

PDA ou Dxp ?

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
J u g g e r    1
J u g g e r
41 minutos atrás, Stark-san disse:

PDA ou Dxp ?

Creio eu que seja uma adaptação de PDA com source, a base que estou usando é o:

 

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
Stark-san    0
Stark-san

Entendo, irei refazer o teu pokedex.lua e já te mando quando possível, tranquilo ?

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
J u g g e r    1
J u g g e r
17 minutos atrás, Stark-san disse:

Entendo, irei refazer o teu pokedex.lua e já te mando quando possível, tranquilo ?

Agradeço meu amigo! <3

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
Stark-san    0
Stark-san

Bem aqui está o lua para Dxp, esse lua do Dxp achei em uma antiga base no qual estive trabalhando, não lembro de muita coisa nas configurações dela.. Mas espero que ajude.

DXP:

Spoiler

local function checkDex(cid)
local unlock = 0
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(cid, oldpokedex[i][1]).dex then
		   unlock = unlock + 1
		end
	end
return unlock
end

local rate = 50
local rewards = {
[10] = {{2160, 1}, {11638, 1}, {12344, 5}},
[20] = {{2160, 1}, {11638, 1}, {12344, 5}},
[30] = {{2160, 1}, {11638, 1}, {12344, 5}},
[40] = {{2160, 1}, {11639, 1}, {12344, 10}},
[50] = {{2160, 2}, {11639, 1}, {12344, 10}},
[60] = {{2160, 2}, {11639, 1}, {12344, 15}},
[70] = {{2160, 2}, {11640, 1}, {12344, 15}},
[80] = {{2160, 2}, {11640, 1}, {12344, 20}},
[90] = {{2160, 3}, {11640, 1}, {12344, 20}},
[100] = {{2160, 3}, {11640, 1}, {12344, 25}},
[120] = {{2160, 3}, {11640, 1}, {12344, 30}},
[150] = {{2160, 3}, {11641, 1}, {12344, 30}},
[180] = {{2160, 3}, {11641, 1}, {12344, 30}},
[210] = {{2160, 5}, {11641, 1}, {12344, 30}},
[250] = {{2160, 5}, {11641, 1}, {12344, 30}},
}
local sto = 63999

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) or isWatchingTv(cid) then
return true
end

local poke = getCreatureName(item2.uid)

	if isMonster(item2.uid) then
	local name = doCorrectString(getCreatureName(item2.uid))
       local this = newpokedex[name]
	   local myball = 0
	   if isSummon(item2.uid) then
	      myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
       end
       if not getPlayerInfoAboutPokemon(cid, poke).dex then
	      local exp = this.level * rate
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked ".. getCreatureName(item2.uid).." in your pokedex!")
	      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
          doSendMagicEffect(getThingPos(cid), 210)
          doPlayerAddExperience(cid, exp)
          doAddPokemonInDexList(cid, poke)
       else
		  local name = doCorrectString(getCreatureName(item2.uid))
          doShowPokedexRegistration(cid, name, myball, item2)
       end
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
                                    --alterado v1.7 \/\/
	for i = 1, #oldpokedex do
		if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
		   if i <= 151 then
              kanto = kanto+1
           elseif i >= 209 then
              johto = johto+1
           end
		end
	end                                                      --alterado v1.6

	local player = getRecorderPlayer(toPos, cid)

	if cid == player then
	    doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
	if getPlayerVocation(cid) == 9 then
		doPlayerSetVocation(cid, 10)
	end	
end

return true
end

Na sua pasta Lib adicione este código no arquivo "pokedex system.lua"


local skills = specialabilities                                    --alterado v1.9 \/ peguem tudo!

function doAddPokemonInDexList(cid, poke)
if getPlayerInfoAboutPokemon(cid, poke).dex then return true end
	poke = doCorrectString(poke)
	local a = newpokedex[poke]                                              
	local b = getPlayerStorageValue(cid, a.storage)
	setPlayerStorageValue(cid, a.storage, b.." dex,")
end

function getPokemonEvolutionDescription(name, next)
	local kev = poevo[name]
	local stt = {}
	if isInArray(specialevo, name) then
       if name == "Poliwhirl" then
          if next then
             return "\nPoliwrath or Politoed, requires level 65."
          end   
          table.insert(stt, "Evolve Stone: Water Stone and Punch Stone or Water Stone and Earth Stone\n\n")
          table.insert(stt, "Evolutions:\nPoliwrath, requires level 65.\nPolitoed, requires level 65.")
       elseif name == "Gloom" then
          if next then
             return "\nVileplume or Bellossom, requires level 50."
          end
          table.insert(stt, "Evolve Stone: 2 Leaf Stone or Leaf Stone and Venom Stone\n\n")
          table.insert(stt, "Evolutions:\nVileplume, requires level 50.\nBellossom, requires level 50.")
       elseif name == "Slowpoke" then
          if next then
             return "\nSlowbro, requires level 45.\nSlowking, requires level 100."
          end
          table.insert(stt, "Evolve Stone: Enigma Stone or Ancient Stone\n\n")
          table.insert(stt, "Evolutions:\nSlowbro, requires level 45.\nSlowking, requires level 100.")
       elseif name == "Eevee" then
          if next then
             return "\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55."
          end
          table.insert(stt, "Evolve Stone: Water Stone or Thunder Stone or Fire Stone or Darkness Stone or Enigma Stone\n\n")
          table.insert(stt, "Evolutions:\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55.")
       elseif name == "Tyrogue" then
          if next then
             return "\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60."
          end
          table.insert(stt, "Evolve Stone: Punch Stone\n\n")   
          table.insert(stt, "Evolutions:\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60.")
       end
    elseif kev then
       if next then
          table.insert(stt, "\n"..kev.evolution..", requires level "..kev.level..".")
          return table.concat(stt)
       end
       local id = tonumber(kev.stoneid)
       local id2 = tonumber(kev.stoneid2)
       local stone = ""
       if tonumber(kev.count) == 2 then
          stone = doConvertStoneIdToString(id).." (2x)"
       else
          stone = id2 == 0 and doConvertStoneIdToString(id) or doConvertStoneIdToString(id).." and "..doConvertStoneIdToString(id2)
       end
       table.insert(stt, "Evolve Stone: "..stone.."\n\n")
       table.insert(stt, "Evolutions:\n"..kev.evolution..", requeris level "..kev.level..".")
       table.insert(stt, getPokemonEvolutionDescription(kev.evolution, true))
    else
        if not next then
           table.insert(stt, "Evolutions:\nIt doen't evolve.")
        end
    end   
return table.concat(stt)
end

local function getMoveDexDescr(name, number)
	local x = movestable[name]
	if not x then return "" end
	
	local z = "\n"
	local tables = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12}
	local y = tables[number]
	if not y then return "" end

local txt = ""..z..""..y.name.." - m"..number.." - level "..y.level.." - "..(y.t) 
return txt
end      
                                                                                                                                 --alterado v1.8
local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "control mind", "transform", "levitate_fly"}
local passivas = {
["Shock Counter"] = {"Electabuzz", "Shiny Electabuzz", "Elekid", "Raikou", tpw = "electric"},
["Lava-Counter"] = {"Magmar", "Magby", "Entei", tpw = "fire"},
["Counter Helix"] = {"Scyther", "Shiny Scyther", tpw = "bug"},
["Giroball"] = {"Pineco", "Forretress", tpw = "steel"},
["Counter Claw"] = {"Scizor", tpw = "bug"},
["Counter Spin"] = {"Hitmontop", "Shiny Hitmontop", tpw = "fighting"},
["Demon Kicker"] = {"Hitmonlee", "Shiny Hitmonlee", tpw = "fighting"},
["Demon Puncher"] = {"Hitmonchan", "Shiny Hitmonchan", tpw = "unknow"},               --alterado v1.6
["Stunning Confusion"] = {"Psyduck", "Golduck", "Wobbuffet", tpw = "psychic"},
["Groundshock"] = {"Kangaskhan", tpw = "normal"},
["Electric Charge"] = {"Pikachu", "Raichu", "Shiny Raichu", tpw = "electric"},
["Melody"] = {"Wigglytuff", tpw = "normal"},
["Dragon Fury"] = {"Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", tpw = "dragon"},
["Fury"] = {"Persian", "Raticate", "Shiny Raticate", tpw = "normal"},
["Mega Drain"] = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela", tpw = "grass"},
["Spores Reaction"] = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume", tpw = "grass"},
["Amnesia"] = {"Wooper", "Quagsire", "Swinub", "Piloswine", tpw = "psychic"},
["Zen Mind"] = {"Slowking", tpw = "psychic"}, 
["Mirror Coat"] = {"Wobbuffet", tpw = "psychic"},
["Lifesteal"] = {"Zubat", "Golbat", "Crobat", "Shiny Zubat", "Shiny Golbat", "Shiny Crobat", tpw = "poison"},
["Evasion"] = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Ledian", "Ledyba", "Sneasel", tpw = "normal"},
["Foresight"] = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Hitmontop", "Hitmonlee", "Hitmonchan", tpw = "fighting"},
["Levitate"] = {"Gengar", "Haunter", "Gastly", "Misdreavus", "Weezing", "Koffing", "Unown", "Shiny Gengar", tpw = "ghost"},

["Bone Spin"] = {"Cubone", "Marowak", "Shiny Cubone", "Shiny Marowak", tpw = "rock"},
}


function doShowPokedexRegistration(cid, pokemon, ball, item2)


local myball = ball
local name = pokemon 

local v = fotos[name]
local stt = {}

table.insert(stt, "Name: "..name.."\n")

if pokes[name].type2 and pokes[name].type2 ~= "no type" then
   table.insert(stt, "Type: "..pokes[name].type.."/"..pokes[name].type2)
else
    table.insert(stt, "Type: "..pokes[name].type)
end

if virtual then
   table.insert(stt, "\nRequired level: "..pokes[name].level.."\n")
else
   table.insert(stt, "\nRequired level: ".. getPokemonLevelD(name) .."\n")  --alterado v1.9
end

table.insert(stt, "\n"..getPokemonEvolutionDescription(name).."\n")

table.insert(stt, "\nMoves:")
table.insert(stt, "\nPoke-Status:\nOffense: "..getPlayerStorageValue(item2.uid,1001).."\nDefense: "..getPlayerStorageValue(item2.uid,1002).."\nSpeed: "..getPlayerStorageValue(item2.uid,1003).."\nVitality: "..getPlayerStorageValue(item2.uid,1004).."\nSpecial-Attack: "..getPlayerStorageValue(item2.uid,1005).."\n")

if name == "Ditto" then
   table.insert(stt, "\nIt doesn't use any moves until transformed.")
else
   for a = 1, 15 do
      table.insert(stt, getMoveDexDescr(name, a))
   end
end

for e, f in pairs(passivas) do
   if isInArray(passivas[e], name) then
      local tpw = passivas[e].tpw
      if name == "Pineco" and passivas[e] == "Giroball" then
         tpw = "bug"
      end
      table.insert(stt, "\n"..e.." - passive - "..tpw)
   end
end
            
table.insert(stt, "\n\nAbility:\n") 
local abilityNONE = true                   --alterado v1.8 \/
			
for b, c in pairs(skills) do
   if isInArray(skillcheck, b) then
      if isInArray(c, name) then
         table.insert(stt, (b == "levitate_fly" and "Levitate" or doCorrectString(b)).."\n")
         abilityNONE = false
      end
   end
end
if abilityNONE then
   table.insert(stt, "None")
end
		
if string.len(table.concat(stt)) > 8192 then
   print("Error while making pokedex info with pokemon named "..name..".\n   Pokedex registration has more than 8192 letters (it has "..string.len(stt).." letters), it has been blocked to prevent fatal error.")
   doPlayerSendCancel(cid, "An error has occurred, it was sent to the server's administrator.") 
return true
end	

doShowTextDialog(cid, v, table.concat(stt))
end

 

 

Editado por Stark-san

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • 0
Majesty    1755
Majesty

O autor do tópico resolveu a questão por conta própria e postou a solução. Este tópico está fechado agora. Se você tiver outras perguntas, crie um novo tópico.

Compartilhar este post


Link para o post
Compartilhar em outros sites
Visitante
Este tópico está impedido de receber novos posts.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×