solta o script da Joy pra mim usar como base ai meu nobre
info
Grupo: Cavaleiro
Registrado: 05/10/17
Posts: 185
Reputação: +43
Gênero: Masculino

info
Grupo: Visconde
Registrado: 09/05/18
Posts: 267
Reputação: +9
Gênero: Feminino
Char no Tibia: Merascylla

3 horas atrás, Holograma disse:solta o script da Joy pra mim usar como base ai meu nobre
oi, desculpa pela demora é esse aqui
local posis = { --[storage da city] = {pos da nurse na city},
[897530] = {x = 1054, y = 1050, z = 7}, --saffron --alterado v1.9 \/
[897531] = {x = 1061, y = 900, z = 7}, --cerulean
[897532] = {x = 1203, y = 1040, z = 7}, --lavender
[897533] = {x = 1213, y = 1321, z = 7}, --fuchsia
[897534] = {x = 860, y = 1094, z = 6}, --celadon
[897535] = {x = 706, y = 1083, z = 7}, --viridian
[897536] = {x = 1073, y = 1233, z = 7}, --vermilion
[897537] = {x = 723, y = 844, z = 7}, --pewter
[897538] = {x = 848, y = 1394, z = 7}, --cinnabar
[897539] = {x = 1554, y = 1194, z = 5}, --snow
[897540] = {x = 258, y = 429, z = 7}, --golden
[897541] = {x = 243, y = 1028, z = 7}, -- Hammlin
[897542] = {x = 268, y = 1163, z = 7}, -- Shamouti
[897543] = {x = 252, y = 1260, z = 6}, -- Ascordbia
[897544] = {x = 2612, y = 985, z = 7}, -- Vip 1
[897545] = {x = 2680, y = 675, z = 7}, -- Vip 2
[897546] = {x = 2559, y = 444, z = 5}, -- Vip 3
[897546] = {x = 2559, y = 444, z = 5}, -- Pallet
[897546] = {x = 652, y = 1171, z = 7}, -- Coliseum
[897546] = {x = 1163, y = 1450, z = 13}, -- Outland north
[897546] = {x = 1509, y = 1290, z = 13}, -- outland west
[897546] = {x = 1152, y = 1068, z = 13}, -- outland sul
}
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye sir!')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
for a, b in pairs(gobackmsgs) do
local gm = string.gsub(b.go, "doka!", "")
local bm = string.gsub(b.back, "doka!", "")
if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then
return true
end
end
if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) then
if exhaustion.get(cid, 9211) then
selfSay('Por Favor espere um momento para eu por curar novamente seus Pokemons!')
return true
end
if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then
selfSay("Por Favor, entre no Centro Pokemon para eu poder curar seus Pokemons!")
return true
end
if getPlayerStorageValue(cid, 52480) >= 1 then
selfSay("Não possu curar seus Pokemons enquanto você está em Duel!") --alterado v1.6.1
return true
end
exhaustion.set(cid, 9211, 1)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doCureStatus(cid, "all", true)
doSendMagicEffect(getThingPos(cid), 103)
local mypb = getPlayerSlotItem(cid, 8)
if #getCreatureSummons(cid) >= 1 then
if not nurseHealsPokemonOut then
selfSay("Please, return your pokemon to his ball!")
return true
end
local s = getCreatureSummons(cid)[1]
doCreatureAddHealth(s, getCreatureMaxHealth(s))
doSendMagicEffect(getThingPos(s), 13)
doCureStatus(s, "all", false)
if getPlayerStorageValue(s, 1008) < baseNurseryHappiness then
setPlayerStorageValue(s, 1008, baseNurseryHappiness)
end
if getPlayerStorageValue(s, 1009) > baseNurseryHunger then
setPlayerStorageValue(s, 1009, baseNurseryHunger)
end
else
if mypb.itemid ~= 0 and isPokeball(mypb.itemid) then --alterado v1.3
doItemSetAttribute(mypb.uid, "hp", 1)
if getItemAttribute(mypb.uid, "hunger") and getItemAttribute(mypb.uid, "hunger") > baseNurseryHunger then
doItemSetAttribute(mypb.uid, "hunger", baseNurseryHunger)
end
for c = 1, 15 do
local str = "move"..c
setCD(mypb.uid, str, 0)
end
if getItemAttribute(mypb.uid, "happy") and getItemAttribute(mypb.uid, "happy") < baseNurseryHappiness then
doItemSetAttribute(mypb.uid, "happy", baseNurseryHappiness)
end
if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
for a, b in pairs (pokeballs) do
if isInArray(b.all, mypb.itemid) then
doTransformItem(mypb.uid, b.on)
end
end
end
end
end
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
local balls = getPokeballsInContainer(bp.uid)
if #balls >= 1 then
for _, uid in ipairs(balls) do
doItemSetAttribute(uid, "hp", 1)
for c = 1, 15 do
local str = "move"..c
setCD(uid, str, 0)
end
if getItemAttribute(uid, "hunger") and getItemAttribute(uid, "hunger") > baseNurseryHunger then
doItemSetAttribute(uid, "hunger", baseNurseryHunger)
end
if getItemAttribute(uid, "happy") and getItemAttribute(uid, "happy") < baseNurseryHappiness then
doItemSetAttribute(uid, "happy", baseNurseryHappiness)
end
local this = getThing(uid)
for a, b in pairs (pokeballs) do
if isInArray(b.all, this.itemid) then
doTransformItem(uid, b.on)
end
end
end
end
selfSay('Todos os seus Pokemons foram curados, Boa Sorte em sua jornada!')
if useKpdoDlls then --alterado v1.7
doUpdateMoves(cid)
end
if useOTClient then
onPokeHealthChange(cid) --alterei aki
end
end
end
info
Grupo: Cavaleiro
Registrado: 05/10/17
Posts: 185
Reputação: +43
Gênero: Masculino

