Niloahs
Well-Known Member
- Joined
- Feb 10, 2020
- Messages
- 110
- Solutions
- 1
- Reaction score
- 81
hi guys, can someone help me changing this script?
i have the script but dont work the way i want, basicaly i want the enviroment spell cast the full area instead of only the line.
and if possible make the area damage + effect random
thanks very much
i have the script but dont work the way i want, basicaly i want the enviroment spell cast the full area instead of only the line.
and if possible make the area damage + effect random
Lua:
local effects = {
{fromPosition = Position(1040, 1073, 7), toPosition = Position(1046, 1076, 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]
fromPosition = settings.fromPosition
toPosition = settings.toPosition
local spectators = Game.getSpectators(settings.fromPosition, false, true, 7, 7, 5, 5)
if #spectators > 0 then
if settings.effect then
for y = fromPosition.y, toPosition.y do
local newPosition = Position(fromPosition.x, y, fromPosition.z)
newPosition:sendMagicEffect(settings.effect)
jolf = Tile(newPosition):getTopCreature()
if jolf and jolf:isPlayer() then
doTargetCombatHealth(0, jolf, COMBAT_PHYSICALDAMAGE, -500, -1000, settings.effect)
end
end
for x = fromPosition.x, toPosition.x do
local newPosition2 = Position(x, fromPosition.y, fromPosition.z)
newPosition2:sendMagicEffect(settings.effect)
jolf = Tile(newPosition2):getTopCreature()
if jolf and jolf:isPlayer() then
doTargetCombatHealth(0, jolf, COMBAT_PHYSICALDAMAGE, -10, -500, settings.effect)
end
end
end
end
end
return true
end
spawnDamage:interval(2000)
spawnDamage:register()
thanks very much