EDITED O POSTE
function onUse(cid, item, frompos, item2, topos) if not isCreature(item2.uid) or not isSummon(item2.uid) then doPlayerSendCancel(cid, "You can only give this Boost to trainers' pokemons.") return true end if getCreatureHealth(item2.uid) == 0 then return true end local pb = getPlayerSlotItem(getCreatureMaster(item2.uid), 8) --doPlayerSendTextMessage(cid, 27, "You gave a Boost Stone to "..getPokeName(item2.uid)..".") local level = getItemAttribute(pb.uid, "level") local exp = getItemAttribute(pb.uid, "exp") local neededexp = getItemAttribute(pb.uid, "nextlevelexp") local boost = getItemAttribute(pb.uid, "boost") or 0 if boost >= 200 then doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.") return true end doRemoveItem(item.uid, 1) if getHappiness(item2.uid) < 50 then doSendMagicEffect(getThingPos(item2.uid), 168) return true end doCreatureSay(item2.uid, "BOOST+.", TALKTYPE_ORANGE_1) doSetItemAttribute(pb.uid, "boost", boost + 1) doPlayerSendTextMessage(getCreatureMaster(item2.uid), 27, "Your "..getPokeName(item2.uid).." has eaten a Boost Stone!") doSendFlareEffect(getThingPos(item2.uid)) doSendAnimatedText(getThingPos(item2.uid), "B O O S T!", 215) doCreatureSay(cid, getPokeName(item2.uid)..", take this Boost!", TALKTYPE_SAY) return false end






info
Group: Campones
Joined: 16/10/12
Posts: 45
Reputation: +4
Tibia Character: Chapalirous
Boost Stone quando Chega no boost maximo ela continua Gastando e não boosta mais. Eu queria que parasse de gastar as Boost Stone quando chega no boost Máximo
function onUse(cid, item, frompos, item2, topos)
if not isCreature(item2.uid) or not isSummon(item2.uid) then
doPlayerSendCancel(cid, "You can only give this Boost to trainers' pokemons.")
return true
end
if getCreatureHealth(item2.uid) == 0 then return true end
local pb = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
doPlayerSendTextMessage(cid, 27, "You gave a Boost Stone to "..getPokeName(item2.uid)..".")
doCreatureSay(cid, getPokeName(item2.uid)..", take this Boost!", TALKTYPE_SAY)
doRemoveItem(item.uid, 1)
local level = getItemAttribute(pb.uid, "level")
local exp = getItemAttribute(pb.uid, "exp")
local neededexp = getItemAttribute(pb.uid, "nextlevelexp")
local boost = getItemAttribute(pb.uid, "boost") or 0
if boost >= 200 then
doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.")
return true
end
if getHappiness(item2.uid) < 50 then
doSendMagicEffect(getThingPos(item2.uid), 168)
return true
end
doCreatureSay(item2.uid, "BOOST+.", TALKTYPE_ORANGE_1)
doSetItemAttribute(pb.uid, "boost", boost + 1)
doPlayerSendTextMessage(getCreatureMaster(item2.uid), 27, "Your "..getPokeName(item2.uid).." has eaten a Boost Stone!")
doSendFlareEffect(getThingPos(item2.uid))
doSendAnimatedText(getThingPos(item2.uid), "B O O S T!", 215)
return false
end
Edited Novembro 28 by Chapalirous