Salve guys, to com um problema no meu script de revive e queria uma ajuda para correção
- Atualmente é possivel usar revive mesmo com pokémon vivo, queria que funcionasse apenas quando o mesmo estivesse morto
- Atualmente da pra usar revive em qualquer coisa kk, nao precisa nem selecionar a pokebola... da pra usar revive no revive !
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureTurn(creature)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getTileInfo(getThingPos(cid)).pvp then
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendTextMessage(cid, 27, "[AVISO] Voce nao pode usar Revive no PVP.")
doRemoveItem(item.uid, 1)
return true
end
if ( inSafeZoneEvent(cid) ) then
return doPlayerSendCancel(cid, "Voce nao pode usar na arena!")
end
doCureStatus(cid, "all", true)
doSendMagicEffect(getThingPos(cid), 132)
doRemoveItem(item.uid, 1)
local mypb = getPlayerSlotItem(cid, 8)
if #getCreatureSummons(cid) >= 1 then
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
PokeBar.create(cid)
local nwplayer = getCreatureName(cid)
if useKpdoDlls then --alterado v1.7
doUpdateMoves(cid)
end
end