• Dear Guest,

    You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode.
    To view all forum nodes and be able to create threads/posts please register or log-in with your existing account.

    TwinStar team

[RELEASE] - StatValues (for Warlocks and Mages)

Hagson

Authorized
Joined
Oct 16, 2014
StatValues
StatValues (for Warlocks and Mages) is an original addon that calculates the values of Crit, Hit and Int relative to spellpower depending on your current gear, buffs, specc and other factors. It also has the ability to simulate buffs and future gear upgrades.


The goal of the addon is to take every applicable factor into account, and get a mathematically correct answer for the age old question of "hit vs. crit" and "how much sp for a hit/crit", no longer needing to go by feeling or hearsay.

You use the addon by typing "/statvalues" or "/sv" followed by a selection of variables, for example "/statvalues print" or "/sv b".



HUq46Ux.png

Results of the "Print" and "Buffed" commands in my current gear.

pSadZoP.png

Results of the "Custom" and "Custombuffed" commands in my current gear simulating replacing Briarwood Reed with Neltharion's Tear.

About StatValues:
StatValues works by calculating how much "true damage" your bolts will do, which is the average damage when resists and crits have been factored in. It first calculates this with your current setup, then with an extra crit, hit and intellect. It then calculates how much spellpower you would need to add to reach these values, thus getting the value ratio between crit/hit/int and spellpower for maximum bolt damage. Note that the addon does not calculate dps, only bolt damage, though for Warlocks and Mages this is essentially the same thing once divided by cast time.

The addon grabs the Spellpower, Crit and Hit from your currently equipped gear and buffs. If you're a Warlock advanced calculations are made for Improved Shadowbolt, if you're specced into that. It also considers Ruin (Warlock), Devastation (Warlock), Elemental Precision (Mage), Ice Shards (Mage) and Winter's Chill (Mage). Winter's Chill simulation is enabled by default, since even if you're not personally specced into it someone in your raid likely is, and can be disabled with a command.

TheoryCraft and BonusScanner are being used to grab the Sp, Crit and Hit from your gear and buffs, so you need to have them installed and enabled for StatValues to work.

For more detail about how the values are calculated see the "Mathematical Equations" section below or, even better, read the code for yourself. It's mostly math so even if you're not well versed in programming you should be able to understand most things.


The functions


‘Print’ or ‘p’
The most common function. Gathers your stats, calculates and prints the values of hit, crit and int relative to spellpower.

‘Buffed’ or ‘b’
Like Print, but adds stats equivalent to what you would have if you had had world- and raidbuffs and consumables.
The specific stats added are:
Spellpower: Warlocks: Flask + Greater Arcane + Shadow Power + Brilliant Wizard oil = 261. Mages: Flask + Greater Arcane + Frost Power + Brilliant Wizard oil = 236.
Crit: Ony/Nef + Felwood + DM:N + Brilliant Wizard oil= 18%
Intellect: Blasted Lands + Arcane Intellect + Mark of the Wild = 68 intellect. The added benefits of Spirit of Zandalar (ZG buff), kings, if alliance, and the racial, if gnome, are also considered.
Note: Don't use this while already buffed, or it will show incorrect values.

‘Custom’ or ‘c’
Like print, but adds stats as specified by you using /script StatValues.customX = Y. You can use this to simulate future gear upgrades, unaccounted for buffs, or similar. Negative values are accepted.

'Custombuffed' or 'cb'
Combines 'Buffed' and 'Custom', allowing you to simulate altered gear with buffs.

‘Stats’ or ’s’
Gathers and prints the stats used by the addon. Spellpower, crit, hit and intellect.

‘Debug’
Prints some calculated values, so you can see where stuff went wrong, if it did. Most people will not need this information.



Other stuff of interest:
Assumptions:
Your target has 0 Shadow/Frost resistance.
The average critchange of all Warlocks in your raid is the same as your own. (Warlock only)
You (or someone in the raid) either have 5/5 Winter's Chill, or 0/5. (Mage only)

Statics:
Spellpower coefficient for Shadowbolt: 3/3.5 [1]
Spellpower coefficient for Frostbolt: (3/3.5)*0.95 [1]
Amount of Intellect required for 1% crit for Warlock: 60.6 [1]
Amount of Intellect required for 1% crit for Mages: 59.5 [1]
Base crit chance for Warlock: 1.7% [1]
Base crit chance for Mages: 0.02% [1]
Base damage for Shadowbolt: 529 [2]
Base damage for Frostbolt: 464 [2]

See the bottom of the document for sources.

Mathematical equations:
True damage:
DMG = HitEffect * CritEffect * SPEffect = (0.83 + Hit) * CritEffect * (Base + (Coeff * SP))
See statics for values of Coeff and Base.
Values of SP, Crit and Hit are gathered by the addon prior to running these methods.
CritEffect varies for Warlock and Mage.

CritEffect:
For mages it’s very simple;
CritEffect = (1 + Crit)
but for Warlocks it’s more complicated due to Improved. Shadowbolt.
If you are specced into this, the below is calculated, else it’s the same as for mages.
CritEffect = (1 + Crit) + ((0.2 + (0.2 * (1 - Crit) * 3)) * Crit)
1 + Crit is the standard crit damage gain.
0.2 is the base bonus, a crit will always give this bonus.
0.2 is the bonus lost per charge lost due to crits wasting charges, (1 - Crit) is the chance not to crit, and 3 is the amount of stacks lost after removing the first one which will always benefit you.
If you are only partly specced into Improved Shadowbolt, the value that is currently 0.2 will be changed to reflect this. For example if you’re 3/5 Improved Shadowbolt it would be 0.04 * 3 = 0.12.
To better understand this, try the calculations with a couple of examples, for example 0%, 10% and 100% crit, and see how it affects the outcome.
Please note that you do not need to factor hit rating into this, since a “would-be” crit which is resisted still applies the debuff, [3] and the change for a "crit to miss" is equal to the change for a "miss to crit", so they cancel eachother out. (1 - Hit) * (Crit) = (Crit) * (1 - Hit)

Statvalues:
We will use the Crit Value calculation for Warlocks in this example, since it's the most complex and therefore shows off all the calculations.
We solve for CritValue by breaking out the spelldamage part of the True Damage calculations, and then subtracting the original damage, thus answering the question “How much spellpower do I need in order to gain as much damage as I gain from 1% extra crit?”.
NewDamage = (CritEffect * HitEffect * SPEffect)
NewDamage / (CritEffect * HitEffect) = SPEffect = Base + (Coeff * SP)
NewDamage / (CritEffect * HitEffect) - Base = Coeff * SP
(NewDamage / (CritEffect * HitEffect) - Base) / Coeff = SP
Thus we see how much SP we need in order to achieve the same damage, had we not had the extra crit.
SP - OldSP = NewSP
NewSP is how much SP we need to add to our original SP, and this is the number we’re interested in.


TL,DR:

  • Install addon.
  • Type "/sv p" and "/sv b".
  • Gear accordingly.



For more information see the attached readme.

If you have any questions about how the addon works, or if you think is anything is wrong feel free to write so here.

Download link


Changelog:

  • Ver 1.1: Changed “buffed” and “custombuffed” commands to use the ZG buff (Spirit of Zandalar) and Brilliant Wizard Oil instead of Wizard Oil for both classes, and Elixir of Frost Power for mages.
    Warlocks now gain 261 instead of 249 SP, Mages now gain 236 instead of 209 SP, both now gain 19% instead of 18% crit when buffed, and the int gain is increased by 15 percentage points.
    Also fixed a bug with Warlocks with Ruin and Mages without 5/5 Ice Shards.
  • Ver 1.0: Public Release

Sources:

  1. Big TheoryCraft Thread (http://forum.twinstar.cz/showthread.php/57011-Big-TheoryCrafting-Thread)
  2. Original Research
  3. Video of a “Resisted Crit” http://www.dailymotion.com/video/x3d2w8m
 
Last edited:
Greetings,

I found this addon to be "the best friend of every caster". Keep up the good work.

I have a qustion tho about that number "0.87" from DMG = HitEffect * CritEffect * SPEffect = (0.87 + Hit) * CritEffect * (Base + (Coeff * SP)). Where does it come from ? Also, is that formula accurate for fire mages using fireball coeff too?
 
Last edited:
0.87 was a typo in the explanation (the addon correctly uses 0.83).
0.83 is used because that is your chance to hit vs. a level 63 mob (bosses count as 63) without any added hit chance.

At the moment the addon only works for frost- and shadowbolt. Making it work for fireball (and ignite) would be quite a lot of work, but I might do it as AQ draws nearer.
 
Hey Hags, any way to get it to show true bolt dmg with 8/8 NW bonus?

True bolt damage would not change with netherwind, since that only affects the cast time (aka more dps, but not more damage per bolt).

If you want to approximate the DPS gain you could look at it this way though: 10% to reduce cast time from 2.5s to 1.5, is 10% chance to reduce cast time by 1.0s, is average 0.1s cast time reduction, is average 2.4s cast time. 2.5/2.4 ~ 1.04167
Average 4.2% DPS gain, assuming optimal conditions. In reality it will be a bit lower, since your first bolt will always have 2.5s cast.

This is DPS though, not bolt damage, which means we have to assumes a whole bunch of other things such as infinite mana and never moving.
 
Alright Hags, thanks. =) I'm going to +1 about making it viable for calculating Fire aswell.
 
Please note that you do not need to factor hit rating into this, since a “would-be” crit which is resisted still applies the debuff, [3] and the change for a "crit to miss" is equal to the change for a "miss to crit", so they cancel eachother out. (1 - Hit) * (Crit) = (Crit) * (1 - Hit)