local itemID = 1234 -- ID do item no mapa que irá acionar a cura function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == itemID then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) -- Cura o jogador doCureStatus(cid, "all", true) -- Cura todos os status negativos do jogador doSendMagicEffect(getThingPos(cid), EFFECT_HEAL) -- Efeito de cura local backpack = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if backpack.itemid == 0 then return true end local iter = makeItemIter(backpack.uid) local ball = iter.next() while ball.itemid ~= 0 do if isPokeball(ball.itemid) then local creatureID = getItemAttribute(ball.uid, "pokeid") if creatureID then doCreatureAddHealth(creatureID, getCreatureMaxHealth(creatureID) - getCreatureHealth(creatureID)) -- Cura o Pokémon doCureStatus(creatureID, "all", true) -- Cura todos os status negativos do Pokémon doSendMagicEffect(getThingPos(creatureID), EFFECT_HEAL) -- Efeito de cura end end ball = iter.next() end iter.free() doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Todos os seus Pokémon foram curados.") -- Mensagem de sucesso end return true end function isPokeball(itemid) -- Adicione aqui os itemids das pokébolas que deseja considerar local validPokeballIDs = {1, 2, 3, 4} -- Por exemplo, considere as pokébolas com IDs 1, 2, 3, 4 for _, id in ipairs(validPokeballIDs) do if itemid == id then return true end end return false end
Editado Abril 10 por Holograma
info
Grupo: Visconde
Registrado: 09/05/18
Posts: 267
Reputação: +9
Gênero: Feminino
Char no Tibia: Merascylla

