NB
pedido

Adicionar Level Na Talkactions

Por nbb147, 03 de nov. de 2012 em Scripts

script
5
1.1k
nbb147N
03 de novembro de 2012 às 20:00

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

SlicerS
03 de novembro de 2012 às 20:19

 

-- 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...

nbb147N
03 de novembro de 2012 às 20:34

cara deu certo, rep+, posso te fazer um pedido?

SlicerS
03 de novembro de 2012 às 20:50

ja deveria ter feito ^^

nbb147N
03 de novembro de 2012 às 20:51

tem como colocar pra quando o player chegar em certo level nao poder mais usar essa talk?