Ir para conteúdo

Featured Replies

Postado
  • Autor

@Naze Isso, ele pode usar a magia escolhida normalmente, mas caso ele queria usar outra, ele terá que esperar x minutos contando da última magia soltada

Meu Curso sobre Programação para OTServer

Programando OTServer

 

Peça o seu script! Entre agora mesmo no grupo

Developing

 

Conteúdos:

 

Discord: Belmont#7352

Não esqueça do REP+ :)     

  • Respostas 10
  • Visualizações 517
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
  • Solução

 

@Phineasz 

Mas frigo

Spoiler

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 43)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12)

local arr = {
{0, 0, 0, 0, 0},
{0, 0, 1, 0, 0},
{0, 1, 3, 1, 0},
{0, 0, 1, 0, 0},
{0, 0, 0, 0, 0}
}

 

local area = createCombatArea(arr)
setCombatArea(combat, area)

local function meteorCast(p)
    doCombat(p.cid, p.combat, positionToVariant(p.pos))
end
local function stunEffect(cid)
    doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end


function onTargetTile(cid, pos)
            local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_ICE)
            addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
end

 

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
local waittime = 1.0 -- Tempo de exhaustion
local storage = 45670 -- não mecha

if isPlayer(cid) and exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, storage)).." segundos(s) para usar novamente.")
    return false
end
exhaustion.set(cid, storage, waittime)
exhaustion.set(cid, 45671, 60)
    if getPlayerStorageValue(cid, 64854) >= 10 then
        return doCombat(cid, combat, var)
    else
    doSendMagicEffect(getThingPos(cid), 2)
        doPlayerSendTextMessage(cid, 22, "Voce nao possui essa magia pois nao fez a quest das novas magias.")
    end

end

Spoiler

local combat = createCombatObject()

local meteor = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 45)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12)

local arr = {
{0, 0, 0, 0, 0},
{0, 0, 1, 0, 0},
{0, 1, 3, 1, 0},
{0, 0, 1, 0, 0},
{0, 0, 0, 0, 0}
}

 

local area = createCombatArea(arr)
setCombatArea(combat, area)

local function meteorCast(p)
    doCombat(p.cid, p.combat, positionToVariant(p.pos))
end
local function stunEffect(cid)
    doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end


function onTargetTile(cid, pos)
            local newpos = {x = pos.x + 7, y = pos.y - 6, z = pos.z}
            doSendDistanceShoot(newpos, pos, CONST_ANI_EARTH)
            addEvent(meteorCast, 200, {cid = cid,pos = pos, combat = meteor})
end

 

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
local waittime = 1.0 -- Tempo de exhaustion
local storage = 45671 -- não mecha

if isPlayer(cid) and exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "Aguarde "..(exhaustion.get(cid, storage)).." segundos(s) para usar novamente.")
    return false
end
exhaustion.set(cid, storage, waittime)
exhaustion.set(cid, 45670, 60)
    if getPlayerStorageValue(cid, 64854) >= 10 then
        return doCombat(cid, combat, var)
    else
    doSendMagicEffect(getThingPos(cid), 2)
        doPlayerSendTextMessage(cid, 22, "Voce nao possui essa magia pois nao fez a quest das novas magias.")
    end
end

Mas tera

Postado

@Phineasz Me passa os scripts das 4 magias e faço pra vc.

@edit, nem reparei mas o do @ernaix69 ta correto, so vc altera o tempo que quer.

Editado por Naze (veja o histórico de edições)

Discord: Naze#3578

 

Ter Linux Dentro de Windows com Acesso 'localhost' para testes e +

AutoLoot Otimizado Direto na Source (tfs 0.4/otx)

 

// Pirataria é crime, original é roubo, compartilhar é legal.

 

tumblr_muk78tEwDQ1qah4nko1_500.gif

Postado
  • Autor

@Naze @ernaix69 Sim, funcionou obrigado, mas teria como tirar esse 1 segundo de exasted, e deixar o exasted normal pelo xml pfv? Eu tentei tirar o Waittime do script, mas deu erro erro na distro

image.png.715cbebffca45067938942dbb888797d.png

 

Fui no arquivo 034-exhaunstion, tentei todos os modelos que tinha lá, check, get, e make, o check funcionou, mas ele não voltava a storage do exasted da última magia usada

Meu Curso sobre Programação para OTServer

Programando OTServer

 

Peça o seu script! Entre agora mesmo no grupo

Developing

 

Conteúdos:

 

Discord: Belmont#7352

Não esqueça do REP+ :)     

Postado

@Phineasz 

Spoiler

exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time()
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time()
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time() + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}
 

troca seu 034-exhaust por esse, acredito q não vá dar conclito em nada na sua datepack

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.7k

Informação Importante

Confirmação de Termo