Files

42 lines
1.3 KiB
Lua
Raw Permalink Normal View History

2023-03-21 02:26:13 -06:00
local NPC_BANSHEE = 400112
local NPC_TARGET = 3338
2023-03-24 04:58:13 -06:00
local SPELL_BANSHEE_SCREAM = 8124
2023-03-21 02:26:13 -06:00
local SPELL_SHADOW_BOLT = 9613
local SPELL_CAST_DEATH = 5
2023-03-21 03:16:58 -06:00
local function CastShadowBolt(eventId, delay, calls, creature)
2023-03-21 02:26:13 -06:00
creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, true)
end
2023-03-21 03:16:58 -06:00
local function CastBansheeScream(eventId, delay, calls, creature)
2023-03-21 02:26:13 -06:00
creature:CastSpell(creature:GetVictim(), SPELL_BANSHEE_SCREAM, true)
end
local function CastSpellOnTarget(creature, targetNPC)
creature:CastSpell(targetNPC, SPELL_CAST_DEATH, true)
end
local function Banshee_OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastShadowBolt, math.random(4000, 8000), 0)
creature:RegisterEvent(CastBansheeScream, math.random(9000, 18000), 1)
local targetNPC = creature:GetNearestCreature(50, NPC_TARGET)
if targetNPC then
CastSpellOnTarget(creature, targetNPC)
end
end
local function Banshee_OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function Banshee_OnDied(event, creature, killer)
creature:RemoveEvents()
2023-03-27 09:27:43 -06:00
creature:DespawnOrUnsummon(10000)
2023-03-21 02:26:13 -06:00
end
RegisterCreatureEvent(NPC_BANSHEE, 1, Banshee_OnEnterCombat)
RegisterCreatureEvent(NPC_BANSHEE, 2, Banshee_OnLeaveCombat)
RegisterCreatureEvent(NPC_BANSHEE, 4, Banshee_OnDied)