Ir para conteúdo
  • 0

[Resolvido] Go/back, Valendo +Rep [Ajuda]


Flaah

Pergunta

Ola amigos do XTIBIA tenho um grande problema que esta acontecendo no meu server, que seria:

 

O ERRO que de um sistema de Go/Back de um Pokemon Tibia que eu achei.

 

Este é o unico erro que esta no meu server, porfavor amigos me ajuda ae, VALENDO +REP!

 

Erro quando coloco pra FORA da pokebola o pokémon.

 

[13/04/2012 13:59:18] [Error - Action Interface]

[13/04/2012 13:59:18] data/actions/scripts/goback.lua:onUse

[13/04/2012 13:59:18] Description:

[13/04/2012 13:59:18] (luaDoItemSetAttribute) Item not found

 

[13/04/2012 13:59:18] [Error - Action Interface]

[13/04/2012 13:59:18] data/actions/scripts/goback.lua:onUse

[13/04/2012 13:59:18] Description:

[13/04/2012 13:59:18] (luaDoTransformItem) Item not found

 

[13/04/2012 13:59:18] [Error - Action Interface]

[13/04/2012 13:59:18] data/actions/scripts/goback.lua:onUse

[13/04/2012 13:59:18] Description:

[13/04/2012 13:59:18] (luaDoItemSetAttribute) Item not found

 

Erro quando coloco pra DENTRO da pokebola o pokémon.

 

[13/04/2012 13:59:18] [Error - Action Interface]

[13/04/2012 13:59:18] data/actions/scripts/goback.lua:onUse

[13/04/2012 13:59:18] Description:

[13/04/2012 13:59:18] (luaDoItemSetAttribute) Item not found

 

[13/04/2012 13:59:30] [Error - Action Interface]

[13/04/2012 13:59:30] data/actions/scripts/goback.lua:onUse

[13/04/2012 13:59:30] Description:

[13/04/2012 13:59:30] (luaDoTransformItem) Item not found

 

[13/04/2012 13:59:30] [Error - Action Interface]

[13/04/2012 13:59:30] data/actions/scripts/goback.lua:onUse

[13/04/2012 13:59:30] Description:

[13/04/2012 13:59:30] (luaDoItemSetAttribute) Item not found

 

Arquivo: GoBack.lua

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
function getPokemonMaxLife(name)
	local file = io.open('data/monster/monsters.xml','r')
	local arquivo = file:read(-1):lower():match('')
	file:close()
	local data = io.open('data/monster/'..(arquivo or ''),'r')
	if not data then
		return 100
	end
	local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
	data:close()
	return maximo
end
----- Config -----
local MaximoSummon = 1
local nome1 = getItemName(item.uid)
local nome = nome1:match('(.-) Pokeball')
local summons = getCreatureSummons(cid)
local action_id = getItemAttribute(item.uid, "aid")
------ Config -----
local summons = getCreatureSummons(cid)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid then
doPlayerSendCancel(cid, "Coloque no slot certo!.")
return TRUE
end

if getTilePzInfo(getCreaturePosition(cid)) then
return doPlayerSendCancel(cid, "You can't use pokeball in Protection Zones.")
end

if getItemAttribute(item.uid,"level") >= getPlayerLevel(cid) then
doPlayerSendCancel(cid, "You dont have level to use.")
return TRUE
end

if(table.maxn(summons) < MaximoSummon) then -- no summons
creature = doSummonCreature(nome, getCreaturePosition(cid))
doConvinceCreature(cid, creature)
local hp = getCreatureHealth(getCreatureSummons(cid)[1])
doItemSetAttribute(getPlayerSlotItem(cid,8).uid, "aid", hp)
doPlayerSay(cid, "Go,"..nome.."", TALKTYPE_SAY)
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(creature, "DiePoke")
doSendMagicEffect(getCreaturePosition(creature), 188)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2532, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name",""..nome.." Pokeball")
if action_id ~= 0 then
doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(nome) - action_id)))
else
doCreatureAddHealth(creature, getPokemonMaxLife(nome))
end
else
for _, pid in ipairs(summons) do
if (table.maxn(summons) >= 1) then
doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1]))
doSendMagicEffect(getCreaturePosition(creature), 188)
doPlayerSay(cid, "Back,"..nome.."", TALKTYPE_SAY)
doRemoveCreature(pid)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2532, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", nome .." Pokeball")
end
end
end
return true
end

 

