1
[Spells] Cambiar de Efecto cuando este en diferente posicion Vie Sep 11, 2020 12:55 pm
SoyFabi

Miembro

Seria asi, en este caso cuando el player cambia de position sale el efecto de otra posicion.
![[Spells] Cambiar de Efecto cuando este en diferente posicion TgFX4lH](https://2img.net/h/imgfz.com/i/TgFX4lH.gif)
Tengo el scripts aqui pero lo necesito acomodar para que sea en (Target) ya que al usar el spell solo me lo tira a mi mismo(mi posicion).
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
local arr1 = {
{1, 0, 0},
{1, 0, 0},
{1, 0, 0},
{1, 0, 2},
{1, 0, 0},
{1, 0, 0},
{1, 0, 0},
}
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 300)
local arr2 = {
{1, 2},
}
local area2 = createCombatArea(arr2)
setCombatArea(combat2, area2)
local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end
function spell3(cid)
if getCreatureLookDirection(cid) == 1 then --DERECHA
doCombat(cid, combat2, numberToVariant(cid))
end
end
function spell4(cid)
if getCreatureLookDirection(cid) == 1 then --DERECHA
doCombat(cid, combat2, numberToVariant(cid))
end
end
function test(cid)
addEvent(spell3,100,cid) --DERECHO
addEvent(spell4,100,cid) --DERECHO
end
function test2(cid)
addEvent(test,0,cid)
end
function onCastSpell(cid, var)
local waittime = 0.0 -- Tempo de exhaustion
local storage = 1 -- não mecha
if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "You are exhausted.")
return false
end
local parameters = {cid = cid, var = var, combat1 = combat1 , combat2 = combat2}
for i = 1, 1 do
addEvent(function()
if isCreature(cid) then
addEvent(onCastSpell2, 100, parameters)
end
end, 1 + ((i-1) * 650))
end
addEvent(test2,0,cid)
exhaustion.set(cid, storage, waittime)
return TRUE
end