Skip to content

Commit

Permalink
sapphiron flight trigger and improved engage trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
xorann committed Jun 12, 2018
1 parent a811073 commit c854256
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Raids/Naxxramas/Sapphiron/I18n.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ L:RegisterTranslations("enUS", function() return {
trigger_lifeDrain1 = "afflicted by Life Drain",
trigger_lifeDrain2 = "Life Drain was resisted by",
trigger_icebolt = "You are afflicted by Icebolt",
trigger_deepBreath = "%s takes in a deep breath...",
trigger_deepBreath = "Sapphiron takes in a deep breath...",
trigger_flight = "Sapphiron lifts off into the air!",

-- messages
msg_berserk10m = "10min to berserk!",
Expand All @@ -50,3 +51,7 @@ L:RegisterTranslations("enUS", function() return {
-- misc

} end )

L:RegisterTranslations("deDe", function() return {
trigger_icebolt = "Ihr seid von Eisblitz betroffen.",
} end )
48 changes: 47 additions & 1 deletion ServerProjects/Classic-WoW/Raids/Naxxramas/Sapphiron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local icon = module.icon
local syncName = module.syncName

-- module variables
module.revision = 20014 -- To be overridden by the module!
module.revision = 20018 -- To be overridden by the module!

-- override timers if necessary
--timer.berserk = 300
Expand All @@ -38,6 +38,8 @@ function module:OnEnable()
end

self:RegisterEvent("CHAT_MSG_MONSTER_EMOTE", "CheckForDeepBreath")
self:CombatlogFilter(L["trigger_deepBreath"], self.DeepBreathEvent, true)
self:CombatlogFilter(L["trigger_flight"], self.FlightEvent, true)

self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_PARTY_DAMAGE", "CheckForLifeDrain")
self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_FRIENDLYPLAYER_DAMAGE", "CheckForLifeDrain")
Expand Down Expand Up @@ -72,6 +74,8 @@ function module:OnEngage()
-- start it.
self:ScheduleEvent("besapphdelayed", self.StartTargetScanner, 5, self)
end

self:ScheduleRepeatingEvent("bwsapphengagecheck", self.EngageCheck, 1, self)
end

-- called after boss is disengaged (wipe(retreat) or victory)
Expand Down Expand Up @@ -104,6 +108,46 @@ function module:CheckForDeepBreath(msg)
self:Sync(syncName.deepbreath)
end
end
function module:DeepBreathEvent(msg)
if string.find(msg, L["trigger_deepBreath"]) then
self:Sync(syncName.deepbreath)
end
end

function module:FlightEvent(msg)
if string.find(msg, L["trigger_flight"]) then
self:Sync(syncName.flight)
end
end

------------------------------
-- Utility Functions --
------------------------------
function module:EngageCheck()
if not self.engaged then
if self:IsSapphironVisible() then
module:CancelScheduledEvent("bwsapphengagecheck")

module:SendEngageSync()
end
else
module:CancelScheduledEvent("bwsapphengagecheck")
end
end

function module:IsSapphironVisible()
if UnitName("playertarget") == self:ToString() then
return true
else
for i = 1, GetNumRaidMembers(), 1 do
if UnitName("Raid" .. i .. "target") == self:ToString() then
return true
end
end
end

return false
end


----------------------------------
Expand All @@ -122,6 +166,8 @@ function module:TestModule()
module:CheckForDeepBreath(L["trigger_deepBreath"])
module:CheckForLifeDrain(L["trigger_lifeDrain1"])
module:CheckForLifeDrain(L["trigger_lifeDrain2"])
module:DeepBreathEvent(L["trigger_deepBreath"])
module:FlightEvent(L["trigger_flight"])

module:OnDisengage()
module:TestDisable()
Expand Down

0 comments on commit c854256

Please sign in to comment.