Ir para conteúdo

Ajuda


Mutter03

Posts Recomendados

Fala galera, eu to com 2 scripts d spells aki, os dois dao varios ataques com um msm cast, o primeiro qdo vc anda a area do dano anda com vc, ja o segundo n, e eu n faço ideia pq, ja mexi em tudo

 

1° Spell

 

local spellConfig = {
   {effect = 28,
    area = createCombatArea({
       {1, 1, 1},
       {1, 2, 1},
       {1, 1, 1}})
   },
   {effect = 29,
    area = createCombatArea({
       {0, 1, 1, 1, 0},
       {1, 1, 1, 1, 1},
       {1, 1, 2, 1, 1},
       {1, 1, 1, 1, 1},
       {0, 1, 1, 1, 0}})
   },
   {effect = 30,
    area = createCombatArea({
       {1, 1, 1},
       {1, 2, 1},
       {1, 1, 1}})
   },
   {effect = 28,
    area = createCombatArea({
       {0, 1, 1, 1, 0},
       {1, 1, 1, 1, 1},
       {1, 1, 2, 1, 1},
       {1, 1, 1, 1, 1},
       {0, 1, 1, 1, 0}})
   },
   {effect = 29,
    area = createCombatArea({
       {1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1},
       {1, 1, 2, 1, 1},
       {1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1}})
   },
   {effect = 30,
    area = createCombatArea({
       {1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1},
       {1, 1, 2, 1, 1},
       {1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1}})
   },
   {effect = 28,
    area = createCombatArea({
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 2, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1}})
   },
   {effect = 29,
    area = createCombatArea({
       {0, 1, 1, 1, 1, 1, 0},
       {1, 1, 1, 1, 0, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 2, 1, 1, 0},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {0, 1, 1, 1, 1, 1, 0}})
   },
   {effect = 30,
    area = createCombatArea({
       {1, 1, 1},
       {1, 2, 1},
       {1, 1, 1}})
   },
   {effect = 28,
    area = createCombatArea({
       {0, 1, 1, 1, 1, 1, 0},
       {1, 1, 1, 1, 0, 1, 1},
       {1, 1, 1, 0, 1, 1, 1},
       {1, 1, 1, 2, 1, 1, 0},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {0, 1, 1, 1, 1, 1, 0}})
   },
   {effect = 29,
    area = createCombatArea({
       {0, 1, 0, 1, 0, 1, 0},
       {1, 0, 0, 0, 0, 0, 0},
       {1, 0, 1, 0, 1, 0, 1},
       {1, 0, 0, 2, 1, 0, 0},
       {0, 0, 1, 0, 0, 1, 0},
       {1, 0, 0, 1, 0, 0, 0},
       {0, 1, 0, 0, 1, 0, 1}})
   },
   {effect = 34,
    area = createCombatArea({
       {0, 1, 1, 1, 1, 1, 0},
       {1, 1, 1, 1, 0, 1, 1},
       {1, 1, 1, 0, 1, 1, 1},
       {1, 1, 1, 2, 1, 1, 0},
       {1, 1, 1, 1, 1, 1, 1},
       {1, 1, 1, 1, 1, 1, 1},
       {0, 1, 1, 1, 1, 1, 0}})
   }
}


local combats = {}
for k, config in ipairs(spellConfig) do
   combats[k] = createCombatObject()
       onTargetTile = function(cid, pos)
           local basePos = getThingPosition(cid)
           local fromPos = {x=basePos.x-6, y=basePos.y-8, z=basePos.z}
           doSendDistanceShoot(fromPos, pos, 37)
       end
       setCombatCallback(combats[k], CALLBACK_PARAM_TARGETTILE, "onTargetTile")
       setCombatParam(combats[k], COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
       setCombatParam(combats[k], COMBAT_PARAM_EFFECT, config.effect)
       setCombatFormula(combats[k], COMBAT_FORMULA_LEVELMAGIC, -0.593, -50, -0.929, -100)
       setCombatArea(combats[k], config.area)
end


local function castingSpellTime(p)
   if(isCreature(p[1]) == TRUE) then
       doCombat(unpack(p))
   end
end

function onCastSpell(cid, var)
   for k, combat in ipairs(combats) do
       addEvent(castingSpellTime, (250*k), {cid, combat, var})
   end
   return true
end

 

 

 

 

2º Spell

 

local spellConfig = {
    {effect = 255,
    area = createCombatArea({
       {1, 0, 0},
       {0, 3, 0},
       {0, 0, 1}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 1, 0},
       {0, 3, 0},
       {0, 1, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 1},
       {0, 3, 0},
       {1, 0, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 0},
       {1, 3, 1},
       {0, 0, 0}})
   },
    {effect = 255,
    area = createCombatArea({
       {1, 0, 0},
       {0, 3, 0},
       {0, 0, 1}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 1, 0},
       {0, 3, 0},
       {0, 1, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 1},
       {0, 3, 0},
       {1, 0, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 0},
       {1, 3, 1},
       {0, 0, 0}})
   },
    {effect = 255,
    area = createCombatArea({
       {1, 0, 0},
       {0, 3, 0},
       {0, 0, 1}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 1, 0},
       {0, 3, 0},
       {0, 1, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 1},
       {0, 3, 0},
       {1, 0, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 0},
       {1, 3, 1},
       {0, 0, 0}})
   },
    {effect = 255,
    area = createCombatArea({
       {1, 0, 0},
       {0, 3, 0},
       {0, 0, 1}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 1, 0},
       {0, 3, 0},
       {0, 1, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 1},
       {0, 3, 0},
       {1, 0, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 0},
       {1, 3, 1},
       {0, 0, 0}})
   },
    {effect = 255,
    area = createCombatArea({
       {1, 0, 0},
       {0, 3, 0},
       {0, 0, 1}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 1, 0},
       {0, 3, 0},
       {0, 1, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 1},
       {0, 3, 0},
       {1, 0, 0}})
   },
   {effect = 255,
    area = createCombatArea({
       {0, 0, 0},
       {1, 3, 1},
       {0, 0, 0}})
   }


}


local combats = {}
for k, config in ipairs(spellConfig) do
   combats[k] = createCombatObject()
       onTargetTile = function(cid, pos)
           local basePos = getCreaturePosition(cid)
           doSendDistanceShoot(basePos, pos, 24)
       end
       setCombatCallback(combats[k], CALLBACK_PARAM_TARGETTILE, "onTargetTile")
       setCombatParam(combats[k], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
       setCombatParam(combats[k], COMBAT_PARAM_EFFECT, config.effect)
   setCombatFormula(combats[k], COMBAT_FORMULA_SKILL, 0.6, -100, 1.2, -90)
       setCombatArea(combats[k], config.area)
end


local function castingSpellTime(p)
   if(isCreature(p[1]) == TRUE) then
       doCombat(unpack(p))
   end
end

function onCastSpell(cid, var)
   for k, combat in ipairs(combats) do
       addEvent(castingSpellTime, (250*k), {cid, combat, var})
   end
   return true
end

 

 

BUG ! PODE FECHA O TOPICO

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...