area incorreta.
como voce é usuario novo leia as regras.
Area correta seria:Servidores e derivados/ Pedidos e duvidas de servidores e derivados.
Topico Fechado!
Por Watsson, 20 de dez. de 2012 em Tópicos Sem Resposta
info
Grupo: Conde
Registrado: 27/07/12
Posts: 757
Reputação: +57
Char no Tibia: [ADM] Bhoris

area incorreta.
como voce é usuario novo leia as regras.
Area correta seria:Servidores e derivados/ Pedidos e duvidas de servidores e derivados.
Topico Fechado!
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Campones
Registrado: 01/02/10
Posts: 1
Reputação: 0
Char no Tibia: Oris Tath
Queria saber como configurar meu script de potion para poder usar durante a batalha..
[/size] [size=4]function setStorage(cid, storage, valor)[/size] [size=4]if isCreature(cid) then[/size] [size=4]if getPlayerStorageValue(cid, storage) >= 1 then[/size] [size=4]setPlayerStorageValue(cid, storage, valor)[/size] [size=4]end[/size] [size=4]end[/size] [size=4]end[/size] [size=4]function doHealOverTime(cid, div, turn, effect)[/size] [size=4]if not isCreature(cid) then return true end[/size] [size=4]if turn <= 0 then return true end[/size] [size=4]if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end[/size] [size=4]if getPlayerStorageValue(cid, 174) >= 1 then[/size] [size=4]setPlayerStorageValue(cid, 174, 0)[/size] [size=4]setPlayerStorageValue(cid, 173, 0)[/size] [size=4]return true[/size] [size=4]end[/size] [size=4]local d = div / 10000[/size] [size=4]local amount = math.floor(getCreatureMaxHealth(cid) * d)[/size] [size=4]doCreatureAddHealth(cid, amount)[/size] [size=4]if math.floor(turn/10) == turn/10 then[/size] [size=4]doSendMagicEffect(getThingPos(cid), effect)[/size] [size=4]end[/size] [size=4]addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)[/size] [size=4]end[/size] [size=4]local potions = {[/size] [size=4][12347] = {effect = 13, div = 30}, --super potion[/size] [size=4][12348] = {effect = 13, div = 60}, --great potion --edited deixei igual as potions do PXG[/size] [size=4][12346] = {effect = 12, div = 80}, --ultra potion[/size] [size=4][12345] = {effect = 14, div = 90}, --hyper potion[/size] [size=4]}[/size] [size=4]--[12343] = {effect = 12, div = 100}}[/size] [size=4]function onUse(cid, item, frompos, item2, topos)[/size] [size=4]if isPlayer(item2.uid) then[/size] [size=4]return doPlayerSendCancel(cid, "You can only use potions on pokemons!")[/size] [size=4]end[/size] [size=4]if not isCreature(item2.uid) then[/size] [size=4]return doPlayerSendCancel(cid, "You can only use potions on pokemons!")[/size] [size=4]end[/size] [size=4]if not isPlayer(getCreatureMaster(item2.uid)) then[/size] [size=4]return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")[/size] [size=4]end[/size] [size=4]if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then[/size] [size=4]return doPlayerSendCancel(cid, "This pokemon is already at full health.")[/size] [size=4]end[/size] [size=4]if getPlayerStorageValue(item2.uid, 173) >= 1 then[/size] [size=4]return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")[/size] [size=4]end[/size] [size=4]if getCreatureMaster(item2.uid) ~= cid then[/size] [size=4]return doPlayerSendCancel(cid, "You can only use potions on your own Pokemons!")[/size] [size=4]end[/size] [size=4]doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY)[/size] [size=4]doSendMagicEffect(getThingPos(item2.uid), 172)[/size] [size=4]setPlayerStorageValue(item2.uid, 173, 1)[/size] [size=4]doRemoveItem(item.uid, 1)[/size] [size=4]local sid = item2.uid[/size] [size=4]local a = potions[item.itemid][/size] [size=4]doHealOverTime(item2.uid, a.div, 100, effect)[/size] [size=4]addEvent(setStorage, 10000, sid, 173, 0)[/size] [size=4]return true[/size] [size=4]end[/size] [size=4]