Ae Pessoal, estou criando meu OT Server e estou precisando de um sistema de resets que mude a vocation quando reseta (igual a do Rozin), e que de preferencia, resete mana e life! Alguem pode me ajudar?!
Eu tenho 4 vocations iniciais, Warrior, Archer, Wizard e Priest. Queria que quando eles pegassem level 50k, pudessem resetar pra Elemental Master, e voltassem pro level 8, depois, quando pegassem level 150k, resetassem pra outra vocation, e por aí fosse, eu tenho um script parecido, mas quando eu reseto não mudo a vocation, tá aí o script:
function onSay(cid, words, param)config = {
level= 50000, -- level para resetar
RemainingLvl=1000, -- level que ficara depois do reset
exper=10000, -- Experiência que ficara depois do Reset
pid=getPlayerGUID(cid), -- Não Mecha
skull="yes", -- Players com Skull podem resetar "yes" para sim e "no" para não
redskull="yes",-- Players com Red Skull podem resetar "yes" para sim e "no" para não
prot="yes", -- precisa estar em area pz para resetar "yes" para sim e "no" para não
bat="yes", -- player com fight pode resetar "yes para sim e "no" para não
mana = 1000, -- mana que ficara após o reset
health = 1000, -- Health que ficara após o reset
new_voc = 5 -- Vocacao apos o reset
}
function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end
if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid, 24, "apenas players sem white skull podem resetar.")
return TRUE
elseif(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"apenas player sem red skull podem resetar.")
return TRUE
elseif(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder resetar.")
return TRUE
elseif(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder resetar.")
return TRUE
end
if getPlayerLevel(cid) >= config.level then
if getPlayerVocation(cid) == 1 then -- Vocação que o player precisa ter
setPlayerStorageValue(cid,1020,getResets(cid)+1)
doTeleportThing(cid, {x = 160, y = 54, z = 7}) -- pos do seu templo
doRemoveCreature(cid, true)
db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper..",`manamax` = "..config.mana..",`healthmax` = "..config.health..",`health` = "..config.health..",`mana` = "..config.mana..",`vocation` = ".. new_voc .." WHERE `id` = "..config.pid)
else
doPlayerSendCancel(cid, "Você precisa ser sorcerer para resetar.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Você precisa do level "..config.level.." ou mais para resetar.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end
Alguem pode me ajudar?