diff --git a/.luacheckrc b/.luacheckrc index 2e903fee..baa7d679 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", @@ -2620,6 +2627,7 @@ stds.ecs = { "MainMenuBar", "MapQuestInfoRewardsFrame", "MasterLooterFrame", + "MAX_SPELL_SCHOOLS", "MerchantFrame", "Minimap", "MinimapCluster", @@ -2696,11 +2704,11 @@ stds.ecs = { "SpellBookFrame", "StackSplitFrame", "STANDARD_TEXT_FONT", - "StaticPopup_Show", "StaticPopup1", "StaticPopup2", "StaticPopup3", "StaticPopup4", + "StaticPopup_Show", "StaticPopupDialogs", "StatsFrame", "StopwatchFrame", @@ -2752,7 +2760,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 +2775,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 +2809,7 @@ stds.ecs = { "SLASH_ECS1", "SlashCmdList", "spy", + -- keep-sorted end } } std = "max+ecs" diff --git a/Modules/Data/Constants.lua b/Modules/Data/Constants.lua index 7f424a18..1bff4d8b 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") @@ -21,6 +27,7 @@ Data.WARLOCK = 9 Data.DRUID = 11 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 +86,257 @@ Data.Aura = { [17800] = (ECS.IsWotlk and -5 or nil), -- Shadow Mastery 5/5 [22959] = (ECS.IsWotlk and -5 or nil), -- Improved Scorch }, + DamageReductionFlat = { + -- keep-sorted start case=no block=yes + [0] = { + -- keep-sorted start numeric=yes + [604] = 10, -- Dampen Magic + [1008] = -15, -- Amplify Magic + [4244] = -10, -- Open Wound Effect + [4805] = -5, -- Distracting Spit + [8450] = 20, -- Dampen Magic + [8451] = 40, -- Dampen Magic + [8455] = -30, -- Amplify Magic + [10169] = -50, -- Amplify Magic + [10170] = -75, -- Amplify Magic + [10173] = 60, -- Dampen Magic + [10174] = 90, -- Dampen Magic + [11374] = (IsWotlk and -8 or nil), -- Gift of Arthas + [12545] = -15, -- Spitelash + [20590] = -20, -- Ragged John's Neverending Cup + [20911] = ((not IsWotlk) and 10 or nil), -- Blessing of Sanctuary + [20912] = ((not IsWotlk) and 14 or nil), -- Blessing of Sanctuary + [20913] = 19, -- Blessing of Sanctuary + [20914] = 24, -- Blessing of Sanctuary + [23120] = 100, -- Black March Blessing + [25685] = 50, -- Energize + [25794] = 5, -- Ahn'Qiraj Reward Buff (Melee - 20) + [25795] = 15, -- Ahn'Qiraj Reward Buff (Melee - 40) + [25796] = 25, -- Ahn'Qiraj Reward Buff (Melee - 60) + [25797] = 5, -- Ahn'Qiraj Reward Buff (Caster - 20) + [25798] = 15, -- Ahn'Qiraj Reward Buff (Caster - 40) + [25799] = 25, -- Ahn'Qiraj Reward Buff (Caster - 60) + [25899] = 24, -- Greater Blessing of Sanctuary + [27130] = -90, -- Amplify Magic + [27168] = 80, -- Blessing of Sanctuary + [27169] = 80, -- Greater Blessing of Sanctuary + [28772] = -200, -- Elemental Vulnerability + [29109] = -10, -- Arcane Residue + [29900] = -600, -- Unstable Magic + [30113] = ((not IsWotlk) and -120 or nil), -- Putrid Bite + [31410] = -7, -- Coral Cut + [33944] = 120, -- Dampen Magic + [33946] = -120, -- Amplify Magic + [34697] = -500, -- Allergic Reaction + [34700] = -500, -- Allergic Reaction + [35004] = -350, -- Spore Cloud + [35005] = -350, -- Spore Cloud + [36789] = -100, -- Diminish Soul + [37973] = -14, -- Coral Cut + [38848] = -200, -- Diminish Soul + [39626] = 20, -- Earthen Elixir + [40237] = 500, -- Protection of the Hawk + [41965] = -50000, -- Corrupted Light + [43017] = -240, -- Amplify Magic + [49163] = -35, -- Perpetual Instability + [50272] = -300, -- Unstable Magic + [51054] = -900, -- Amplify Magic + [52873] = -15, -- Open Wound (tooltip says %) + [52918] = 75, -- Anti-Magic Barrier + [53766] = 75, -- Anti-Magic Shell + [59371] = -1800, -- Amplify Magic + [70408] = -2400, -- Amplify Magic + [370544] = 4, -- Skeletal Artifact + [371206] = -75, -- Servant of Chaos + [398117] = -20, -- Pockets of Treats + [427143] = -3, -- Curse of Vulnerability + [449920] = -50, -- Malevolence + [449927] = -7, -- Blood Corruption + [1230206] = -200, -- Snuff Out + -- keep-sorted end + }, + [Data.ARCANE_SCHOOL] = { + -- keep-sorted start numeric=yes + [33527] = -20, -- Arcane Buffet + [34794] = -1200, -- Arcane Resonance + [34856] = -100, -- Bloodburn + [37133] = -50, -- Arcane Buffet + [38138] = -20, -- Arcane Buffet + [43015] = 240, -- Dampen Magic + [44120] = -200, -- Fists of Arcane Fury + [45018] = -500, -- Arcane Buffet + [49730] = 500, -- Deadnettle + [54226] = -150, -- Arcane Buffet + [57063] = -2000, -- Arcane Attraction + [59485] = -300, -- Arcane Buffet + -- keep-sorted end + }, + [Data.FIRE_SCHOOL] = { + -- keep-sorted start numeric=yes + [9482] = -100, -- Amplify Flames + [9574] = -30, -- Flame Buffet + [9658] = -20, -- Flame Buffet + [10452] = -20, -- Flame Buffet + [13744] = 25, -- Blazing Emblem + [15128] = -1000, -- Mark of Flames + [16168] = -180, -- Flame Buffet + [16536] = -30, -- Flame Buffet + [19397] = -25, -- Incinerate + [22433] = -1000, -- Flame Buffet + [22713] = -20, -- Flame Buffet + [25050] = (IsClassic and -1000 or -500), -- Mark of Flames + [25651] = -40, -- Flame Buffet + [25668] = -40, -- Flame Buffet + [29618] = -50, -- Burning Brand + [30053] = -500, -- Amplify Flames + [31280] = -20, -- Bloodmyst Chill + [31724] = -50, -- Flame Buffet + [33526] = -20, -- Flame Buffet + [37675] = -1675, -- Chaos Blast + [38141] = -20, -- Flame Buffet + [40719] = -50, -- Flame Buffet + [41596] = -5000, -- Flame Buffet + [43757] = -100, -- Burning Brand + [46279] = -1000, -- Flame Buffet + [57557] = -1000, -- Pyrobuffet + [58903] = -1000, -- Pyrobuffet + [59601] = -500, -- Burning Brand + [64016] = -1000, -- Flame Buffet + [64023] = -1500, -- Flame Buffet + [460338] = -30, -- Purged by Fire + [462400] = -25, -- Incinerate + -- keep-sorted end + }, + [Data.FROST_SCHOOL] = { + -- keep-sorted start numeric=yes + [6873] = -50, -- Foul Chill + [31280] = -20, -- Bloodmyst Chill + [33528] = -20, -- Frost Buffet + [38142] = -20, -- Frost Buffet + [58025] = -50, -- Frost Buffet + -- keep-sorted end + }, + [Data.HOLY_SCHOOL] = { + -- keep-sorted start numeric=yes + [2537] = -6, -- Crusader Strike + [8823] = -10, -- Crusader Strike + [8824] = -15, -- Crusader Strike + [10336] = -22, -- Crusader Strike + [10337] = -30, -- Crusader Strike + [14517] = -10, -- Crusader Strike + [14518] = -20, -- Crusader Strike + [17281] = -30, -- Crusader Strike + [20188] = (IsClassic and -30 or (IsTBC and -23 or nil)), -- Judgement of the Crusader + [20300] = (IsClassic and -50 or -58), -- Judgement of the Crusader + [20301] = (IsClassic and -80 or -92), -- Judgement of the Crusader + [20302] = (IsClassic and -110 or -127), -- Judgement of the Crusader + [20303] = (IsClassic and -140 or -161), -- Judgement of the Crusader + [21183] = -20, -- Judgement of the Crusader + [27159] = -219, -- Judgement of the Crusader + [36647] = -10, -- Crusader Strike + [456496] = -140, -- Judgement of the Crusader + [460338] = -30, -- Purged by Fire + [1234893] = -20, -- Crusader Strike + -- keep-sorted end + }, + [Data.NATURE_SCHOOL] = { + -- keep-sorted start numeric=yes + [20542] = -100, -- Static Conduit + [26419] = -100, -- Acid Spray + [27891] = (IsWotlk and -200 or -80), -- Disease Buffet + [33657] = -2000, -- Resonance + [46481] = -650, -- Disease Buffet + [54331] = -300, -- Acidic Sludge + [469548] = -380, -- Disease Buffet + -- keep-sorted end + }, + [Data.PHYSICAL_SCHOOL] = { + -- keep-sorted start numeric=yes + [3247] = -25, -- Agonizing Pain (tooltip) + [3264] = -5, -- Blood Howl + [3387] = -8, -- Rage of Thule + [3427] = -3, -- Infected Wound (tooltip) + [3436] = -5, -- Wandering Plague + [3439] = -5, -- Wandering Plague + [4166] = -30, -- Vulnerable (tooltip) + [4932] = 40, -- Ward of Myzrael + [5810] = 15, -- Stone Skin + [6922] = -3, -- Curse of the Shadowhorn + [7139] = -10, -- Fel Stomp + [7140] = -5, -- Expose Weakness + [7367] = -5, -- Infected Bite + [8282] = -1, -- Curse of Blood + [11374] = ((not IsWotlk) and -8 or nil), -- Gift of Arthas + [12245] = -3, -- Infected Spine + [12279] = -1, -- Curse of Blood + [15042] = -1, -- Curse of Blood + [15595] = 25, -- Force of Will + [16098] = -2, -- Curse of Blood + [16128] = -20, -- Infected Bite + [16511] = (IsClassic and -3 or -13), -- Hemorrhage + [17230] = -6, -- Infected Wound (tooltip) + [17347] = (IsClassic and -5 or -21), -- Hemorrhage + [17348] = (IsClassic and -7 or -29), -- Hemorrhage + [20590] = -5, -- Ragged John's Neverending Cup + [24673] = -500, -- Curse of Blood + [26864] = -42, -- Hemorrhage + [27857] = -5, -- Copy of Wandering Plague + [29306] = -100, -- Infected Wound + [30080] = -250, -- Retching Plague + [30081] = (IsWotlk and -1000 or -250), -- Retching Plague + [30478] = -15, -- Hemorrhage + [30932] = -95, -- Impaling Bolt + [31282] = -3, -- Infected Wound (tooltip) + [32056] = -3, -- Spite of the Umbrafen + [32682] = -50, -- Curse of the Dark Talon + [32683] = -5, -- Curse of the Dark Talon + [32733] = -3, -- Mange (tooltip) + [34716] = -550, -- Stomp + [37331] = -150, -- Hemorrhage + [37776] = 10, -- Blood Howl + [37937] = -80, -- Flayed Flesh + [37998] = -57, -- Piercing Strike + [38149] = -150, -- Curse of the Dark Talon + [38167] = -1, -- Curse of Blood + [38753] = -150, -- Shrapnel Bomb + [40248] = -250, -- Impaling Bolt + [43150] = -150, -- Claw Rage + [45897] = -45, -- Hemorrhage + [48423] = -250, -- Spirit Strike + [48660] = -75, -- Hemorrhage + [49165] = -100, -- Shred + [50075] = -50, -- Maim Flesh + [50414] = -500, -- Curse of Blood + [54604] = -1, -- Curse of Blood + [56444] = -250, -- Retching Plague + [56445] = -1500, -- Retching Plague + [59009] = -1000, -- Curse of Blood + [59304] = -1000, -- Spirit Strike + [60626] = -100, -- Necrotic Strike + [61549] = -500, -- Shred + [65954] = -75, -- Hemorrhage + [71157] = -100, -- Infected Wound + [445867] = -5, -- Recurrent Nightmare + [446362] = -1, -- Curse of Blood + [448107] = -5, -- Blood Howl + -- keep-sorted end + }, + [Data.SHADOW_SCHOOL] = { + -- keep-sorted start numeric=yes + [17151] = 50, -- Shadow Barrier + [30937] = -1000, -- Mark of Shadow + [31394] = -20, -- Mark of Shadow + [33529] = -20, -- Shadow Buffet + [38143] = -20, -- Shadow Buffet + [38627] = -1500, -- Shadow Nova + [41047] = -1200, -- Shadow Resonance + [41961] = -10000, -- Shadow Resonance + [45770] = -750, -- Shadow Bolt Volley + [54113] = -500, -- Shadow Bolt + -- keep-sorted end + }, + -- keep-sorted end + }, IsFeralForm = { [768] = true, -- Cat Form [5487] = true, -- Bear Form @@ -121,7 +379,7 @@ Data.Aura = { [1135] = 332, -- drink [1137] = 489, -- drink [2639] = 70, -- food - [10250] = 800, -- drink + [10250] = 800, -- drink [16609] = 10, -- Warchief's Blessing [18140] = 735, -- Blessed Sunfruit Juice [18194] = (ECS.IsWotlk and 10 or 8), -- Mana Regeneration @@ -141,7 +399,7 @@ Data.Aura = { [26402] = 735, -- Drink [26473] = 367, -- drink [26475] = 551, -- drink - [27089] = 240*5, -- Drink + [27089] = 240 * 5, -- Drink [28145] = (ECS.IsWotlk and 14 or 11), -- Power of the Guardian [28509] = (ECS.IsWotlk and 20 or 16), -- Greater Mana Regeneration [28519] = (ECS.IsWotlk and 31 or 25), -- Flask of Mighty Restoration @@ -169,8 +427,8 @@ Data.Aura = { [42308] = 1250, -- brain food [42312] = 1200, -- Brain Food [43154] = 489, -- Drink - [43182] = 428*5, -- Drink - [43183] = 640*5, -- Drink + [43182] = 428 * 5, -- Drink + [43183] = 640 * 5, -- Drink [43742] = (ECS.IsWotlk and 28 or 22), -- Grace of the Naaru [44107] = 42, -- Brewfest Drink [44109] = 104, -- Brewfest Drink @@ -185,7 +443,7 @@ Data.Aura = { [45020] = 1200, -- Holiday Drink [46386] = (ECS.IsWotlk and 83 or 66), -- Luminous Bluetail [46755] = 240, -- drink - [49472] = 240*5, -- Drink Coffee + [49472] = 240 * 5, -- Drink Coffee [49623] = 125, -- Effervescence [52051] = 91, -- Blessing of Zim'Rhuk within Zul'Drak, Gundrak, and Drak'Tharon Keep. [52127] = 10, -- Water Shield rank 1 @@ -198,7 +456,7 @@ Data.Aura = { [53373] = 1200, -- Thunderbrew's Hard Ale [53764] = 30, -- Mighty Mana Regeneration [54212] = 45, -- Flask of Pure Mojo - [57073] = 640*5, -- Drink + [57073] = 640 * 5, -- Drink [57107] = 15, -- Well Fed [57291] = 15, -- Well Fed [57334] = 40, -- Well Fed @@ -206,7 +464,7 @@ Data.Aura = { [59674] = 20, -- Moonshroud Residue [60520] = 220, -- Spark of Life [61268] = 2160, -- Mana Regeneration - [61830] = 428*5, -- Drink + [61830] = 428 * 5, -- Drink [64356] = 3200, -- Drink [64739] = 272, -- Show of Faith [65003] = 220, -- Memories of Love @@ -233,17 +491,17 @@ Data.Aura = { [1220685] = 28, -- Totemic Power }, MP5Tooltip = { - [5677] = (ECS.IsWotlk and 5/2 or nil), -- Mana Spring rank 1 - [10491] = (ECS.IsWotlk and 5/2 or nil), -- Mana Spring rank 2 - [10493] = (ECS.IsWotlk and 5/2 or nil), -- Mana Spring rank 3 - [10494] = (ECS.IsWotlk and 5/2 or nil), -- Mana Spring rank 4 + [5677] = (ECS.IsWotlk and 5 / 2 or nil), -- Mana Spring rank 1 + [10491] = (ECS.IsWotlk and 5 / 2 or nil), -- Mana Spring rank 2 + [10493] = (ECS.IsWotlk and 5 / 2 or nil), -- Mana Spring rank 3 + [10494] = (ECS.IsWotlk and 5 / 2 or nil), -- Mana Spring rank 4 [19742] = ((not ECS.IsClassic) and 1 or nil), -- Blessing of Wisdom rank 1 [19850] = ((not ECS.IsClassic) and 1 or nil), -- Blessing of Wisdom rank 2 [19852] = ((not ECS.IsClassic) and 1 or nil), -- Blessing of Wisdom rank 3 [19853] = ((not ECS.IsClassic) and 1 or nil), -- Blessing of Wisdom rank 4 [19854] = ((not ECS.IsClassic) and 1 or nil), -- Blessing of Wisdom rank 5 [25290] = ((not ECS.IsClassic) and 1 or nil), -- Blessing of Wisdom rank 6 - [25569] = (ECS.IsWotlk and 5/2 or nil), -- Mana Spring rank 5 + [25569] = (ECS.IsWotlk and 5 / 2 or nil), -- Mana Spring rank 5 [25894] = ((not ECS.IsClassic) and 1 or nil), -- Greater Blessing of Wisdom rank 1 [25918] = ((not ECS.IsClassic) and 1 or nil), -- Greater Blessing of Wisdom rank 2 [27142] = 1, -- Blessing of Wisdom rank 7 @@ -253,56 +511,56 @@ Data.Aura = { [48937] = 1, -- Greater Blessing of Wisdom rank 4 [48938] = 1, -- Greater Blessing of Wisdom rank 5 [56521] = 1, -- Blessing of Wisdom - [58775] = 5/2, -- Mana Spring rank 6 - [58776] = 5/2, -- Mana Spring rank 7 - [58777] = 5/2, -- Mana Spring rank 8 + [58775] = 5 / 2, -- Mana Spring rank 6 + [58776] = 5 / 2, -- Mana Spring rank 7 + [58777] = 5 / 2, -- Mana Spring rank 8 }, PercentageMp5 = { - [12051] = ((not ECS.IsClassic) and 0.15/2*5 or nil), -- Evocation - [18792] = (ECS.IsClassic and 0.02/4 or 0.03/4)*5, -- Fel Energy - [24355] = 0.02*5, -- Drink - [24707] = 0.03*5, -- Food - [25990] = 0.05*5, -- Graccu's Mince Meat Fruitcake - [26263] = (ECS.IsClassic and 0.04 or 0.03)*5, -- Dim Sum - [29055] = 0.04*5, -- Refreshing Red Apple - [30024] = 0.2*5, -- Drink - [30254] = 0.05*5, -- Evocation - [30874] = 0.05*5, -- Gift of the Water Spirit - [34074] = 0.04/3*5, -- Aspect of the Viper - [35701] = 0.02/4*5, -- Touch of Shadow - [38549] = 0.03*5, -- Empowerment - [38730] = 0.09/2*5, -- Refreshing Mist - [52067] = 0.02/2*5, -- Aura of Regeneration - [53089] = 0.02*5, -- Worgen's Blood - [53517] = 0.1/3*5, -- Roar of Recovery - [54428] = 0.05/3*5, -- Divine Plea - [57056] = 0.02/5*5, -- Aura of Regeneration - [58026] = 0.1/2*5, -- Blessing of the Crusade - [61011] = 0.15/2*5, -- Improved Brilliance Aura - [74501] = 0.05*5, -- Brilliant Tactics - [74719] = 0.05*5, -- Brilliant Tactics - [74865] = 0.05*5, -- Boon of the Loa + [12051] = ((not ECS.IsClassic) and 0.15 / 2 * 5 or nil), -- Evocation + [18792] = (ECS.IsClassic and 0.02 / 4 or 0.03 / 4) * 5, -- Fel Energy + [24355] = 0.02 * 5, -- Drink + [24707] = 0.03 * 5, -- Food + [25990] = 0.05 * 5, -- Graccu's Mince Meat Fruitcake + [26263] = (ECS.IsClassic and 0.04 or 0.03) * 5, -- Dim Sum + [29055] = 0.04 * 5, -- Refreshing Red Apple + [30024] = 0.2 * 5, -- Drink + [30254] = 0.05 * 5, -- Evocation + [30874] = 0.05 * 5, -- Gift of the Water Spirit + [34074] = 0.04 / 3 * 5, -- Aspect of the Viper + [35701] = 0.02 / 4 * 5, -- Touch of Shadow + [38549] = 0.03 * 5, -- Empowerment + [38730] = 0.09 / 2 * 5, -- Refreshing Mist + [52067] = 0.02 / 2 * 5, -- Aura of Regeneration + [53089] = 0.02 * 5, -- Worgen's Blood + [53517] = 0.1 / 3 * 5, -- Roar of Recovery + [54428] = 0.05 / 3 * 5, -- Divine Plea + [57056] = 0.02 / 5 * 5, -- Aura of Regeneration + [58026] = 0.1 / 2 * 5, -- Blessing of the Crusade + [61011] = 0.15 / 2 * 5, -- Improved Brilliance Aura + [74501] = 0.05 * 5, -- Brilliant Tactics + [74719] = 0.05 * 5, -- Brilliant Tactics + [74865] = 0.05 * 5, -- Boon of the Loa [408510] = 0.02, -- Water Shield [413083] = 0.15, -- Resilience of Nature - [415058] = 0.05/3*5, -- Guarded by the Light - [415423] = 0.1/3*5, -- Aspect of the Viper - [425294] = 0.06*5, -- Dispersion - [437324] = 0.02*5, -- Deep Slumber - [449879] = 0.06*5, -- Dream Fog - [1226808] = 0.05*5, -- Food + [415058] = 0.05 / 3 * 5, -- Guarded by the Light + [415423] = 0.1 / 3 * 5, -- Aspect of the Viper + [425294] = 0.06 * 5, -- Dispersion + [437324] = 0.02 * 5, -- Deep Slumber + [449879] = 0.06 * 5, -- Dream Fog + [1226808] = 0.05 * 5, -- Food }, PeriodicallyGiveMana = { [15604] = 150, -- Second Wind [15822] = 20, -- Dreamless Sleep - [16191] = 170/3*5, -- Mana Tide + [16191] = 170 / 3 * 5, -- Mana Tide [16599] = 50, -- Blessing of Shahram [17252] = 22, -- Mark of the Dragon Lord [17328] = 15, -- Aura of Penitence - [17355] = 230/3*5, -- Mana Tide - [17360] = 290/3*5, -- Mana Tide + [17355] = 230 / 3 * 5, -- Mana Tide + [17360] = 290 / 3 * 5, -- Mana Tide [17447] = 375, -- Circle of Flame [18194] = 8, -- Mana Regeneration - [19634] = 50/3*5, -- Mana Rejuvenation + [19634] = 50 / 3 * 5, -- Mana Rejuvenation [21955] = 60, -- Razorlash Root [23108] = 500, -- Blessing of Nordrassil [23513] = 2500, -- Essence of the Red @@ -319,7 +577,7 @@ Data.Aura = { [29882] = 875, -- Loose Mana [31045] = 375, -- Talasite Owl [35478] = 200, -- Drums of Restoration - [38929] = 400/3*5, -- Fel Mana + [38929] = 400 / 3 * 5, -- Fel Mana [45027] = 750, -- Revitalize [45052] = 750, -- Evocation [45860] = 1125, -- Breath: Revitalize @@ -328,7 +586,7 @@ Data.Aura = { [54833] = 450, -- Glyph of Innervate [55740] = 2500, -- Essence of the Red [71881] = 300, -- Invigoration - [71941] = 200/3*5, -- Twisted Nightmare + [71941] = 200 / 3 * 5, -- Twisted Nightmare [351358] = 200, -- Greater Drums of Restoration [434851] = 380, -- Minor Evocation [435168] = 12, -- Guard of the Innovator @@ -336,18 +594,18 @@ Data.Aura = { [462858] = 750, -- Circle of Flame }, PeriodicallyGiveManaTooltip = { - [5677] = ((not ECS.IsWotlk) and 5/2 or nil), -- Mana Spring rank 1 - [10491] = ((not ECS.IsWotlk) and 5/2 or nil), -- Mana Spring rank 2 - [10493] = ((not ECS.IsWotlk) and 5/2 or nil), -- Mana Spring rank 3 - [10494] = ((not ECS.IsWotlk) and 5/2 or nil), -- Mana Spring rank 4 + [5677] = ((not ECS.IsWotlk) and 5 / 2 or nil), -- Mana Spring rank 1 + [10491] = ((not ECS.IsWotlk) and 5 / 2 or nil), -- Mana Spring rank 2 + [10493] = ((not ECS.IsWotlk) and 5 / 2 or nil), -- Mana Spring rank 3 + [10494] = ((not ECS.IsWotlk) and 5 / 2 or nil), -- Mana Spring rank 4 [19742] = (ECS.IsClassic and 1 or nil), -- Blessing of Wisdom rank 1 [19850] = (ECS.IsClassic and 1 or nil), -- Blessing of Wisdom rank 2 [19852] = (ECS.IsClassic and 1 or nil), -- Blessing of Wisdom rank 3 [19853] = (ECS.IsClassic and 1 or nil), -- Blessing of Wisdom rank 4 [19854] = (ECS.IsClassic and 1 or nil), -- Blessing of Wisdom rank 5 - [24853] = 5/2, -- Mana Spring + [24853] = 5 / 2, -- Mana Spring [25290] = (ECS.IsClassic and 1 or nil), -- Blessing of Wisdom rank 6 - [25569] = ((not ECS.IsWotlk) and 5/2 or nil), -- Mana Spring rank 5 + [25569] = ((not ECS.IsWotlk) and 5 / 2 or nil), -- Mana Spring rank 5 [25894] = (ECS.IsClassic and 1 or nil), -- Greater Blessing of Wisdom rank 1 [25918] = (ECS.IsClassic and 1 or nil), -- Greater Blessing of Wisdom rank 2 }, @@ -422,6 +680,7 @@ Data.Aura = { [1227200] = 20, -- Wickedness [1236220] = -50, -- Slow }, + -- keep-sorted end } Data.Enchant = { BlockValue = { @@ -521,6 +780,10 @@ Data.Gem = { }, } Data.Item = { + DamageReductionFlat = { + [22191] = 10, -- Obsidian Mail Tunic + [234460] = 40, -- Obsidian Mail Tunic + }, IsTimeworn = { [233496] = true, [233505] = true, diff --git a/Modules/Data/Defense.lua b/Modules/Data/Defense.lua index f9511d57..c6622d3c 100755 --- a/Modules/Data/Defense.lua +++ b/Modules/Data/Defense.lua @@ -1,3 +1,12 @@ +-- 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 MAX_SPELL_SCHOOLS = MAX_SPELL_SCHOOLS +-- keep-sorted end + ---@class Data local Data = ECSLoader:ImportModule("Data") ---@type DataUtils @@ -236,3 +245,48 @@ function _Defense:GetEnchantsBlockValue() end return mod end + +---@return table +function Data:GetDamageReductionFlat() + local mod = {0,0,0,0,0,0,0} + for i = EQUIPPED_FIRST,EQUIPPED_LAST do + local id, _ = GetInventoryItemID("player", i) + for s=1,7 do + mod[s] = mod[s] + (Data.Item.DamageReductionFlat[id] or 0) + end + end + local i = 1 + repeat + local aura = GetBuffDataByIndex("player", i) + i = i + 1 + if aura and aura.spellId then + local modAll = (Data.Aura.DamageReductionFlat[0][aura.spellId] or 0) + for s=1,7 do + mod[s] = mod[s] + modAll + if Data.Aura.DamageReductionFlat[s] then + mod[s] = mod[s] + (Data.Aura.DamageReductionFlat[s][aura.spellId] or 0) + end + end + end + until (not aura) + i = 1 + repeat + local aura = GetDebuffDataByIndex("player", i) + i = i + 1 + if aura and aura.spellId then + local modAll = (Data.Aura.DamageReductionFlat[0][aura.spellId] or 0) + for s=1,MAX_SPELL_SCHOOLS do + mod[s] = mod[s] + modAll + if Data.Aura.DamageReductionFlat[s] then + mod[s] = mod[s] + (Data.Aura.DamageReductionFlat[s][aura.spellId] or 0) + end + end + if aura.spellId == 23341 then + mod[Data.FIRE_SCHOOL] = mod[Data.FIRE_SCHOOL] - 150 * aura.applications -- Flame Buffet + elseif aura.spellId == 24339 then + mod[Data.PHYSICAL_SCHOOL] = mod[Data.PHYSICAL_SCHOOL] - 100 * aura.applications -- Infected Bite + end + end + until (not aura) + return mod +end \ No newline at end of file