isso é um sistema de sentar? já criei isso uma vez
http://www.xtibia.com/forum/topic/187379-sistema-de-sentar-com-recuperacao-automatica/
By HeelNox, 14 de ago. de 2013 in Scripts
info
Group: Herói
Joined: 20/05/10
Posts: 3.4k
Reputation: +1.5k
Gender: Masculino

isso é um sistema de sentar? já criei isso uma vez
http://www.xtibia.com/forum/topic/187379-sistema-de-sentar-com-recuperacao-automatica/
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

#Obrigado Slicer, não prestei atenção, no caso irá retornar e não irá healar porque não tem o valor da storage ainda, rsrs.
#Maelnise
O correto é o "hp" porque é o parâmetro da função criada.
Tente!
function onSay(cid, words, param)
local hpGain = 5
local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
heal(cid, hpGain)
doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
function heal(uid, hp)
if not isPlayer(uid) then
return true
end
if getPlayerStorageValue(uid, 9329) < 1 then
return true
end
doCreatureAddHealth(uid, hp)
return addEvent(heal, 1 * 1500, uid, hp)
end
Edited Agosto 17 by Roksas
info
Group: Visconde
Joined: 08/10/11
Posts: 444
Reputation: +71
Gender: Feminino
Tibia Character: No Have.

isso é um sistema de sentar? já criei isso uma vez
http://www.xtibia.com/forum/topic/187379-sistema-de-sentar-com-recuperacao-automatica/
Sim e um sistema de sentar
#Obrigado Slicer, não prestei atenção, no caso irá retornar e não irá healar porque não tem o valor da storage ainda, rsrs.
#Maelnise
O correto é o "hp" porque é o parâmetro da função criada.
Tente!
function onSay(cid, words, param) local hpGain = 5 local vocs = { [1] = 538, [2] = 585, [3] = 536, } if not vocs[getPlayerVocation(cid)] then return true end if getPlayerStorageValue(cid, 9329) < 1 then doCreatureSetNoMove(cid, true) setPlayerStorageValue(cid, 9329, 1) heal(cid, hpGain) doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1) elseif getPlayerStorageValue(cid, 9329) >= 1 then doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, 9329, -1) doRemoveCondition(cid, CONDITION_OUTFIT) end return true end function heal(uid, hp) if not isPlayer(uid) then return true end if getPlayerStorageValue(uid, 9329) < 1 then return true end doCreatureAddHealth(uid, hp) return addEvent(heal, 1 * 1500, uid, hp) end
Funcionou vlw
info
Group: Visconde
Joined: 08/10/11
Posts: 444
Reputation: +71
Gender: Feminino
Tibia Character: No Have.
Não funfou , estou com meu char player e não ta healando
Edited Agosto 17 by DarkHeel