praduh 0 Postado Agosto 28, 2012 Share Postado Agosto 28, 2012 (editado) Pessoal alguém sabe como arruma esse erro? Erro que da no exe do server: [27/08/2012 21:03:44] [Error - Action Interface] [27/08/2012 21:03:44] data/actions/scripts/starter.lua:onUse [27/08/2012 21:03:44] Description: [27/08/2012 21:03:44] data/actions/scripts/starter.lua:32: attempt to call global 'getPokemonStatus' (a nil value) [27/08/2012 21:03:44] stack traceback: [27/08/2012 21:03:44] data/actions/scripts/starter.lua:32: in function <data/actions/scripts/starter.lua:14> Arquivo data\actions\scripts\starter.lua: local starterpokes = { ["Chikorita"] = {x = 1061, y = 1048, z = 6}, ["Squirtle"] = {x = 1071, y = 1048, z = 6}, ["Charmander"] = {x = 1067, y = 1048, z = 6}, ["Cyndaquil"] = {x = 1065, y = 1048, z = 6}, ["Totodile"] = {x = 1069, y = 1048, z = 6}, ["Bulbasaur"] = {x = 1063, y = 1048, z = 6}, } local level = 5 local extrastr = 1.5 local btype = "normal" function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) > 1 then return true end local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end local gender = getRandomGenderByName(pokemon) local mypoke = getPokemonStatus(pokemon) if not mypoke then return true end local offense = mypoke.off * level * extrastr local defense = mypoke.def * level * extrastr local speed = mypoke.agi * level * extrastr local vit = mypoke.vit * level * extrastr local spatk = mypoke.spatk * level * extrastr local happy = 180 local leveltable = getPokemonExperienceTable(pokemon) doPlayerAddItem(cid, 2152, 40) doPlayerAddItem(cid, 2394, 10) doPlayerAddItem(cid, 12345, 2) local item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", pokemon) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "level", level) doItemSetAttribute(item, "exp", leveltable[level]) doItemSetAttribute(item, "nextlevelexp", leveltable[level+1] - leveltable[level]) doItemSetAttribute(item, "offense", offense) doItemSetAttribute(item, "defense", defense) doItemSetAttribute(item, "speed", speed) doItemSetAttribute(item, "vitality", vit) doItemSetAttribute(item, "specialattack", spatk) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "description", "Contains a "..pokemon..".") doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") doItemSetAttribute(item, "firstpoke", getCreatureName(cid)) doPlayerAddItemEx(cid, item, true) doTransformItem(item, pokeballs[btype].on) doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.") doPlayerSendTextMessage(cid, 27, "Don\'t forget to use your pokedex on every undiscovered pokemon!") doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 27) doSendMagicEffect(getThingPos(cid), 29) return end Linha de comando no action.xml: -- BOXES (poke inicial) <action itemid="1740" event="script" value="starter.lua"/> Se alguém puder me ajudar fico muito grato. Editado Agosto 28, 2012 por PraduH Link para o comentário https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/ Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Agosto 29, 2012 Share Postado Agosto 29, 2012 Está faltando a função getPokemonStatus no seu server... Você modificou alguma coisa na pasta libs? deletou algum arquivo ou algo do tipo? Fala qual server você tá usando também, se é algum editado ou o advanced original Link para o comentário https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/#findComment-1326993 Compartilhar em outros sites More sharing options...
0 praduh 0 Postado Agosto 29, 2012 Autor Share Postado Agosto 29, 2012 É o PDA BY SLICER sem level.... não me lembro de ter deletado nenhum arquivo do sv mais vou baixar ele novamente e vou ver se fiz alguma merda vou aproveitar e atualizar pra versão 1.5 pq não atualizei ainda ai posto aqui pra avisar se deu certo ou não... o SLICER também está dando uma ajuda com o erro. Muito obrigado por enquanto. Link para o comentário https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/#findComment-1327022 Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Agosto 29, 2012 Share Postado Agosto 29, 2012 Ah sim, aí foi uma modificação do server original que não ficou compatível com algumas scripts. Se o cara removeu o sistema de level, ele provavelmente deletou a função getPokemonStatus que é baseada em sistema de level. Aí você teria que ver com o autor da edição do server pra ver como se faz um novo baú Link para o comentário https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/#findComment-1327029 Compartilhar em outros sites More sharing options...
0 praduh 0 Postado Agosto 30, 2012 Autor Share Postado Agosto 30, 2012 O Slicer me passou um script que ele disse que é o correto pra pokemon sem lvl eu vou testar hoje de noite e volto aqui para avisar se funcionou. Só pra avisar deu certo o Slicer me passo um script que resolveu o problema.. se alguém estiver com o mesmo problema fala cmg q eu mando o script Link para o comentário https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/#findComment-1327182 Compartilhar em outros sites More sharing options...
0 notle2012 233 Postado Agosto 30, 2012 Share Postado Agosto 30, 2012 reportado já resolveu Link para o comentário https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/#findComment-1327785 Compartilhar em outros sites More sharing options...
Pergunta
praduh 0
Pessoal alguém sabe como arruma esse erro?
Erro que da no exe do server:
[27/08/2012 21:03:44] [Error - Action Interface]
[27/08/2012 21:03:44] data/actions/scripts/starter.lua:onUse
[27/08/2012 21:03:44] Description:
[27/08/2012 21:03:44] data/actions/scripts/starter.lua:32: attempt to call global 'getPokemonStatus' (a nil value)
[27/08/2012 21:03:44] stack traceback:
[27/08/2012 21:03:44] data/actions/scripts/starter.lua:32: in function <data/actions/scripts/starter.lua:14>
Arquivo data\actions\scripts\starter.lua:
local starterpokes = {
["Chikorita"] = {x = 1061, y = 1048, z = 6},
["Squirtle"] = {x = 1071, y = 1048, z = 6},
["Charmander"] = {x = 1067, y = 1048, z = 6},
["Cyndaquil"] = {x = 1065, y = 1048, z = 6},
["Totodile"] = {x = 1069, y = 1048, z = 6},
["Bulbasaur"] = {x = 1063, y = 1048, z = 6},
}
local level = 5
local extrastr = 1.5
local btype = "normal"
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 1 then
return true
end
local pokemon = ""
for a, b in pairs (starterpokes) do
if isPosEqualPos(topos, b) then
pokemon = a
end
end
if pokemon == "" then return true end
local gender = getRandomGenderByName(pokemon)
local mypoke = getPokemonStatus(pokemon)
if not mypoke then return true end
local offense = mypoke.off * level * extrastr
local defense = mypoke.def * level * extrastr
local speed = mypoke.agi * level * extrastr
local vit = mypoke.vit * level * extrastr
local spatk = mypoke.spatk * level * extrastr
local happy = 180
local leveltable = getPokemonExperienceTable(pokemon)
doPlayerAddItem(cid, 2152, 40)
doPlayerAddItem(cid, 2394, 10)
doPlayerAddItem(cid, 12345, 2)
local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "level", level)
doItemSetAttribute(item, "exp", leveltable[level])
doItemSetAttribute(item, "nextlevelexp", leveltable[level+1] - leveltable[level])
doItemSetAttribute(item, "offense", offense)
doItemSetAttribute(item, "defense", defense)
doItemSetAttribute(item, "speed", speed)
doItemSetAttribute(item, "vitality", vit)
doItemSetAttribute(item, "specialattack", spatk)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
doItemSetAttribute(item, "firstpoke", getCreatureName(cid))
doPlayerAddItemEx(cid, item, true)
doTransformItem(item, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.")
doPlayerSendTextMessage(cid, 27, "Don\'t forget to use your pokedex on every undiscovered pokemon!")
doSendMagicEffect(getThingPos(cid), 29)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), 27)
doSendMagicEffect(getThingPos(cid), 29)
return
end
Linha de comando no action.xml:
-- BOXES (poke inicial)
<action itemid="1740" event="script" value="starter.lua"/>
Se alguém puder me ajudar fico muito grato.
Editado por PraduHLink para o comentário
https://xtibia.com/forum/topic/192861-erro-nos-baus-de-poke-inicial/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados