Files
ScourgeInvasion/BOSSES/LordBlackwood.lua
2025-06-12 15:45:15 -04:00

33 lines
1.1 KiB
Lua

-- Lord Blackwood (S)courge Invasion Boss) made by Manmadedrummer for Araxia Online
local NPC_BLACKWOOD = 14695
local SPELL_MULTI_SHOT = 21390
local SPELL_SHIELD_BASH = 11972
local SPELL_SMOKE_BOMB = 7964
local SPELL_SHOOT = 16496
local function CastRandomSpell(eventId, delay, calls, creature)
local target = creature:GetVictim()
if target then
local spellList = {SPELL_MULTI_SHOT, SPELL_SHIELD_BASH, SPELL_SMOKE_BOMB, SPELL_SHOOT}
local spellToCast = spellList[math.random(1, #spellList)]
creature:CastSpell(target, spellToCast, false)
end
creature:RegisterEvent(CastRandomSpell, math.random(2000, 5000), 1)
end
local function OnCombat(event, creature, target)
creature:RegisterEvent(CastRandomSpell, math.random(1000, 3000), 1)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDeath(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(NPC_BLACKWOOD, 1, OnCombat)
RegisterCreatureEvent(NPC_BLACKWOOD, 2, OnLeaveCombat)
RegisterCreatureEvent(NPC_BLACKWOOD, 4, OnDeath)