Quero criar uma armadura que diminui em porcentagem o dano desse script:
local areas = {
{leftUpPoint = {x = 31815, y = 32206, z = 7}, rightDownPoint = {x = 32070, y = 32425, z = 7}, minHit = 300, maxHit = 600},
}
function onThink(interval, lastExecution, thinkInterval)
for id, arr in pairs(areas) do
for x = arr.leftUpPoint.x, arr.rightDownPoint.x do
for y = arr.leftUpPoint.y, arr.rightDownPoint.y do
for z = arr.leftUpPoint.z, arr.rightDownPoint.z do
local pos = {x = x, y = y, z = z}
local uid = getTopCreature(pos).uid
if isPlayer(uid) then
local random = math.random(arr.minHit, arr.maxHit)
doCreatureAddHealth(uid, -random)
doSendMagicEffect(pos, 8)
end
end
end
end
end
return true
end
<globalevent name="think" interval="3000" script="others/areahit.lua"/>