Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Basta configurar a area que quer, lá na area, não se esqueça em colocar direction="1" na tag do spell.xml

e se caso quiser mudar o efeito é só mudar no areaEffect

Damagetype É se a magia será hit fisico, elemental, etc.

 

 

local function doPushCreature(target, cid)
    if target > 0 then
   if not isNpc(target) then
   local position = getThingPosition(cid)
   local fromPosition = getThingPosition(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 = {
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
	{0, 1, 1, 1, 0},
	{0, 1, 1, 1, 0},
	{0, 1, 3, 1, 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, -4, 0, -4.7, 0)
    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

 

  • Respostas 7
  • Visualizações 448
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • REP SE AJUDEI 

  • Foi erro meu, haha, é fácil resolver isso. Segue abaixo:   local function doPushCreature(target, cid) if target > 0 then if not isNpc(target) then local position = getThingP

Postado
  • Autor

ele tá empurrando eu quero q ele puxe , e desse msm jeito ae soque e puxando não empurrando.

Meu Servidor Minecraft : Ip - Skylowcraft.minecraftbr.net:25585 = Servidor 24hrs Sem Lag , Sem Hackers (1.7.2) Servidor De Fullpvp e Survival - Vamos Colocar Minigames!.

Postado
  • Solução

Foi erro meu, haha, é fácil resolver isso.

Segue abaixo:

 

local function doPushCreature(target, cid)
    if target > 0 then
   if not isNpc(target) then
   local position = getThingPosition(cid)
   local fromPosition = getThingPosition(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 = {
    [1] = {
   damageType = 1,
   areaEffect = 2,
   area = {
	{0, 1, 1, 1, 0},
	{0, 1, 1, 1, 0},
	{0, 1, 3, 1, 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, -4, 0, -4.7, 0)
    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


 

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