diff --git a/Core/HolidayEvents.lua b/Core/HolidayEvents.lua index 9313dcea..b4a6ea3a 100644 --- a/Core/HolidayEvents.lua +++ b/Core/HolidayEvents.lua @@ -59,6 +59,12 @@ function HolidayEvents.IsItemAvailableToday(item) if isRequiredHolidayEventActive then return true end + + if type(item.holidayTexture) == "table" then -- Modern file data ID format: Supports multiple textures per item + if item.holidayTexture[artTextureID] then + return true + end + end end return false diff --git a/DB/Pets/HolidayEvents.lua b/DB/Pets/HolidayEvents.lua index 17502e8c..51c81d28 100644 --- a/DB/Pets/HolidayEvents.lua +++ b/DB/Pets/HolidayEvents.lua @@ -280,6 +280,29 @@ local holidayEventPets = { coords = { { m = 435, i = true } }, sourceText = L["Can be contained in Loot-Filled Pumpkin, rewarded for defeating the World Event Dungeon during Hallow's End."], }, + ["Lil'Kaz's Hilt"] = { + cat = CONSTANTS.ITEM_CATEGORIES.HOLIDAY, + type = CONSTANTS.ITEM_TYPES.PET, + method = CONSTANTS.DETECTION_METHODS.NPC, -- LOOT_TOAST ... ? + name = L["Lil'Kaz's Hilt"], + spellId = 466576, + itemId = 230011, + npcs = { 121818 }, + chance = 10, -- No data available + creatureId = 231841, + coords = { { m = CONSTANTS.UIMAPIDS.BLASTED_LANDS, x = 32.8, y = 47.7 } }, + -- TODO migrate all entries to this format? (check if Custom items/SV would be affected first...) + holidayTexture = { + [CONSTANTS.ART_TEXTURES.TWENTIETH_ANNIVERSARY_START] = true, + [CONSTANTS.ART_TEXTURES.TWENTIETH_ANNIVERSARY_ONGOING] = true, + [CONSTANTS.ART_TEXTURES.TWENTIETH_ANNIVERSARY_END] = true, + }, + groupSize = 5, + equalOdds = true, + -- TODO defeat detection (daily loot lockout vs. 1st attempt bonus? check wowhead comments) + -- daily bonus: ? + -- loot lockout: 47461 + }, } Rarity.ItemDB.MergeItems(Rarity.ItemDB.pets, holidayEventPets) diff --git a/DB/SharedConstants.lua b/DB/SharedConstants.lua index 3b137c35..f7125ebd 100644 --- a/DB/SharedConstants.lua +++ b/DB/SharedConstants.lua @@ -21,6 +21,7 @@ C.UIMAPIDS = { -- Classic Zones DUROTAR = 1, ARATHI_HIGHLANDS = 14, + BLASTED_LANDS = 17, HILLSBRAD_FOOTHILLS = 25, ELWYNN_FOREST = 37, DARKSHORE = 62, @@ -250,6 +251,12 @@ C.ART_TEXTURES = { WINTERVEIL_IEND = 235483, WINTERVEIL_ONGOING = 235484, WINTERVEIL_START = 235485, + ANNIVERSARY_START = 1084434, + ANNIVERSARY_ONGOING = 1084433, + ANNIVERSARY_END = 1084432, + TWENTIETH_ANNIVERSARY_START = 6238552, + TWENTIETH_ANNIVERSARY_ONGOING = 6238551, + TWENTIETH_ANNIVERSARY_END = 6238550, } C.ARCHAEOLOGY_RACES = { diff --git a/Locales.lua b/Locales.lua index 0c616b18..17ef1ed7 100644 --- a/Locales.lua +++ b/Locales.lua @@ -2,6 +2,7 @@ local L L = LibStub("AceLocale-3.0"):NewLocale("Rarity", "enUS", true) -- L["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"] = true +L["Lil'Kaz's Hilt"] = true L["Writhing Transmutagen"] = true L["When enabled, Rarity will not add tooltip information for items that aren't being tracked."] = true L["Hide untracked items in tooltips"] = true diff --git a/Tests/WOWAPI.lua b/Tests/WOWAPI.lua index 36305b99..b2bac443 100644 --- a/Tests/WOWAPI.lua +++ b/Tests/WOWAPI.lua @@ -36,7 +36,8 @@ _G.CreateFrame = function(...) return createDummyFrame() end -_G.EnableAddOn = function(...) +local C_AddOns = {} +C_AddOns.EnableAddOn = function(...) print("[EnableAddOn] NYI", ...) end @@ -44,6 +45,8 @@ _G.IsAddOnLoaded = function(...) print("[IsAddOnLoaded] NYI", ...) end +_G.C_AddOns = C_AddOns + _G.GetChannelList = function(...) print("[GetChannelList] NYI", ...) end diff --git a/Tests/test-holiday-events.spec.lua b/Tests/test-holiday-events.spec.lua index e2e044fe..30f6ae79 100644 --- a/Tests/test-holiday-events.spec.lua +++ b/Tests/test-holiday-events.spec.lua @@ -11,6 +11,13 @@ describe("HolidayEvents", function() holidayTexture = SharedConstants.HOLIDAY_TEXTURES.DARKMOON_FAIRE, } local ITEM_WITHOUT_HOLIDAY_TEXTURE = {} + local ITEM_WITH_MULTIPLE_HOLIDAY_TEXTURES = { + holidayTexture = { + [SharedConstants.ART_TEXTURES.TWENTIETH_ANNIVERSARY_START] = true, + [SharedConstants.ART_TEXTURES.TWENTIETH_ANNIVERSARY_ONGOING] = true, + [SharedConstants.ART_TEXTURES.TWENTIETH_ANNIVERSARY_END] = true, + }, + } it("should return true if the item requires an active holiday event that is currently enabled", function() Rarity.holiday_textures[SharedConstants.ART_TEXTURES.DMF_ONGOING] = true @@ -38,5 +45,14 @@ describe("HolidayEvents", function() it("should return true if the item doesn't require any holiday event to be active", function() assertTrue(HolidayEvents.IsItemAvailableToday(ITEM_WITHOUT_HOLIDAY_TEXTURE)) end) + + it("should return true if the item uses file data IDs and the holiday event is active", function() + Rarity.holiday_textures[SharedConstants.ART_TEXTURES.TWENTIETH_ANNIVERSARY_ONGOING] = true + assertTrue(HolidayEvents.IsItemAvailableToday(ITEM_WITH_MULTIPLE_HOLIDAY_TEXTURES)) + end) + + it("should return false if the item uses file data IDs and the holiday event is inactive", function() + assertFalse(HolidayEvents.IsItemAvailableToday(ITEM_WITH_MULTIPLE_HOLIDAY_TEXTURES)) + end) end) end)