Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

Olá pessoal do TibiaKing, hoje venho aqui trazer um mini tutorial de como colocar o exhaustion corretamente em suas spells, bastante gente utiliza o exaustion que está no proprio xml, mas por lá acontece alguns erros exemplo: se tiver uma spell com 8000 de exaustion, e outra de 2000 e você vai no seu servidor e usa a spell com 8000 de exhaustion, tem que esperar o tempo dela pra usar qualquer outra, o método que venho trazer aqui ele funciona corretamente e ainda avisa no console quanto tempo falta para usar a spell, sem mais delongas vamos lá!

 

1- vá até o seu XML procure a magia que quer por o exhaustion

exemplo:

Spoiler

    <instant name="Air Fury" words="air fury" lvl="36" mana="35" prem="0" exhaustion="5500" groups="1,6000" needlearn="0" event="script" value="Air/air fury.lua">
        <vocation id="5"/>
        <vocation id="6"/>
    </instant>

 

perceba que ela tem um exhaustion definido ali em cima, para esse método funcionar corretamente e recomendado deixar o exhaustion do XML em 1000.

 

forma correta:

Spoiler

    <instant name="Air Fury" words="air fury" lvl="36" mana="35" prem="0" exhaustion="1000" groups="1,6000" needlearn="0" event="script" value="Air/air fury.lua">
        <vocation id="5"/>
        <vocation id="6"/>
    </instant>

 

 

2- feito isso vamos ate a pasta onde se encontra seu script e abra ele:

como exemplo irei utilizar uma spell de área que empurra os players próximos!

 

Spoiler

local function doPushCreature(target, cid)
local storage = 259886
    if target > 0 then
    if not isNpc(target) then
    local position = getThingPos(cid)
    local fromPosition = getThingPos(target)
    local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
    local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
    local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
    if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
    doTeleportThing(target, toPosition, true)
    end
    end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.8, 0.7, -1.8, 0.7)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    for n = 1, #spell.combats do
    addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end

 

 

3- com a spell aberta, logo no inicio da spells vamos inserir as seguintes linhas de código:

Spoiler

local exausted = 25 -- exhausted em segundos
local storage = 32598 -- storage do exausted

 

 

ficando assim:

Spoiler

local exausted = 3 -- exhausted em segundos
local storage = 15428 -- storage do exausted

local function doPushCreature(target, cid)
local storage = 259886
    if target > 0 then
    if not isNpc(target) then
    local position = getThingPos(cid)
    local fromPosition = getThingPos(target)
    local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
    local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
    local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
    if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
    doTeleportThing(target, toPosition, true)
    end
    end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.8, 0.7, -1.8, 0.7)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    for n = 1, #spell.combats do
    addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end

 

 

4- por fim, logo abaixo do function onCastSpell(cid, var) vamos adicionar as seguintes linhas de código:

 

Spoiler

if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
    return false
    end
    exhaustion.set(cid, storage, exausted)

 

 

ficando assim:

Spoiler

local exausted = 3 -- exhausted em segundos
local storage = 15428 -- storage do exausted

local function doPushCreature(target, cid)
local storage = 259886
    if target > 0 then
    if not isNpc(target) then
    local position = getThingPos(cid)
    local fromPosition = getThingPos(target)
    local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
    local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
    local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
    if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
    doTeleportThing(target, toPosition, true)
    end
    end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.8, 0.7, -1.8, 0.7)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
    return false
    end
    exhaustion.set(cid, storage, exausted)
    for n = 1, #spell.combats do
    addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end

 

 

Pronto com isso o exhaution já foi adicionado a sua spell, faça bom proveito:

Print:

 

5a79ec06a2f3f_exhaustion100.thumb.png.ff62af9a8adeeda6ce3111dfc480992c.png

Postado

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

ichigo.gif
https://github.com/Cjaker/

  , _ ,
 ( o o )
