From 79a28e13d1bd821a5d5cdeca94658a987f0c3ff5 Mon Sep 17 00:00:00 2001 From: Godejord <42249105+godejord@users.noreply.github.com> Date: Mon, 20 Feb 2023 18:36:53 +0100 Subject: [PATCH] DB: Added Verdant skitterfly --- .luacheckrc | 4 ++-- Core/EventHandlers.lua | 26 ++++++++++++++++++++++++++ DB/Mounts/Dragonflight.lua | 16 ++++++++++++++++ DB/Nodes.lua | 1 + DB/SharedConstants.lua | 8 ++++++++ Locales.lua | 3 +++ 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 8bbde6c3..95d0454d 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -28,7 +28,6 @@ ignore = { "542", -- empty if branch (likely some commented-out code that needs to be reviewed later) "512", -- loop is executed at most once (no idea why, will also have to be reviewed later) "231", -- variable is never accessed (still more readable than replacing everything with underscores... remove later?) - } globals = { @@ -742,6 +741,7 @@ globals = { "C_LootJournal.SetLegendaryInventoryTypeFilter", "C_LossOfControl.GetEventInfo", "C_LossOfControl.GetNumEvents", + "C_MajorFactions", "C_MapBar", "C_MapBar.BarIsShown", "C_MapBar.GetCurrentValue", @@ -19443,4 +19443,4 @@ globals = { "ZOOM_OUT", "ZOOM_OUT_BUTTON_TEXT", "_RECORDING_WARNING_CORRUPTED", -} +} diff --git a/Core/EventHandlers.lua b/Core/EventHandlers.lua index 8c7c504b..ca54cc68 100644 --- a/Core/EventHandlers.lua +++ b/Core/EventHandlers.lua @@ -47,6 +47,7 @@ local GetStatistic = _G.GetStatistic local GetLootSourceInfo = _G.GetLootSourceInfo local C_Timer = _G.C_Timer local IsSpellKnown = _G.IsSpellKnown +local GetCurrentRenownLevel = C_MajorFactions.GetCurrentRenownLevel -- Addon APIs local DebugCache = Rarity.Utils.DebugCache @@ -1610,6 +1611,31 @@ function R:OnEvent(event, ...) end end + -- Handle opening Expedition Scout's Pack (Verdant Skitterfly mount in Dragonflight) + if + Rarity.isFishing + and Rarity.isOpening + and Rarity.lastNode + and (Rarity.lastNode == L["Expedition Scout's Pack"]) + then + local names = { "Verdant Skitterfly" } + Rarity:Debug("Detected Opening on " .. L["Expedition Scout's Pack"] .. " (method = SPECIAL)") + -- This mount has a prerequisite to drop. Renown 25 with Dragonscale Expedition + if GetCurrentRenownLevel(CONSTANTS.FACTION_IDS.DRAGONSCALE_EXPEDITION) >= 25 then + for _, name in pairs(names) do + local v = self.db.profile.groups.mounts[name] + if v and type(v) == "table" and v.enabled ~= false then + if v.attempts == nil then + v.attempts = 1 + else + v.attempts = v.attempts + 1 + end + self:OutputAttempts(v) + end + end + end + end + -- HANDLE FISHING if Rarity.isFishing and Rarity.isOpening == false then if Rarity.isPool then diff --git a/DB/Mounts/Dragonflight.lua b/DB/Mounts/Dragonflight.lua index 6a49b8de..8e2ef5a0 100644 --- a/DB/Mounts/Dragonflight.lua +++ b/DB/Mounts/Dragonflight.lua @@ -32,6 +32,22 @@ local dragonflightMounts = { { m = CONSTANTS.UIMAPIDS.THALDRASZUS }, }, }, + ["Verdant Skitterfly"] = { + cat = CONSTANTS.ITEM_CATEGORIES.DRAGONFLIGHT, + type = CONSTANTS.ITEM_TYPES.MOUNT, + method = CONSTANTS.DETECTION_METHODS.SPECIAL, + name = L["Verdant Skitterfly"], + spellId = 374048, + itemId = 192764, + chance = 100, -- Blind guess + sourceText = L["This mount can only drop after hitting renown 25 with Dragonscale Expedition."], + coords = { + { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, + { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, + { m = CONSTANTS.UIMAPIDS.THE_AZURE_SPAN }, + { m = CONSTANTS.UIMAPIDS.THALDRASZUS }, + }, + }, } Rarity.ItemDB.MergeItems(Rarity.ItemDB.mounts, dragonflightMounts) diff --git a/DB/Nodes.lua b/DB/Nodes.lua index 8aabd581..aa11a40b 100644 --- a/DB/Nodes.lua +++ b/DB/Nodes.lua @@ -250,4 +250,5 @@ R.opennodes = { [L["Zovaal's Vault"]] = true, [L["Mawsworn Supply Chest"]] = true, [L["Sandworn Chest"]] = true, + [L["Expedition Scout's Pack"]] = true, } diff --git a/DB/SharedConstants.lua b/DB/SharedConstants.lua index 7a5c6b23..75263cbe 100644 --- a/DB/SharedConstants.lua +++ b/DB/SharedConstants.lua @@ -221,6 +221,14 @@ C.ARCHAEOLOGY_RACES = { DWARF = 20, } +C.FACTION_IDS = { + -- Dragonflight + MARUUK_CENTAUR = 2503, + DRAGONSCALE_EXPEDITION = 2507, + VALDRAKKEN_ACCORD = 2510, + ISKAARA_TUSKARR = 2511, +} + -- 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 diff --git a/Locales.lua b/Locales.lua index 98993718..9304435d 100644 --- a/Locales.lua +++ b/Locales.lua @@ -1878,6 +1878,9 @@ L["Plainswalker Bearer"] = true L["Rockin' Rollin' Racer Customizer 19.9.3"] = true L["Vengeance's Reins"] = true L["Fractal Cypher of the Zereth Overseer"] = true +L["Verdant Skitterfly"] = true +L["This mount can only drop after hitting renown 25 with Dragonscale Expedition."] = true +L["Expedition Scout's Pack"] = true --[[ The rest of this file is auto-generated using the WoWAce localization application.