Ir para conteúdo

Featured Replies

Postado

Olá pessoal do Tibiaking, sou novo no fórum e a um tempo venho desenvolvendo um servidor, porem estou com um

problema pois não tenho um bom conhecimento em Scripts.

 

Então eu queria ajuda de vocês para resolver este problema que está me incomodando...

 

Vamos direto ao ponto:

 

eu estou com um script de go/back feito por Mkalo para tibia ,(não pokemon)

ele funciona perfeitamente porem acontece um pequeno erro, quando eu entro em um Magic Force Field (teleport) o summon some

e não retorna na "pokebola" ela fica como se tive-se aberta mesmo clicando varias vezes não acontece nada, somente diz que o

pokemon (summon) ja está fora dela.

 

Não aparece nenhum erro na distro. (segue script)

 

 

--[[

This file is part of Pokemon Systems by Mkalo.
 
Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
 
   Pokemon System By Mkalo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with Pokemon System By Mkalo. If not, see
]]--
local pokes = {
["Pet Wolf"] = {level = 100, go = "Saia wolf!", back = "Volte wolf."},
["Pet Panda"] = {level = 100, go = "Saia panda!", back = "Volte panda."},
["Pet Hyaena"] = {level = 100, go = "Saia hyaena!", back = "Volte hyaena."},
["Pet Gorilla"] = {level = 200, go = "Saia gorilla!", back = "Volte gorilla."},
["Pet Bear"] = {level = 200, go = "Saia bear!", back = "Volte bear."},
["Pet Lion"] = {level = 300, go = "Saia lion!", back = "Volte lion."},
["Pet Tiger"] = {level = 300, go = "Saia tiger!", back = "Volte tiger."},
["Pet Elephant"] = {level = 400, go = "Saia elephant!", back = "Volte elephant."},
["Pet Mammoth"] = {level = 400, go = "Saia mammoth!", back = "Volte mammoth."},
}
 
local msgunica = false
 
function onUse(cid, item, frompos, item2, topos)
 
local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]"))
local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))
 
if item.itemid == pokeout then
 
if health ~= nil and health <= 0 then
return doPlayerSendCancel(cid, "Seu pet esta morto.")
end
 
if #getCreatureSummons(cid) >= 1 then
for _,z in pairs(getCreatureSummons(cid)) do
if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then
doTransformItem(item.uid, pokein)
if msgunica then
doCreatureSay(cid, "Back, " .. getCreatureName(z), TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, pokes[getCreatureName(z)].back, TALKTYPE_ORANGE_1)
end
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")
setPlayerStorageValue(cid, 61204, 0)
doSendMagicEffect(getCreaturePosition(z), 10)
return doRemoveCreature(z)
end
end
end
 
elseif item.itemid == pokein then
 
if getTilePzInfo(getCreaturePosition(cid)) then
return doPlayerSendCancel(cid, "Voce nao pode usar seu pet em Protection Zones.")
end
 
if not canSummon(cid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
 
if getPlayerStorageValue(cid, 63215) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")
end
 
if getPlayerStorageValue(cid, 62314) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while flying.")
end
 
if getPlayerStorageValue(cid, 59987) >= 1 then
return doPlayerSendCancel(cid, "You can't use pokeball while riding.")
end
 
for i,x in pairs(pokes) do
if #getCreatureSummons(cid) >= 1 then
return doPlayerSendCancel(cid, "You already summoned a pokemon.")
end
 
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
if getPlayerLevel(cid) >= x.level then
pk =  doSummonCreature(i, getThingPosition(cid))
doConvinceCreature(cid, pk)
setCreatureMaxHealth(pk, tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")))
doCreatureAddHealth(pk, maxh)
doCreatureAddHealth(pk, health-maxh)
doTransformItem(item.uid, pokeout)
if msgunica then
doCreatureSay(cid, "Go, " .. i, TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, x.go, TALKTYPE_ORANGE_1)
end
doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))
doSendMagicEffect(getCreaturePosition(pk), 10)
setPlayerStorageValue(cid, 61204, 1)
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
break
else
doPlayerSendCancel(cid, "Only players level "..x.level.." or higher can use this pet.")
end
end
end
end
return TRUE
end

 

 

Ficarei muito grato caso alguém consiga me ajudar, não sei se seria possível mais eu acho que

um script que impedisse o player entrar em PZ com o pokemon para fora resolveria o problema...

 

(O server é 8.60 tfs 0.3.6)

 

Obrigado. (rep+)

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

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo