-- Script by LuckOake
function onSay(cid, words)
local waittime = 20 -- Tempo de exhaustion
local storage = 6811
local tempo = 10800 -- Tempo em segundos até a vocation sumir
local vocation = 10 -- Vocation ID
local mana = 100 -- Mana necessária
local outfit = {lookType = 123, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} -- Outfit
local useable_vocs = {"Elite Knight"} -- Vocations que podem usar a talk
local level = 100
if not isInArray(useable_vocs, getPlayerVocationName(cid)) then
doPlayerSendCancel(cid, "Your vocation cannot use this spell.") return true
elseif exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.") return true
elseif getPlayerMana(cid) < mana then
doPlayerSendCancel(cid, "Not enough mana.") return true
elseif getPlayerLevel(cid) < level then
doPlayerSendCancel(cid, "You need to be atleast level "..level..".") return true
end
exhaustion.set(cid, storage, waittime)
doPlayerAddMana(cid, -mana)
setPlayerStorageValue(cid, 8152, getPlayerVocation(cid))
doSetCreatureOutfit(cid, outfit, -1)
doPlayerSetVocation(cid, vocation)
addEvent(doPlayerSetVocation, tempo*1000, cid, getPlayerStorageValue(cid, 8152))
addEvent(doRemoveCondition, tempo*1000, cid, CONDITION_OUTFIT)
return true
end
ta ae...




info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado
Essa script faz player se transformar e troca o playerde voc, alguem pode mim ajudar a adicionar level nela?
-- Script by LuckOake
function onSay(cid, words)
local waittime = 20 -- Tempo de exhaustion
local storage = 6811
local tempo = 10800 -- Tempo em segundos até a vocation sumir
local vocation = 10 -- Vocation ID
local mana = 100 -- Mana necessária
local outfit = {lookType = 123, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} -- Outfit
local useable_vocs = {"Elite Knight"} -- Vocations que podem usar a talk
if not isInArray(useable_vocs, getPlayerVocationName(cid)) then
doPlayerSendCancel(cid, "Your vocation cannot use this spell.") return true
elseif exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.") return true
elseif getPlayerMana(cid) < mana then
doPlayerSendCancel(cid, "Not enough mana.") return true
end
exhaustion.set(cid, storage, waittime)
doPlayerAddMana(cid, -mana)
setPlayerStorageValue(cid, 8152, getPlayerVocation(cid))
doSetCreatureOutfit(cid, outfit, -1)
doPlayerSetVocation(cid, vocation)
addEvent(doPlayerSetVocation, tempo*1000, cid, getPlayerStorageValue(cid, 8152))
addEvent(doRemoveCondition, tempo*1000, cid, CONDITION_OUTFIT)
return true
end