Olá Xtibianos
Estou aqui mais uma vez para postar outro Script - Sistema reset com vocation - .. Vi que Muita gente queria ele, eu consegui fazer e resolvi postar aqui..
Função : É o seguinte O player fala !promovoc, feito isso o player voltara para o level 8 com Health máxima 185, e mana máxima 35, e ainda vai para uma vocação superior
CRÉDITOS : Marcryzius - pelo sistema
Davi (eu) - pela modificação
Vá em data/talkactions/talkactions.xml e bote:
<talkaction words="!promovoc" event="script" value="promovoc.lua"/>
Em data/talkactions/scripts crie uma pasta chamada promovoc.lua e bote isso dentro dela:
function onSay(cid, words, param) config = { level= 10000, -- level para resetar RemainingLvl=8, -- level que ficara depois do reset exper=4200, -- 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 voc = getPlayerVocation(cid), -- Não mecha mana = 35, -- mana que ficara após o reset health = 185 -- Health que ficara após 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 end if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"apenas player sem red skull podem resetar.") return TRUE end if(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 end if(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 setPlayerStorageValue(cid,1020,getResets(cid)+1) doPlayerPopupFYI(cid,"you now was reset, you have "..getResets(cid)+(1).." reset\'s.") doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) if getPlayerVocation(cid) == 8 then -- Vocação que o player precisa ter doPlayerSetVocation(cid, 9) -- Vocação que o player ficara após o reset doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper..",`manamax` = "..config.mana..",`healthmax` = "..config.health..",`health` = "..config.health..",`mana` = "..config.mana.." WHERE `id` = "..config.pid) else doPlayerSendCancel(cid, "Você precisa do level "..config.level.." ou mais para resetar.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return TRUE end
Até mais..