Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

  • Nome: Sistema de reset
  • Versão testada: TFS 0.3.6pl1 / 0.4 / 0.3.7 / 1.1
  • Créditos: fireelement
  • Imagem:

    IE7MP5d.png

Vá em data/talkactions/talkactions.xml e adicione essa tag:

Para TFS 0.3/0.4:

Mostrar conteúdo oculto

Para TFS 1.1/1.0:

Mostrar conteúdo oculto

 

Agora vá em data/talkactions/scripts/ e crie um arquivo com o nome reset.lua e cole isso nele:

Para TFS 0.3/0.4:

Mostrar conteúdo oculto

Para TFS 1.1:

Mostrar conteúdo oculto

Para TFS 1.0:

Mostrar conteúdo oculto

  • Respostas 11
  • Visualizações 4k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Olá!

Fiz umas alterações com funções 1.0 e deu certo.

local config = {
    backToLevel = 8,
    redskull = false, -- need to be without redskull to reset?
    battle = true, -- need to be without battle to reset?
    pz = false, -- need to be in protect zone to reset?
    stages = {
        {resets = 4, level = 350, premium = 330},
        {resets = 9, level = 355, premium = 340},
        {resets = 14, level = 360, premium = 355},
        {resets = 19, level = 365, premium = 360},
        {resets = 24, level = 380, premium = 370},
        {resets = 29, level = 390, premium = 380},
        {resets = 34, level = 410, premium = 400},
        {resets = 39, level = 430, premium = 420},
        {resets = 44, level = 450, premium = 440},
        {resets = 49, level = 480, premium = 470},
        {resets = 54, level = 510, premium = 500},
        {resets = 59, level = 550, premium = 540},
        {resets = 64, level = 590, premium = 580},
        {resets = 69, level = 630, premium = 620},
        {resets = 74, level = 680, premium = 670},
        {resets = 79, level = 730, premium = 720},
        {resets = 84, level = 780, premium = 770},
        {resets = 89, level = 860, premium = 840},
        {resets = 94, level = 930, premium = 910},
        {resets = 2^1024, level = 1010, premium = 990}
    }
}

function onSay(cid, words, param)
    local function getPlayerResets(cid)
        local resets = getPlayerStorageValue(cid, 500)
        return resets < 0 and 0 or resets
    end

    local function doPlayerAddResets(cid, count)
        setPlayerStorageValue(cid, 500, getPlayerResets(cid) + count)
    end

    if config.redskull and getCreatureSkullType(cid) == 4 then
        return doPlayerSendCancel(cid, "You need to be without red skull to reset.")
    elseif config.pz and not getTilePzInfo(getCreaturePosition(cid)) then
        return doPlayerSendCancel(cid, "You need to be in protection zone to reset.")
    elseif config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
        return doPlayerSendCancel(cid, "You need to be without battle to reset.")
    end

    local resetLevel = 0
    for x, y in ipairs(config.stages) do
        if getPlayerResets(cid) <= y.resets then
            resetLevel = isPremium(cid) and y.premium or y.level
            break
        end
    end

    if getPlayerLevel(cid) < resetLevel then
        return doPlayerSendCancel(cid, "You need level " .. resetLevel .. " or more to reset.")
    end

    doPlayerAddResets(cid, 1)
    local healthMax, manaMax = getCreatureHealth(cid), getPlayerMaxMana(cid)
    getPlayerLevel(cid, -(getPlayerLevel(cid) - config.backToLevel))
    getCreatureHealth(cid, healthMax)
    getPlayerMaxMana(cid, manaMax)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Now you have " .. getPlayerResets(cid) .. " " .. (getPlayerResets(cid) == 1 and "reset" or "resets") .. ".")
    return true
end

--------

21:57 Now you have 1 reset.
21:57 Now you have 2 resets.

 

Mas o level nao volta ao nivel 8.

 

Obs : TFS 1.0 tem como ajudar? E se possivel um sistema de reset no Look.

Na verdade... preciso de um sistema de reset com look, para TFS 1.0

Estou com um projeto 10.76 se alguem poder me ajudar eu agradeço!

Postado
  • Autor
  Em 17/04/2015 em 00:15, Marjer disse:

Olá!

Fiz umas alterações com funções 1.0 e deu certo.

Mostrar conteúdo oculto

--------

21:57 Now you have 1 reset.

21:57 Now you have 2 resets.

 

Mas o level nao volta ao nivel 8.

 

Obs : TFS 1.0 tem como ajudar? E se possivel um sistema de reset no Look.

Na verdade... preciso de um sistema de reset com look, para TFS 1.0

Estou com um projeto 10.76 se alguem poder me ajudar eu agradeço!

 

Testei aqui e o TFS tem um bug na função addMana =/

Mostrar conteúdo oculto

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo