From a8b002d216ec1741389cd23397026f87aed334c0 Mon Sep 17 00:00:00 2001 From: cyriun Date: Tue, 10 Oct 2023 15:05:39 +1100 Subject: [PATCH 1/5] current draft for primal storm pets --- Core.lua | 17 + DB/Item.lua | 2 + DB/Pets/Dragonflight.lua | 682 +-------------------------------------- 3 files changed, 31 insertions(+), 670 deletions(-) diff --git a/Core.lua b/Core.lua index 3e80df6c..61bec75d 100644 --- a/Core.lua +++ b/Core.lua @@ -680,6 +680,23 @@ function R:IsAttemptAllowed(item) return false end + local requiredAuraFound = false + local auraToCheck = "Elementally Imbued" + local auraSpellIdToFind = item.requiredAuraID + if item.requiresAura then + local unit = "target" + AuraUtil.ForEachAura(unit, "HELPFUL", nil, function(name, _, _, _, _, _, _, _, _, spellId) + if name == auraToCheck and spellId == auraSpellIdToFind then + requiredAuraFound = true + Rarity:Debug("Required aura found for item: " .. item.name) + return true + end + end) + if not requiredAuraFound then + Rarity:Debug("Required aura NOT found for item: " .. item.name) + end + end + local activeCovenantID = C_Covenants.GetActiveCovenantID() if item.requiresCovenant and item.requiredCovenantID and activeCovenantID ~= item.requiredCovenantID then local activeCovenantData = C_Covenants.GetCovenantData(activeCovenantID) diff --git a/DB/Item.lua b/DB/Item.lua index 6c334073..6ccc8539 100644 --- a/DB/Item.lua +++ b/DB/Item.lua @@ -35,6 +35,8 @@ local Item = { worldQuestId = false, pickpocket = false, requiresCompletedQuestId = false, + requiresAura = false, + requiredAuraID = false, -- Populated fields (SavedVariables) attempts = false, lastAttempts = false, diff --git a/DB/Pets/Dragonflight.lua b/DB/Pets/Dragonflight.lua index 382a783d..38c1d6a3 100644 --- a/DB/Pets/Dragonflight.lua +++ b/DB/Pets/Dragonflight.lua @@ -271,177 +271,13 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Heights"], - npcs = { - 184444, - 184453, - 184461, - 185147, - 185168, - 185350, - 185353, - 185357, - 185465, - 186109, - 186239, - 186512, - 186594, - 186598, - 186599, - 186600, - 186602, - 186604, - 186605, - 186606, - 186607, - 186609, - 186612, - 186620, - 186624, - 186626, - 186627, - 186628, - 186630, - 186632, - 186638, - 186684, - 186724, - 186727, - 186728, - 186735, - 186783, - 186859, - 187306, - 187366, - 187599, - 187600, - 187602, - 187813, - 187867, - 187868, - 187886, - 187889, - 187919, - 187923, - 187928, - 187932, - 188009, - 188014, - 188044, - 190737, - 190738, - 190776, - 190778, - 190779, - 190780, - 190991, - 190995, - 190996, - 191129, - 191476, - 191479, - 191507, - 191508, - 191637, - 191654, - 191658, - 191661, - 191677, - 191678, - 191680, - 191898, - 191899, - 191902, - 191940, - 192340, - 192341, - 192582, - 192694, - 192696, - 192699, - 192700, - 192702, - 192703, - 193198, - 193244, - 193522, - 193664, - 193688, - 193967, - 194119, - 194120, - 194797, - 194798, - 194912, - 195448, - 195814, - 195815, - 195836, - 195837, - 195839, - 196336, - 196398, - 196772, - 196835, - 196972, - 196973, - 197075, - 197076, - 197088, - 197118, - 197119, - 197120, - 197121, - 197122, - 197123, - 197124, - 197125, - 197126, - 197128, - 197129, - 197130, - 197131, - 197132, - 197133, - 197134, - 197135, - 197138, - 197139, - 197142, - 197169, - 197344, - 197353, - 197354, - 197356, - 198343, - 199298, - 201535, - 201537, - 201538, - 201540, - 201549, - 201550, - 201552, - 201554, - 201555, - 201556, - 201557, - 201558, - 201559, - 203741, - 203743, - 203744, - 203745, - 203746, - 203747, - 203748, - 203754, - 203755, - 203756, - }, + npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) itemId = 200263, spellId = 389384, chance = 1000, creatureId = 189132, + requiresAura = true, + requiredAuraID = 368380, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, @@ -455,179 +291,13 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Depths"], - npcs = { - 184444, - 184453, - 184461, - 185147, - 185168, - 185353, - 185357, - 185465, - 186109, - 186109, - 186239, - 186512, - 186594, - 186598, - 186599, - 186600, - 186602, - 186604, - 186605, - 186606, - 186607, - 186609, - 186612, - 186620, - 186624, - 186626, - 186627, - 186628, - 186630, - 186632, - 186684, - 186724, - 186727, - 186728, - 186735, - 186783, - 186859, - 187306, - 187366, - 187599, - 187600, - 187602, - 187813, - 187867, - 187868, - 187886, - 187889, - 187919, - 187923, - 187928, - 187932, - 188009, - 188014, - 188044, - 190737, - 190738, - 190776, - 190779, - 190780, - 190991, - 190995, - 190996, - 191129, - 191363, - 191476, - 191479, - 191507, - 191508, - 191654, - 191658, - 191661, - 191677, - 191679, - 191680, - 191898, - 191899, - 191902, - 192334, - 192340, - 192341, - 192582, - 192694, - 192696, - 192699, - 192700, - 192702, - 192703, - 193139, - 193198, - 193244, - 193522, - 193664, - 193688, - 193776, - 194119, - 194120, - 194797, - 194798, - 194912, - 195448, - 195815, - 195836, - 195837, - 195838, - 195839, - 196193, - 196336, - 196398, - 196772, - 196834, - 196835, - 196973, - 197075, - 197076, - 197088, - 197118, - 197119, - 197120, - 197121, - 197122, - 197123, - 197124, - 197125, - 197126, - 197128, - 197129, - 197130, - 197131, - 197132, - 197133, - 197134, - 197135, - 197136, - 197138, - 197139, - 197142, - 197169, - 197344, - 197353, - 197354, - 197356, - 197902, - 198343, - 199298, - 201535, - 201537, - 201538, - 201539, - 201540, - 201549, - 201550, - 201552, - 201553, - 201554, - 201555, - 201556, - 201557, - 201558, - 201559, - 201561, - 203744, - 203745, - 203747, - 203748, - 203750, - 203752, - 203754, - }, + npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) itemId = 200260, spellId = 389378, chance = 1000, creatureId = 189130, + requiresAura = true, + requiredAuraID = 368380, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, @@ -641,177 +311,13 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Inferno"], - npcs = { - 184444, - 184453, - 184461, - 185147, - 185168, - 185350, - 185353, - 185357, - 185465, - 186512, - 186594, - 186599, - 186600, - 186602, - 186604, - 186605, - 186606, - 186607, - 186609, - 186612, - 186620, - 186624, - 186626, - 186627, - 186628, - 186632, - 186638, - 186684, - 186724, - 186727, - 186728, - 186735, - 186783, - 186792, - 186859, - 187306, - 187366, - 187599, - 187600, - 187602, - 187813, - 187867, - 187868, - 187886, - 187889, - 187919, - 187923, - 187928, - 187932, - 188009, - 188014, - 190737, - 190738, - 190776, - 190779, - 190780, - 190991, - 190995, - 190996, - 191129, - 191363, - 191476, - 191479, - 191479, - 191507, - 191508, - 191637, - 191654, - 191658, - 191661, - 191672, - 191677, - 191678, - 191680, - 191898, - 191899, - 191901, - 191902, - 192334, - 192340, - 192341, - 192371, - 192582, - 192694, - 192696, - 192699, - 192700, - 192702, - 192703, - 193198, - 193244, - 193522, - 193664, - 193688, - 193776, - 193967, - 194119, - 194797, - 194798, - 194912, - 195448, - 195815, - 195836, - 195837, - 195839, - 196336, - 196772, - 196835, - 196973, - 197075, - 197076, - 197087, - 197118, - 197119, - 197120, - 197121, - 197122, - 197123, - 197124, - 197125, - 197126, - 197128, - 197129, - 197130, - 197131, - 197132, - 197133, - 197134, - 197135, - 197136, - 197138, - 197139, - 197140, - 197142, - 197169, - 197344, - 197353, - 197354, - 197356, - 197902, - 198343, - 199298, - 201535, - 201537, - 201538, - 201539, - 201540, - 201549, - 201550, - 201552, - 201553, - 201554, - 201555, - 201556, - 201557, - 201558, - 201559, - 201561, - 203743, - 203747, - 203753, - 203754, - 203755, - 203756, - 203757, - }, + npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) itemId = 200255, spellId = 389363, chance = 1000, creatureId = 189112, + requiresAura = true, + requiredAuraID = 368380, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, @@ -825,177 +331,13 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Cave"], - npcs = { - 184444, - 184453, - 184461, - 185147, - 185168, - 185350, - 185353, - 185357, - 185465, - 186109, - 186239, - 186512, - 186594, - 186599, - 186600, - 186602, - 186604, - 186605, - 186606, - 186607, - 186608, - 186609, - 186612, - 186620, - 186624, - 186626, - 186627, - 186628, - 186630, - 186632, - 186684, - 186724, - 186727, - 186728, - 186735, - 186783, - 186792, - 186859, - 187306, - 187366, - 187599, - 187600, - 187602, - 187813, - 187867, - 187868, - 187886, - 187889, - 187919, - 187923, - 187928, - 187932, - 188009, - 188014, - 188044, - 190737, - 190738, - 190776, - 190778, - 190779, - 190780, - 190991, - 190995, - 190996, - 191129, - 191363, - 191479, - 191507, - 191508, - 191637, - 191654, - 191658, - 191661, - 191677, - 191678, - 191680, - 191898, - 191899, - 191902, - 192334, - 192340, - 192341, - 192582, - 192694, - 192696, - 192699, - 192700, - 192702, - 192703, - 193152, - 193198, - 193244, - 193664, - 194119, - 194120, - 194797, - 194798, - 194912, - 195448, - 195814, - 195815, - 195836, - 195837, - 195839, - 196193, - 196336, - 196398, - 196772, - 196834, - 196835, - 197075, - 197076, - 197087, - 197088, - 197091, - 197092, - 197118, - 197119, - 197120, - 197121, - 197122, - 197123, - 197124, - 197125, - 197126, - 197128, - 197129, - 197130, - 197131, - 197132, - 197133, - 197134, - 197135, - 197136, - 197138, - 197139, - 197140, - 197142, - 197169, - 197344, - 197353, - 197356, - 197902, - 198343, - 199298, - 201535, - 201537, - 201538, - 201539, - 201540, - 201550, - 201552, - 201553, - 201554, - 201555, - 201556, - 201557, - 201558, - 201561, - 203739, - 203740, - 203741, - 203742, - 203750, - 203754, - }, + npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) itemId = 200183, spellId = 389143, chance = 1000, creatureId = 192258, + requiresAura = true, + requiredAuraID = 368380, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, From 2b9ffb97808eeb0e1657151011f43c07203ec2c2 Mon Sep 17 00:00:00 2001 From: cyriun Date: Wed, 11 Oct 2023 00:47:09 +1100 Subject: [PATCH 2/5] Adding necessary return statement --- Core.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Core.lua b/Core.lua index 61bec75d..bb88158f 100644 --- a/Core.lua +++ b/Core.lua @@ -694,6 +694,7 @@ function R:IsAttemptAllowed(item) end) if not requiredAuraFound then Rarity:Debug("Required aura NOT found for item: " .. item.name) + return false end end From 7e16b51a5a4f2b2b12690c129f59010432ad95b6 Mon Sep 17 00:00:00 2001 From: cyriun Date: Wed, 11 Oct 2023 00:47:56 +1100 Subject: [PATCH 3/5] re-adding npc ids for each pet these were only removed for ease of testing --- DB/Pets/Dragonflight.lua | 674 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 670 insertions(+), 4 deletions(-) diff --git a/DB/Pets/Dragonflight.lua b/DB/Pets/Dragonflight.lua index 38c1d6a3..b7b4fb2f 100644 --- a/DB/Pets/Dragonflight.lua +++ b/DB/Pets/Dragonflight.lua @@ -271,7 +271,173 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Heights"], - npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) + npcs = { + 184444, + 184453, + 184461, + 185147, + 185168, + 185350, + 185353, + 185357, + 185465, + 186109, + 186239, + 186512, + 186594, + 186598, + 186599, + 186600, + 186602, + 186604, + 186605, + 186606, + 186607, + 186609, + 186612, + 186620, + 186624, + 186626, + 186627, + 186628, + 186630, + 186632, + 186638, + 186684, + 186724, + 186727, + 186728, + 186735, + 186783, + 186859, + 187306, + 187366, + 187599, + 187600, + 187602, + 187813, + 187867, + 187868, + 187886, + 187889, + 187919, + 187923, + 187928, + 187932, + 188009, + 188014, + 188044, + 190737, + 190738, + 190776, + 190778, + 190779, + 190780, + 190991, + 190995, + 190996, + 191129, + 191476, + 191479, + 191507, + 191508, + 191637, + 191654, + 191658, + 191661, + 191677, + 191678, + 191680, + 191898, + 191899, + 191902, + 191940, + 192340, + 192341, + 192582, + 192694, + 192696, + 192699, + 192700, + 192702, + 192703, + 193198, + 193244, + 193522, + 193664, + 193688, + 193967, + 194119, + 194120, + 194797, + 194798, + 194912, + 195448, + 195814, + 195815, + 195836, + 195837, + 195839, + 196336, + 196398, + 196772, + 196835, + 196972, + 196973, + 197075, + 197076, + 197088, + 197118, + 197119, + 197120, + 197121, + 197122, + 197123, + 197124, + 197125, + 197126, + 197128, + 197129, + 197130, + 197131, + 197132, + 197133, + 197134, + 197135, + 197138, + 197139, + 197142, + 197169, + 197344, + 197353, + 197354, + 197356, + 198343, + 199298, + 201535, + 201537, + 201538, + 201540, + 201549, + 201550, + 201552, + 201554, + 201555, + 201556, + 201557, + 201558, + 201559, + 203741, + 203743, + 203744, + 203745, + 203746, + 203747, + 203748, + 203754, + 203755, + 203756, + }, itemId = 200263, spellId = 389384, chance = 1000, @@ -291,7 +457,175 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Depths"], - npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) + npcs = { + 184444, + 184453, + 184461, + 185147, + 185168, + 185353, + 185357, + 185465, + 186109, + 186109, + 186239, + 186512, + 186594, + 186598, + 186599, + 186600, + 186602, + 186604, + 186605, + 186606, + 186607, + 186609, + 186612, + 186620, + 186624, + 186626, + 186627, + 186628, + 186630, + 186632, + 186684, + 186724, + 186727, + 186728, + 186735, + 186783, + 186859, + 187306, + 187366, + 187599, + 187600, + 187602, + 187813, + 187867, + 187868, + 187886, + 187889, + 187919, + 187923, + 187928, + 187932, + 188009, + 188014, + 188044, + 190737, + 190738, + 190776, + 190779, + 190780, + 190991, + 190995, + 190996, + 191129, + 191363, + 191476, + 191479, + 191507, + 191508, + 191654, + 191658, + 191661, + 191677, + 191679, + 191680, + 191898, + 191899, + 191902, + 192334, + 192340, + 192341, + 192582, + 192694, + 192696, + 192699, + 192700, + 192702, + 192703, + 193139, + 193198, + 193244, + 193522, + 193664, + 193688, + 193776, + 194119, + 194120, + 194797, + 194798, + 194912, + 195448, + 195815, + 195836, + 195837, + 195838, + 195839, + 196193, + 196336, + 196398, + 196772, + 196834, + 196835, + 196973, + 197075, + 197076, + 197088, + 197118, + 197119, + 197120, + 197121, + 197122, + 197123, + 197124, + 197125, + 197126, + 197128, + 197129, + 197130, + 197131, + 197132, + 197133, + 197134, + 197135, + 197136, + 197138, + 197139, + 197142, + 197169, + 197344, + 197353, + 197354, + 197356, + 197902, + 198343, + 199298, + 201535, + 201537, + 201538, + 201539, + 201540, + 201549, + 201550, + 201552, + 201553, + 201554, + 201555, + 201556, + 201557, + 201558, + 201559, + 201561, + 203744, + 203745, + 203747, + 203748, + 203750, + 203752, + 203754, + }, itemId = 200260, spellId = 389378, chance = 1000, @@ -311,7 +645,173 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Inferno"], - npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) + npcs = { + 184444, + 184453, + 184461, + 185147, + 185168, + 185350, + 185353, + 185357, + 185465, + 186512, + 186594, + 186599, + 186600, + 186602, + 186604, + 186605, + 186606, + 186607, + 186609, + 186612, + 186620, + 186624, + 186626, + 186627, + 186628, + 186632, + 186638, + 186684, + 186724, + 186727, + 186728, + 186735, + 186783, + 186792, + 186859, + 187306, + 187366, + 187599, + 187600, + 187602, + 187813, + 187867, + 187868, + 187886, + 187889, + 187919, + 187923, + 187928, + 187932, + 188009, + 188014, + 190737, + 190738, + 190776, + 190779, + 190780, + 190991, + 190995, + 190996, + 191129, + 191363, + 191476, + 191479, + 191479, + 191507, + 191508, + 191637, + 191654, + 191658, + 191661, + 191672, + 191677, + 191678, + 191680, + 191898, + 191899, + 191901, + 191902, + 192334, + 192340, + 192341, + 192371, + 192582, + 192694, + 192696, + 192699, + 192700, + 192702, + 192703, + 193198, + 193244, + 193522, + 193664, + 193688, + 193776, + 193967, + 194119, + 194797, + 194798, + 194912, + 195448, + 195815, + 195836, + 195837, + 195839, + 196336, + 196772, + 196835, + 196973, + 197075, + 197076, + 197087, + 197118, + 197119, + 197120, + 197121, + 197122, + 197123, + 197124, + 197125, + 197126, + 197128, + 197129, + 197130, + 197131, + 197132, + 197133, + 197134, + 197135, + 197136, + 197138, + 197139, + 197140, + 197142, + 197169, + 197344, + 197353, + 197354, + 197356, + 197902, + 198343, + 199298, + 201535, + 201537, + 201538, + 201539, + 201540, + 201549, + 201550, + 201552, + 201553, + 201554, + 201555, + 201556, + 201557, + 201558, + 201559, + 201561, + 203743, + 203747, + 203753, + 203754, + 203755, + 203756, + 203757, + }, itemId = 200255, spellId = 389363, chance = 1000, @@ -331,7 +831,173 @@ local dragonflightPets = { type = CONSTANTS.ITEM_TYPES.PET, method = CONSTANTS.DETECTION_METHODS.NPC, name = L["Echo of the Cave"], - npcs = { 188014, 185589 }, --Pitchstone Rumbler, worldbreaker brute (for testing) + npcs = { + 184444, + 184453, + 184461, + 185147, + 185168, + 185350, + 185353, + 185357, + 185465, + 186109, + 186239, + 186512, + 186594, + 186599, + 186600, + 186602, + 186604, + 186605, + 186606, + 186607, + 186608, + 186609, + 186612, + 186620, + 186624, + 186626, + 186627, + 186628, + 186630, + 186632, + 186684, + 186724, + 186727, + 186728, + 186735, + 186783, + 186792, + 186859, + 187306, + 187366, + 187599, + 187600, + 187602, + 187813, + 187867, + 187868, + 187886, + 187889, + 187919, + 187923, + 187928, + 187932, + 188009, + 188014, + 188044, + 190737, + 190738, + 190776, + 190778, + 190779, + 190780, + 190991, + 190995, + 190996, + 191129, + 191363, + 191479, + 191507, + 191508, + 191637, + 191654, + 191658, + 191661, + 191677, + 191678, + 191680, + 191898, + 191899, + 191902, + 192334, + 192340, + 192341, + 192582, + 192694, + 192696, + 192699, + 192700, + 192702, + 192703, + 193152, + 193198, + 193244, + 193664, + 194119, + 194120, + 194797, + 194798, + 194912, + 195448, + 195814, + 195815, + 195836, + 195837, + 195839, + 196193, + 196336, + 196398, + 196772, + 196834, + 196835, + 197075, + 197076, + 197087, + 197088, + 197091, + 197092, + 197118, + 197119, + 197120, + 197121, + 197122, + 197123, + 197124, + 197125, + 197126, + 197128, + 197129, + 197130, + 197131, + 197132, + 197133, + 197134, + 197135, + 197136, + 197138, + 197139, + 197140, + 197142, + 197169, + 197344, + 197353, + 197356, + 197902, + 198343, + 199298, + 201535, + 201537, + 201538, + 201539, + 201540, + 201550, + 201552, + 201553, + 201554, + 201555, + 201556, + 201557, + 201558, + 201561, + 203739, + 203740, + 203741, + 203742, + 203750, + 203754, + }, itemId = 200183, spellId = 389143, chance = 1000, From c6e5040b53b54577a760b216356c2cc55c713ee5 Mon Sep 17 00:00:00 2001 From: cyriun Date: Mon, 30 Oct 2023 16:07:37 +1100 Subject: [PATCH 4/5] wip for primal storm pets roughly 4 elemental npcs spawn with the corresponding elemental storm that dont get the aura but drop the pets. --- Core.lua | 198 +++++++++++++++++++++++++++++++++++++-- DB/Pets/Dragonflight.lua | 109 +++++++++------------ 2 files changed, 238 insertions(+), 69 deletions(-) diff --git a/Core.lua b/Core.lua index bb88158f..a797269e 100644 --- a/Core.lua +++ b/Core.lua @@ -680,18 +680,204 @@ function R:IsAttemptAllowed(item) return false end + local buffedNPCS = { + 184444, + 184453, + 184461, + 185147, + 185168, + 185350, + 185353, + 185357, + 185465, + 186109, + 186239, + 186512, + 186594, + 186598, + 186599, + 186600, + 186602, + 186604, + 186605, + 186606, + 186607, + 186609, + 186612, + 186620, + 186624, + 186626, + 186627, + 186628, + 186630, + 186632, + 186638, + 186684, + 186724, + 186727, + 186728, + 186735, + 186783, + 186859, + 187306, + 187366, + 187599, + 187600, + 187602, + 187813, + 187867, + 187868, + 187886, + 187889, + 187919, + 187923, + 187928, + 187932, + 188009, + 188014, + 188044, + 190737, + 190738, + 190776, + 190778, + 190779, + 190780, + 190991, + 190995, + 190996, + 191129, + 191476, + 191479, + 191507, + 191508, + 191637, + 191654, + 191658, + 191661, + 191677, + 191678, + 191680, + 191898, + 191899, + 191902, + 191940, + 192340, + 192341, + 192582, + 192694, + 192696, + 192699, + 192700, + 192702, + 192703, + 193198, + 193244, + 193522, + 193664, + 193688, + 193967, + 194119, + 194120, + 194797, + 194798, + 194912, + 195448, + 195814, + 195815, + 195836, + 195837, + 195839, + 196336, + 196398, + 196772, + 196835, + 196972, + 196973, + 197075, + 197076, + 197088, + 197118, + 197119, + 197120, + 197121, + 197122, + 197123, + 197124, + 197125, + 197126, + 197128, + 197129, + 197130, + 197131, + 197132, + 197133, + 197134, + 197135, + 197138, + 197139, + 197142, + 197169, + 197344, + 197353, + 197354, + 197356, + 198343, + 199298, + 201535, + 201537, + 201538, + 201540, + 201549, + 201550, + 201552, + 201554, + 201555, + 201556, + 201557, + 201558, + 201559, + 203744, + } local requiredAuraFound = false local auraToCheck = "Elementally Imbued" local auraSpellIdToFind = item.requiredAuraID + if item.requiresAura then local unit = "target" - AuraUtil.ForEachAura(unit, "HELPFUL", nil, function(name, _, _, _, _, _, _, _, _, spellId) - if name == auraToCheck and spellId == auraSpellIdToFind then - requiredAuraFound = true - Rarity:Debug("Required aura found for item: " .. item.name) - return true + local npcid = tonumber((select(6, strsplit("-", UnitGUID("target")))) or 0) -- Extract and convert NPC ID + + local buffedNPCMatch = false + for _, id in pairs(buffedNPCS) do + if id == npcid then + buffedNPCMatch = true + Rarity:Debug("Buffed NPC ID match") + AuraUtil.ForEachAura(unit, "HELPFUL", nil, function(name, _, _, _, _, _, _, _, _, spellId) + if name == auraToCheck and spellId == auraSpellIdToFind then + Rarity:Debug("Required aura found for item: " .. item.name) + requiredAuraFound = true + end + end) + break end - end) + end + + if not buffedNPCMatch then + Rarity:Debug("No NPC ID found for target") + local unbuffedNPCMatch = false + for _, id in pairs(item.npcs) do + if id == npcid then + Rarity:Debug("Unbuffed NPC ID match") + unbuffedNPCMatch = true + requiredAuraFound = true + break + end + end + + if not unbuffedNPCMatch then + Rarity:Debug("NPC ID not found in item.npcs") + end + end + if not requiredAuraFound then Rarity:Debug("Required aura NOT found for item: " .. item.name) return false diff --git a/DB/Pets/Dragonflight.lua b/DB/Pets/Dragonflight.lua index b7b4fb2f..83757f42 100644 --- a/DB/Pets/Dragonflight.lua +++ b/DB/Pets/Dragonflight.lua @@ -427,16 +427,12 @@ local dragonflightPets = { 201557, 201558, 201559, - 203741, - 203743, 203744, + --nonbuffed npcs (air) + 203747, 203745, + 203743, 203746, - 203747, - 203748, - 203754, - 203755, - 203756, }, itemId = 200263, spellId = 389384, @@ -463,11 +459,11 @@ local dragonflightPets = { 184461, 185147, 185168, + 185350, 185353, 185357, 185465, 186109, - 186109, 186239, 186512, 186594, @@ -488,6 +484,7 @@ local dragonflightPets = { 186628, 186630, 186632, + 186638, 186684, 186724, 186727, @@ -515,27 +512,28 @@ local dragonflightPets = { 190737, 190738, 190776, + 190778, 190779, 190780, 190991, 190995, 190996, 191129, - 191363, 191476, 191479, 191507, 191508, + 191637, 191654, 191658, 191661, 191677, - 191679, + 191678, 191680, 191898, 191899, 191902, - 192334, + 191940, 192340, 192341, 192582, @@ -545,30 +543,28 @@ local dragonflightPets = { 192700, 192702, 192703, - 193139, 193198, 193244, 193522, 193664, 193688, - 193776, + 193967, 194119, 194120, 194797, 194798, 194912, 195448, + 195814, 195815, 195836, 195837, - 195838, 195839, - 196193, 196336, 196398, 196772, - 196834, 196835, + 196972, 196973, 197075, 197076, @@ -590,7 +586,6 @@ local dragonflightPets = { 197133, 197134, 197135, - 197136, 197138, 197139, 197142, @@ -599,32 +594,27 @@ local dragonflightPets = { 197353, 197354, 197356, - 197902, 198343, 199298, 201535, 201537, 201538, - 201539, 201540, 201549, 201550, 201552, - 201553, 201554, 201555, 201556, 201557, 201558, 201559, - 201561, 203744, - 203745, + --nonbuffed npcs (water) 203747, - 203748, 203750, + 203748, 203752, - 203754, }, itemId = 200260, spellId = 389378, @@ -655,8 +645,11 @@ local dragonflightPets = { 185353, 185357, 185465, + 186109, + 186239, 186512, 186594, + 186598, 186599, 186600, 186602, @@ -671,6 +664,7 @@ local dragonflightPets = { 186626, 186627, 186628, + 186630, 186632, 186638, 186684, @@ -679,7 +673,6 @@ local dragonflightPets = { 186728, 186735, 186783, - 186792, 186859, 187306, 187366, @@ -697,37 +690,34 @@ local dragonflightPets = { 187932, 188009, 188014, + 188044, 190737, 190738, 190776, + 190778, 190779, 190780, 190991, 190995, 190996, 191129, - 191363, 191476, 191479, - 191479, 191507, 191508, 191637, 191654, 191658, 191661, - 191672, 191677, 191678, 191680, 191898, 191899, - 191901, 191902, - 192334, + 191940, 192340, 192341, - 192371, 192582, 192694, 192696, @@ -740,24 +730,27 @@ local dragonflightPets = { 193522, 193664, 193688, - 193776, 193967, 194119, + 194120, 194797, 194798, 194912, 195448, + 195814, 195815, 195836, 195837, 195839, 196336, + 196398, 196772, 196835, + 196972, 196973, 197075, 197076, - 197087, + 197088, 197118, 197119, 197120, @@ -775,42 +768,36 @@ local dragonflightPets = { 197133, 197134, 197135, - 197136, 197138, 197139, - 197140, 197142, 197169, 197344, 197353, 197354, 197356, - 197902, 198343, 199298, 201535, 201537, 201538, - 201539, 201540, 201549, 201550, 201552, - 201553, 201554, 201555, 201556, 201557, 201558, 201559, - 201561, - 203743, - 203747, + 203744, + --nonbuffed npcs (fire) 203753, - 203754, - 203755, 203756, 203757, + 203754, + 203755, }, itemId = 200255, spellId = 389363, @@ -845,6 +832,7 @@ local dragonflightPets = { 186239, 186512, 186594, + 186598, 186599, 186600, 186602, @@ -852,7 +840,6 @@ local dragonflightPets = { 186605, 186606, 186607, - 186608, 186609, 186612, 186620, @@ -862,13 +849,13 @@ local dragonflightPets = { 186628, 186630, 186632, + 186638, 186684, 186724, 186727, 186728, 186735, 186783, - 186792, 186859, 187306, 187366, @@ -897,7 +884,7 @@ local dragonflightPets = { 190995, 190996, 191129, - 191363, + 191476, 191479, 191507, 191508, @@ -911,7 +898,7 @@ local dragonflightPets = { 191898, 191899, 191902, - 192334, + 191940, 192340, 192341, 192582, @@ -921,10 +908,12 @@ local dragonflightPets = { 192700, 192702, 192703, - 193152, 193198, 193244, + 193522, 193664, + 193688, + 193967, 194119, 194120, 194797, @@ -936,18 +925,15 @@ local dragonflightPets = { 195836, 195837, 195839, - 196193, 196336, 196398, 196772, - 196834, 196835, + 196972, + 196973, 197075, 197076, - 197087, 197088, - 197091, - 197092, 197118, 197119, 197120, @@ -965,38 +951,35 @@ local dragonflightPets = { 197133, 197134, 197135, - 197136, 197138, 197139, - 197140, 197142, 197169, 197344, 197353, + 197354, 197356, - 197902, 198343, 199298, 201535, 201537, 201538, - 201539, 201540, + 201549, 201550, 201552, - 201553, 201554, 201555, 201556, 201557, 201558, - 201561, - 203739, - 203740, + 201559, + 203744, + --nonbuffed npcs (earth) 203741, 203742, - 203750, - 203754, + 203739, + 203740, }, itemId = 200183, spellId = 389143, From 5ef14d0c0867b248f033176a2ad1ca245ea1681b Mon Sep 17 00:00:00 2001 From: cyriun Date: Tue, 31 Oct 2023 23:11:47 +1100 Subject: [PATCH 5/5] rework/refactor aura check this might need another rework to fit in player aura checking to track the "Brul" pet --- Core.lua | 18 +++++------------- DB/Item.lua | 3 +-- DB/Pets/Dragonflight.lua | 12 ++++-------- DB/SharedConstants.lua | 4 ++++ 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/Core.lua b/Core.lua index a797269e..b1ee3628 100644 --- a/Core.lua +++ b/Core.lua @@ -839,20 +839,18 @@ function R:IsAttemptAllowed(item) 203744, } local requiredAuraFound = false - local auraToCheck = "Elementally Imbued" - local auraSpellIdToFind = item.requiredAuraID - if item.requiresAura then + if item.requiredAura then local unit = "target" - local npcid = tonumber((select(6, strsplit("-", UnitGUID("target")))) or 0) -- Extract and convert NPC ID + local npcid = tonumber((select(6, strsplit("-", UnitGUID("target")))) or 0) local buffedNPCMatch = false for _, id in pairs(buffedNPCS) do if id == npcid then buffedNPCMatch = true Rarity:Debug("Buffed NPC ID match") - AuraUtil.ForEachAura(unit, "HELPFUL", nil, function(name, _, _, _, _, _, _, _, _, spellId) - if name == auraToCheck and spellId == auraSpellIdToFind then + AuraUtil.ForEachAura(unit, "HELPFUL", nil, function(_, _, _, _, _, _, _, _, _, spellId) + if item.requiredAura[spellId] then Rarity:Debug("Required aura found for item: " .. item.name) requiredAuraFound = true end @@ -862,20 +860,14 @@ function R:IsAttemptAllowed(item) end if not buffedNPCMatch then - Rarity:Debug("No NPC ID found for target") - local unbuffedNPCMatch = false for _, id in pairs(item.npcs) do if id == npcid then Rarity:Debug("Unbuffed NPC ID match") - unbuffedNPCMatch = true + requiredAuraFound = true break end end - - if not unbuffedNPCMatch then - Rarity:Debug("NPC ID not found in item.npcs") - end end if not requiredAuraFound then diff --git a/DB/Item.lua b/DB/Item.lua index 6ccc8539..22da8a8a 100644 --- a/DB/Item.lua +++ b/DB/Item.lua @@ -35,8 +35,7 @@ local Item = { worldQuestId = false, pickpocket = false, requiresCompletedQuestId = false, - requiresAura = false, - requiredAuraID = false, + requiredAura = false, -- Populated fields (SavedVariables) attempts = false, lastAttempts = false, diff --git a/DB/Pets/Dragonflight.lua b/DB/Pets/Dragonflight.lua index 83757f42..944de627 100644 --- a/DB/Pets/Dragonflight.lua +++ b/DB/Pets/Dragonflight.lua @@ -438,8 +438,7 @@ local dragonflightPets = { spellId = 389384, chance = 1000, creatureId = 189132, - requiresAura = true, - requiredAuraID = 368380, + requiredAura = { [CONSTANTS.AURAS.ELEMENTALLY_IMBUED] = true }, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, @@ -620,8 +619,7 @@ local dragonflightPets = { spellId = 389378, chance = 1000, creatureId = 189130, - requiresAura = true, - requiredAuraID = 368380, + requiredAura = { [CONSTANTS.AURAS.ELEMENTALLY_IMBUED] = true }, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, @@ -803,8 +801,7 @@ local dragonflightPets = { spellId = 389363, chance = 1000, creatureId = 189112, - requiresAura = true, - requiredAuraID = 368380, + requiredAura = { [CONSTANTS.AURAS.ELEMENTALLY_IMBUED] = true }, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, @@ -985,8 +982,7 @@ local dragonflightPets = { spellId = 389143, chance = 1000, creatureId = 192258, - requiresAura = true, - requiredAuraID = 368380, + requiredAura = { [CONSTANTS.AURAS.ELEMENTALLY_IMBUED] = true }, coords = { { m = CONSTANTS.UIMAPIDS.THE_WAKING_SHORES }, { m = CONSTANTS.UIMAPIDS.OHN_AHRAN_PLAINS }, diff --git a/DB/SharedConstants.lua b/DB/SharedConstants.lua index 3410a772..999434db 100644 --- a/DB/SharedConstants.lua +++ b/DB/SharedConstants.lua @@ -321,6 +321,10 @@ C.AURAS = { ROCKS_ON_THE_ROCKS = 407063, } +C.AURAS = { + ELEMENTALLY_IMBUED = 368380, +} + -- 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