Hello, i would want to make this script work like this instead:
*Config to use only one or more effects, for example 3, 5, 10 and 20.
*Config to use specific different locations not only from pos topos, for example Position(116, 423, 7), and Position(126, 443, 7), and Position(135, 436, 7),
*Make so the different locations have different delays so all don't go at the same time.
Found script here on otland so credit to the creator don't remember who.
*Config to use only one or more effects, for example 3, 5, 10 and 20.
*Config to use specific different locations not only from pos topos, for example Position(116, 423, 7), and Position(126, 443, 7), and Position(135, 436, 7),
*Make so the different locations have different delays so all don't go at the same time.
Found script here on otland so credit to the creator don't remember who.
Lua:
local config = {
minDamage = 10,
maxDamage = 1000,
magicEffectStart = 1,
magicEffectEnd = 50
}
local effects = {
{
fromPosition = Position(116, 423, 7),
toPosition = Position(123, 428, 7),
effect = CONST_ME_HOLYDAMAGE
},
}
local spawnDamage = GlobalEvent("spawn damage")
function spawnDamage.onThink(interval)
local jolf
for i = 1, #effects do
local settings = effects[i]
local spectators = Game.getSpectators(settings.fromPosition, false, true, 7, 7, 5, 5)
if #spectators > 0 then
for y = settings.fromPosition.y, settings.toPosition.y do
for x = settings.fromPosition.x, settings.toPosition.x do
newPosition = Position(x, y, settings.fromPosition.z)
newPosition:sendMagicEffect(math.random(config.magicEffectStart, config.magicEffectEnd))
jolf = Tile(newPosition):getTopCreature()
if jolf and jolf:isPlayer() then
doTargetCombatHealth(0, jolf, COMBAT_PHYSICALDAMAGE, -config.minDamage, -config.maxDamage, settings.effect)
end
end
end
end
end
return true