/'` ' `'\                     ESTOU TE OBSERVANDO O_O
|'''''''|
|\\'''//|
   """

 

  • 2 years later...
Postado
Em 06/02/2018 em 15:55, samuelandrade45 disse:

Olá pessoal do TibiaKing, hoje venho aqui trazer um mini tutorial de como colocar o exhaustion corretamente em suas spells, bastante gente utiliza o exaustion que está no proprio xml, mas por lá acontece alguns erros exemplo: se tiver uma spell com 8000 de exaustion, e outra de 2000 e você vai no seu servidor e usa a spell com 8000 de exhaustion, tem que esperar o tempo dela pra usar qualquer outra, o método que venho trazer aqui ele funciona corretamente e ainda avisa no console quanto tempo falta para usar a spell, sem mais delongas vamos lá!

 

1- vá até o seu XML procure a magia que quer por o exhaustion

exemplo:

  Mostrar conteúdo oculto


    <instant name="Air Fury" words="air fury" lvl="36" mana="35" prem="0" exhaustion="5500" groups="1,6000" needlearn="0" event="script" value="Air/air fury.lua">
        <vocation id="5"/>
        <vocation id="6"/>
    </instant>

 

perceba que ela tem um exhaustion definido ali em cima, para esse método funcionar corretamente e recomendado deixar o exhaustion do XML em 1000.

 

forma correta:

  Mostrar conteúdo oculto


    <instant name="Air Fury" words="air fury" lvl="36" mana="35" prem="0" exhaustion="1000" groups="1,6000" needlearn="0" event="script" value="Air/air fury.lua">
        <vocation id="5"/>
        <vocation id="6"/>
    </instant>

 

 

2- feito isso vamos ate a pasta onde se encontra seu script e abra ele:

como exemplo irei utilizar uma spell de área que empurra os players próximos!

 

  Mostrar conteúdo oculto


local function doPushCreature(target, cid)
local storage = 259886
    if target > 0 then
    if not isNpc(target) then
    local position = getThingPos(cid)
    local fromPosition = getThingPos(target)
    local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
    local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
    local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
    if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
    doTeleportThing(target, toPosition, true)
    end
    end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.8, 0.7, -1.8, 0.7)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    for n = 1, #spell.combats do
    addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end

 

 

3- com a spell aberta, logo no inicio da spells vamos inserir as seguintes linhas de código:

  Mostrar conteúdo oculto


local exausted = 25 -- exhausted em segundos
local storage = 32598 -- storage do exausted

 

 

ficando assim:

  Mostrar conteúdo oculto


local exausted = 3 -- exhausted em segundos
local storage = 15428 -- storage do exausted

local function doPushCreature(target, cid)
local storage = 259886
    if target > 0 then
    if not isNpc(target) then
    local position = getThingPos(cid)
    local fromPosition = getThingPos(target)
    local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
    local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
    local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
    if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
    doTeleportThing(target, toPosition, true)
    end
    end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.8, 0.7, -1.8, 0.7)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    for n = 1, #spell.combats do
    addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end

 

 

4- por fim, logo abaixo do function onCastSpell(cid, var) vamos adicionar as seguintes linhas de código:

 

  Mostrar conteúdo oculto


if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
    return false
    end
    exhaustion.set(cid, storage, exausted)

 

 

ficando assim:

  Mostrar conteúdo oculto


local exausted = 3 -- exhausted em segundos
local storage = 15428 -- storage do exausted

local function doPushCreature(target, cid)
local storage = 259886
    if target > 0 then
    if not isNpc(target) then
    local position = getThingPos(cid)
    local fromPosition = getThingPos(target)
    local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
    local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
    local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
    if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
    doTeleportThing(target, toPosition, true)
    end
    end
    end
end
local spell = {}
spell.config = {
    [3] = {
   damageType = 1,
   areaEffect = 2,
   area = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
   }   
    },
    [2] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 1, 0, 2, 0, 1, 0},
   {0, 1, 0, 0, 0, 1, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    },
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 1, 2, 1, 0, 0},
   {0, 0, 1, 1, 1, 0, 0},
   {0, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, 0}
   }   
    }
}
  
spell.combats = {}
for _, config in ipairs(spell.config) do
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
    setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.8, 0.7, -1.8, 0.7)
    function onTargetCreature(cid, target)
   doPushCreature(target, cid)
    end
    setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
    setCombatArea(combat, createCombatArea(config.area))
    table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
    if isPlayer(cid) and exhaustion.check(cid, storage) == TRUE then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar novamente.")
    return false
    end
    exhaustion.set(cid, storage, exausted)
    for n = 1, #spell.combats do
    addEvent(doCombat, (n * 120), cid, spell.combats[n], var)
    end
    return true
end

 

 

Pronto com isso o exhaution já foi adicionado a sua spell, faça bom proveito:

Print:

 

5a79ec06a2f3f_exhaustion100.thumb.png.ff62af9a8adeeda6ce3111dfc480992c.png

No meu caso, os exhausts estão se confundindo. Por exemplo, não consigo pushar um player enquanto heala ou pota. Onde eu configuro isso? 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo