Files

54 lines
2.0 KiB
Lua
Raw Permalink Normal View History

2023-03-23 02:54:59 -06:00
local NPC_CAPTAIN_RATTLEBONES = 401116
2023-03-21 02:26:56 -06:00
local SPELL_SHADOW_BOLT = 20791
local SPELL_CURSE_OF_THE_PIRATE_KING = 70542
local SPELL_PIRATES_CLEAVE = 40505
local SPELL_CANNONBALL_BARRAGE = 6251
local YELL_AGGRO_DIALOGUE = {
"Ye be treadin' on dangerous waters!",
"Yarr, ye landlubbers be meetin' yer doom!",
"Arrr, ye won't leave me ship alive!",
"I be sendin' ye to the depths of the sea!",
"Ye be facin' the wrath of Captain Rattlebones!"
}
local YELL_DEATH_DIALOGUE = "Me ship...me crew...I be joinin' ye soon..."
2023-03-23 02:54:59 -06:00
local function CastShadowBolt(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, true)
2023-03-21 02:26:56 -06:00
end
2023-03-23 02:54:59 -06:00
local function CastCurseOfThePirateKing(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_CURSE_OF_THE_PIRATE_KING, true)
2023-03-21 02:26:56 -06:00
end
2023-03-23 02:54:59 -06:00
local function CastPiratesCleave(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_PIRATES_CLEAVE, true)
2023-03-21 02:26:56 -06:00
end
2023-03-23 02:54:59 -06:00
local function CastCannonballBarrage(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SPELL_CANNONBALL_BARRAGE, true)
2023-03-21 02:26:56 -06:00
end
local function CaptainRattlebones_OnEnterCombat(event, creature, target)
creature:SendUnitYell(YELL_AGGRO_DIALOGUE[math.random(1, #YELL_AGGRO_DIALOGUE)], 0)
2023-03-23 02:54:59 -06:00
creature:RegisterEvent(CastShadowBolt, 3000, 0)
creature:RegisterEvent(CastCurseOfThePirateKing, 12000, 0)
creature:RegisterEvent(CastPiratesCleave, 8000, 0)
creature:RegisterEvent(CastCannonballBarrage, 18000, 0)
2023-03-21 02:26:56 -06:00
end
local function CaptainRattlebones_OnLeaveCombat(event, creature)
2023-03-23 02:54:59 -06:00
creature:RemoveEvents()
2023-03-21 02:26:56 -06:00
end
local function CaptainRattlebones_OnDied(event, creature, killer)
2023-03-23 02:54:59 -06:00
creature:RemoveEvents()
2023-03-21 02:26:56 -06:00
creature:SendUnitSay(YELL_DEATH_DIALOGUE, 0)
end
RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 1, CaptainRattlebones_OnEnterCombat)
RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 2, CaptainRattlebones_OnLeaveCombat)
RegisterCreatureEvent(NPC_CAPTAIN_RATTLEBONES, 4, CaptainRattlebones_OnDied)