Skip to content

Commit

Permalink
Merge pull request #677 from cyriun/i-6754-brul
Browse files Browse the repository at this point in the history
Implement tracking for Brul (pet)
  • Loading branch information
rdw-software authored Nov 12, 2023
2 parents 56b84ff + a2c63c2 commit e716e2b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ globals = {
"READY_CHECK_WAITING_TEXTURE",

-- FrameXML (Blizzard interface)
"AuraUtil",
"BackdropTemplateMixin",
"ChatFontNormal",
"FauxScrollFrame_GetOffset",
Expand Down
29 changes: 28 additions & 1 deletion Core/EventHandlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ local UnitGUID = UnitGUID
local LoadAddOn = LoadAddOn
local GetBestMapForUnit = _G.C_Map.GetBestMapForUnit
local GetMapInfo = _G.C_Map.GetMapInfo
local IsQuestFlaggedCompleted = C_QuestLog.IsQuestFlaggedCompleted
local UnitCanAttack = _G.UnitCanAttack
local UnitIsPlayer = _G.UnitIsPlayer
local UnitIsDead = _G.UnitIsDead
Expand Down Expand Up @@ -1931,6 +1932,10 @@ function R:OnLootReady(event, ...)
Rarity:OnDisgustingVatFished()
end

if Rarity.isOpening and Rarity.lastNode == L["Chest of Massive Gains"] then
Rarity:OnChestOfMassiveGainsOpened()
end

-- Handle mining Elementium
if
Rarity.relevantSpells[Rarity.previousSpell] == "Mining"
Expand Down Expand Up @@ -2069,7 +2074,29 @@ function R:OnLootReady(event, ...)
end
end

local IsQuestFlaggedCompleted = C_QuestLog.IsQuestFlaggedCompleted
function Rarity:OnChestOfMassiveGainsOpened()
Rarity:Debug("Detected Opening on Chest of Massive Gains")

local hasOpenedChestToday = IsQuestFlaggedCompleted(75325)
if hasOpenedChestToday then
Rarity:Debug("Skipping this attempt (loot lockout for Chest of Massive Gains is active)")
return
end

local wasRequiredAuraFoundOnPlayer = false
AuraUtil.ForEachAura("player", "HELPFUL", nil, function(_, _, _, _, _, _, _, _, _, spellID)
if spellID == CONSTANTS.AURAS.ROCKS_ON_THE_ROCKS then
wasRequiredAuraFoundOnPlayer = true
end
end)

if not wasRequiredAuraFoundOnPlayer then
Rarity:Debug(format("Required aura %s NOT found on player", L["Rocks on the Rocks"]))
return
end

addAttemptForItem("Brul", "pets")
end

function Rarity:OnDisgustingVatFished()
local hasFishedEmmahThisWeek = IsQuestFlaggedCompleted(75488)
Expand Down
17 changes: 17 additions & 0 deletions DB/Pets/Dragonflight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,23 @@ local dragonflightPets = {
{ m = CONSTANTS.UIMAPIDS.THE_FORBIDDEN_REACH, x = 29.2, y = 53.0, n = L["Entrance to Zskera Vaults"] },
},
},
["Brul"] = {
cat = CONSTANTS.ITEM_CATEGORIES.DRAGONFLIGHT,
type = CONSTANTS.ITEM_TYPES.PET,
method = CONSTANTS.DETECTION_METHODS.SPECIAL,
name = L["Brul"],
spellId = 408110,
itemId = 205114,
creatureId = 204303,
chance = 35,
sourceText = format(
L["Use %s before opening %s, which spawns after %s is defeated."],
L["Rocks on the Rocks"],
L["Chest of Massive Gains"],
L["Brullo the Strong"]
),
coords = { { m = CONSTANTS.UIMAPIDS.ZARALEK_CAVERN, x = 41.5, y = 86.2, n = L["Chest of Massive Gains"] } },
},
}

Rarity.ItemDB.MergeItems(Rarity.ItemDB.pets, dragonflightPets)
4 changes: 4 additions & 0 deletions DB/SharedConstants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ C.LFG_DUNGEON_IDS = {
THE_UPPER_REACHES_LAYER_16 = 2318,
}

C.AURAS = {
ROCKS_ON_THE_ROCKS = 407063,
}

-- This doesn't really belong here and needs streamlining anyway, but for now this is the best place.
-- Tooltip Filters (Note: Currently, this system is merely a stub. but more (and custom) filters may be added in the future)
-- These are used to decide whether the tooltip should be extended to display information about an CONSTANTS.ITEM_TYPES.ITEM for the NPCs listed in its tooltipNpcs table. Useful if we want to draw attention to an CONSTANTS.ITEM_TYPES.ITEM, but not every player can obtain it
Expand Down
5 changes: 5 additions & 0 deletions Locales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2039,6 +2039,11 @@ L["Emmah"] = true
L["Box of Rattling Chains"] = true
L["Sunreaver Micro-Sentry"] = true
L["Haywire Sunreaver Construct"] = true
L["Brul"] = true
L["Chest of Massive Gains"] = true
L["Use %s before opening %s, which spawns after %s is defeated."] = true
L["Brullo the Strong"] = true
L["Rocks on the Rocks"] = true

--[[
The rest of this file is auto-generated using the WoWAce localization application.
Expand Down

0 comments on commit e716e2b

Please sign in to comment.