Veja ae se está conforme você pediu...se sim, da up ae, se não, tenta explicar novamente!
local function endTransform(cid)if isCreature(cid) and getPlayerStorageValue(cid, 8152) > 0 then
doPlayerSetVocation(cid, getPlayerStorageValue(cid, 8152))
setPlayerStorageValue(cid, 8152, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
end
function onSay(cid, words)
local waittime = 2 -- Tempo de exhaustion
local storage = 6811
local tempo = math.abs(1000*getCreatureMaxMana(cid)*0.3) -- Tempo em milesegundos (1seg = 1000) até a vocation sumir
local vocation = 61 -- Vocation ID
local mana = 1 -- Quando de mana se tira por segundo
local manamin = getCreatureMaxMana(cid)*0.3 -- Mana mínima necessária e que determina o tempo
local outfit = {lookType = 118, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} -- Outfit
local useable_vocs = {"Knight"} -- Vocations que podem usar a talk
local level = 40
local levelMax = 150
if not isInArray(useable_vocs, getPlayerVocationName(cid)) then
doPlayerSendCancel(cid, "Essa vocaçao nao possui o selo.") return true
elseif exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar esse selo novamente.") return true
elseif getPlayerMana(cid) < manamin then
doPlayerSendCancel(cid, "Voce nao tem chakra suficiente.") return true
elseif getPlayerLevel(cid) < level then
doPlayerSendCancel(cid, "Voce prescisa estar level "..level..".") return true
elseif getPlayerLevel(cid) >= levelMax then
doPlayerSendCancel(cid, "O level maximo para usar esse selo é ("..levelMax..").") return true
end
exhaustion.set(cid, storage, waittime)
for i = 1, math.abs(getCreatureMaxMana(cid)*0.3) do
addEvent(doPlayerAddMana, i*1000, cid, -mana) -- A cada 1 segundo sairá a mana pré-determinada
end
setPlayerStorageValue(cid, 8152, getPlayerVocation(cid))
doSetCreatureOutfit(cid, outfit, -1)
doPlayerSetVocation(cid, vocation)
addEvent(endTransform, tempo, cid)
return true
end
Em azul significa onde mudei ou adicionei algo.




info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado
galera to com uma talk que muda vocation do player e transform ele por certo tempo, eu queria saber se tem como fazer pra ela ficar gastando a mana do player e quando chega-se a certa quantidade ele voltava a vocaçao normal e o addon saia, caso nao de certo fazer isso, façam so para tirar mana msm, que da certo, script:
Editado Novembro 17 por nbb147