Skip to content

Commit

Permalink
Realm: conditional mod load + Vanilla Onyxia (#195)
Browse files Browse the repository at this point in the history
In the case Warmane starts diverging Onyxia realm boss scripts too much from its WotLK realm counterparts, then it might be sensible to have specific mods for Onyxia realm and a way to conditionally load them based on Realm name, while not having to specify Realm names for the "standard" mods.

One key note that was heavily deliberated was whether or not it would make to split the repositories, and the reason I decided against that idea was that Warmane still uses the same 3.3.5a client, therefore the addon folder will also be the same, hence it makes sense to ensure minimal impact for users who realm hop.

Vanilla mods are also relevant for stats purposes (and since Warmane vanilla is 25man instead of 40, it clashes with WotLK version too).
  • Loading branch information
Zidras authored Dec 24, 2023
1 parent 0220b45 commit 3beee5e
Show file tree
Hide file tree
Showing 22 changed files with 528 additions and 21 deletions.
30 changes: 21 additions & 9 deletions DBM-Core/DBM-Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local function currentFullDate()
end

DBM = {
Revision = parseCurseDate("20231205225227"),
Revision = parseCurseDate("20231223195525"),
DisplayVersion = "10.1.8 alpha", -- the string that is shown as version
ReleaseRevision = releaseDate(2023, 12, 5) -- the date of the latest stable version that is available, optionally pass hours, minutes, and seconds for multiple releases in one day
}
Expand Down Expand Up @@ -1341,6 +1341,8 @@ do
name = GetAddOnMetadata(i, "X-DBM-Mod-Name") or "",
zone = {strsplit(",", GetAddOnMetadata(i, "X-DBM-Mod-LoadZone") or CL.UNKNOWN)},
mapId = {strsplit(",", GetAddOnMetadata(i, "X-DBM-Mod-MapID") or "")},
realm = {strsplit(",", GetAddOnMetadata(i, "X-DBM-Mod-LoadRealm") or "")},
blockRealm = {strsplit(",", GetAddOnMetadata(i, "X-DBM-Mod-BlockRealm") or "None")}, -- meant to prevent double load by blocking mod if it exists in different expansions
subTabs = GetAddOnMetadata(i, "X-DBM-Mod-SubCategoriesID") and {strsplit(",", GetAddOnMetadata(i, "X-DBM-Mod-SubCategoriesID"))} or GetAddOnMetadata(i, "X-DBM-Mod-SubCategories") and {strsplit(",", GetAddOnMetadata(i, "X-DBM-Mod-SubCategories"))},
oneFormat = tonumber(GetAddOnMetadata(i, "X-DBM-Mod-Has-Single-Format") or 0) == 1, -- Deprecated
hasLFR = tonumber(GetAddOnMetadata(i, "X-DBM-Mod-Has-LFR") or 0) == 1, -- Deprecated
Expand Down Expand Up @@ -1368,6 +1370,12 @@ do
tremove(self.AddOns[#self.AddOns].mapId, j)
end
end
for k, _ in ipairs(self.AddOns[#self.AddOns].realm) do
self.AddOns[#self.AddOns].realm[k] = (self.AddOns[#self.AddOns].realm[k]):trim()
end
for k, _ in ipairs(self.AddOns[#self.AddOns].blockRealm) do
self.AddOns[#self.AddOns].blockRealm[k] = (self.AddOns[#self.AddOns].blockRealm[k]):trim()
end
if self.AddOns[#self.AddOns].subTabs then
local subTabs = self.AddOns[#self.AddOns].subTabs
for k, _ in ipairs(subTabs) do
Expand Down Expand Up @@ -3142,8 +3150,8 @@ do
end
end
-- LoadMod
self:LoadModsOnDemand("zone", zoneName)
self:LoadModsOnDemand("mapId", mapID)
self:LoadModsOnDemand("zone", zoneName, playerRealm)
self:LoadModsOnDemand("mapId", mapID, playerRealm)
-- if self.Options.ShowReminders then
self:CheckAvailableMods()
-- end
Expand Down Expand Up @@ -3177,18 +3185,22 @@ do
end
DBM.ZONE_CHANGED = DBM.ZONE_CHANGED_INDOORS

function DBM:LoadModsOnDemand(checkTable, checkValue)
function DBM:LoadModsOnDemand(checkTable, checkValue, checkRealm)
self:Debug("LoadModsOnDemand fired")
for _, v in ipairs(self.AddOns) do
local modTable = v[checkTable]
local modRealm = v.realm
local modBlockRealm = v.blockRealm
local _, _, _, enabled = GetAddOnInfo(v.modId)
--self:Debug(v.modId.." is "..enabled, 2)
if not IsAddOnLoaded(v.modId) and modTable and checkEntry(modTable, checkValue) then
if enabled then
self:LoadMod(v)
else
if self.Options.ShowReminders then
self:AddMsg(L.LOAD_MOD_DISABLED:format(v.name))
if not checkEntry(modBlockRealm, checkRealm) and (modRealm[1] == "" or checkEntry(modRealm, checkRealm)) then -- custom realm check (for non-WotLK specific mods, like Vanilla Onyxia). Toc only filled if necessary for conditional mod load based on realm
if enabled then
self:LoadMod(v)
else
if self.Options.ShowReminders then
self:AddMsg(L.LOAD_MOD_DISABLED:format(v.name))
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions DBM-Onyxia/DBM-Onyxia.toc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
## X-DBM-StatTypes: normal,normal25
## X-DBM-Mod-Sort: 3
## X-DBM-Mod-MapID: 719
## X-DBM-Mod-BlockRealm: Onyxia
## X-DBM-Mod-Name: Onyxia's Lair
## X-DBM-Mod-Name-frFR: Repaire d'Onyxia
## X-DBM-Mod-Name-ruRU: Логово Ониксии
Expand Down
17 changes: 5 additions & 12 deletions DBM-Onyxia/Onyxia.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local mod = DBM:NewMod("Onyxia", "DBM-Onyxia")
local L = mod:GetLocalizedStrings()

mod:SetRevision("20231219231417")
mod:SetRevision("20231223195525")
mod:SetCreatureID(10184)

mod:RegisterCombat("combat")
Expand All @@ -19,11 +19,8 @@ mod:RegisterEventsInCombat(
"UNIT_HEALTH boss1"
)

local myRealm = select(3, DBM:GetMyPlayerInfo())
local onyxiaRealm = myRealm == "Onyxia"

-- General
local timerAchieve = not onyxiaRealm and mod:NewAchievementTimer(300, 4405)
local timerAchieve = mod:NewAchievementTimer(300, 4405)

mod:AddBoolOption("SoundWTF3", false, "sound")

Expand All @@ -50,7 +47,7 @@ local specWarnBlastNova = mod:NewSpecialWarningRun(68958, "Melee", nil, nil, 4,
local timerBreathCast = mod:NewCastTimer(8, 18584, nil, nil, nil, 3)
local timerNextDeepBreath = mod:NewCDTimer(35, 18584, nil, nil, nil, 3)--Range from 35-60seconds in between based on where she moves to.
local timerWhelps = mod:NewNextTimer(105, 17646, nil, nil, nil, 1, 69004)
local timerAchieveWhelps = not onyxiaRealm and mod:NewAchievementTimer(10, 4406)
local timerAchieveWhelps = mod:NewAchievementTimer(10, 4406)
local timerBigAddCD = mod:NewNextTimer(44.9, 68959, nil, "-Healer", nil, 1, 10697) -- Ignite Weapon for Onyxian Lair Guard

-- Stage Three (40% – 0%)
Expand Down Expand Up @@ -86,9 +83,7 @@ function mod:OnCombatStart(delay)
self.vb.warned_preP2 = false
self.vb.warned_preP3 = false
timerNextFlameBreath:Start(12.1-delay) -- REVIEW! variance? (25N Lordaeron 2022/10/13) - 12.1
if not onyxiaRealm then
timerAchieve:Start(-delay)
end
timerAchieve:Start(-delay)
if self.Options.SoundWTF3 then
DBM:PlaySoundFile("Interface\\AddOns\\DBM-Onyxia\\sounds\\dps-very-very-slowly.ogg")
self:Schedule(20, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-Onyxia\\sounds\\hit-it-like-you-mean-it.ogg")
Expand Down Expand Up @@ -169,9 +164,7 @@ function mod:OnSync(msg)
timerBigAddCD:Start(20) -- (25N Lordaeron 2022/10/13) - Stage 2/20.0
-- preWarnDeepBreath:Schedule(72) -- Pre-Warn Deep Breath
timerNextDeepBreath:Start(75.5) -- Breath-17086. REVIEW! variance? (25N Lordaeron 2022/10/13) - 75.5
if not onyxiaRealm then
timerAchieveWhelps:Start()
end
timerAchieveWhelps:Start()
timerNextFlameBreath:Cancel()
self:Schedule(5, Whelps, self)
if self.Options.SoundWTF3 then
Expand Down
52 changes: 52 additions & 0 deletions DBM-VanillaOnyxia/DBM-VanillaOnyxia.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Interface: 30300
## Title:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0Onyxia (Vanilla)|r
## Title-frFR:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0Repaire d'Onyxia (Vanilla)|r
## Title-ruRU:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0Ониксия (Vanilla)|r
## Title-esES:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0Guarida de Onyxia (Vanilla)|r
## Title-esMX:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0Guarida de Onyxia (Vanilla)|r
## Title-zhTW:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0奧妮克希亞 (Vanilla)|r
## Title-zhCN:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0奥妮克希亚 (Vanilla)|r
## Title-koKR:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0오닉시아| (Vanilla)r
## Title-deDE:|cffffe00a<|r|cffff7d0aDBM|r|cffffe00a>|r |cff69ccf0Onyxias Hort| (Vanilla)r
## LoadOnDemand: 1
## RequiredDeps: DBM-Core
## SavedVariables: DBMVanillaOnyxia_AllSavedVars
## SavedVariablesPerCharacter: DBMVanillaOnyxia_SavedStats
## X-DBM-Mod: 1
## X-DBM-Mod-Type: RAID
## X-DBM-Mod-Category: Classic
## X-DBM-StatTypes: normal
## X-DBM-Mod-Sort: 1108
## X-DBM-Mod-MapID: 719
## X-DBM-Mod-LoadRealm: Onyxia
## X-DBM-Mod-Name: Onyxia's Lair (Vanilla)
## X-DBM-Mod-Name-frFR: Repaire d'Onyxia (Vanilla)
## X-DBM-Mod-Name-ruRU: Логово Ониксии (Vanilla)
## X-DBM-Mod-Name-esES: Guarida de Onyxia (Vanilla)
## X-DBM-Mod-Name-esMX: Guarida de Onyxia (Vanilla)
## X-DBM-Mod-Name-zhTW: 奧妮克希亞 (Vanilla)
## X-DBM-Mod-Name-zhCN: 奥妮克希亚的巢穴 (Vanilla)
## X-DBM-Mod-Name-koKR: 오닉시아 (Vanilla)
## X-DBM-Mod-Name-deDE: Onyxias Hort (Vanilla)
## X-DBM-Mod-LoadZone: Onyxia's Lair
## X-DBM-Mod-LoadZone-frFR: Repaire d'Onyxia
## X-DBM-Mod-LoadZone-ruRU: Логово Ониксии
## X-DBM-Mod-LoadZone-esES: Guarida de Onyxia
## X-DBM-Mod-LoadZone-esMX: Guarida de Onyxia
## X-DBM-Mod-LoadZone-zhTW: 奧妮克希亞的巢穴
## X-DBM-Mod-LoadZone-zhCN: 奥妮克希亚的巢穴
## X-DBM-Mod-LoadZone-koKR: 오닉시아의 둥지
## X-DBM-Mod-LoadZone-deDE: Onyxias Hort

localization.en.lua
localization.de.lua
localization.fr.lua
localization.ru.lua
localization.tw.lua
localization.kr.lua
localization.tw.lua
localization.es.lua
localization.cn.lua
localization.ru.lua

Onyxia.lua
193 changes: 193 additions & 0 deletions DBM-VanillaOnyxia/Onyxia.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
local mod = DBM:NewMod("Onyxia-Vanilla", "DBM-VanillaOnyxia")
local L = mod:GetLocalizedStrings()

mod:SetRevision("20231219231417")
mod:SetCreatureID(10184)

mod:RegisterCombat("combat")

--[[mod:RegisterEvents(
"CHAT_MSG_MONSTER_YELL"
)]]

mod:RegisterEventsInCombat(
"SPELL_CAST_START 68958 17086 18351 18564 18576 18584 18596 18609 18617 18435 68970 18431 18500 18392 68926",
"SPELL_CAST_SUCCESS 68959 68963",
"SPELL_DAMAGE 68867 69286",
"CHAT_MSG_MONSTER_YELL",
"UNIT_DIED",
"UNIT_HEALTH boss1"
)

-- General
mod:AddBoolOption("SoundWTF3", false, "sound")

-- Stage One (100% – 65%)
mod:AddTimerLine(DBM_CORE_L.SCENARIO_STAGE:format(1)..": 100% – 65%")
local warnPhase2Soon = mod:NewPrePhaseAnnounce(2)
local warnWingBuffet = mod:NewSpellAnnounce(18500, 2, nil, "Tank")

local timerNextFlameBreath = mod:NewCDTimer(13.3, 18435, nil, "Tank", 2, 5, nil, nil, true) -- Breath she does on ground in frontal cone. REVIEW! ~7s variance [13.3-20]. Added "keep" arg (25N Lordaeron 2022/10/13) - 13.3, 18.8, 16.3, 13.6

-- Stage Two (65% – 40%)
mod:AddTimerLine(DBM_CORE_L.SCENARIO_STAGE:format(2)..": 65% – 40%")
local warnPhase2 = mod:NewPhaseAnnounce(2)
local warnPhase3Soon = mod:NewPrePhaseAnnounce(3)
local warnFireball = mod:NewTargetNoFilterAnnounce(18392, 2, nil, false)
local warnWhelpsSoon = mod:NewSoonAnnounce(17646, 1, 69004)
--local preWarnDeepBreath = mod:NewSoonAnnounce(17086, 2)--Experimental, if it is off please let me know.

local yellFireball = mod:NewYell(18392)
local specWarnBreath = mod:NewSpecialWarningSpell(18584, nil, nil, nil, 2, 2)
local specWarnAdds = mod:NewSpecialWarningAdds(68959, "-Healer", nil, nil, 1, 2)
local specWarnBlastNova = mod:NewSpecialWarningRun(68958, "Melee", nil, nil, 4, 2) -- from Onyxian Lair Guard

local timerBreathCast = mod:NewCastTimer(8, 18584, nil, nil, nil, 3)
local timerNextDeepBreath = mod:NewCDTimer(35, 18584, nil, nil, nil, 3)--Range from 35-60seconds in between based on where she moves to.
local timerWhelps = mod:NewNextTimer(105, 17646, nil, nil, nil, 1, 69004)
local timerBigAddCD = mod:NewNextTimer(44.9, 68959, nil, "-Healer", nil, 1, 10697) -- Ignite Weapon for Onyxian Lair Guard

-- Stage Three (40% – 0%)
mod:AddTimerLine(DBM_CORE_L.SCENARIO_STAGE:format(3)..": 40% – 0%")
local warnPhase3 = mod:NewPhaseAnnounce(3)

local specWarnBellowingRoar = mod:NewSpecialWarningSpell(18431, nil, nil, nil, 2, 2)

mod.vb.warned_preP2 = false
mod.vb.warned_preP3 = false
mod.vb.whelpsCount = 0

local function Whelps(self)
if self:IsInCombat() then
self.vb.whelpsCount = self.vb.whelpsCount + 1
timerWhelps:Start()
warnWhelpsSoon:Schedule(95)
self:Schedule(105, Whelps, self)
end
end

function mod:FireballTarget(targetname)
if not targetname then return end
warnFireball:Show(targetname)
if targetname == UnitName("player") then
yellFireball:Yell()
end
end

function mod:OnCombatStart(delay)
self:SetStage(1)
self.vb.whelpsCount = 0
self.vb.warned_preP2 = false
self.vb.warned_preP3 = false
timerNextFlameBreath:Start(12.1-delay) -- REVIEW! variance? (25N Lordaeron 2022/10/13) - 12.1
if self.Options.SoundWTF3 then
DBM:PlaySoundFile("Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\dps-very-very-slowly.ogg")
self:Schedule(20, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\hit-it-like-you-mean-it.ogg")
self:Schedule(30, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\now-hit-it-very-hard-and-fast.ogg")
end
end

function mod:SPELL_CAST_START(args)
local spellId = args.spellId
if spellId == 68958 then -- Blast Nova (from Onyxian Lair Guard)
specWarnBlastNova:Show()
elseif args:IsSpellID(17086, 18351, 18564, 18576) or args:IsSpellID(18584, 18596, 18609, 18617) then -- 1 ID for each direction
specWarnBreath:Show()
timerBreathCast:Start()
timerNextDeepBreath:Start()
-- preWarnDeepBreath:Schedule(35) -- Pre-Warn Deep Breath
elseif args:IsSpellID(18435, 68970) then -- Flame Breath (Ground phases)
timerNextFlameBreath:Start()
elseif spellId == 18431 then
specWarnBellowingRoar:Show()
specWarnBellowingRoar:Play("fearsoon")
elseif args:IsSpellID(18500, 69293) then -- Wing Buffet
warnWingBuffet:Show()
elseif args:IsSpellID(18392, 68926) then -- Fireball
self:BossTargetScanner(args.sourceGUID, "FireballTarget", 0.15, 12)
end
end

function mod:SPELL_CAST_SUCCESS(args)
if args:IsSpellID(68959, 68963) then--Ignite Weapon (Onyxian Lair Guard spawn)
specWarnAdds:Show()
specWarnAdds:Play("bigmob")
timerBigAddCD:Start()
end
end

function mod:SPELL_DAMAGE(_, _, _, destGUID, _, _, spellId)
if (spellId == 68867 or spellId == 69286) and destGUID == UnitGUID("player") and self.Options.SoundWTF3 then -- Tail Sweep
DBM:PlaySoundFile("Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\watch-the-tail.ogg")
end
end

function mod:CHAT_MSG_MONSTER_YELL(msg)
-- if msg == L.YellPull and not self:IsInCombat() then
-- DBM:StartCombat(self, 0)
if msg == L.YellP2 or msg:find(L.YellP2) then
self:SendSync("Phase2")
elseif msg == L.YellP3 or msg:find(L.YellP3) then
self:SendSync("Phase3")
end
end

function mod:UNIT_DIED(args)
if self:IsInCombat() and args:IsPlayer() and self.Options.SoundWTF3 then
DBM:PlaySoundFile("Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\thats-a-fucking-fifty-dkp-minus.ogg")
end
end

function mod:UNIT_HEALTH(uId)
if self.vb.phase == 1 and not self.vb.warned_preP2 and self:GetUnitCreatureId(uId) == 10184 and UnitHealth(uId) / UnitHealthMax(uId) <= 0.70 then
self.vb.warned_preP2 = true
warnPhase2Soon:Show()
elseif self.vb.phase == 2 and not self.vb.warned_preP3 and self:GetUnitCreatureId(uId) == 10184 and UnitHealth(uId) / UnitHealthMax(uId) <= 0.45 then
self.vb.warned_preP3 = true
warnPhase3Soon:Show()
if self.Options.SoundWTF3 then
self:Unschedule(DBM.PlaySoundFile, DBM)
end
end
end

function mod:OnSync(msg)
if not self:IsInCombat() then return end
if msg == "Phase2" then
self:SetStage(2)
self.vb.whelpsCount = 0
warnPhase2:Show()
timerBigAddCD:Start(20) -- (25N Lordaeron 2022/10/13) - Stage 2/20.0
-- preWarnDeepBreath:Schedule(72) -- Pre-Warn Deep Breath
timerNextDeepBreath:Start(75.5) -- Breath-17086. REVIEW! variance? (25N Lordaeron 2022/10/13) - 75.5
timerNextFlameBreath:Cancel()
self:Schedule(5, Whelps, self)
if self.Options.SoundWTF3 then
self:Unschedule(DBM.PlaySoundFile, DBM)
DBM:PlaySoundFile("Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\i-dont-see-enough-dots.ogg")
self:Schedule(10, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\throw-more-dots.ogg")
self:Schedule(17, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\whelps-left-side-even-side-handle-it.ogg") -- 18
end
if self.Options.RangeFrame then
DBM.RangeCheck:Show(8)
end
elseif msg == "Phase3" then
self:SetStage(3)
warnPhase3:Show()
self:Unschedule(Whelps)
timerWhelps:Stop()
timerNextDeepBreath:Stop()
timerBigAddCD:Stop()
warnWhelpsSoon:Cancel()
-- preWarnDeepBreath:Cancel()
if self.Options.SoundWTF3 then
self:Unschedule(DBM.PlaySoundFile, DBM)
self:Schedule(15, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\dps-very-very-slowly.ogg")
self:Schedule(35, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\hit-it-like-you-mean-it.ogg")
self:Schedule(45, DBM.PlaySoundFile, DBM, "Interface\\AddOns\\DBM-VanillaOnyxia\\sounds\\now-hit-it-very-hard-and-fast.ogg")
end
if self.Options.RangeFrame then
DBM.RangeCheck:Hide()
end
end
end
Loading

0 comments on commit 3beee5e

Please sign in to comment.