local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2000)
setConditionFormula(condition, -0.9, 0, -0.9, 0)
local function getCreaturesInArea(fromPos, toPos, player, monster, summon)
local t = {}
for z=fromPos.z, toPos.z do
for y=fromPos.y, toPos.y do
for x=fromPos.x, toPos.x do
local v = getTopCreature({x=x,y=y,z=z,stackpos=253})
if player == true then
if isPlayer(v.uid) then
table.insert(t, v.uid)
end
end
if monster == true then
if isMonster(v.uid) and not isSummon(v.uid) then
table.insert(t, v.uid)
end
end
if summon == true then
if isSummon(v.uid) then
table.insert(t, v.uid)
end
end
end
end
end
return t
end
function onCast(cid, target)
local count = 1 -- change this to the count of areas you currently have inside the script.
local table = { -- in order to add more areas, copy the first line, and add it. Then add +1 to count. Make sure the last line inside of the table DOESN'T end with a comma (,), and that the rest of them DO.
{fromx=1005,fromy=1012,fromz=7,tox=1047,toy=1034,toz=7} -- change those positions to the area you would like spells to be disabled inside of.
}
local othertable = {}
repeat
local postable = table[count]
local fromPos, toPos = {x=postable.fromx,y=postable.fromy,z=postable.fromz}, {x=postable.tox,y=postable.toy,z=postable.toz}
for _, n in ipairs(getCreaturesInArea(fromPos, toPos, true, false, false)) do
table.insert(othertable, n)
end
count = count-1
until count == 0
if((getCreatureCondition(cid, CONDITION_HASTE))) then
doRemoveCondition(cid, CONDITION_HASTE)
end
doAddCondition(cid, condition)
return true
end