Ir para conteúdo
  • 0

flavinhoo

Pergunta

ai galera do Xtibia.com, tenho um system de reset aque perfeito , só qe quando reseta so volta o level não volta a experiencia, ai qando o player tem uns 4 reset qando ele clica para abrir os skills da debug, sera que tem como colocar para a experience volta para 4200, para nao bugar ?

 

Sistema é esse :

 

 

--[[ SCRIPTING> MarcelloMkez <scriptING ]]

--[[ [Advanced Reset System]

Autor: MarcelloMkez

Versão: 1.0

TFS: 0.3.6

Testado em: 8.50

Fórum: www.xtibia.com/forum/topic/138026-talk-action-advanced-reset-system/

[Características]

~ Versão 1.0 ~

 

- Resets no Look;

- Premium Account ou não;

- Mudar Vocação;

- Limite de Resets;

- Opções para Abilitar e Desabilitar Condições;

 

[Em Construção]

- Stages Free e Premium;

- 'Talvez' um novo sistema de mudar Vocação;

sem data para postagem. ]]

 

 

function onSay(cid, words, param)

--[Configurações de Condição]__

 

config = { --[[verdadeiro / Falso]]

 

needPa = false, -- Precisa de Premium Account? [true / false]

needPz = true, -- Precisa estar em Protection Zone? [true / false]

battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]

withe = false, -- Players PK Withe pode Resetar? [true / false]

red = false, -- Players PK Red pode Resetar? [true / false]

tp = true, -- Teleportar para o Templo após o reset? [true / false]

look = true, -- Mostrar Resets no Look do Player? [true / false]

addLimite = true, -- Abilitar Limite de Resets? [true / false]

setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]

storage = 2310, -- Storage [valor]

 

 

--[Configurações do Reset]__

 

resetStatus = {

 

player = getPlayerGUID(cid), -- Não Mude.

lvl = 717217, -- Level Necessário para Resetar. [valor]

lvlreset = 8, -- Level que retornará após o Reset. [valor]

limite = 100, -- Máximo de resets que um player pode chegar. [valor]

newClasse = 1, -- Id da Nova Vocação após o Reset. [valor]

tempo= 3 -- Tempo para o Player deslogar para Resetar. Em segundos. [valor]

},

}

 

--[Funções]__

 

