mirror of
https://github.com/araxiaonline/ScourgeInvasion.git
synced 2026-06-13 03:02:21 -04:00
31 lines
1014 B
Lua
31 lines
1014 B
Lua
-- Revanchion (Scourge Invasion Boss) made by Manmadedrummer for Araxia Online
|
|
|
|
local NPC_REVANCHION = 14690
|
|
local SPELL_FROST_NOVA = 14907
|
|
local SPELL_SHADOW_BOLT_VOLLEY = 15245
|
|
|
|
local function CastRandomSpell(eventId, delay, calls, creature)
|
|
local target = creature:GetVictim()
|
|
if target then
|
|
local spellList = {SPELL_FROST_NOVA, SPELL_SHADOW_BOLT_VOLLEY}
|
|
local spellToCast = spellList[math.random(1, #spellList)]
|
|
creature:CastSpell(target, spellToCast, false)
|
|
end
|
|
creature:RegisterEvent(CastRandomSpell, 3000, 1)
|
|
end
|
|
|
|
local function OnCombat(event, creature, target)
|
|
creature:RegisterEvent(CastRandomSpell, 3000, 1)
|
|
end
|
|
|
|
local function OnLeaveCombat(event, creature)
|
|
creature:RemoveEvents()
|
|
end
|
|
|
|
local function OnDeath(event, creature, killer)
|
|
creature:RemoveEvents()
|
|
end
|
|
|
|
RegisterCreatureEvent(NPC_REVANCHION, 1, OnCombat)
|
|
RegisterCreatureEvent(NPC_REVANCHION, 2, OnLeaveCombat)
|
|
RegisterCreatureEvent(NPC_REVANCHION, 4, OnDeath) |