function doMoveInArea2(cid, eff, area, element, min, max, spell, ret)
if not isCreature(cid) then return true end
local pos = getPosfromArea(cid, area) --alterado v1.8
setPlayerStorageValue(cid, 21101, -1)
local skills = {"Skull Bash", "Gust", "Water Pulse", "Stick Throw", "Overheat", "Toxic", "Take Down", "Gyro Ball"} --alterado v1.7
local n = 0
local l = 0
while n < #pos do
if not isCreature(cid) then return true end
if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
local pid = getThingFromPosWithProtect(thing)
----
if pid ~= cid then
if spell and isInArray(skills, spell) then
if spell == "Stick Throw" then
addEvent(sendEffWithProtect, l*300, cid, pos[n], eff)
addEvent(sendMoveBack, 1200, cid, pos, eff, min, max)
addEvent(doMoveDano2, l*300, cid, pid, element, min, max, ret, spell) --alterado v1.6
elseif spell and spell == "Gyro Ball" then --alterado v1.7
pos[n].x = pos[n].x+1
addEvent(sendEffWithProtect, l*200, cid, pos[n], eff)
addEvent(doMoveDano2, l*200, cid, pid, element, min, max, ret, spell)
else
addEvent(sendEffWithProtect, l*200, cid, pos[n], eff)
addEvent(doMoveDano2, l*200, cid, pid, element, min, max, ret, spell) --alterado v1.6
end
elseif spell and spell == "Epicenter" then
local random = math.random(50, 500)
addEvent(sendEffWithProtect, random, cid, pos[n], eff)
addEvent(doDanoWithProtect, random, cid, GROUNDDAMAGE, pos[n], crusher, -min, -max, 255)
elseif spell and spell == "Shadowave" then
posi = {x=pos[n].x, y=pos[n].y+1, z=pos[n].z}
sendEffWithProtect(cid, posi, eff)
doMoveDano2(cid, pid, element, min, max, ret, spell) --alterado v1.6
elseif spell and spell == "Surf" then
addEvent(sendEffWithProtect, math.random(50, 500), cid, pos[n], eff)
addEvent(doMoveDano2, 400, cid, pid, element, min, max, ret, spell) --alterado v1.6
elseif spell and spell == "Sand Attack" then
addEvent(sendEffWithProtect, n*200, cid, pos[n], eff)
addEvent(doMoveDano2, n*200, cid, pid, element, min, max, ret, spell) --alterado v1.6
elseif spell and (spell == "Muddy Water" or spell == "Venom Motion") then
local arr = {
[1] = 0, [2] = 0, [3] = 0, [4] = 200, [5] = 200, [6] = 200, [7] = 400, [8] = 400, [9] = 400, [10] = 600, [11] = 600,
[12] = 600, [13] = 800, [14] = 800, [15] = 800
}
local time = {0, 200, 400, 600, 800}
addEvent(sendEffWithProtect, arr[n], cid, pos[n], eff)
addEvent(doMoveDano2, arr[n], cid, pid, element, min, max, ret, spell)
elseif spell and (spell == "Inferno" or spell == "Fissure" or spell == "Volcano Burst") then --alterado v1.8
addEvent(sendEffWithProtect, math.random(0, 500), cid, pos[n], eff)
addEvent(doMoveDano2, math.random(0, 500), cid, pid, element, min, max, ret, spell)
else
sendEffWithProtect(cid, pos[n], eff)
doMoveDano2(cid, pid, element, min, max, ret, spell)
end
end
l = l+1
end
end
---