diff --git a/README.md b/README.md index 1326310..445d278 100644 --- a/README.md +++ b/README.md @@ -1,195 +1,192 @@ -# RatingBuster - -![RatingBuster](https://user-images.githubusercontent.com/7716908/186707338-2bcf29cc-0529-4be9-9a4b-d29b621580fa.png) - -RatingBuster converts combat ratings in your tooltips into percentages, so that you have more meaningful information when comparing different items. - -The design aim of RatingBuster is to provide detailed, meaningful and customizable information about items so you can easily decide for yourself which item is better. - -![image](https://user-images.githubusercontent.com/7716908/118906904-3ff4e380-b8e4-11eb-8fb5-a0b090d9e9c2.png) - -Originally written by Whitetooth (https://github.com/hotdogee) - -## Installation: -Available for download at: - -[CurseForge](https://www.curseforge.com/wow/addons/ratingbuster-classic) | [WoWInterface](https://www.wowinterface.com/downloads/info26235-RatingBusterClassic.html#info) | [Wago Addons](https://addons.wago.io/addons/ratingbuster) | [WowUp](https://wowup.io/addons/54151) | [GitHub Releases](https://github.com/raethkcj/RatingBuster/releases/latest) - -## Features - -Rating Conversion: - * Converts combat ratings into percentages. - -Stat Breakdown: - * Breakdown Strength, Agility, Stamina, Intellect and Spirit into base stats. - * Supports talents, buffs and racials that give you extra bonuses. - * Ex talent: Lunar Guidance - "Increases your spell damage and healing by 8%/16%/25% of your total Intellect." - * Ex talent: Heart of the Wild - "Increases your Intellect by 4%/8%/12%/16%/20%. In addition, ......etc" - * Ex: +13 Intellect (+234 Mana, +0.18% Spell Crit, +3.9 Dmg) - -Stat Summary: - * Summarizes all the stats from the item itself, enchants and gems, converts them to base stats and displays the total value and/or difference from your current equipped item. - * Ex: Crit Chance - Adds up agility and crit rating from the item, enchant and gem. Converts agility and crit rating to crit chance, and displays the total in a single value. - -Item Level and Item ID: - * Item Level is obtained from the WoW API, not a calculated value. - * Item ID is useful for advanced users. - -Supports talents, buffs and racials that modify your stats for all classes. - -Fully customizable, decide what you need to see and what you don't want. - - -## Auto fill gems in empty sockets -1. You can set the default gems for each type of empty socket using "/rb sum gem " or using the options window. -2. To specify the gem of your choice, you will need to give RatingBuster the ItemLink or the ItemID of the gem. -3. ItemLink example: type "/rb sum gem blue " (last char is a space) and link the gem (from your bags, AH, ItemSync or whatever), then press . -4. What if you can't link the gem? Well thats what ItemID is for. Find your gem on http://www.wowhead.com/ and look at the URL, - for example "http://www.wowhead.com/?item=32193", 32193 is the ItemID for that gem. - Go back in wow, type "/rb sum gem red 32193" and press . - -Note1: If you have "/rb sum ignore gem" on, the auto fill gems won't work. -Note2: Meta gem conditions and SetBonuses work, so if you don't meet the conditions, StatSummary won't count them. -Note3: RatingBuster will only auto fill empty sockets, if the item already has some gems on it, it will remain. -Note4: Empty sockets filled by RatingBuster will keep the "Empty Socket Icon" so you can still easily tell what color socket it is. -Note5: Gem text filled by RatingBuster will be shown in gray color to differentiate from real gems. - - -## Supported Addons - -EquipCompare, EQCompare, tekKompare. -LinkWrangler, MultiTips, Links. -AtlasLoot, ItemMagic, Sniff. - -will work with all bag mods too! - - -## Options - -Type `/rb` or `/ratingbuster` to open the options menu GUI, or add a slash command: - -- `help` - Show help message -- `enableStatMods` - Enable support for Stat Mods -- `showItemID` - Show the ItemID in tooltips -- `showItemLevel` - Show the ItemLevel in tooltips -- `useRequiredLevel` - Calculate using the required level if you are below the required level -- `customLevel` - Set the level used in calculations (0 = your level) -- `rating` - Options for Rating display - - `showRatings` - Show Rating conversions in tooltips - - `detailedConversionText` - Show detailed text for Resilience and Expertise conversions - - `defBreakDown` - Convert Defense into Crit Avoidance, Hit Avoidance, Dodge, Parry and Block - - `wpnBreakDown` - Convert Weapon Skill into Crit, Hit, Dodge Neglect, Parry Neglect and Block Neglect - - `expBreakDown` - Convert Expertise into Dodge Neglect and Parry Neglect - - `color` - Changes the color of added text - - `pick` - Pick a color - - `enableTextColor` - Enable colored text -- `stat` - Changes the display of base stats - - `showStats` - Show base stat conversions in tooltips - - `str` - Changes the display of Strength - - `showAPFromStr` - Show Attack Power from Strength - - `showBlockValueFromStr` - Show Block Value from Strength -- `agi` - Changes the display of Agility - - `showCritFromAgi` - Show Crit chance from Agility - - `showDodgeFromAgi` - Show Dodge chance from Agility - - `showAPFromAgi` - Show Attack Power from Agility - - `showRAPFromAgi` - Show Ranged Attack Power from Agility - - `showArmorFromAgi` - Show Armor from Agility -- `sta` - Changes the display of Stamina - - `showHealthFromSta` - Show Health from Stamina -- `int` - Changes the display of Intellect - - `showSpellCritFromInt` - Show Spell Crit chance from Intellect - - `showManaFromInt` - Show Mana from Intellect - - `showMP5FromInt` - Show Mana Regen while casting from Intellect - - `showMP5NCFromInt` - Show Mana Regen while NOT casting from Intellect -- `spi` - Changes the display of Spirit - - `showMP5NCFromSpi` - Show Mana Regen while NOT casting from Spirit - - `showHP5FromSpi` - Show Health Regen from Spirit -- `sum` - Options for stat summary - - `showSum` - Show stat summary in tooltips - - `ignore` - Ignore stuff when calculating the stat summary - - `sumIgnoreUnused` - Show stat summary only for highest level armor type and items you can use with uncommon quality and up - - `sumIgnoreEquipped` - Hide stat summary for equipped items - - `sumIgnoreEnchant` - Ignore enchants on items when calculating the stat summary - - `sumIgnoreGems` - Ignore gems on items when calculating the stat summary -- `sumDiffStyle` - Display diff values in the main tooltip or only in compare tooltips - values"comp", "main"} -- `space` - Add a empty line before or after stat summary - - `sumBlankLine` - Add a empty line before stat summary - - `sumBlankLineAfter` - Add a empty line after stat summary -- `sumShowIcon` - Show the sigma icon before summary listing -- `sumShowTitle` - Show the title text before summary listing -- `showZeroValueStat` - Show zero value stats in summary for consistancy -- `calcSum` - Calculate the total stats for the item -- `calcDiff` - Calculate the stat difference for the item and equipped items -- `sumSortAlpha` - Enable to sort StatSummary alphabetically, disable to sort according to stat type(basic, physical, spell, tank) -- `sumAvoidWithBlock` - Enable to include block chance in Avoidance summary, Disable for only dodge, parry, miss -- `basic` - Choose basic stats for summary - - `sumHP` - Health <- Health, Stamina - - `sumMP` - Mana <- Mana, Intellect - - `sumMP5` - Mana Regen <- Mana Regen, Spirit - - `sumMP5NC` - Mana Regen while not casting <- Spirit - - `sumHP5` - Health Regen <- Health Regen - - `sumHP5OC` - Health Regen when out of combat <- Spirit - - `sumStr` - Strength Summary - - `sumAgi` - Agility Summary - - `sumSta` - Stamina Summary - - `sumInt` - Intellect Summary - - `sumSpi` - Spirit Summary -- `physical` - Choose physical damage stats for summary - - `sumAP` - Attack Power <- Attack Power, Strength, Agility - - `sumRAP` - Ranged Attack Power <- Ranged Attack Power, Intellect, Attack Power, Strength, Agility - - `sumFAP` - Feral Attack Power <- Feral Attack Power, Attack Power, Strength, Agility - - `sumHit` - Hit Chance <- Hit Rating, Weapon Skill Rating - - `sumHitRating` - Hit Rating Summary - - `sumCrit` - Crit Chance <- Crit Rating, Agility, Weapon Skill Rating - - `sumCritRating` - Crit Rating Summary - - `sumHaste` - Haste <- Haste Rating - - `sumHasteRating` - Haste Rating Summary - - `sumDodgeNeglect` - Dodge Neglect <- Expertise, Weapon Skill Rating - - `sumParryNeglect` - Parry Neglect <- Expertise, Weapon Skill Rating - - `sumBlockNeglect` - Block Neglect <- Weapon Skill Rating - - `sumWeaponSkill` - Weapon Skill <- Weapon Skill Rating - - `sumExpertise` - Expertise <- Expertise Rating - - `sumWeaponMaxDamage` - Weapon Max Damage Summary - - `weapondps` - Weapon DPS Summary - - `sumIgnoreArmor` - Ignore Armor Summary -- `spell` - Choose spell damage and healing stats for summary - - `sumSpellDmg` - Spell Damage <- Spell Damage, Intellect, Spirit, Stamina - - `sumHolyDmg` - Holy Spell Damage <- Holy Spell Damage, Spell Damage, Intellect, Spirit - - `sumArcaneDmg` - Arcane Spell Damage <- Arcane Spell Damage, Spell Damage, Intellect - - `sumFireDmg` - Fire Spell Damage <- Fire Spell Damage, Spell Damage, Intellect, Stamina - - `sumNatureDmg` - Nature Spell Damage <- Nature Spell Damage, Spell Damage, Intellect - - `sumFrostDmg` - Frost Spell Damage <- Frost Spell Damage, Spell Damage, Intellect - - `sumShadowDmg` - Shadow Spell Damage <- Shadow Spell Damage, Spell Damage, Intellect, Spirit, Stamina - - `sumHealing` - Healing <- Healing, Intellect, Spirit, Agility, Strength - - `sumSpellHit` - Spell Hit Chance <- Spell Hit Rating - - `sumSpellHitRating` - Spell Hit Rating Summary - - `sumSpellCrit` - Spell Crit Chance <- Spell Crit Rating, Intellect - - `sumSpellCritRating` - Spell Crit Rating Summary - - `sumSpellHaste` - Spell Haste <- Spell Haste Rating - - `sumSpellHasteRating` - Spell Haste Rating Summary - - `sumPenetration` - Spell Penetration Summary -- `tank` - Choose tank stats for summary - - `sumArmor` - Armor <- Armor from items, Armor from bonuses, Agility, Intellect - - `sumDefense` - Defense <- Defense Rating - - `sumDodge` - Dodge Chance <- Dodge Rating, Agility, Defense Rating - - `sumDodgeRating` - Dodge Rating Summary - - `sumParry` - Parry Chance <- Parry Rating, Defense Rating - - `sumParryRating` - Parry Rating Summary - - `sumBlock` - Block Chance <- Block Rating, Defense Rating - - `sumBlockRating` - Block Rating Summary - - `sumBlockValue` - Block Value <- Block Value, Strength - - `sumHitAvoid` - Hit Avoidance <- Defense Rating - - `sumCritAvoid` - Crit Avoidance <- Defense Rating, Resilience - - `sumResilience` - Resilience Summary - - `sumArcaneResist` - Arcane Resistance Summary - - `sumFireResist` - Fire Resistance Summary - - `sumNatureResist` - Nature Resistance Summary - - `sumFrostResist` - Frost Resistance Summary - - `sumShadowResist` - Shadow Resistance Summary - - `sumAvoidance` - Avoidance <- Dodge, Parry, MobMiss, Block(Optional) -- `gem` - Auto fill empty gem slots - - `sumGemRed` - ItemID or Link of the gem you would like to auto fill - - `sumGemYellow` - ItemID or Link of the gem you would like to auto fill - - `sumGemBlue` - ItemID or Link of the gem you would like to auto fill - - `sumGemMeta` - ItemID or Link of the gem you would like to auto fill +# RatingBuster + +![RatingBuster](https://user-images.githubusercontent.com/7716908/186707338-2bcf29cc-0529-4be9-9a4b-d29b621580fa.png) + +RatingBuster converts combat ratings in your tooltips into percentages, so that you have more meaningful information when comparing different items. + +The design aim of RatingBuster is to provide detailed, meaningful and customizable information about items so you can easily decide for yourself which item is better. + +![image](https://user-images.githubusercontent.com/7716908/118906904-3ff4e380-b8e4-11eb-8fb5-a0b090d9e9c2.png) + +Originally written by Whitetooth (https://github.com/hotdogee) + +## Installation: +Available for download at: + +[CurseForge](https://www.curseforge.com/wow/addons/ratingbuster-classic) | [WoWInterface](https://www.wowinterface.com/downloads/info26235-RatingBusterClassic.html#info) | [Wago Addons](https://addons.wago.io/addons/ratingbuster) | [WowUp](https://wowup.io/addons/54151) | [GitHub Releases](https://github.com/raethkcj/RatingBuster/releases/latest) + +## Features + +Rating Conversion: + * Converts combat ratings into percentages. + +Stat Breakdown: + * Breakdown Strength, Agility, Stamina, Intellect and Spirit into base stats. + * Supports talents, buffs and racials that give you extra bonuses. + * Ex talent: Lunar Guidance - "Increases your spell damage and healing by 8%/16%/25% of your total Intellect." + * Ex talent: Heart of the Wild - "Increases your Intellect by 4%/8%/12%/16%/20%. In addition, ......etc" + * Ex: +13 Intellect (+234 Mana, +0.18% Spell Crit, +3.9 Dmg) + +Stat Summary: + * Summarizes all the stats from the item itself, enchants and gems, converts them to base stats and displays the total value and/or difference from your current equipped item. + * Ex: Crit Chance - Adds up agility and crit rating from the item, enchant and gem. Converts agility and crit rating to crit chance, and displays the total in a single value. + +Item Level and Item ID: + * Item Level is obtained from the WoW API, not a calculated value. + * Item ID is useful for advanced users. + +Supports talents, buffs and racials that modify your stats for all classes. + +Fully customizable, decide what you need to see and what you don't want. + + +## Auto fill gems in empty sockets +1. You can set the default gems for each type of empty socket using "/rb sum gem " or using the options window. +2. To specify the gem of your choice, you will need to give RatingBuster the ItemLink or the ItemID of the gem. +3. ItemLink example: type "/rb sum gem blue " (last char is a space) and link the gem (from your bags, AH, ItemSync or whatever), then press . +4. What if you can't link the gem? Well thats what ItemID is for. Find your gem on http://www.wowhead.com/ and look at the URL, + for example "http://www.wowhead.com/?item=32193", 32193 is the ItemID for that gem. + Go back in wow, type "/rb sum gem red 32193" and press . + +Note1: If you have "/rb sum ignore gem" on, the auto fill gems won't work. +Note2: Meta gem conditions and SetBonuses work, so if you don't meet the conditions, StatSummary won't count them. +Note3: RatingBuster will only auto fill empty sockets, if the item already has some gems on it, it will remain. +Note4: Empty sockets filled by RatingBuster will keep the "Empty Socket Icon" so you can still easily tell what color socket it is. +Note5: Gem text filled by RatingBuster will be shown in gray color to differentiate from real gems. + + +## Supported Addons + +EquipCompare, EQCompare, tekKompare. +LinkWrangler, MultiTips, Links. +AtlasLoot, ItemMagic, Sniff. + +will work with all bag mods too! + + +## Options + +Type `/rb` or `/ratingbuster` to open the options menu GUI, or add a slash command: + +- `help` - Show help message +- `showItemID` - Show the ItemID in tooltips +- `showItemLevel` - Show the ItemLevel in tooltips +- `rating` - Options for Rating display + - `showRatings` - Show Rating conversions in tooltips + - `detailedConversionText` - Show detailed text for Resilience and Expertise conversions + - `defBreakDown` - Convert Defense into Crit Avoidance, Hit Avoidance, Dodge, Parry and Block + - `wpnBreakDown` - Convert Weapon Skill into Crit, Hit, Dodge Neglect, Parry Neglect and Block Neglect + - `expBreakDown` - Convert Expertise into Dodge Neglect and Parry Neglect + - `color` - Changes the color of added text + - `pick` - Pick a color + - `enableTextColor` - Enable colored text +- `stat` - Changes the display of base stats + - `showStats` - Show base stat conversions in tooltips + - `str` - Changes the display of Strength + - `showAPFromStr` - Show Attack Power from Strength + - `showBlockValueFromStr` - Show Block Value from Strength +- `agi` - Changes the display of Agility + - `showCritFromAgi` - Show Crit chance from Agility + - `showDodgeFromAgi` - Show Dodge chance from Agility + - `showAPFromAgi` - Show Attack Power from Agility + - `showRAPFromAgi` - Show Ranged Attack Power from Agility + - `showArmorFromAgi` - Show Armor from Agility +- `sta` - Changes the display of Stamina + - `showHealthFromSta` - Show Health from Stamina +- `int` - Changes the display of Intellect + - `showSpellCritFromInt` - Show Spell Crit chance from Intellect + - `showManaFromInt` - Show Mana from Intellect + - `showMP5FromInt` - Show Mana Regen while casting from Intellect + - `showMP5NCFromInt` - Show Mana Regen while NOT casting from Intellect +- `spi` - Changes the display of Spirit + - `showMP5NCFromSpi` - Show Mana Regen while NOT casting from Spirit + - `showHP5FromSpi` - Show Health Regen from Spirit +- `sum` - Options for stat summary + - `showSum` - Show stat summary in tooltips + - `ignore` - Ignore stuff when calculating the stat summary + - `sumIgnoreUnused` - Show stat summary only for highest level armor type and items you can use with uncommon quality and up + - `sumIgnoreEquipped` - Hide stat summary for equipped items + - `sumIgnoreEnchant` - Ignore enchants on items when calculating the stat summary + - `sumIgnoreGems` - Ignore gems on items when calculating the stat summary +- `sumDiffStyle` - Display diff values in the main tooltip or only in compare tooltips + values"comp", "main"} +- `space` - Add a empty line before or after stat summary + - `sumBlankLine` - Add a empty line before stat summary + - `sumBlankLineAfter` - Add a empty line after stat summary +- `sumShowIcon` - Show the sigma icon before summary listing +- `sumShowTitle` - Show the title text before summary listing +- `showZeroValueStat` - Show zero value stats in summary for consistancy +- `calcSum` - Calculate the total stats for the item +- `calcDiff` - Calculate the stat difference for the item and equipped items +- `sumSortAlpha` - Enable to sort StatSummary alphabetically, disable to sort according to stat type(basic, physical, spell, tank) +- `sumAvoidWithBlock` - Enable to include block chance in Avoidance summary, Disable for only dodge, parry, miss +- `basic` - Choose basic stats for summary + - `sumHP` - Health <- Health, Stamina + - `sumMP` - Mana <- Mana, Intellect + - `sumMP5` - Mana Regen <- Mana Regen, Spirit + - `sumMP5NC` - Mana Regen while not casting <- Spirit + - `sumHP5` - Health Regen <- Health Regen + - `sumHP5OC` - Health Regen when out of combat <- Spirit + - `sumStr` - Strength Summary + - `sumAgi` - Agility Summary + - `sumSta` - Stamina Summary + - `sumInt` - Intellect Summary + - `sumSpi` - Spirit Summary +- `physical` - Choose physical damage stats for summary + - `sumAP` - Attack Power <- Attack Power, Strength, Agility + - `sumRAP` - Ranged Attack Power <- Ranged Attack Power, Intellect, Attack Power, Strength, Agility + - `sumFAP` - Feral Attack Power <- Feral Attack Power, Attack Power, Strength, Agility + - `sumHit` - Hit Chance <- Hit Rating, Weapon Skill Rating + - `sumHitRating` - Hit Rating Summary + - `sumCrit` - Crit Chance <- Crit Rating, Agility, Weapon Skill Rating + - `sumCritRating` - Crit Rating Summary + - `sumHaste` - Haste <- Haste Rating + - `sumHasteRating` - Haste Rating Summary + - `sumDodgeNeglect` - Dodge Neglect <- Expertise, Weapon Skill Rating + - `sumParryNeglect` - Parry Neglect <- Expertise, Weapon Skill Rating + - `sumBlockNeglect` - Block Neglect <- Weapon Skill Rating + - `sumWeaponSkill` - Weapon Skill <- Weapon Skill Rating + - `sumExpertise` - Expertise <- Expertise Rating + - `sumWeaponMaxDamage` - Weapon Max Damage Summary + - `weapondps` - Weapon DPS Summary + - `sumIgnoreArmor` - Ignore Armor Summary +- `spell` - Choose spell damage and healing stats for summary + - `sumSpellDmg` - Spell Damage <- Spell Damage, Intellect, Spirit, Stamina + - `sumHolyDmg` - Holy Spell Damage <- Holy Spell Damage, Spell Damage, Intellect, Spirit + - `sumArcaneDmg` - Arcane Spell Damage <- Arcane Spell Damage, Spell Damage, Intellect + - `sumFireDmg` - Fire Spell Damage <- Fire Spell Damage, Spell Damage, Intellect, Stamina + - `sumNatureDmg` - Nature Spell Damage <- Nature Spell Damage, Spell Damage, Intellect + - `sumFrostDmg` - Frost Spell Damage <- Frost Spell Damage, Spell Damage, Intellect + - `sumShadowDmg` - Shadow Spell Damage <- Shadow Spell Damage, Spell Damage, Intellect, Spirit, Stamina + - `sumHealing` - Healing <- Healing, Intellect, Spirit, Agility, Strength + - `sumSpellHit` - Spell Hit Chance <- Spell Hit Rating + - `sumSpellHitRating` - Spell Hit Rating Summary + - `sumSpellCrit` - Spell Crit Chance <- Spell Crit Rating, Intellect + - `sumSpellCritRating` - Spell Crit Rating Summary + - `sumSpellHaste` - Spell Haste <- Spell Haste Rating + - `sumSpellHasteRating` - Spell Haste Rating Summary + - `sumPenetration` - Spell Penetration Summary +- `tank` - Choose tank stats for summary + - `sumArmor` - Armor <- Armor from items, Armor from bonuses, Agility, Intellect + - `sumDefense` - Defense <- Defense Rating + - `sumDodge` - Dodge Chance <- Dodge Rating, Agility, Defense Rating + - `sumDodgeRating` - Dodge Rating Summary + - `sumParry` - Parry Chance <- Parry Rating, Defense Rating + - `sumParryRating` - Parry Rating Summary + - `sumBlock` - Block Chance <- Block Rating, Defense Rating + - `sumBlockRating` - Block Rating Summary + - `sumBlockValue` - Block Value <- Block Value, Strength + - `sumHitAvoid` - Hit Avoidance <- Defense Rating + - `sumCritAvoid` - Crit Avoidance <- Defense Rating, Resilience + - `sumResilience` - Resilience Summary + - `sumArcaneResist` - Arcane Resistance Summary + - `sumFireResist` - Fire Resistance Summary + - `sumNatureResist` - Nature Resistance Summary + - `sumFrostResist` - Frost Resistance Summary + - `sumShadowResist` - Shadow Resistance Summary + - `sumAvoidance` - Avoidance <- Dodge, Parry, MobMiss, Block(Optional) +- `gem` - Auto fill empty gem slots + - `sumGemRed` - ItemID or Link of the gem you would like to auto fill + - `sumGemYellow` - ItemID or Link of the gem you would like to auto fill + - `sumGemBlue` - ItemID or Link of the gem you would like to auto fill + - `sumGemMeta` - ItemID or Link of the gem you would like to auto fill diff --git a/RatingBuster.lua b/RatingBuster.lua index 497b026..b2abbfb 100644 --- a/RatingBuster.lua +++ b/RatingBuster.lua @@ -50,7 +50,7 @@ end --------------------- local _ local _, class = UnitClass("player") -local calcLevel, playerLevel +local playerLevel local db -- Initialized in :OnInitialize() -- Localize globals @@ -162,26 +162,6 @@ local options = { end, dialogHidden = true, }, - enableStatMods = { - type = 'toggle', - name = L["Enable Stat Mods"], - desc = L["Enable support for Stat Mods"], - order = 2, - width = "full", - }, - useRequiredLevel = { - type = 'toggle', - name = L["Use required level"], - desc = L["Calculate using the required level if you are below the required level"], - }, - customLevel = { - type = 'range', - name = L["Set level"], - desc = L["Set the level used in calculations (0 = your level)"], - min = 0, - max = GetMaxPlayerLevel(), - step = 1, - }, pp = { type = "execute", name = "Performance Profile", @@ -1140,8 +1120,6 @@ local options = { -- Default values local defaults = { global = { - useRequiredLevel = true, - customLevel = 0, textColor = CreateColor(1.0, 0.996, 0.545), enableReforgeUI = true, @@ -1168,7 +1146,6 @@ local defaults = { sumIgnoreExtraSockets = true, }, profile = { - enableStatMods = true, enableAvoidanceDiminishingReturns = StatLogic.GetAvoidanceAfterDR and true or false, showRatings = true, detailedConversionText = false, @@ -1775,20 +1752,6 @@ function RatingBuster.ProcessTooltip(tooltip) local name, link = tooltip:GetItem() if not name then return end - --------------------------- - -- Set calculation level -- - --------------------------- - calcLevel = db.global.customLevel or 0 - if calcLevel == 0 then - calcLevel = playerLevel - end - if db.global.useRequiredLevel and link then - local _, _, _, _, reqLevel = GetItemInfo(link) - --RatingBuster:Print(link..", "..calcLevel) - if reqLevel and calcLevel < reqLevel then - calcLevel = reqLevel - end - end --------------------- -- Tooltip Scanner -- --------------------- @@ -1921,7 +1884,7 @@ end function RatingBuster:ProcessLine(text, link, color) -- Get data from cache if available - local cacheID = text..calcLevel + local cacheID = text..playerLevel local cacheText = cache[cacheID] if cacheText then if cacheText ~= text then @@ -2093,7 +2056,7 @@ do -- Combat Ratings -- -------------------- -- Calculate stat value - local effect = StatLogic:GetEffectFromRating(value, statID, calcLevel) + local effect = StatLogic:GetEffectFromRating(value, statID, playerLevel) --self:Debug(reversedAmount..", "..amount..", "..v[2]..", "..RatingBuster.targetLevel)-- debug -- If rating is resilience, add a minus sign if statID == StatLogic.Stats.DefenseRating and db.profile.defBreakDown then @@ -2179,11 +2142,8 @@ do -------------- -- Strength -- -------------- - local statmod = 1 - if db.profile.enableStatMods then - statmod = GSM("MOD_STR") - value = value * statmod - end + local statmod = GSM("MOD_STR") + value = value * statmod local infoTable = {} if db.profile.showAPFromStr then local mod = GSM("MOD_AP") @@ -2225,7 +2185,7 @@ do -- Death Knight: Forceful Deflection - Passive if db.profile.showParryFromStr then local rating = value * GSM("ADD_PARRY_RATING_MOD_STR") - local effect = StatLogic:GetEffectFromRating(rating, StatLogic.Stats.ParryRating, calcLevel) + local effect = StatLogic:GetEffectFromRating(rating, StatLogic.Stats.ParryRating, playerLevel) if db.profile.enableAvoidanceDiminishingReturns then local effectNoDR = effect effect = StatLogic:GetAvoidanceGainAfterDR(StatLogic.Stats.Parry, processedParry + effect) - StatLogic:GetAvoidanceGainAfterDR(StatLogic.Stats.Parry, processedParry) @@ -2236,7 +2196,7 @@ do end else local rating = value * GSM("ADD_PARRY_RATING_MOD_STR") - local effect = StatLogic:GetEffectFromRating(rating, StatLogic.Stats.ParryRating, calcLevel) + local effect = StatLogic:GetEffectFromRating(rating, StatLogic.Stats.ParryRating, playerLevel) processedParry = processedParry + effect end infoString = table.concat(infoTable, ", ") @@ -2244,11 +2204,8 @@ do ------------- -- Agility -- ------------- - local statmod = 1 - if db.profile.enableStatMods then - statmod = GSM("MOD_AGI") - value = value * statmod - end + local statmod = GSM("MOD_AGI") + value = value * statmod local infoTable = {} if db.profile.showAPFromAgi then local mod = GSM("MOD_AP") @@ -2269,12 +2226,12 @@ do end end if db.profile.showCritFromAgi then - local effect = value * StatLogic:GetCritPerAgi(class, calcLevel) + local effect = value * StatLogic:GetCritPerAgi() if effect > 0 then tinsert(infoTable, (L["$value% Crit"]:gsub("$value", ("%+.2f"):format(effect)))) end end - if db.profile.showDodgeFromAgi and (calcLevel == playerLevel) then + if db.profile.showDodgeFromAgi then local effect = value * StatLogic:GetDodgePerAgi() if effect > 0 then tinsert(infoTable, (L["$value% Dodge"]:gsub("$value", ("%+.2f"):format(effect)))) @@ -2313,11 +2270,8 @@ do ------------- -- Stamina -- ------------- - local statmod = 1 - if db.profile.enableStatMods then - statmod = GSM("MOD_STA") - value = value * statmod - end + local statmod = GSM("MOD_STA") + value = value * statmod local infoTable = {} if db.profile.showHealthFromSta then local mod = GSM("MOD_HEALTH") @@ -2351,11 +2305,8 @@ do --------------- -- Intellect -- --------------- - local statmod = 1 - if db.profile.enableStatMods then - statmod = GSM("MOD_INT") - value = value * statmod - end + local statmod = GSM("MOD_INT") + value = value * statmod local infoTable = {} if db.profile.showManaFromInt then local mod = GSM("MOD_MANA") @@ -2367,7 +2318,7 @@ do end end if db.profile.showSpellCritFromInt then - local effect = value * StatLogic:GetSpellCritPerInt(class, calcLevel) + local effect = value * StatLogic:GetSpellCritPerInt() if effect > 0 then tinsert(infoTable, (L["$value% Spell Crit"]:gsub("$value", ("%+.2f"):format(effect)))) end @@ -2431,11 +2382,8 @@ do ------------ -- Spirit -- ------------ - local statmod = 1 - if db.profile.enableStatMods then - statmod = GSM("MOD_SPI") - value = value * statmod - end + local statmod = GSM("MOD_SPI") + value = value * statmod local infoTable = {} if db.profile.showMP5FromSpi then local effect = value * GSM("ADD_NORMAL_MANA_REG_MOD_SPI") * GSM("MOD_NORMAL_MANA_REG") * math.min(GSM("ADD_MANA_REG_MOD_NORMAL_MANA_REG"), 1) @@ -2477,7 +2425,7 @@ do end if db.profile.showSpellCritFromSpi then local mod = GSM("ADD_SPELL_CRIT_RATING_MOD_SPI") - local effect = StatLogic:GetEffectFromRating(value * mod, StatLogic.Stats.SpellCritRating, calcLevel) + local effect = StatLogic:GetEffectFromRating(value * mod, StatLogic.Stats.SpellCritRating, playerLevel) if effect > 0 then tinsert(infoTable, (L["$value% Spell Crit"]:gsub("$value", ("%+.2f"):format(effect)))) end @@ -2487,10 +2435,8 @@ do ----------- -- Armor -- ----------- - if db.profile.enableStatMods then - local base, bonus = StatLogic:GetArmorDistribution(link, value, color) - value = base * GSM("MOD_ARMOR") + bonus - end + local base, bonus = StatLogic:GetArmorDistribution(link, value, color) + value = base * GSM("MOD_ARMOR") + bonus local infoTable = {} local effect = value * GSM("ADD_AP_MOD_ARMOR") * GSM("MOD_AP") if floor(abs(effect) * 10 + 0.5) > 0 then @@ -2501,11 +2447,8 @@ do ------------------ -- Attack Power -- ------------------ - local statmod = 1 - if db.profile.enableStatMods then - statmod = GSM("MOD_AP") - value = value * statmod - end + local statmod = GSM("MOD_AP") + value = value * statmod local infoTable = {} -- Shaman: Mental Quickness -- Paladin: Sheath of Light, Touched by the Light @@ -2792,7 +2735,7 @@ local summaryCalcData = { name = StatLogic.Stats.MeleeHit, func = function(sum) return sum[StatLogic.Stats.MeleeHit] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.MeleeHitRating], StatLogic.Stats.MeleeHitRating, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.MeleeHitRating], StatLogic.Stats.MeleeHitRating, playerLevel) + sum[StatLogic.Stats.WeaponSkill] * 0.1 end, ispercent = true, @@ -2811,7 +2754,7 @@ local summaryCalcData = { name = StatLogic.Stats.RangedHit, func = function(sum) return sum[StatLogic.Stats.RangedHit] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.RangedHitRating], StatLogic.Stats.RangedHitRating, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.RangedHitRating], StatLogic.Stats.RangedHitRating, playerLevel) end, ispercent = true, }, @@ -2829,8 +2772,8 @@ local summaryCalcData = { name = StatLogic.Stats.MeleeCrit, func = function(sum) return sum[StatLogic.Stats.MeleeCrit] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.MeleeCritRating], StatLogic.Stats.MeleeCritRating, calcLevel) - + sum[StatLogic.Stats.Agility] * StatLogic:GetCritPerAgi(class, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.MeleeCritRating], StatLogic.Stats.MeleeCritRating, playerLevel) + + sum[StatLogic.Stats.Agility] * StatLogic:GetCritPerAgi() end, ispercent = true, }, @@ -2848,8 +2791,8 @@ local summaryCalcData = { name = StatLogic.Stats.RangedCrit, func = function(sum) return sum[StatLogic.Stats.RangedCrit] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.RangedCritRating], StatLogic.Stats.RangedCritRating, calcLevel) - + sum[StatLogic.Stats.Agility] * StatLogic:GetCritPerAgi(class, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.RangedCritRating], StatLogic.Stats.RangedCritRating, playerLevel) + + sum[StatLogic.Stats.Agility] * StatLogic:GetCritPerAgi() end, ispercent = true, }, @@ -2866,7 +2809,7 @@ local summaryCalcData = { option = "sumHaste", name = StatLogic.Stats.MeleeHaste, func = function(sum) - return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.MeleeHasteRating], StatLogic.Stats.MeleeHasteRating, calcLevel) + return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.MeleeHasteRating], StatLogic.Stats.MeleeHasteRating, playerLevel) end, ispercent = true, }, @@ -2883,7 +2826,7 @@ local summaryCalcData = { option = "sumRangedHaste", name = StatLogic.Stats.RangedHaste, func = function(sum) - return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.RangedHasteRating], StatLogic.Stats.RangedHasteRating, calcLevel) + return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.RangedHasteRating], StatLogic.Stats.RangedHasteRating, playerLevel) end, ispercent = true, }, @@ -2900,7 +2843,7 @@ local summaryCalcData = { option = "sumExpertise", name = StatLogic.Stats.Expertise, func = function(sum) - return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ExpertiseRating], StatLogic.Stats.ExpertiseRating, calcLevel) + return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ExpertiseRating], StatLogic.Stats.ExpertiseRating, playerLevel) end, }, -- Expertise Rating - EXPERTISE_RATING @@ -2916,7 +2859,7 @@ local summaryCalcData = { option = "sumDodgeNeglect", name = StatLogic.Stats.DodgeReduction, func = function(sum) - return floor(StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ExpertiseRating], StatLogic.Stats.ExpertiseRating, calcLevel)) * 0.25 + return floor(StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ExpertiseRating], StatLogic.Stats.ExpertiseRating, playerLevel)) * 0.25 + sum[StatLogic.Stats.WeaponSkill] * 0.1 end, ispercent = true, @@ -2926,7 +2869,7 @@ local summaryCalcData = { option = "sumParryNeglect", name = StatLogic.Stats.ParryReduction, func = function(sum) - return floor(StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ExpertiseRating], StatLogic.Stats.ExpertiseRating, calcLevel)) * 0.25 + return floor(StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ExpertiseRating], StatLogic.Stats.ExpertiseRating, playerLevel)) * 0.25 end, ispercent = true, }, @@ -2960,7 +2903,7 @@ local summaryCalcData = { option = "sumArmorPenetration", name = StatLogic.Stats.ArmorPenetration, func = function(sum) - return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ArmorPenetrationRating], StatLogic.Stats.ArmorPenetrationRating, calcLevel) + return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ArmorPenetrationRating], StatLogic.Stats.ArmorPenetrationRating, playerLevel) end, ispercent = true, }, @@ -3069,7 +3012,7 @@ local summaryCalcData = { name = StatLogic.Stats.SpellHit, func = function(sum) return sum[StatLogic.Stats.SpellHit] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.SpellHitRating], StatLogic.Stats.SpellHitRating, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.SpellHitRating], StatLogic.Stats.SpellHitRating, playerLevel) end, ispercent = true, }, @@ -3087,8 +3030,8 @@ local summaryCalcData = { name = StatLogic.Stats.SpellCrit, func = function(sum) return sum[StatLogic.Stats.SpellCrit] - + StatLogic:GetEffectFromRating(summaryFunc[StatLogic.Stats.SpellCritRating](sum), StatLogic.Stats.SpellCritRating, calcLevel) - + sum[StatLogic.Stats.Intellect] * StatLogic:GetSpellCritPerInt(class, calcLevel) + + StatLogic:GetEffectFromRating(summaryFunc[StatLogic.Stats.SpellCritRating](sum), StatLogic.Stats.SpellCritRating, playerLevel) + + sum[StatLogic.Stats.Intellect] * StatLogic:GetSpellCritPerInt() end, ispercent = true, }, @@ -3106,7 +3049,7 @@ local summaryCalcData = { option = "sumSpellHaste", name = StatLogic.Stats.SpellHaste, func = function(sum) - return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.SpellHasteRating], StatLogic.Stats.SpellHasteRating, calcLevel) + return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.SpellHasteRating], StatLogic.Stats.SpellHasteRating, playerLevel) end, ispercent = true, }, @@ -3146,7 +3089,7 @@ local summaryCalcData = { name = StatLogic.Stats.DodgeBeforeDR, func = function(sum) return sum[StatLogic.Stats.Dodge] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.DodgeRating], StatLogic.Stats.DodgeRating, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.DodgeRating], StatLogic.Stats.DodgeRating, playerLevel) + summaryFunc[StatLogic.Stats.Defense](sum) * DODGE_PARRY_BLOCK_PERCENT_PER_DEFENSE + sum[StatLogic.Stats.Agility] * StatLogic:GetDodgePerAgi() end, @@ -3184,7 +3127,7 @@ local summaryCalcData = { func = function(sum) return GetParryChance() > 0 and ( sum[StatLogic.Stats.Parry] - + StatLogic:GetEffectFromRating(summaryFunc[StatLogic.Stats.ParryRating](sum), StatLogic.Stats.ParryRating, calcLevel) + + StatLogic:GetEffectFromRating(summaryFunc[StatLogic.Stats.ParryRating](sum), StatLogic.Stats.ParryRating, playerLevel) + summaryFunc[StatLogic.Stats.Defense](sum) * DODGE_PARRY_BLOCK_PERCENT_PER_DEFENSE ) or 0 end, @@ -3223,7 +3166,7 @@ local summaryCalcData = { func = function(sum) return GetBlockChance() > 0 and ( sum[StatLogic.Stats.BlockChance] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.BlockRating], StatLogic.Stats.BlockRating, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.BlockRating], StatLogic.Stats.BlockRating, playerLevel) + summaryFunc[StatLogic.Stats.Defense](sum) * DODGE_PARRY_BLOCK_PERCENT_PER_DEFENSE ) or 0 end, @@ -3282,7 +3225,7 @@ local summaryCalcData = { name = StatLogic.Stats.Defense, func = function(sum) return sum[StatLogic.Stats.Defense] - + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.DefenseRating], StatLogic.Stats.DefenseRating, calcLevel) + + StatLogic:GetEffectFromRating(sum[StatLogic.Stats.DefenseRating], StatLogic.Stats.DefenseRating, playerLevel) end, }, -- Avoidance - DODGE, PARRY, MELEE_HIT_AVOID, BLOCK(Optional) @@ -3306,7 +3249,7 @@ local summaryCalcData = { option = "sumCritAvoid", name = StatLogic.Stats.CritAvoidance, func = function(sum) - return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ResilienceRating], StatLogic.Stats.ResilienceRating, calcLevel) + return StatLogic:GetEffectFromRating(sum[StatLogic.Stats.ResilienceRating], StatLogic.Stats.ResilienceRating, playerLevel) + summaryFunc[StatLogic.Stats.Defense](sum) * DODGE_PARRY_BLOCK_PERCENT_PER_DEFENSE end, ispercent = true, @@ -3508,20 +3451,11 @@ function RatingBuster:StatSummary(tooltip, link) end -- Apply Base Stat Mods for _, v in pairs(statData) do - v[StatLogic.Stats.Strength] = (v[StatLogic.Stats.Strength] or 0) - v[StatLogic.Stats.Agility] = (v[StatLogic.Stats.Agility] or 0) - v[StatLogic.Stats.Stamina] = (v[StatLogic.Stats.Stamina] or 0) - v[StatLogic.Stats.Intellect] = (v[StatLogic.Stats.Intellect] or 0) - v[StatLogic.Stats.Spirit] = (v[StatLogic.Stats.Spirit] or 0) - end - if db.profile.enableStatMods then - for _, v in pairs(statData) do - v[StatLogic.Stats.Strength] = v[StatLogic.Stats.Strength] * GSM("MOD_STR") - v[StatLogic.Stats.Agility] = v[StatLogic.Stats.Agility] * GSM("MOD_AGI") - v[StatLogic.Stats.Stamina] = v[StatLogic.Stats.Stamina] * GSM("MOD_STA") - v[StatLogic.Stats.Intellect] = v[StatLogic.Stats.Intellect] * GSM("MOD_INT") - v[StatLogic.Stats.Spirit] = v[StatLogic.Stats.Spirit] * GSM("MOD_SPI") - end + v[StatLogic.Stats.Strength] = (v[StatLogic.Stats.Strength] or 0) * GSM("MOD_STR") + v[StatLogic.Stats.Agility] = (v[StatLogic.Stats.Agility] or 0) * GSM("MOD_AGI") + v[StatLogic.Stats.Stamina] = (v[StatLogic.Stats.Stamina] or 0) * GSM("MOD_STA") + v[StatLogic.Stats.Intellect] = (v[StatLogic.Stats.Intellect] or 0) * GSM("MOD_INT") + v[StatLogic.Stats.Spirit] = (v[StatLogic.Stats.Spirit] or 0) * GSM("MOD_SPI") end local summary = {} diff --git a/libs/StatLogic/Cata_Logic.lua b/libs/StatLogic/Cata_Logic.lua index 5368c27..5511f3e 100644 --- a/libs/StatLogic/Cata_Logic.lua +++ b/libs/StatLogic/Cata_Logic.lua @@ -2073,7 +2073,7 @@ function StatLogic:GetDodgeChanceBeforeDR() local dodgeFromAdditionalAgi = dodgePerAgi * (effectiveStat - baseAgi) local modDodge = dodgeFromDodgeRating + dodgeFromDefenceRating + dodgeFromAdditionalAgi - local drFreeDodge = GetDodgeChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Dodge, modDodge, addon.class) + local drFreeDodge = GetDodgeChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Dodge, modDodge) return modDodge, drFreeDodge end @@ -2102,7 +2102,7 @@ function StatLogic:GetParryChanceBeforeDR() local modParry = parryFromParryRating + parryFromDefenceRating -- drFreeParry - local drFreeParry = GetParryChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Parry, modParry, addon.class) + local drFreeParry = GetParryChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Parry, modParry) return modParry, drFreeParry end @@ -2133,14 +2133,11 @@ Formula details: ]] ---@param stat `StatLogic.Stats.Dodge`|`StatLogic.Stats.Parry`|`StatLogic.Stats.Miss` ---@param avoidanceBeforeDR number Amount of avoidance before diminishing returns in percentages. ----@param class? string|number - ClassID or "ClassName". Default: PlayerClass
See :GetClassIdOrName(class) for valid class values. ---@return number avoidanceAfterDR Avoidance after diminishing returns in percentages. -function StatLogic:GetAvoidanceAfterDR(stat, avoidanceBeforeDR, class) +function StatLogic:GetAvoidanceAfterDR(stat, avoidanceBeforeDR) -- argCheck for invalid input self:argCheck(stat, 2, "table") self:argCheck(avoidanceBeforeDR, 3, "number") - self:argCheck(class, 4, "nil", "string", "number") - class = self:ValidateClass(class) local C = C_d if stat == StatLogic.Stats.Parry then @@ -2150,6 +2147,7 @@ function StatLogic:GetAvoidanceAfterDR(stat, avoidanceBeforeDR, class) end if avoidanceBeforeDR > 0 then + local class = addon.class return 1 / (1 / C[class] + K[class] / avoidanceBeforeDR) else return 0 diff --git a/libs/StatLogic/StatLogic.lua b/libs/StatLogic/StatLogic.lua index 0295142..7b73d0a 100644 --- a/libs/StatLogic/StatLogic.lua +++ b/libs/StatLogic/StatLogic.lua @@ -109,17 +109,6 @@ do end end -function StatLogic:ValidateClass(class) - if type(class) == "number" and StatLogic:GetClassIdOrName(class) then - -- if class is a class id, convert to class string - class = StatLogic:GetClassIdOrName(class) - elseif type(class) ~= "string" or not StatLogic:GetClassIdOrName(class) then - -- if class is not a string, or doesn't correspond to a class id, default to player class - class = addon.class - end - return class -end - -- Localize globals local _G = getfenv(0) local pairs = pairs @@ -1308,15 +1297,9 @@ function StatLogic:GetDodgePerAgi() return dodgeFromAgi / agility end -function StatLogic:GetCritPerAgi(class, level) - -- argCheck for invalid input - self:argCheck(class, 3, "nil", "string", "number") - self:argCheck(level, 4, "nil", "number") - class = self:ValidateClass(class) - -- if level is invalid input, default to player level - if type(level) ~= "number" or level < 1 or level > GetMaxPlayerLevel() then - level = UnitLevel("player") - end +function StatLogic:GetCritPerAgi() + local level = UnitLevel("player") + local class = addon.class if addon.CritPerAgi[class][level] then return addon.CritPerAgi[class][level] @@ -1330,15 +1313,9 @@ function StatLogic:GetCritPerAgi(class, level) end end -function StatLogic:GetSpellCritPerInt(class, level) - -- argCheck for invalid input - self:argCheck(class, 3, "nil", "string", "number") - self:argCheck(level, 4, "nil", "number") - class = self:ValidateClass(class) - -- if level is invalid input, default to player level - if type(level) ~= "number" or level < 1 or level > GetMaxPlayerLevel() then - level = UnitLevel("player") - end +function StatLogic:GetSpellCritPerInt() + local level = UnitLevel("player") + local class = addon.class if addon.SpellCritPerInt[class][level] then return addon.SpellCritPerInt[class][level] diff --git a/libs/StatLogic/Wrath_Logic.lua b/libs/StatLogic/Wrath_Logic.lua index 79a47d6..4caf910 100644 --- a/libs/StatLogic/Wrath_Logic.lua +++ b/libs/StatLogic/Wrath_Logic.lua @@ -3372,7 +3372,7 @@ function StatLogic:GetDodgeChanceBeforeDR() local dodgeFromAdditionalAgi = dodgePerAgi * (effectiveStat - baseAgi) local modDodge = dodgeFromDodgeRating + dodgeFromDefenceRating + dodgeFromAdditionalAgi - local drFreeDodge = GetDodgeChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Dodge, modDodge, addon.class) + local drFreeDodge = GetDodgeChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Dodge, modDodge) return modDodge, drFreeDodge end @@ -3401,7 +3401,7 @@ function StatLogic:GetParryChanceBeforeDR() local modParry = parryFromParryRating + parryFromDefenceRating -- drFreeParry - local drFreeParry = GetParryChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Parry, modParry, addon.class) + local drFreeParry = GetParryChance() - self:GetAvoidanceAfterDR(StatLogic.Stats.Parry, modParry) return modParry, drFreeParry end @@ -3432,14 +3432,11 @@ Formula details: ]] ---@param stat `StatLogic.Stats.Dodge`|`StatLogic.Stats.Parry`|`StatLogic.Stats.Miss` ---@param avoidanceBeforeDR number Amount of avoidance before diminishing returns in percentages. ----@param class? string|number - ClassID or "ClassName". Default: PlayerClass
See :GetClassIdOrName(class) for valid class values. ---@return number avoidanceAfterDR Avoidance after diminishing returns in percentages. -function StatLogic:GetAvoidanceAfterDR(stat, avoidanceBeforeDR, class) +function StatLogic:GetAvoidanceAfterDR(stat, avoidanceBeforeDR) -- argCheck for invalid input self:argCheck(stat, 2, "table") self:argCheck(avoidanceBeforeDR, 3, "number") - self:argCheck(class, 4, "nil", "string", "number") - class = self:ValidateClass(class) local C = C_d if stat == StatLogic.Stats.Parry then @@ -3449,6 +3446,7 @@ function StatLogic:GetAvoidanceAfterDR(stat, avoidanceBeforeDR, class) end if avoidanceBeforeDR > 0 then + local class = addon.class return 1 / (1 / C[class] + K[class] / avoidanceBeforeDR) else return 0