2 horas atrás, Holograma disse:local itemID = 1234 -- ID do item no mapa que irá acionar a cura function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == itemID then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) -- Cura o jogador doCureStatus(cid, "all", true) -- Cura todos os status negativos do jogador doSendMagicEffect(getThingPos(cid), EFFECT_HEAL) -- Efeito de cura local backpack = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if backpack.itemid == 0 then return true end local iter = makeItemIter(backpack.uid) local ball = iter.next() while ball.itemid ~= 0 do if isPokeball(ball.itemid) then local creatureID = getItemAttribute(ball.uid, "pokeid") if creatureID then doCreatureAddHealth(creatureID, getCreatureMaxHealth(creatureID) - getCreatureHealth(creatureID)) -- Cura o Pokémon doCureStatus(creatureID, "all", true) -- Cura todos os status negativos do Pokémon doSendMagicEffect(getThingPos(creatureID), EFFECT_HEAL) -- Efeito de cura end end ball = iter.next() end iter.free() doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Todos os seus Pokémon foram curados.") -- Mensagem de sucesso end return true end function isPokeball(itemid) -- Adicione aqui os itemids das pokébolas que deseja considerar local validPokeballIDs = {1, 2, 3, 4} -- Por exemplo, considere as pokébolas com IDs 1, 2, 3, 4 for _, id in ipairs(validPokeballIDs) do if itemid == id then return true end end return false end
Fiz o teste e deu certo em recuperar a vida do personagem, porém não cura a do pokémon e da esse erro:
[10/04/2024 21:46:45] [Error - Action Interface]
[10/04/2024 21:46:45] data/actions/scripts/Healing Machine.lua:onUse
[10/04/2024 21:46:46] Description:
[10/04/2024 21:46:46] data/actions/scripts/Healing Machine.lua:14: attempt to call global 'makeItemIter' (a nil value)
[10/04/2024 21:46:46] stack traceback:
[10/04/2024 21:46:46] data/actions/scripts/Healing Machine.lua:14: in function <data/actions/scripts/Healing Machine.lua:3>
info
Grupo: Cavaleiro
Registrado: 05/10/17
Posts: 185
Reputação: +43
Gênero: Masculino

perdao
local itemID = 1234 -- ID do item no mapa que irá acionar a cura function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == itemID then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) -- Cura o jogador doCureStatus(cid, "all", true) -- Cura todos os status negativos do jogador doSendMagicEffect(getThingPos(cid), EFFECT_HEAL) -- Efeito de cura local backpack = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if backpack.itemid == 0 then return true end local bpItems = getContainerItems(backpack.uid) for _, item in ipairs(bpItems) do if isPokeball(item.itemid) then local creatureID = getItemAttribute(item.uid, "pokeid") if creatureID then doCreatureAddHealth(creatureID, getCreatureMaxHealth(creatureID) - getCreatureHealth(creatureID)) -- Cura o Pokémon doCureStatus(creatureID, "all", true) -- Cura todos os status negativos do Pokémon doSendMagicEffect(getThingPos(creatureID), EFFECT_HEAL) -- Efeito de cura end end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Todos os seus Pokémon foram curados.") -- Mensagem de sucesso end return true end function isPokeball(itemid) -- Adicione aqui os itemids das pokébolas que deseja considerar local validPokeballIDs = {1, 2, 3, 4} -- Por exemplo, considere as pokébolas com IDs 1, 2, 3, 4 for _, id in ipairs(validPokeballIDs) do if itemid == id then return true end end return false end
info
Grupo: Visconde
Registrado: 09/05/18
Posts: 267
Reputação: +9
Gênero: Feminino
Char no Tibia: Merascylla

