local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
return false
end
if tb_rot[n] == false then
doCreatureAddHealth(cid, heals['hp'])
doCreatureAddMana(cid, heals['mana'])
doSendMagicEffect(getCreaturePosition(cid), 3)
addEvent(rot, interval,cid,2,old)
return false
end
n = n+1
addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
if isInArray(cid) == TRUE then
return FALSE
end
if getPlayerMaxMana(cid) and getCreatureMaxHealth(cid) then
doPlayerSendCancel(cid,"Your life and mana full")
end
addEvent(rot, interval,cid,1,getCreaturePosition(cid))
return FALSE
end
info
Group: Barão
Joined: 05/08/10
Posts: 218
Reputation: +86
Gender: Masculino

Luck esta a mesma coisa lek , o ot trava !
e
mulizeu esta a mesma coisa , ele continua a encher e diz "you life and mana full" :S
Edited Agosto 29 by Mattziin
info
Group: Lorde
Joined: 22/07/12
Posts: 2.2k
Reputation: +453
Tibia Character: Kissy

local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
return false
end
if tb_rot[n] == false then
doCreatureAddHealth(cid, heals['hp'])
doCreatureAddMana(cid, heals['mana'])
doSendMagicEffect(getCreaturePosition(cid), 3)
addEvent(rot, interval,cid,2,old)
return false
end
n = n+1
addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
if isInArray(cid) == TRUE then
return FALSE
end
if getPlayerMaxMana(cid) and getCreatureMaxHealth(cid) then
doPlayerSendCancel(cid,"Your life and mana full")
end
addEvent(rot, interval,cid,1,getCreaturePosition(cid))
return FALSE
end
if getCreatureMaxHealth(cid) then
if getPlayerMaxMana(cid) then
doPlayerSendTextMessage(cid, 22 ,"Desculpe Voce ja tem a mana full")
end
return true
end
info
Group: Barão
Joined: 05/08/10
Posts: 218
Reputation: +86
Gender: Masculino

Mais ele contua a encher mana e life vazia ou cheia??
se for cheia é so por isso
local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
return false
end
if tb_rot[n] == false then
doCreatureAddHealth(cid, heals['hp'])
doCreatureAddMana(cid, heals['mana'])
doSendMagicEffect(getCreaturePosition(cid), 3)
addEvent(rot, interval,cid,2,old)
return false
end
n = n+1
addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
if isInArray(cid) == TRUE then
return FALSE
end
if getPlayerMaxMana(cid) and getCreatureMaxHealth(cid) then
return doPlayerSendCancel(cid,"Your life and mana full")
end
addEvent(rot, interval,cid,1,getCreaturePosition(cid))
return FALSE
end
SkyLight
ficou a mesma coisa lek :S
Mulizeu
Agora ele nao enche , ele diz q ta full sendo q nao estar !
Edited Agosto 29 by Mattziin
info
Group: Herói
Joined: 20/05/10
Posts: 3.4k
Reputation: +1.5k
Gender: Masculino

function onSay(cid, words, param)
events = {}
function rot(cid, formula)
if not isCreature(cid) then return LUA_ERROR end
if getCreatureHealth(cid) < getCreatureMaxHealth(cid) or getCreatureMana(cid) < getCreatureMaxMana(cid) then
doCreatureAddHealth(cid, getCreatureHealth(cid) < getCreatureMaxHealth(cid) and formula.hp or 0)
doCreatureAddMana(cid, getCreatureMana(cid) < getCreatureMaxMana(cid) and formula.mana or 0)
doSendMagicEffect(getCreaturePosition(cid), 3)
events[getPlayerGUID(cid)] = addEvent(rot, 1000, cid, formula)
end
return true
end
local x = {hp = 800, mana = 800}
rot(cid, x)
return true
end
Vodkart
Lek eu te amo funfou
s2s2s2s2s2
Só q nao aparece a mensagem "Vc estar full" quando estar full.
poderia adicionar uma função de falar sem ser o doPlayerSendCancel ? ![]()
Edited Agosto 29 by Mattziin
info
Group: Herói
Joined: 20/05/10
Posts: 3.4k
Reputation: +1.5k
Gender: Masculino

function onSay(cid, words, param)
events = {}
function rot(cid, formula)
if not isCreature(cid) then return LUA_ERROR end
if getCreatureHealth(cid) < getCreatureMaxHealth(cid) or getCreatureMana(cid) < getCreatureMaxMana(cid) then
doCreatureAddHealth(cid, getCreatureHealth(cid) < getCreatureMaxHealth(cid) and formula.hp or 0)
doCreatureAddMana(cid, getCreatureMana(cid) < getCreatureMaxMana(cid) and formula.mana or 0)
doSendMagicEffect(getCreaturePosition(cid), 3)
events[getPlayerGUID(cid)] = addEvent(rot, 1000, cid, formula)
end
return true
end
local x = {hp = 800, mana = 800}
if getCreatureHealth(cid) == getCreatureMaxHealth(cid) and getCreatureMana(cid) == getCreatureMaxMana(cid) then
doPlayerSendTextMessage(cid, 22 , "Desculpe mais sua mana e hp ja esta full") return true
end
rot(cid, x)
return true
end
Edited Agosto 29 by Vodkart
Vodkart
Mano Deu Certo , muito obrigado mesmo.
Skylight, Mozuli e luckoake
obrigado por tentarem me ajuda ![]()
Podem fechar o topico.
O Vodkart vc poderia me ajuda aqui tambem ? http://www.xtibia.com/forum/topic/193003-script-pra-uma-sword/page__fromsearch__1
Edited Agosto 29 by Mattziin
info
Group: Lorde
Joined: 22/07/12
Posts: 2.2k
Reputation: +453
Tibia Character: Kissy

duvida sanada
reportado
Eta esqueci de dizer , vodkart mais esse dai quando ele anda continua enchendo , eu queria um q se ele andar para na hora entendeu?
ou entao um que se algum player te atacar ele para de healar na hora.
tem como buga com essa talkactions se bota na hotckey e fica falando direto ela ela enche muito rapido e buga , nao existe uma maneira de tirar isso nao ?
Edited Setembro 2 by Mattziin





info
Group: Marquês
Joined: 22/07/12
Posts: 1.1k
Reputation: +400
Gender: Masculino
Tibia Character: Luck Oake
@SkyLigh
Tá, já percebemos que não funciona. Mas ao invés de simplesmente falar que não funciona, me corrija.
@Topic
Tenta assim:
local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
local php = getCreatureMaxHealth(cid)
local mhp = getCreatureMaxMana(cid)
----
local interval = 1000
local function rot(cid,n,old)
local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
return false
end
if tb_rot[n] == false then
while getCreatureHealth(cid) ~= php and getCreatureMana(cid) ~= mhp do
doCreatureAddHealth(cid, heals['hp'])
doCreatureAddMana(cid, heals['mana'])
doSendMagicEffect(getCreaturePosition(cid), 3)
addEvent(rot, interval,cid,2,old)
end
doPlayerSendCancel(cid, "Life e Mana completos.")
return false
end
n = n+1
addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
if isInArray(cid) == TRUE then
return FALSE
end
addEvent(rot, interval,cid,1,getCreaturePosition(cid))
return FALSE
end
Edited Agosto 29 by LuckOake