This devalues hit a lot. Melee's are facing crit cap, where attacks which don't hit can't crit, but caster dps doesn't have this issue. Not sure if this is working as intended.

Resisted Shadow Bolt should never apply Improved Shadowbolt if you ask me.

Edit: Don't enemies have innate resistances which can't be negated? (MobLevel - PlayerLevel)*5?
 
Last edited:
This devalues hit a lot.
No. Not only does this only applies to spells where the debuff is not the "main thing" but can apply debuffs, for example Improved Shadowbolt. A resisted shadowbolt crit applies the debuff, but deals no damage. Also keep in mind a Shadowbolt which crits can have its debuff part resisted, like I explained in the post you qouted. This negates the effect of this "resisted crit" system, and the average will be the same, like I concluded in the post you qouted. This only adds some extra variation and RNG.


Melee's are facing crit cap, where attacks which don't hit can't crit, but caster dps doesn't have this issue. Not sure if this is working as intended.
Melee attacks are on a one-roll system, whereas caster attacks are on a two roll system. Because of this the caster critcap is 100%, which noone will reach.
This is the way it should function in vanilla.

Edit: Don't enemies have innate resistances which can't be negated? (MobLevel - PlayerLevel)*5?
Not as far as I know. However you will aways have 1% chance to miss, you can never reach 100% (which the addon handles).
 
It's my personal opinion that it's an eyesore for me to see missed spells apply improved shadowbolts, or to see critical shadowbolts not apply ISB. The way it is working now is actually better for the player with regards to aggro management.

That's why I wrote "if you ask me" at the end.

I'll try the addon out for sure! :D
 
How come im getting "165: attempt to index nil value" when typing /sv p. I have theorycraft and bonus scanner addons installed.
 
How come im getting "165: attempt to index nil value" when typing /sv p. I have theorycraft and bonus scanner addons installed.

At row 165 the addon gathers the critchance for shadowbolt from theorycraft. Please double check that you have an up to date version of theorycraft installed and enabled.
 
I am using Theorycraft Version 1.06.5 (think thats the highest that works on vanilla?) and it is working in game no problem
 
BonusScanner doesn't take into account the 3P Bloodvine bonus for Tailors. To make up for it, type this before you start any operation, it will add 2% crit to your character:

/script StatValues.customCrit = 0.02
 
Hagson any other ideas what could be causing this issue?

I'm not at my computer so I cant check what version of Theorycraft I'm using. I would try disabling any addons that could interfere, or try another version of theorycraft, as well as remove all .wtf files related to Theorycraft.
So long as you are a Warlock, and have rank 9 Shadowbolt trained the issue is most likely with Theorycraft.
 
Ohhh I didnt realize this only worked for level 60's.....im currently lvl 43 so only rank 6 shadowbolt. Thanks!
 
Re: StatValues (for Warlocks and Mages)

Version 1.1 released: Changed “buffed” and “custombuffed” commands to use the ZG buff (Spirit of Zandalar) and Brilliant Wizard Oil instead of Wizard Oil for both classes, and Elixir of Frost Power for mages.
Warlocks now gain 261 instead of 249 SP, Mages now gain 236 instead of 209 SP, both now gain 19% instead of 18% crit when buffed, and the int gain is increased by 15 percentage points.
Also fixed a bug with Warlocks with Ruin and Mages without 5/5 Ice Shards.


Before you ask about ignite: It's a lot harder than shadow- and frostbolt due to the increased amount of variables, and the increased variance. You have to calculate the damage benefit from critting when ignite has 0, 1, 2, 3, 4, and 5 stacks and the chance of it having these different stacks. You also need to know how many mages are in the raid and (for it to be perfect) their crit chance. If someone has a smart way to do this, or comes up with some different way to account for it im all ears.

BonusScanner doesn't take into account the 3P Bloodvine bonus for Tailors. To make up for it, type this before you start any operation, it will add 2% crit to your character:

/script StatValues.customCrit = 0.02

Looking back at this comment I realise it (and I) was mistaken. While it might be true that BonusScanner doesn't take the set bonus into account, TheoryCraft (which is used for gathering crit data) does.

So you don't need to use any custom parameters for the Bloodvine setbonus, Theorycraft handles it.
(You can test this with /sw s (or check the code) if you dont believe me)
 
Last edited by a moderator:
Love the addon! Only issue Im having is that everytime I relog it increases my crit by 5%. The only way I have found to correct it is by taking all my gear off and on again.
 
That's a weird bug. The addon doesn't actually save any data, everything is generated when running the commands, so it's very weird that that should happen.
I am also unable to reproduce this, maybe it's a bug with theorycraft (which is used to gather crit data) and some special item?
 
Never heard about your stuff nor am I German.
I did get some of the stats about mages from a German guildie, so perhaps he has seen your stuff?

@Sasha
The download is linked twice in the initial post. I updated the links when updating the addon, so there are no longer any links to version 1.0
 
But I just explained they are not

I don't even speak german, how could I steal something I can't even read?
 
Top Bottom