11 horas atrás, Holograma disse:perdao
local itemID = 1234 -- ID do item no mapa que irá acionar a cura function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == itemID then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) -- Cura o jogador doCureStatus(cid, "all", true) -- Cura todos os status negativos do jogador doSendMagicEffect(getThingPos(cid), EFFECT_HEAL) -- Efeito de cura local backpack = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if backpack.itemid == 0 then return true end local bpItems = getContainerItems(backpack.uid) for _, item in ipairs(bpItems) do if isPokeball(item.itemid) then local creatureID = getItemAttribute(item.uid, "pokeid") if creatureID then doCreatureAddHealth(creatureID, getCreatureMaxHealth(creatureID) - getCreatureHealth(creatureID)) -- Cura o Pokémon doCureStatus(creatureID, "all", true) -- Cura todos os status negativos do Pokémon doSendMagicEffect(getThingPos(creatureID), EFFECT_HEAL) -- Efeito de cura end end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Todos os seus Pokémon foram curados.") -- Mensagem de sucesso end return true end function isPokeball(itemid) -- Adicione aqui os itemids das pokébolas que deseja considerar local validPokeballIDs = {1, 2, 3, 4} -- Por exemplo, considere as pokébolas com IDs 1, 2, 3, 4 for _, id in ipairs(validPokeballIDs) do if itemid == id then return true end end return false end
ela continua curando a vida do personagem certinho mas não do pokémon, mas dessa fez foi diferente "data/actions/scripts/Healing Machine.lua:14: attempt to call global 'getContainerItems' (a nil value)". Eu testei com o pokémon pra fora da pokeball, com todos eles na mochila e até sem pokéball nenhuma, mas esse erro aparece em todas elas.
info
Grupo: Cavaleiro
Registrado: 05/10/17
Posts: 185
Reputação: +43
Gênero: Masculino

O erro provavelmente ocorre porque a versão do seu servidor não suporta essa função diretamente. Tenta assim
local itemID = 1234 -- ID do item no mapa que irá acionar a cura function onUse(cid, item, fromPosition, itemEx, toPosition) if itemEx.itemid == itemID then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) -- Cura o jogador doCureStatus(cid, "all", true) -- Cura todos os status negativos do jogador doSendMagicEffect(getThingPos(cid), EFFECT_HEAL) -- Efeito de cura local backpack = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK) if backpack.itemid == 0 then return true end local bpItems = getItemsInContainer(backpack.uid) -- Correção aqui for _, item in ipairs(bpItems) do if isPokeball(item.itemid) then local creatureID = getItemAttribute(item.uid, "pokeid") if creatureID then doCreatureAddHealth(creatureID, getCreatureMaxHealth(creatureID) - getCreatureHealth(creatureID)) -- Cura o Pokémon doCureStatus(creatureID, "all", true) -- Cura todos os status negativos do Pokémon doSendMagicEffect(getThingPos(creatureID), EFFECT_HEAL) -- Efeito de cura end end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Todos os seus Pokémon foram curados.") -- Mensagem de sucesso end return true end function isPokeball(itemid) -- Adicione aqui os itemids das pokébolas que deseja considerar local validPokeballIDs = {1, 2, 3, 4} -- Por exemplo, considere as pokébolas com IDs 1, 2, 3, 4 for _, id in ipairs(validPokeballIDs) do if itemid == id then return true end end return false end
Já imaginou ganhar um pouco mais de dinheiro e se divertir ao mesmo tempo? Foi exatamente isso que aconteceu comigo no onabet-apostas.com. Comecei por curiosidade, jogando Sweet Bonanza, e acabei ganhando um prêmio que nem esperava. O site é muito fácil de usar, tem muitos jogos legais e ainda oferece saques rápidos via PIX. E a melhor parte: você não precisa investir muito dinheiro para começar - você pode se cadastrar com apenas R$ 1. Se você é um entusiasta de apostas como eu, deve dar uma olhada aqui.




info
Grupo: Visconde
Registrado: 09/05/18
Posts: 267
Reputação: +9
Gênero: Feminino
Char no Tibia: Merascylla
Bom dia s2
Eu gostaria de fazer um pedido ou se esse tópico já estiver alguém pode me mandar o link, eu cheguei a procurar mas não encontrei. Bom é o seguinte, eu gostaria de um script pra quando o jogador clicar em um item do mapa os pokémon que ele tem na mochila fossem curados, da mesma forma que acontece quando ele fala com a Nurse Joy, porém seria feito por aquela maquina que geralmente fica no CP.
Desde já agradeço pela atenção.