What I want to know is it possible to give it that ability with this
Code: Select all
{
class = "MonsterAttack",
name = "summonUndead",
cooldown = 10,
repeatChance = 0,
animation = "summonUndead",
sound = "skeleton_commander_summon_spell",
onAttack = function(self)
for tries=1,20 do
-- choose summon location
local dx,dy = getForward(self.go.facing)
local x = self.go.x + math.random(-1,1)
local y = self.go.y + math.random(-1,1)
-- is valid spawn point?
local map = self.go.map
local elevation = map:getElevation(x, y)
if not map:isBlocked(x, y, elevation) then
spawn("hell_fire_elemental", self.go.level, x, y, self.go.facing, elevation)
return
end
end
end,
},