Ir para conteúdo

[Encerrado] Look nas pokeballs e Revive:


xmaster0

Posts Recomendados

Pessoas do xtibia,

quem pode me ajudar a colocar o look nas pokeballs pra ver os hits points (hp)

pq se eu der look com o pokemon fora da ball nele no pokemon, aparece o life mas na pokeball nada

 

Script:

 

 

function onLook(cid, thing, position, lookDistance)
if thing.itemid == 448 then
if thing.actionid == 1005 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It looks like that this tile is not a trap.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This tile is for sure a trap.")
end
return false
end
if thing.itemid == 5339 then
if thing.actionid == 1001 then
doTeleportThing(cid, {x=1003,y=1018,z=7})
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "I said there wouldn\t be anymore tips, so don\'t read everything.")
doSendMagicEffect({x=1003,y=1018,z=7}, CONST_ME_TELEPORT)
return false
else
return true
end
end
if not isMonster(thing.uid) then
return true
end
if isPlayer(getCreatureMaster(thing.uid)) then
nome = getCreatureName(getCreatureMaster(thing.uid))
poke = string.lower(getCreatureName(thing.uid))
else
return true
end
if getCreatureMaster(thing.uid) == cid then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".\nIt belongs to "..nome..".\nHP=["..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."].")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".\nIt belongs to "..nome..".")
end

return false
end

 

 

e se puderem ajudar pra botar pro revive funcionar na pokebag, pq ele so revive se o pokemon tiver na slot ( slot é o lugar onde colocamos a ball pra poder usar o poke)

 

script:

 

 

local pokeballs = {'2222', '2224'}
local ultraballs = {'2220', '2227'}
local greatballs = {'2651', '2657'}
local superballs = {'2653', '2658'}
local saffariballs = {'2655', '2659'}
local masterballs = {'11618', '11619'}

local DUSTS = {
-- pokeballs
[2224] = {2222},

-- ultraballs
[2227] = {2220},

-- greatballs
[2657] = {2651},

-- superballs
[2658] = {2653},

-- saffariballs
[2659] = {2655},

-- masterballs
[11619] = {11618}

}

function onUse(cid, item, frompos, item2, topos)
for a, b in pairs(ginasios) do
if getPlayerStorageValue(cid, b.storage) == 1 then -- GYM
doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")
return true
end
end

if isCreature(item2.uid) then
return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
end

if isPlayer(item2.uid) then
return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")
end

if item2.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
return doPlayerSendCancel(cid, "You can only use revive in pokeballs in Feet Slot!")
end
local dust = DUSTS[item2.itemid]
if(not dust) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
doSendMagicEffect(getThingPos(cid), 174)
doRemoveItem(item.uid, 1)
if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2222)
end
if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2220)
end
if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2651)
end
if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2653)
end
if isInArray(masterballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 11618)
end
if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2655)
end
end

 

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...