local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1499)
local areas = {
{topLeft = Position(1000, 1000, 7), bottomRight = Position(1100, 1100, 7)},
{topLeft = Position(1000, 1000, 7), bottomRight = Position(1100, 1100, 7)},
{topLeft = Position(1000, 1000, 7), bottomRight = Position(1100, 1100, 7)},
}
local function Position(x, y, z)
return {x = x, y = y, z = z}
end
function onCastSpell(cid, var)
for i = 1, #areas do
if isInRange(getCreaturePosition(cid), areas[i].topLeft, areas[i].bottomRight) then
doPlayerSendCancel(cid, "You can't cast magic wall runes inside a event area.")
return false
end
end
return doCombat(cid, combat, var)
end