-- script by Marcryzius D'evil --
function onSay(cid, words, param)
config1 =
{
level=250, -- level necessario pra reseta.
RemainingLvl=8, -- {8} = level(normal) que ficará depois de ser resetado.
exper=4200, -- experiencia que ficará depois de ser resetado.
pid=getPlayerGUID(cid), -- não mecha
skull="yes", -- players com white skull podem resetar? ("yes" or "no").
redskull="yes", -- players com red skull podem resetar? ("yes" or "no").
prot="yes", -- players precisam estar em protection zone pra resetar? ("yes" or "no").
bat="yes" -- players precisam estar sem fight pra resetarem? ("yes" or "no").
}
config2 =
{
level=500, -- level necessario pra reseta.
RemainingLvl=8, -- {8} = level(normal) que ficará depois de ser resetado.
exper=4200, -- experiencia que ficará depois de ser resetado.
pid=getPlayerGUID(cid), -- não mecha
skull="yes", -- players com white skull podem resetar? ("yes" or "no").
redskull="yes", -- players com red skull podem resetar? ("yes" or "no").
prot="yes", -- players precisam estar em protection zone pra resetar? ("yes" or "no").
bat="yes" -- players precisam estar sem fight pra resetarem? ("yes" or "no").
}
function getResets(cid)
if getPlayerStorageValue(cid,1020) == 0 then
if(config1.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"apenas players sem white skull podem resetar.")
return TRUE
end
if(config1.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"apenas player sem red skull podem resetar.")
return TRUE
end
if(config1.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"você precisa estar em protection zone pra poder resetar.")
return TRUE
end
if(config1.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"você precisa estar sem battler pra poder resetar.")
return TRUE
end
if(config1.RemainingLvl+(getPlayerLevel(cid)-config1.level) >= getPlayerLevel(cid))then
RemainingLvl=config1.RemainingLvl+(getPlayerLevel(cid)-config1.level)
else
RemainingLvl=config1.RemainingLvl
end
elseif getPlayerStorageValue(cid,1020) == 1 then
if(config2.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"apenas players sem white skull podem resetar.")
return TRUE
end
if(config2.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"apenas player sem red skull podem resetar.")
return TRUE
end
if(config2.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"você precisa estar em protection zone pra poder resetar.")
return TRUE
end
if(config2.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"você precisa estar sem battler pra poder resetar.")
return TRUE
end
if(config2.RemainingLvl+(getPlayerLevel(cid)-config2.level) >= getPlayerLevel(cid))then
RemainingLvl=config2.RemainingLvl+(getPlayerLevel(cid)-config2.level)
else
RemainingLvl=config2.RemainingLvl
end
else
doPlayerSendTextMessage(cid,22,"Voce soh pode resetar duas vezes")
if getPlayerLevel(cid) >= config1.level then
setPlayerStorageValue(cid,1020,getResets(cid)+1)
doPlayerSetNameDescription(cid, " Have a "..getResets(cid)+(1).." reset\'s.")
doPlayerPopupFYI(cid,"you now was reset, you have "..getResets(cid)+(1).." reset\'s.")
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..RemainingLvl..", `experience` = "..config1.exper.." WHERE `id` = "..config1.pid)
else
doPlayerSendCancel(cid, "You need to have level "..config1.level.." or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
elseif getPlayerLevel(cid) >= config2.level then
setPlayerStorageValue(cid,1020,getResets(cid)+1)
doPlayerSetNameDescription(cid, " Have a "..getResets(cid)+(1).." reset\'s.")
doPlayerPopupFYI(cid,"you now was reset, you have "..getResets(cid)+(1).." reset\'s.")
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..RemainingLvl..", `experience` = "..config2.exper.." WHERE `id` = "..config2.pid)
else
doPlayerSendCancel(cid, "You need to have level "..config2.level.." or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end










info
Grupo: Banidos
Registrado: 14/02/10
Posts: 50
Reputação: +5
entao eu queria colocar o sistema de reset no meu server...
mais teria quer ser limitado somente 2 reset por char!
tpw um no level 500
e outro no level 250..
tem como?
eu estou usando essa script
Obrigado,
Editado Março 8 por Critico