HI! I have problem with 2 scripts Medicine and Revive. When pokemon die and use revive he have full hp and atack but not heal burn or ice passive dmg the same is with medicine here is my scripts i don't know what is wrong or what have i add .
REVIVE
MEDICINE
REVIVE
LUA:
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, 990) >= 1 then
doPlayerSendCancel(cid, "You can't use revive during gym battles.")
return true
end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
end
--
if item2.itemid <= 0 or not isPokeball(item2.itemid) then
doPlayerSendCancel(cid, "Please, use revive only on pokeballs.")
return true
end
for a, b in pairs (pokeballs) do
if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG
doTransformItem(item2.uid, b.on)
doSetItemAttribute(item2.uid, "hp", 1)
for c = 1, 15 do
local str = "move"..c
setCD(item2.uid, str, 0)
end
setCD(item2.uid, "control", 0)
setCD(item2.uid, "blink", 0) --alterado v1.6
doSendMagicEffect(getThingPos(cid), 13)
doRemoveItem(item.uid, 1)
doCureBallStatus(item2.uid, "all")
cleanBuffs2(item2.uid) --alterado v1.5
return true
end
end
return true
end
MEDICINE
LUA:
function onUse(cid, item, frompos, item2, topos) --alterado v1.8 \/ ajeitado!
if not isSummon(item2.uid) then return doPlayerSendCancel(cid, "This potion can only be used on pokémons.") end
if getCreatureMaster(item2.uid) ~= cid then return doPlayerSendCancel(cid, "You can only use it in your own pokemon.") end
if getPlayerStorageValue(cid, 52481) >= 1 then return doPlayerSendCancel(cid, "You can't do that while a duel.") end
local pokeball = getPlayerSlotItem(cid, 8)
doCureBallStatus(pokeball.uid, "all")
doCureStatus(item2.uid, "all", false)
if (getCreatureCondition(item2.uid, CONDITION_PARALYZE) == true) then
doRemoveCondition(item2.uid, CONDITION_PARALYZE)
end
if getCreatureSpeed(item2.uid) < getSpeed(item2.uid) then
doRegainSpeed(item2.uid)
end
doSendMagicEffect(getThingPos(item2.uid), 14)
doRemoveItem(item.uid, 1)
return true
end
Last edited by a moderator: