Ir para conteúdo
  • 0

[Pedido] Colocar magia para hitar por skill


Farathor

Pergunta

Olá, gostaria de saber como eu coloco para essa magia hitar pelo Skill Distance e não pelo ML

 

 

local combat = createCombatObject()
local combat2 = createCombatObject()
 
local meteor = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 7)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -6.10, -250, -6.40, -250)
 
 
local meteor2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 18)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 6)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -8.10, -280, -8.40, -280)
 
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)
setCombatArea(combat2, area)
 
 
local function meteorCast(p)
doCombat(p.cid, p.combat, positionToVariant(p.pos))
end
local function meteorCast2(p)
doCombat(p.cid, p.combat2, positionToVariant(p.pos))
end
local function stunEffect(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_STUN)
end
 
 
function onTargetTile(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(underWater, ground.itemid) == TRUE) then
local pos = getThingPos(getCreatureTarget(cid))
local posy = {x = pos.x, y = pos.y - 1, z = pos.z}
local posy2 = {x = pos.x, y = pos.y + 1, z = pos.z}
local posx = {x = pos.x - 1, y = pos.y, z = pos.z}
local posx2 = {x = pos.x + 1, y = pos.y, z = pos.z}
doSendDistanceShoot(getThingPos(cid), posy, 7)
doSendDistanceShoot(getThingPos(cid), posy2, 7)
doSendDistanceShoot(getThingPos(cid), posx, 7)
doSendDistanceShoot(getThingPos(cid), posx2, 7)
addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor2_water})
else
local pos = getThingPos(getCreatureTarget(cid))
local posy = {x = pos.x, y = pos.y - 1, z = pos.z}
local posy2 = {x = pos.x, y = pos.y + 1, z = pos.z}
local posx = {x = pos.x - 1, y = pos.y, z = pos.z}
local posx2 = {x = pos.x + 1, y = pos.y, z = pos.z}
doSendDistanceShoot(getThingPos(cid), posy, 7)
doSendDistanceShoot(getThingPos(cid), posy2, 7)
doSendDistanceShoot(getThingPos(cid), posx, 7)
doSendDistanceShoot(getThingPos(cid), posx2, 7)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor})
end
end
end
 
function onTargetTile2(cid, pos)
if (math.random(0, 0) == 0) then
local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1})
if (isInArray(underWater, ground.itemid) == TRUE) then
local pos = getThingPos(getCreatureTarget(cid))
local posy = {x = pos.x, y = pos.y - 1, z = pos.z}
local posy2 = {x = pos.x, y = pos.y + 1, z = pos.z}
local posx = {x = pos.x - 1, y = pos.y, z = pos.z}
local posx2 = {x = pos.x + 1, y = pos.y, z = pos.z}
doSendDistanceShoot(getThingPos(cid), posy, 18)
doSendDistanceShoot(getThingPos(cid), posy2, 18)
doSendDistanceShoot(getThingPos(cid), posx, 18)
doSendDistanceShoot(getThingPos(cid), posx2, 18)
addEvent(meteorCast, 200, {cid = cid, pos = pos, combat = meteor_water})
else
local pos = getThingPos(getCreatureTarget(cid))
local posy = {x = pos.x, y = pos.y - 1, z = pos.z}
local posy2 = {x = pos.x, y = pos.y + 1, z = pos.z}
local posx = {x = pos.x - 1, y = pos.y, z = pos.z}
local posx2 = {x = pos.x + 1, y = pos.y, z = pos.z}
doSendDistanceShoot(getThingPos(cid), posy, 18)
doSendDistanceShoot(getThingPos(cid), posy2, 18)
doSendDistanceShoot(getThingPos(cid), posx, 18)
doSendDistanceShoot(getThingPos(cid), posx2, 18)
addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = meteor2})
end
end
end
 
 
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
 
 
function onCastSpell(cid, var)
if (not canPlayerWearOutfit(cid, 156, 3) or not canPlayerWearOutfit(cid, 152, 3)) then
return doCombat(cid, combat, var)
end
return doCombat(cid, combat2, var)
end
Editado por Farathor
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

×
×
  • Criar Novo...