function Reseting(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function noAll(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

return TRUE

end

 

function noTeleporting(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

return TRUE

end

 

function noLook(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

return TRUE

end

function noClasse(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function setClasse(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doPlayerSetVocation(cid, config.resetStatus.newClasse)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function look(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function teleporting(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,config.storage,resets+1)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)

db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)

return TRUE

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,config.storage)

 

if resets < 0 then

resets = 0

end

return resets

 

end

 

 

local resets = getResets(cid)

local needLvl ="You need "..config.resetStatus.lvl-getPlayerLevel(cid).." level's to reset."

local msg ="~[Reset: "..getResets(cid).."]~ 'Reset to Success! You will be logged out in "..config.resetStatus.tempo.." Seconds."

 

 

--[Condiçoes]__

 

if(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then

doPlayerSendTextMessage(cid,22,"You Need Protection Zone to be Reset.")

return TRUE

 

elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then

doPlayerSendTextMessage(cid, 22, "Congratulations, you reached the limit of Resets.")

return TRUE

 

elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then

doPlayerSendTextMessage(cid,22,"You PK White, so I Can not reset.")

return TRUE

 

elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then

doPlayerSendTextMessage(cid,22,"You PK Red, so I Can not reset.")

return TRUE

 

elseif(config.needPa == true) and not isPremium(cid) then

doPlayerSendTextMessage(cid,22,"You need to be Premium Account Reset.")

return TRUE

 

elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then

doPlayerSendTextMessage(cid,22,"You need to be out of Battle Reset.")

return TRUE

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then

addEvent(Reseting, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then

addEvent(noAll, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then

addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then

addEvent(noLook, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then

addEvent(noClasse, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then

addEvent(setClasse, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then

addEvent(look, config.resetStatus.tempo* 1000, cid)

 

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then

addEvent(teleporting, config.resetStatus.tempo* 1000, cid)

 

elseif doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, needLvl) then

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

return TRUE

end

 

if doPlayerPopupFYI(cid, msg) then

 

end

return TRUE

 

end

--[by: MarcelloMkez]__

Editado por flavinhoo
Link para o comentário
Compartilhar em outros sites

12 respostass a esta questão

Posts Recomendados

  • 0

flavinhoo vc vai tem que ver qual level vai com experiencia 4200, ai é so vc troca nessa parte:

 

lvlreset = 8, -- Level que retornará após o Reset.

 

AJUDEI? +REP mdr.gif

Link para o comentário
Compartilhar em outros sites

  • 0

Respondendo pelo Flaah, o script ficaria assim Flavinho:

 

lvlreset = 4200, -- Level que retornará após o Reset.

 

Assim para o carinha ir para level 8 quando desse reset!! ^^

Link para o comentário
Compartilhar em outros sites

  • 0

guh , mais o player qando reseta vai para o lvl 4200 . eu qeria qe ele volta-se o level 8 e a experiencia tmb , entende?

 

Então cara, coloca lvl 8 nessa parte.

 

lvlreset = 8, -- Level que retornará após o Reset.

 

Que ele ira pra esperiencia 4200, como vc quer.

Editado por Flaah
Link para o comentário
Compartilhar em outros sites

  • 0

veja assim

 

--[[ SCRIPTING> MarcelloMkez <scriptING ]]
--[[ [Advanced Reset System]
Autor: MarcelloMkez
Versão: 1.0
TFS: 0.3.6
Testado em: 8.50
Fórum: www.xtibia.com/forum/topic/138026-talk-action-advanced-reset-system/
[Características]
~ Versão 1.0 ~
- Resets no Look;
- Premium Account ou não;
- Mudar Vocação;
- Limite de Resets;
- Opções para Abilitar e Desabilitar Condições;
[Em Construção]
- Stages Free e Premium;
- 'Talvez' um novo sistema de mudar Vocação;
sem data para postagem. ]]

function onSay(cid, words, param)
--[Configurações de Condição]__
config = { --[[verdadeiro / Falso]]
needPa = false, -- Precisa de Premium Account? [true / false]
needPz = true, -- Precisa estar em Protection Zone? [true / false]
battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false]
red = false, -- Players PK Red pode Resetar? [true / false]
tp = true, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = true, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 2310, -- Storage [valor]

--[Configurações do Reset]__
resetStatus = {
player = getPlayerGUID(cid), -- Não Mude.
lvl = 717217, -- Level Necessário para Resetar. [valor]
lvlreset = 8, -- Level que retornará após o Reset. [valor]
limite = 100, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 1, -- Id da Nova Vocação após o Reset. [valor]
tempo= 3 -- Tempo para o Player deslogar para Resetar. Em segundos. [valor]
},
}
--[Funções]__
function Reseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
function noAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
function noTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
function noLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
function noClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
function setClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
function look(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
function teleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
doPlayerAddExperience(cid, - getPlayerExperience(cid) + getExperienceForLevel(LEVEL))
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
function getResets(cid)
resets = getPlayerStorageValue(cid,config.storage)
if resets < 0 then
resets = 0
end
return resets
end

local resets = getResets(cid)
local needLvl ="You need "..config.resetStatus.lvl-getPlayerLevel(cid).." level's to reset."
local msg ="~[Reset: "..getResets(cid).."]~ 'Reset to Success! You will be logged out in "..config.resetStatus.tempo.." Seconds."

--[Condiçoes]__
if(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"You Need Protection Zone to be Reset.")
return TRUE
elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Congratulations, you reached the limit of Resets.")
return TRUE
elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"You PK White, so I Can not reset.")
return TRUE
elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"You PK Red, so I Can not reset.")
return TRUE
elseif(config.needPa == true) and not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"You need to be Premium Account Reset.")
return TRUE
elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"You need to be out of Battle Reset.")
return TRUE
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
elseif doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
if doPlayerPopupFYI(cid, msg) then
end
return TRUE
end
--[by: MarcelloMkez]__

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...