-
Notifications
You must be signed in to change notification settings - Fork 22
fix Boss avoidance value (#452) #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jdelvare
wants to merge
2
commits into
BreakBB:master
Choose a base branch
from
jdelvare:fix-issue-452
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't
Data:GetDefenseValue()suffice here? We use it for enemy miss chance as well 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately
Data:GetDefenseValue()is based onUnitDefense()which takes talents into account. Specifically when testing on my level 70 paladin, this function returns 370 and not 350, because of talent Anticipation 5/5. However the parry chance penalty that should be applied must be computed by comparing the player's base Defense (without gear nor talents) with the attacker's base weapon skill.I looked for an API function which would return the base Defense value, without talent modifiers, but could not find any. If you know of a way to obtain this value, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, your use of
Data:GetDefenseValue()to compute the chance to be critically hit and the chance to be missed, is correct, because this function adds both values returned byData:GetDefenseValue(). While each value is individually incorrect (the talents contribution should be in the second value, not the first value in my opinion), the sum is right.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simulator is using full defense here https://github.com/wowsims/tbc-new/blob/aa7b0e67211802856ef7e78e9d16be8498b5cff8/sim/core/unit.go#L913
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But method
Unit.GetTotalAvoidanceChanceis not called anywhere, so this is all effectively dead code. I can't see how that code could be correct anyway as the enemy's attack skill is not even factored in.OTOH, I tested my gear in the online simulator at https://www.wowsims.com/tbc/paladin/protection/ and it displays the same (same-level) Dodge chance %, Parry chance % and Block chance % as the current ECS code and the default WoW BC interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So @jdelvare @Alessandro-Barbieri are we fine with the current implementation of the fix then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think the proposed fix should be applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
Blizzard is using full defense in the paperdoll
https://github.com/Gethe/wow-ui-source/blob/4cca594e4db26f8addc25b0c08aba144b00d2b67/Interface/AddOns/Blizzard_CharacterFrame/TBC/PaperDollFrame.lua#L598
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is only used to display extra details for the Defense skill in the paperdoll view. It tells the player how much Defense contributes to Dodge, Parry and Dodge chance. It is not used to compute the Dodge, Parry and Block chance values, because the contribution from Defense is already included in the values returned by GetDodgeChance(), GetParryChance() and GetBlockChance(). It is thus irrelevant to this pull request, and more generally to the functions this pull request is modifying.
I would add that function GetDodgeBlockParryChanceFromDefense() in Blizzard's UI does not actually use the full defense. It starts from the full defense value, yes, but then subtracts UnitLevel("player")*5, which is essentially equal to the base defense (except during leveling). So in practice, this function uses the defense from gear and consumables to compute the contribution to Dodge, Parry and Dodge chance, not the full defense value. As a matter of fact, if you display the Blizzard paperdoll tooltip for Defense on a non-tank character (no defense gear), the value displayed is 0.00%, even though the base defense Skill is not 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afterall I got at the same formula you used but from different premises
See #452 (comment)
I only ask you to remove the comment above because it's misleading, the formula should be correct even if you have unleveled defense.