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
Grupo: Barão
Registrado: 05/08/10
Posts: 218
Reputação: +86
Gênero: 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
Editado Agosto 29 por Mattziin
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: 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
Grupo: Barão
Registrado: 05/08/10
Posts: 218
Reputação: +86
Gênero: 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 !
Editado Agosto 29 por Mattziin
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: 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 ? ![]()
Editado Agosto 29 por Mattziin
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: 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
Editado Agosto 29 por 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
Editado Agosto 29 por Mattziin
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: 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 ?
Editado Setembro 2 por Mattziin





info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: 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
Editado Agosto 29 por LuckOake