diff --git a/.luacheckrc b/.luacheckrc index 2e903fee..1d0a266d 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -17,6 +17,7 @@ stds.ecs = { read_globals = {}, -- these globals can only be accessed. globals = { "----> GlobalAPI", + -- keep-sorted start case=no "AbandonQuest", "AbandonSkill", "AcceptAreaSpiritHeal", @@ -117,8 +118,8 @@ stds.ecs = { "C_ActionBar.IsEnabledAutoCastPetAction", "C_ActionBar.IsOnBarOrSpecialBar", "C_ActionBar.ToggleAutoCastPetAction", - "C_AddOns.GetAddOnInfo", "C_AddOns", + "C_AddOns.GetAddOnInfo", "C_AreaPoiInfo.GetAreaPOIForMap", "C_AreaPoiInfo.GetAreaPOIInfo", "C_AreaPoiInfo.IsAreaPOITimed", @@ -135,6 +136,7 @@ stds.ecs = { "C_CharacterServices.SetAutomaticBoostCharacter", "C_CharacterServicesPublic.ShouldSeeControlPopup", "C_ChatBubbles.GetAllChatBubbles", + "C_ChatInfo", "C_ChatInfo.GetChannelRosterInfo", "C_ChatInfo.GetNumActiveChannels", "C_ChatInfo.GetRegisteredAddonMessagePrefixes", @@ -145,7 +147,6 @@ stds.ecs = { "C_ChatInfo.ReportServerLag", "C_ChatInfo.SendAddonMessage", "C_ChatInfo.SendAddonMessageLogged", - "C_ChatInfo", "C_Club.AcceptInvitation", "C_Club.AddClubStreamChatChannel", "C_Club.AdvanceStreamViewMarker", @@ -389,6 +390,7 @@ stds.ecs = { "C_GuildInfo.RemoveFromGuild", "C_GuildInfo.SetGuildRankOrder", "C_GuildInfo.SetNote", + "C_Item", "C_Item.DoesItemExist", "C_Item.DoesItemExistByID", "C_Item.GetCurrentItemLevel", @@ -411,7 +413,6 @@ stds.ecs = { "C_Item.RequestLoadItemData", "C_Item.RequestLoadItemDataByID", "C_Item.UnlockItem", - "C_Item", "C_KeyBindings.GetCustomBindingType", "C_LootHistory.CanMasterLoot", "C_LootHistory.GetExpiration", @@ -424,6 +425,7 @@ stds.ecs = { "C_LossOfControl.GetNumEvents", "C_Mail.HasInboxMoney", "C_Mail.IsCommandPending", + "C_Map", "C_Map.GetAreaInfo", "C_Map.GetBestMapForUnit", "C_Map.GetBountySetIDForMap", @@ -449,10 +451,9 @@ stds.ecs = { "C_Map.GetWorldPosFromMapPos", "C_Map.MapHasArt", "C_Map.RequestPreloadMap", - "C_Map", + "C_MapExplorationInfo", "C_MapExplorationInfo.GetExploredAreaIDsAtPosition", "C_MapExplorationInfo.GetExploredMapTextures", - "C_MapExplorationInfo", "C_MerchantFrame.GetBuybackItemID", "C_ModelInfo.AddActiveModelScene", "C_ModelInfo.AddActiveModelSceneActor", @@ -462,6 +463,7 @@ stds.ecs = { "C_ModelInfo.GetModelSceneActorInfoByID", "C_ModelInfo.GetModelSceneCameraInfoByID", "C_ModelInfo.GetModelSceneInfoByID", + "C_NamePlate", "C_NamePlate.GetNamePlateEnemyClickThrough", "C_NamePlate.GetNamePlateEnemyPreferredClickInsets", "C_NamePlate.GetNamePlateEnemySize", @@ -485,16 +487,15 @@ stds.ecs = { "C_NamePlate.SetNamePlateSelfPreferredClickInsets", "C_NamePlate.SetNamePlateSelfSize", "C_NamePlate.SetTargetClampingInsets", - "C_NamePlate", "C_NewItems.ClearAll", "C_NewItems.IsNewItem", "C_NewItems.RemoveNewItem", + "C_PaperDollInfo", "C_PaperDollInfo.GetArmorEffectiveness", "C_PaperDollInfo.GetArmorEffectivenessAgainstTarget", "C_PaperDollInfo.GetMinItemLevel", "C_PaperDollInfo.OffhandHasShield", "C_PaperDollInfo.OffhandHasWeapon", - "C_PaperDollInfo", "C_PartyInfo.GetActiveCategories", "C_PartyInfo.GetInviteConfirmationInvalidQueues", "C_PlayerInfo.GetClass", @@ -507,13 +508,13 @@ stds.ecs = { "C_ProductChoice.GetProducts", "C_ProductChoice.MakeSelection", "C_PvP.IsPVPMap", + "C_QuestLog", "C_QuestLog.GetMaxNumQuests", "C_QuestLog.GetMaxNumQuestsCanAccept", "C_QuestLog.GetQuestInfo", "C_QuestLog.GetQuestObjectives", "C_QuestLog.IsOnQuest", "C_QuestLog.ShouldShowQuestRewards", - "C_QuestLog", "C_RecruitAFriend.CheckEmailEnabled", "C_RecruitAFriend.GetRecruitInfo", "C_RecruitAFriend.IsSendingEnabled", @@ -544,15 +545,15 @@ stds.ecs = { "C_Spell.DoesSpellExist", "C_Spell.IsSpellDataCached", "C_Spell.RequestLoadSpellData", - "C_SpellBook.IsSpellKnown", "C_SpellBook", + "C_SpellBook.IsSpellKnown", "C_StorePublic.DoesGroupHavePurchaseableProducts", "C_StorePublic.IsDisabledByParentalControls", "C_StorePublic.IsEnabled", "C_TaxiMap.GetAllTaxiNodes", "C_TaxiMap.GetTaxiNodesForMap", - "C_Timer.After", "C_Timer", + "C_Timer.After", "C_UI.Reload", "C_UIWidgetManager.GetAllWidgetsBySetID", "C_UIWidgetManager.GetBelowMinimapWidgetSetID", @@ -804,22 +805,6 @@ stds.ecs = { "ConvertToParty", "ConvertToRaid", "CopyToClipboard", - "CR_ARMOR_PENETRATION", - "CR_BLOCK", - "CR_CRIT_MELEE", - "CR_CRIT_RANGED", - "CR_CRIT_SPELL", - "CR_DEFENSE_SKILL", - "CR_DODGE", - "CR_EXPERTISE", - "CR_HASTE_MELEE", - "CR_HASTE_RANGED", - "CR_HASTE_SPELL", - "CR_HIT_MELEE", - "CR_HIT_RANGED", - "CR_HIT_SPELL", - "CR_PARRY", - "CR_WEAPON_SKILL", "CreateFont", "CreateFrame", "CreateMacro", @@ -2268,14 +2253,16 @@ stds.ecs = { "UseHearthstone", "UseInventoryItem", "UseItemByName", + -- keep-sorted end "----------------------------------------------------->LUA API", - "bit", + -- keep-sorted start case=no "abs", "acos", "asin", "assert", "atan", "atan2", + "bit", "bit.arshift", "bit.band", "bit.bnot", @@ -2415,7 +2402,9 @@ stds.ecs = { "unpack", "wipe", "xpcall", + -- keep-sorted end "------------------------------------------------------> FRAMES", + -- keep-sorted start case=no "ActionBarActionEventsFrame", "ActionBarButtonEventsFrame", "ActionBarController", @@ -2474,7 +2463,6 @@ stds.ecs = { "ChatConfigFrame", "ChatEdit_GetActiveWindow", "ChatEdit_InsertLink", - "ChatFrame_AddMessageEventFilter", "ChatFrame1", "ChatFrame10", "ChatFrame10EditBox", @@ -2503,6 +2491,7 @@ stds.ecs = { "ChatFrame9", "ChatFrame9EditBox", "ChatFrame9Tab", + "ChatFrame_AddMessageEventFilter", "ChatFrameChannelButton", "ChatFrameMenuButton", "ChatMenu", @@ -2537,6 +2526,22 @@ stds.ecs = { "ContainerFrame7", "ContainerFrame8", "ContainerFrame9", + "CR_ARMOR_PENETRATION", + "CR_BLOCK", + "CR_CRIT_MELEE", + "CR_CRIT_RANGED", + "CR_CRIT_SPELL", + "CR_DEFENSE_SKILL", + "CR_DODGE", + "CR_EXPERTISE", + "CR_HASTE_MELEE", + "CR_HASTE_RANGED", + "CR_HASTE_SPELL", + "CR_HIT_MELEE", + "CR_HIT_RANGED", + "CR_HIT_SPELL", + "CR_PARRY", + "CR_WEAPON_SKILL", "CraftFrame", "CreateChannelPopup", "DEFAULT_CHAT_FRAME", @@ -2547,6 +2552,8 @@ stds.ecs = { "DurabilityFrame", "EmbeddedItemTooltip", "EngravingFrame", + "EQUIPPED_FIRST", + "EQUIPPED_LAST", "EventTraceFrame", "FauxScrollFrame_GetOffset", "FlightMapFrame", @@ -2696,11 +2703,11 @@ stds.ecs = { "SpellBookFrame", "StackSplitFrame", "STANDARD_TEXT_FONT", - "StaticPopup_Show", "StaticPopup1", "StaticPopup2", "StaticPopup3", "StaticPopup4", + "StaticPopup_Show", "StaticPopupDialogs", "StatsFrame", "StopwatchFrame", @@ -2752,7 +2759,9 @@ stds.ecs = { "WorldMapTooltip", "WorldStateScoreFrame", "ZoneTextFrame", + -- keep-sorted end "-----------------------------------------------------> Blizzard Data", + -- keep-sorted start case=no "CALENDAR_FULLDATE_MONTH_NAMES", "CALENDAR_WEEKDAY_NAMES", "QUEST_ITEMS_NEEDED", @@ -2765,19 +2774,27 @@ stds.ecs = { "WOW_PROJECT_ID", "WOW_PROJECT_MAINLINE", "WOW_PROJECT_WRATH_CLASSIC", + -- keep-sorted end "-----------------------------------------------------> Enums", + -- keep-sorted start case=no "LE_EXPANSION_BURNING_CRUSADE", + -- keep-sorted end "-----------------------------------------------------> GlobalStrings", + -- keep-sorted start case=no "CLOSE", "DEFENSE", + -- keep-sorted end "-----------------------------------------------------> External Addons", + -- keep-sorted start case=no "LeaPlusDB", "LibStub", "OutfitterButton", "OutfitterButtonFrame", "OutfitterFrame", "PawnInitialize", + -- keep-sorted end "-----------------------------------------------------> Project Specific", + -- keep-sorted start case=no "assert.are_same", "assert.is_nil", "assert.spy", @@ -2791,6 +2808,7 @@ stds.ecs = { "SLASH_ECS1", "SlashCmdList", "spy", + -- keep-sorted end } } std = "max+ecs" diff --git a/Modules/Config/GeneralSection.lua b/Modules/Config/GeneralSection.lua index 8adafb23..bf777b8c 100644 --- a/Modules/Config/GeneralSection.lua +++ b/Modules/Config/GeneralSection.lua @@ -40,6 +40,32 @@ function _Config:LoadGeneralSection() Stats.RebuildStatInfos() end, }, + stealth = { + type = "toggle", + order = 2, + name = function() return i18n("Show stealth") end, + desc = function() return i18n("Shows/Hides the stealth value.") end, + width = 1.5, + disabled = function() return (not ExtendedCharacterStats.profile.general.display); end, + get = function () return ExtendedCharacterStats.profile.general.stealth.display; end, + set = function (_, value) + ExtendedCharacterStats.profile.general.stealth.display = value + Stats.RebuildStatInfos() + end, + }, + invisibility = { + type = "toggle", + order = 3, + name = function() return i18n("Show invisibility") end, + desc = function() return i18n("Shows/Hides the invisibility value.") end, + width = 1.5, + disabled = function() return (not ExtendedCharacterStats.profile.general.display); end, + get = function () return ExtendedCharacterStats.profile.general.invisibility.display; end, + set = function (_, value) + ExtendedCharacterStats.profile.general.invisibility.display = value + Stats.RebuildStatInfos() + end, + }, }, } end \ No newline at end of file diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 7f424a18..398be65e 100755 --- a/Modules/Data/Constants.lua +++ b/Modules/Data/Constants.lua @@ -1,3 +1,9 @@ +-- keep-sorted start case=no +local IsClassic = ECS.IsClassic +local IsTBC = ECS.IsTBC +local IsWotlk = ECS.IsWotlk +-- keep-sorted end + ---@class Data local Data = ECSLoader:ImportModule("Data") @@ -20,7 +26,9 @@ Data.MAGE = 8 Data.WARLOCK = 9 Data.DRUID = 11 +--- auras with attributes "Passive spell" or "Aura is hidden" should not be listed here Data.Aura = { + -- keep-sorted start case=no block=yes AllowCastingManaRegeneration = { [6117] = (ECS.IsWotlk and 0.5 or 0.3), -- Mage Armor rank 1 [12051] = 1, -- Evocation @@ -79,6 +87,175 @@ Data.Aura = { [17800] = (ECS.IsWotlk and -5 or nil), -- Shadow Mastery 5/5 [22959] = (ECS.IsWotlk and -5 or nil), -- Improved Scorch }, + --- index 0 is for "Apply Aura: Invisibility" + --- index n is for "Apply Aura: Invisibility (n)" + Invisibility = { + -- keep-sorted start case=no block=yes numeric=yes + [0] = { + -- keep-sorted start numeric=yes + [66] = IsClassic and 100 or nil, -- Lesser Invisibility + [885] = 200, -- Invisibility + [3680] = 100, -- Lesser Invisibility + [4079] = 200, -- Cloaking + [4952] = 200, -- Helcular's War + [5543] = 500, -- Fade Out + [6298] = 200, -- Form of the Moonstalker + [7870] = IsWotlk and 200 or 100, -- Lesser Invisibility + [8611] = 5000, -- Phase Shift + [9095] = -1000, -- Cantation of Manifestation + [9587] = 200, -- Magic Potion + [9738] = -1000, -- Rift Spawn Becomes Visible + [10228] = 300, -- Greater Invisibility + [11392] = 200, -- Invisibility + [12332] = 10000, -- Lathoric the Black + [12845] = 100, -- Lesser Invisibility + [16380] = 300, -- Greater Invisibility + [17651] = 5000, -- Image Projection + [20672] = 500, -- Fade + [23452] = 300, -- Invisibility + [24235] = 10000, -- Super Invis + [25905] = 10000, -- Invis Self + [26222] = 10000, -- Super Invis + [28500] = 200, -- Invisibility + [29309] = 5000, -- Phase Shift + [29627] = 200, -- Nether Step + [29921] = 150, -- Phasing Invisibility + [30447] = 50, -- Shadow of the Forest + [30448] = 100, -- Shadow of the Forest + [32612] = 340, -- Invisibility + [32811] = 300, -- Greater Invisibility + [32943] = 300, -- Phasing Invisibility + [41253] = 300, -- Greater Invisibility + [44312] = 9999, -- Head of the Horseman Invisible + [46021] = 350, -- Spectral Realm + [49399] = 100, -- Skeleton Invis + [50700] = 350, -- Copy of Spectral Realm (Test) + [54436] = 600, -- Demonic Empowerment + [55848] = 1000, -- Invisibility + [69107] = 300, -- Killing Spree Invis Aura + [72343] = 400, -- Hallucination + [440505] = 200, -- Invisibility + [441785] = 101, -- Drained of Blood + [1221579] = 201, -- Super Invis + [1227700] = 201, -- Invisibility + [1231389] = 10000, -- Vanish + -- keep-sorted end + }, + [1] = { + -- keep-sorted start numeric=yes + [8203] = 1000, -- Elemental Spirit Invisibility + -- keep-sorted end + }, + [2] = { + -- keep-sorted start numeric=yes + [17680] = 1, -- Spirit Spawn-out + [24221] = 1, -- Quest - Teleport Spawn-out + [24699] = 10000, -- Vanish + [36748] = 1, -- Smoke Spawn-out + [448779] = 5001, -- Wake Up Dead + [459280] = 101, -- Transiting Realities + [1234595] = 10000, -- Vanish + -- keep-sorted end + }, + [4] = { + -- keep-sorted start numeric=yes + [12495] = 1000, -- Eranikus the Chained Invisibility + [29448] = 9999, -- Vanish + [32727] = 100, -- Arena Preparation + [32754] = 100, -- Invisibility + [34341] = 9999, -- Ember Blast + [38544] = 300, -- Coax Marmot + [39667] = 9999, -- Vanish + [41476] = 9999, -- Vanish + [44036] = 340, -- Fade + [44199] = 9999, -- Ember Blast + [49337] = 1000, -- Racer Slam death scene: car flip Parent + [50008] = 1, -- BOTM - Jungle Brew - Jungle Invisibility Aura + [50015] = 9999, -- You're a ...! (NPC) Death Scene + [55964] = 9999, -- Vanish + [74069] = 100, -- Spawn Invisibility Aura + -- keep-sorted end + }, + [5] = { + -- keep-sorted start numeric=yes + [56783] = 50, -- Quest Invis Tier 4 + -- keep-sorted end + }, + [7] = { + -- keep-sorted start numeric=yes + [23303] = 100, -- Vaelen the Flayed [The Shadow Vault] - Invisibility + [27622] = 100, -- Get the Key: Vaelen's Invisibility & See Invisibility + [37754] = 5000, -- Through The Eyes of Gorefiend + [38012] = 5000, -- Garm Wolfbrother: Invisibility + [43890] = 1000, -- Flying Machine Invisibility + [45636] = 100, -- Mist of the Kvaldir + [50734] = 1000, -- Frenzyheart Chicken: Invisibility + [52060] = 300, -- Invisibility + [54500] = 1000, -- Quest Invisibility 1 + [56304] = 350, -- Hodir's Helm Bunny: Invisibility + [56768] = 50, -- Quest Invis Tier 1 + [56779] = 50, -- Quest Invis Tier 1 + [57744] = 1000, -- Quest Invisibility 1 + [59649] = 99, -- Icecrown Bomber - Cloak Dome Bunny + [60190] = 1000, -- Invisibility + [60464] = 9, -- Cloaked Alliance Peeps + [70693] = 1000, -- Uther Despawn + [74980] = 1000, -- Spy Frog Invisibility + [75779] = 1000, -- [DND] Marker + [1221135] = 101, -- Torment's Illusion + -- keep-sorted end + }, + [8] = { + -- keep-sorted start numeric=yes + [34840] = 1000, -- Triangulation Point One Invisibility + [34858] = 2000, -- Triangulation Point Two Invisibility + [40194] = 1000, -- Bombing Run: Invisibility + [51113] = 500, -- Monte Muzzleshot's Invisibility (Mangal) + [51114] = 250, -- Monte Muzzleshot's Invisibility (Camp) + [54503] = 1000, -- Quest Invisibility 2 + [56058] = 100, -- Get the Key: Instructor Hroegar's Invisibility + [59660] = 999, -- Inside Cloak Dome Individual + [60191] = 1000, -- Invisibility + [60481] = 9, -- Cloaked Horde Peeps + [73973] = 1000, -- Poster Location Marker + [75433] = 100, -- Spawn Invisibility Aura (QZS 2) + -- keep-sorted end + }, + [9] = { + -- keep-sorted start numeric=yes + [39596] = 1000, -- Ethereum Relay + [39680] = 5000, -- Sai'kkal Invisibility + [42175] = 5000, -- Evidence Marker Invis + [52213] = 1000, -- Rainspeaker Treasures: Invisibility + [61208] = 300, -- Fjorn's Anvil - Quest Invisibility 3 + [74144] = 1000, -- Poster Location Marker + [74466] = 1000, -- Raging Fire Elemental Invisibility + [75165] = 1000, -- Spirit of the Tiger Aura + [75166] = 1000, -- Spirit of the Tiger Aura (Rider) + [75179] = 1000, -- Matriarch's Shroud + -- keep-sorted end + }, + [10] = { + -- keep-sorted start numeric=yes + [44856] = 100, -- Bash'ir Phasing Device + [45614] = 300, -- Shroud of the Scourge + [48809] = 48812, -- Binding Life + [49097] = 100, -- Out of Body Experience + [52215] = 1000, -- Kartak and Sparktouched: Invisibility + [75513] = 1000, -- Spawn Invisibility Aura (QZM) + [364459] = 1000, -- Shroud of Death + [426062] = 101, -- Quest Invisibility + [462593] = 101, -- Quest Invisibility + [468882] = 101, -- Quest Invisibility + -- keep-sorted end + }, + [28] = { + -- keep-sorted start numeric=yes + [425147] = 101, -- Quest Invisibility + -- keep-sorted end + }, + -- keep-sorted end + }, IsFeralForm = { [768] = true, -- Cat Form [5487] = true, -- Bear Form @@ -112,6 +289,17 @@ Data.Aura = { [49280] = true, -- Lightning Shield rank 10 [49281] = true, -- Lightning Shield rank 11 }, + IsProwlOrStealth = { + -- keep-sorted start numeric=yes + [1784] = true, -- Stealth + [1785] = true, -- Stealth + [1786] = true, -- Stealth + [1787] = true, -- Stealth + [5215] = true, -- Prowl + [6783] = true, -- Prowl + [9913] = true, -- Prowl + -- keep-sorted end + }, MP5 = { [430] = 42, -- drink [431] = 104, -- drink @@ -422,8 +610,85 @@ Data.Aura = { [1227200] = 20, -- Wickedness [1236220] = -50, -- Slow }, + Stealth = { + -- keep-sorted start numeric=yes + [1784] = 5, -- Stealth + [1785] = 100, -- Stealth + [1786] = 200, -- Stealth + [1787] = 300, -- Stealth + [2425] = -100, -- Spotted + [3648] = 5, -- Phase Out + [5215] = 100, -- Prowl + [5916] = 1, -- Shadowstalker Stealth + [6408] = 1, -- Faded + [6538] = 140, -- Dig Trap + [6634] = (IsClassic and 6 or 300), -- Phasing Stealth + [6783] = 200, -- Prowl + [6920] = 100, -- Hide + [8152] = 5, -- Prowl + [8218] = 5, -- Sneak + [8822] = 9999, -- Stealth + [9736] = 180, -- Arantir's Deception + [9740] = 180, -- Arantir's Deception + [9913] = 300, -- Prowl + [10032] = 9999, -- Uber Stealth + [11327] = 170, -- Vanish + [11329] = 270, -- Vanish + [16122] = 99999, -- Phasing + [20540] = 5, -- Ashenvale Outrunner Sneak + [20580] = 50, -- Shadowmeld + [22766] = 1, -- Sneak + [24450] = 150, -- Prowl + [24452] = 200, -- Prowl + [24453] = 250, -- Prowl + [24690] = 1000, -- Aspect of Arlokk + [26381] = 10000, -- Burrow + [26888] = 370, -- Vanish + [29448] = 9999, -- Vanish + [30831] = 1, -- Stealth + [30991] = 1, -- Stealth + [31526] = 9999, -- Stealth + [31621] = 9999, -- Stealth + [32199] = 65, -- Stealth + [32615] = 1, -- Stealth + [34189] = -50, -- Stealth + [35205] = 9999, -- Vanish + [39581] = 10000, -- Storm Blink + [42347] = 1, -- Stealth + [42866] = 9999, -- Stealth + [42932] = 1, -- Prowl + [42943] = 9999, -- Stealth + [47521] = 9999, -- Mole Machine Player Hide and Root + [51755] = 600, -- Camouflage + [52006] = 5000, -- Shroud + [53061] = 1000, -- Cover + [58548] = 4200, -- Ethereal + [59045] = 300, -- Camoflogue + [61704] = 1, -- Sneaky Walk + [66296] = 350, -- Shadow Veil + [66305] = 300, -- Shadow Veil + [67340] = 100, -- Hide + [448471] = 101, -- Lledra's Vehicle Test [DNT] + [460631] = 251, -- (DNT) Pyranis Add Fog Stealth + [467049] = 301, -- Blessing of Bethekk + [469182] = 11, -- Lying Low + [473544] = 5, -- Sneaking + [1220930] = 10000, -- Phantom's Veil + [1221341] = 6, -- Poorly Camouflaged + [1231389] = 10000, -- Vanish + -- keep-sorted end + }, + StealthEffectiveness = { + -- keep-sorted start numeric=yes + [28492] = 30, -- Sneaking + [38552] = 8, -- Improved Stealth + [1220708] = 8, -- Displaced + -- keep-sorted end + }, +-- keep-sorted end } Data.Enchant = { + -- keep-sorted start case=no block=yes BlockValue = { [2583] = 15, -- Presence of Might [2653] = 18, -- Enchant Shield - Tough Shield @@ -458,6 +723,13 @@ Data.Enchant = { [3836] = 8, -- Master's Inscription of the Crag [7099] = 12, -- Blackfathom Mana Oil. This effect only applies within Blackfathom Deeps. }, + StealthEffectiveness = { + -- keep-sorted start numeric=yes + [910] = 5, -- Enchant Cloak - Stealth + [3256] = 5, -- Enchant Cloak - Shadow Armor + -- keep-sorted end + }, +-- keep-sorted end } Data.Gem = { MP5 = { @@ -521,6 +793,7 @@ Data.Gem = { }, } Data.Item = { + -- keep-sorted start case=no block=yes IsTimeworn = { [233496] = true, [233505] = true, @@ -778,6 +1051,27 @@ Data.Item = { [242315] = 3, [242317] = 3, }, + StealthEffectiveness = { + -- keep-sorted start numeric=yes + [8197] = 5, -- Nightscape Boots + [20255] = 5, -- Whisperwalk Boots + [21758] = 3, -- Figurine - Black Pearl Panther + [22003] = 8, -- Darkmantle Boots + [23073] = 8, -- Boots of Displacement + [24128] = (IsTBC and 5 or nil), -- Figurine - Nightseye Panther + [27467] = 5, -- Silent-Strider Kneeboots + [31228] = 5, -- The Master's Treads + [35702] = (IsTBC and 5 or nil), -- Figurine - Shadowsong Panther + [213341] = 5, -- Insulated Workboots + [219343] = 3, -- Filcher's Cowl + [220860] = 5, -- Sergeant Major's Leather Boots + [220861] = 5, -- First Sergeant's Leather Boots + [221409] = 5, -- Emerald Leather Sabatons + [226831] = 8, -- Darkmantle Footpads + [226851] = 8, -- Darkmantle Boots + [236314] = 8, -- Boots of Displacement + -- keep-sorted end + }, TimewornSpellHaste = { [234016] = 2, [234020] = 2, @@ -785,6 +1079,7 @@ Data.Item = { [234028] = 2, [234032] = 2, }, + -- keep-sorted end } Data.setNames = { AUGURS_REGALIA = "Augur's Regalia", @@ -802,3 +1097,18 @@ Data.setNames = { VESTMENTS_OF_TRANSCENDENCE = "Vestments of Transcendence", WINDHAWK_ARMOR = "Windhawk Armor", } +Data.Talent = { + -- keep-sorted start block=yes + [Data.DRUID] = { + -- keep-sorted start + FERAL_INSTINCT = (IsClassic and {16947,16948,16949,16950,16951} or {16947,16948,16949}) + -- keep-sorted end + }, + [Data.ROGUE] ={ + -- keep-sorted start + MASTER_OF_DECEPTION = (IsWotlk and {13958,13970,13971} or {13958,13970,13971,13972,13973}) + -- keep-sorted end + }, + -- keep-sorted end +} + diff --git a/Modules/Data/Data.lua b/Modules/Data/Data.lua index 4d1f3fe1..f1bcf73c 100755 --- a/Modules/Data/Data.lua +++ b/Modules/Data/Data.lua @@ -19,6 +19,8 @@ end dataFunctionRefs = { ["MovementSpeed"] = function() return Data:GetMovementSpeed() end, + ["Stealth"] = function() return Data:GetStealthValue() end, + ["Invisibility"] = function() return Data:GetInvisibility() end, -- Melee ["MeleeAttackPower"] = function() return Data:GetMeleeAttackPower() end, ["MeleeCritChance"] = function() return Data:MeleeCrit() end, diff --git a/Modules/Data/General.lua b/Modules/Data/General.lua index d8c8f7e2..8d03853b 100644 --- a/Modules/Data/General.lua +++ b/Modules/Data/General.lua @@ -1,8 +1,28 @@ +-- keep-sorted start case=no +local EQUIPPED_FIRST = EQUIPPED_FIRST +local EQUIPPED_LAST = EQUIPPED_LAST +local GetBuffDataByIndex = C_UnitAuras.GetBuffDataByIndex +local GetDebuffDataByIndex = C_UnitAuras.GetDebuffDataByIndex +local GetInventoryItemID = GetInventoryItemID +local IsClassic = ECS.IsClassic +local IsWotlk = ECS.IsWotlk +local max = math.max +local pairs = pairs +local playerLevel = UnitLevel("player") +local UnitClass = UnitClass +-- keep-sorted end + ---@class Data local Data = ECSLoader:ImportModule("Data") ---@type DataUtils local DataUtils = ECSLoader:ImportModule("DataUtils") +-- keep-sorted start case=no +local _, _, classId = UnitClass("player") +local _General = {} +local DRUID = Data.DRUID +local ROGUE = Data.ROGUE +-- keep-sorted end ---@return string function Data:GetMovementSpeed() @@ -20,4 +40,142 @@ function Data:GetMovementSpeed() currentSpeed = currentSpeed / 7 * 100 return DataUtils:Round(currentSpeed, 0) .. "%" +end + +---@return number +function Data:GetInvisibility() + local inv = 0 + + -- buffs + local i = 1 + repeat + local aura = GetBuffDataByIndex("player", i) + if aura and aura.spellId then + for _, Id in pairs(Data.Aura.Invisibility) do + inv = max(inv, (Id[aura.spellId] or 0)) + end + end + i = i + 1 + until (not aura) + + -- debuffs + i = 1 + repeat + local aura = GetDebuffDataByIndex("player", i) + if aura and aura.spellId then + for _, Id in pairs(Data.Aura.Invisibility) do + inv = max(inv, (Id[aura.spellId] or 0)) + end + end + i = i + 1 + until (not aura) + + return DataUtils:Round(inv, 2) +end + +---@return number +function Data:GetStealthValue() + return _General:GetStealth() + _General:GetModStealthEffectiveness() +end + +---@return number +function _General:GetStealth() + local stealth = 0 + local prowlOrStealth = false + + for i = EQUIPPED_FIRST,EQUIPPED_LAST do + local id, _ = GetInventoryItemID("player", i) + stealth = stealth + (Data.Item.StealthEffectiveness[id] or 0) + local itemLink = GetInventoryItemLink("player", i) + if itemLink then + local enchant = DataUtils:GetEnchantFromItemLink(itemLink) + if enchant then + stealth = stealth + (Data.Enchant.StealthEffectiveness[enchant] or 0) + end + end + end + + -- buffs + local i = 1 + repeat + local aura = GetBuffDataByIndex("player", i) + if aura and aura.spellId then + if classId == ROGUE or classId == DRUID then + -- check if character is prowling or stealthing + prowlOrStealth = prowlOrStealth or Data.Aura.IsProwlOrStealth[aura.spellId] + end + stealth = max(stealth, (Data.Aura.Stealth[aura.spellId] or 0)) + if aura.spellId == 58984 then -- Shadowmeld + stealth = max(stealth, playerLevel * 5) + end + end + i = i + 1 + until (not aura) + + -- debuffs + i = 1 + repeat + local aura = GetDebuffDataByIndex("player", i) + if aura and aura.spellId then + stealth = max(stealth, (Data.Aura.Stealth[aura.spellId] or 0)) + end + i = i + 1 + until (not aura) + + -- wotlk stealth/prowl stealth level is dependent on level + if prowlOrStealth and IsWotlk then + stealth = max(stealth, playerLevel * 5) + end + + return stealth +end + +---@return number +function _General:GetModStealthEffectiveness() + local stealth = 0 + local prowlOrStealth = false + local hasShadowmeldBonus = false + + -- buffs + local i = 1 + repeat + local aura = GetBuffDataByIndex("player", i) + if aura and aura.spellId then + if classId == Data.ROGUE or classId == Data.DRUID then + -- check if character is prowling or stealthing + prowlOrStealth = prowlOrStealth or Data.Aura.IsProwlOrStealth[aura.spellId] + end + stealth = stealth + (Data.Aura.StealthEffectiveness[aura.spellId] or 0) + if aura.spellId == 58984 then -- Shadowmeld + hasShadowmeldBonus = true + end + end + i = i + 1 + until (not aura) + + -- debuffs + i = 1 + repeat + local aura = GetDebuffDataByIndex("player", i) + if aura and aura.spellId then + stealth = stealth + (Data.Aura.StealthEffectiveness[aura.spellId] or 0) + end + i = i + 1 + until (not aura) + + if (prowlOrStealth or hasShadowmeldBonus) and IsPlayerSpell(21009) then + stealth = stealth + 5 -- Shadowmeld passive / elusiveness + end + + -- talents + if prowlOrStealth then + if classId == DRUID then + local coeff = (IsClassic and 3 or 5) + stealth = stealth + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[DRUID].FERAL_INSTINCT) -- Feral Instinct + elseif classId == ROGUE then + local coeff = (IsWotlk and 5 or 3) + stealth = stealth + coeff * DataUtils:GetActiveTalentSpell(Data.Talent[ROGUE].MASTER_OF_DECEPTION) -- Master of Deception + end + end + return stealth end \ No newline at end of file diff --git a/Modules/Migration.lua b/Modules/Migration.lua index 0f1bf19b..29a22ff9 100644 --- a/Modules/Migration.lua +++ b/Modules/Migration.lua @@ -15,6 +15,8 @@ function Migration:ToLatestProfileVersion(profileVersion) return end + local defaultProfile = Profile:GetDefaultProfile() + if profileVersion < 24 then ExtendedCharacterStats.profile.defense.resilienceRating = ExtendedCharacterStats.profile.defense.resilience ExtendedCharacterStats.profile.defense.resilience = nil @@ -22,4 +24,8 @@ function Migration:ToLatestProfileVersion(profileVersion) if profileVersion < 25 then ExtendedCharacterStats.profile.defense.resilience = nil end -end + if profileVersion < 26 then + ExtendedCharacterStats.profile.general.invisibility = defaultProfile.profile.general.invisibility + ExtendedCharacterStats.profile.general.stealth = defaultProfile.profile.general.stealth + end +end \ No newline at end of file diff --git a/Modules/Profile.lua b/Modules/Profile.lua index 2a2152fe..ad0da30c 100755 --- a/Modules/Profile.lua +++ b/Modules/Profile.lua @@ -20,6 +20,16 @@ local function GetDefaultStatsProfile() text = "General", movementSpeed = {display = true, refName = "MovementSpeed", text = "Movement Speed"}, + stealth = { + display = true, + refName = "Stealth", + text = "Stealth", + }, + invisibility = { + display = true, + refName = "Invisibility", + text = "Invisibility", + }, }, melee = { diff --git a/Modules/Stats.lua b/Modules/Stats.lua index acac2a0b..20a65531 100755 --- a/Modules/Stats.lua +++ b/Modules/Stats.lua @@ -210,7 +210,12 @@ _CreateStatInfos = function() local profile = ExtendedCharacterStats.profile local category = profile.general - _CreateStatInfo(category, category.movementSpeed) + _CreateStatInfo( + category, + category.movementSpeed, + category.stealth, + category.invisibility + ) category = profile.melee _CreateStatInfo( diff --git a/Modules/i18n/translations/ConfigTranslations/GeneralConfigTranslations.lua b/Modules/i18n/translations/ConfigTranslations/GeneralConfigTranslations.lua index 88bb1158..108e5114 100644 --- a/Modules/i18n/translations/ConfigTranslations/GeneralConfigTranslations.lua +++ b/Modules/i18n/translations/ConfigTranslations/GeneralConfigTranslations.lua @@ -42,6 +42,26 @@ local generalConfigTranslations = { ["esMX"] = "Muestra/oculta el valor de velocidad de movimiento", ["ptBR"] = "Mostra/oculta o valor da velocidade de movimento" }, + ["Shows/Hides the stealth value."] = { + ["enUS"] = true, + ["deDE"] = false, + ["frFR"] = false, + ["zhCN"] = false, + ["ruRU"] = false, + ["esES"] = false, + ["esMX"] = false, + ["ptBR"] = false + }, + ["Shows/Hides the invisibility value."] = { + ["enUS"] = true, + ["deDE"] = false, + ["frFR"] = false, + ["zhCN"] = false, + ["ruRU"] = false, + ["esES"] = false, + ["esMX"] = false, + ["ptBR"] = false + }, } for k, v in pairs(generalConfigTranslations) do diff --git a/Modules/i18n/translations/StatTranslations.lua b/Modules/i18n/translations/StatTranslations.lua index 6bf9140e..4138d2e4 100644 --- a/Modules/i18n/translations/StatTranslations.lua +++ b/Modules/i18n/translations/StatTranslations.lua @@ -812,6 +812,26 @@ local statTranslations = { ["esMX"] = "Fallo de las sombras (Niv. + 3)", ["ptBR"] = "Erro de sombra (Nív. + 3)" }, + ["Stealth"] = { + ["enUS"] = true, + ["deDE"] = false, + ["frFR"] = false, + ["zhCN"] = false, + ["ruRU"] = false, + ["esES"] = false, + ["esMX"] = false, + ["ptBR"] = false + }, + ["Invisibility"] = { + ["enUS"] = true, + ["deDE"] = false, + ["frFR"] = false, + ["zhCN"] = false, + ["ruRU"] = false, + ["esES"] = false, + ["esMX"] = false, + ["ptBR"] = false + }, } for k, v in pairs(statTranslations) do