Valendo +REP

 

Poxa galera, preciso muuuuuito da ajuda de vcs :(

 

AJUDA ALGUEM AI, PORFAVOR x.x

 

VALENDO +REP

Editado por Flaah
Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

function onUse(cid, item, fromPosition, itemEx, toPosition)
function getPokemonMaxLife(name)
		    local file = io.open('data/monster/monsters.xml','r')
		    local arquivo = file:read(-1):lower():match('')
		    file:close()
		    local data = io.open('data/monster/'..(arquivo or ''),'r')
		    if not data then
				    return 100
		    end
		    local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
		    data:close()
		    return maximo
end
----- Config -----
local MaximoSummon = 1
local nome1 = getItemName(item.uid)
local nome = nome1:match('(.-) Pokeball')
local summons = getCreatureSummons(cid)
local action_id = getItemAttribute(item.uid, "aid")
------ Config -----
local summons = getCreatureSummons(cid)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid then
doPlayerSendCancel(cid, "Coloque no slot certo!.")
return TRUE
end
if getTilePzInfo(getCreaturePosition(cid)) then
return doPlayerSendCancel(cid, "You can't use pokeball in Protection Zones.")
end
if getItemAttribute(item.uid,"level") >= getPlayerLevel(cid) then
doPlayerSendCancel(cid, "You dont have level to use.")
return TRUE
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
creature = doSummonCreature(nome, getCreaturePosition(cid))
doConvinceCreature(cid, creature)
local hp = getCreatureHealth(getCreatureSummons(cid)[1])
doItemSetAttribute(item.uid, "aid", hp)
doPlayerSay(cid, "Go,"..nome.."", TALKTYPE_SAY)
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(creature, "DiePoke")
doSendMagicEffect(getCreaturePosition(creature), 188)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2532, 1)
doItemSetAttribute(item.uid,"name",""..nome.." Pokeball")
if action_id ~= 0 then
doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(nome) - action_id)))
else
doCreatureAddHealth(creature, getPokemonMaxLife(nome))
end
else
for _, pid in ipairs(summons) do
if (table.maxn(summons) >= 1) then
doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1]))
doSendMagicEffect(getCreaturePosition(creature), 188)
doPlayerSay(cid, "Back,"..nome.."", TALKTYPE_SAY)
doRemoveCreature(pid)
doTransformItem(item.uid, 2532, 1)
doItemSetAttribute(item.uid,"name", nome .." Pokeball")
end
end
end
return true
end

 

acho que agora n da mais o erro, OBS eu n testei caso n funcione avise no tópico

Link para o comentário
Compartilhar em outros sites

  • 0

ForeverTobi deu quase certo, só que esta dando o seguintes ERROS:

 

[15/04/2012 15:30:18] [Error - Action Interface]

[15/04/2012 15:30:18] data/actions/scripts/goback.lua:onUse

[15/04/2012 15:30:18] Description:

[15/04/2012 15:30:18] (luaDoTransformItem) Item not found

 

[15/04/2012 15:30:18] [Error - CreatureScript Interface]

[15/04/2012 15:30:18] data/creaturescripts/scripts/goback.lua:onDeath

[15/04/2012 15:30:18] Description:

[15/04/2012 15:30:18] (luaDoTransformItem) Item not found

 

OBS: Além desses ERROS, quando chamo o pokémon depois de 2 segundos ele morre, mais da pra chama de novo, mais morre denovo, ai fica nessa vai e vem.

 

AJUDA? Porfavor? x.x

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...