essa é a tua talk
function onSay(cid, words, param, channel)
function getPlayerReset(cid)
local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid))
return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end
if (param ~= "dark" and param ~= "hellborn" and param ~= "supreme") then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce digitou errado o nome da classe")
return TRUE
end
local config = {
darklvl = 20, -- level para resetar dark
hellbornlvl = 30, -- level para resetar hellborn
supremelvl = 50, -- level para resetar supreme
vocationDark = 15, -- id vocação dark
vocationHellborn = 16, -- id vocação hellborn
vocationSupreme = 17, -- id vocação supreme
lvlreset = 250, -- level apos resetar primeiras vocações
lvlHellborn = 250, -- level apos resetar vocação sacred
player = getPlayerGUID(cid), -- não mexa!
reset = 50,
pz = "yes", -- players precisam estar em protection zone para usar? ("yes" or "no").
battle = "yes", -- players deve estar sem battle ("yes" or "no")
premium = "no" -- se precisa ser premium account ("yes" or "no")
}
if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa estar em Protection Zone para usar este comando.")
return TRUE
end
if(config.premium == "yes") and (not isPremium(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.")
return TRUE
end
if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce nao pode usar com battle.")
return TRUE
end
if (param == "dark") then
if (getPlayerReset(cid) >= 50) then
if (getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 14) then
if (getPlayerLevel(cid) >= config.darklvl) then
doPlayerSetVocation(cid, config.vocationDark)
setPlayerStorageValue(cid, 897979, config.vocationDark)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = 0 WHERE `id` = "..config.player)
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.darklvl..".")
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ter promotion.")
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce precisa ter 50 resets ou mais para poder mudar de classe.")
return TRUE
end
return true
end
if (param == "hellborn") then
if (getPlayerVocation(cid) == 15) then
if (getPlayerLevel(cid) >= config.hellbornlvl) then
doPlayerSetVocation(cid, config.vocationHellborn)
setPlayerStorageValue(cid, 897979, config.vocationHellborn)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = 0 WHERE `id` = "..config.player)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.hellbornlvl..".")
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.")
return TRUE
end
return true
end
if (param == "supreme") then
if (getPlayerVocation(cid) == 16) then
if (getPlayerLevel(cid) >= config.supremelvl) then
doPlayerSetVocation(cid, config.vocationSupreme)
setPlayerStorageValue(cid, 897979, config.vocationSupreme)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.lvlHellborn..", `experience` = 0 WHERE `id` = "..config.player)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Voce precisa ser level "..config.supremelvl..".") return true
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return true
end
return true
end
return true
end
e isso vc coloca n onLogin.lua
if getPlayerStorageValue(cid, 897979) ~= -1 then
doPlayerSetVocation(cid, getPlayerStorageValue(cid, 897979))
end