@OneDay
Criei uma spell de exemplo para lhe mostrar em áreas...
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
local function event1(parameters)
if isCreature(getThingfromPos(hitpos1).uid) == 1 then
doPushCreature(parameters.cid, getThingfromPos(hitpos1).uid, 0, -1, 1, 500)
elseif isCreature(getThingfromPos(hitpos2).uid) == 1 then
doPushCreature(parameters.cid, getThingfromPos(hitpos2).uid, 0, -1, 1, 500)
elseif isCreature(getThingfromPos(hitpos3).uid) == 1 then
doPushCreature(parameters.cid, getThingfromPos(hitpos3).uid, 0, -1, 1, 500)
end
end
local arr = {
{0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
local parameters = { cid = cid, var = positionToVariant(getPlayerPosition(cid)) }
hitpos1 = {x=pos.x, y=(pos.y-1), z=pos.z, stackpos=253}
hitpos2 = {x=pos.x, y=(pos.y-2), z=pos.z, stackpos=253}
hitpos3 = {x=pos.x, y=(pos.y-3), z=pos.z, stackpos=253}
addEvent(event1, 0, parameters)
return doCombat(cid, combat, var)
end
@danilowarlord
Obrigado 