Secrets wrote:Annaise16 wrote:Egoish wrote:Correct me.if i am wrong but in the old system my "base" chance to avoid from stats is basically removed by my attackers main stat so only the tactic/rr/other bonuses applied...
Yes. That's why it was changed. The effect of weaponskill or strength on items was virtually worthless, and now it is viable to do a defensive or hybrid build of your base stats where before it wasn't.
I don't know how to explain this any further without actually copy and pasting the code we use, so here you go.
//Parry/Dodge/Disrupt chance from tooltip
double secondaryDefense = (((defensiveStat) * 100) / ((target.EffectiveLevel * 7.5 + 50) * 7.5));
//Contestion based on offensive stat.
double removedDefense = (((offensiveStat) * 100) / (((caster.EffectiveLevel * 7.5) + 50) * 7.5));
secondaryDefense += target.StsInterface.GetTotalStat(Stats.Parry);
removedDefense += caster.StsInterface.GetStatLinearModifier(Stats.ParryStrikethrough);
removedDefense = (removedDefense * caster.StsInterface.GetStatPercentageModifier(Stats.ParryStrikethrough));
double baseRoll = 0d;
baseRoll += removedDefense;
if (ability != null)
secondaryDefense += ability.Defensibility;
double finalRoll = (StaticRandom.Instance.NextDouble() * (100d + baseRoll));
if (secondaryDefense >= finalRoll)
{
DoParry();
}
You haven't defined what a number of terms in the code mean, so a simple example with numbers would have been better. I'll try to decode it so you can check if we are interpreting it in the same way. The examples i give will be for level 40 toons and the defence type will be parry.
//Parry/Dodge/Disrupt chance from tooltip
double secondaryDefense = (((defensiveStat) * 100) / ((target.EffectiveLevel * 7.5 + 50) * 7.5));
This port is clear. It represents the defensive stat contribution. So if a level 40 toon's weapon skill = 450,
secondaryDefense = 17.14.
//Contestion based on offensive stat.
double removedDefense = (((offensiveStat) * 100) / (((caster.EffectiveLevel * 7.5) + 50) * 7.5));
This port is clear. it represents the strikethrough component due to the attacker's stats. So if level 40 had 1050 Strength,
removedDefense = 40.
secondaryDefense += target.StsInterface.GetTotalStat(Stats.Parry);
You haven't defined what "target.StsInterface.GetTotalStat(Stats.Parry)" means, so I'm going to have to make a guess. I guess it is the sum of the + x% bonuses. So if a Witch Elf is getting +10% to parry from dual-wielding, +10% from using the Swift Blades tactic, +10% parry from speccing renown points, and +3% Parry from gear, then the total would be +33% Parry. This is then added to the secondaryDefense value calculated above:
secondaryDefense = 17.14 + 33 = 50.14
removedDefense += caster.StsInterface.GetStatLinearModifier(Stats.ParryStrikethrough);
Again, you haven't defined what "caster.StsInterface.GetStatLinearModifier(Stats.ParryStrikethrough)" means. I assume it is the sum of the attacker's strikethrough +x% modifiers. Let's assume a Swordmaster is getting +10% Strikethrough from using the Discerning Offense tactic, and +3% strikethrough from gears. This would give a total of +13 strikethrough which would then be added to the initial removedDefense value:
removedDefefense = 40 + 13 = 53
removedDefense = (removedDefense * caster.StsInterface.GetStatPercentageModifier(Stats.ParryStrikethrough));
double baseRoll = 0d;
baseRoll += removedDefense;
Again, you have not defined this term "caster.StsInterface.GetStatPercentageModifier(Stats.ParryStrikethrough)" and it seems unsual. I can not think of an example of a percentage modifier that isn't added linearly. Can you give an example of one? For this example I'll assume this term equals 1, and that the baseRoll = removedDefense = 53.
if (ability != null)
secondaryDefense += ability.Defensibility;
This looks like check for the undefendable ability that each tank class has and Sever Blessing on WH/WE, etc.
double finalRoll = (StaticRandom.Instance.NextDouble() * (100d + baseRoll));
if (secondaryDefense >= finalRoll)
{
DoParry();
This part is clear. It is the final contested roll. You have added the baseRoll to 100 and then generated a random number between 0 and (100 + baseRoll). For my example, this would be a number between 0 and 153. You then call this number finalRoll. The defender successfully parries if their secondaryDefense value is larger than the finalRoll value.
The problem with the method you have used is that it makes the strikethrough linear modifiers basically worthless. I outlined why this is the case in my previous post. (I'm not sure what affect it has on the multiplicative modifiers as I can not think of any examples f this as I explained earlier. There are at least two possible ways of fixing this. I'll outline these below.
First Possible Fix
As I explained in an earlier post, the contested check that you do when you generate the random number finalRoll and compare secondaryDefense with the random number is mathematically equivalent to dividing secondaryDefense by (100 + baseRoll) and then comparing this with a random number between 0 and 1. So we can calculate the contested value as a percentage.
We could do the same thing earlier in the sequence of calculations. So instead of having a contested roll after adding all the percentage modifiers, we could simply do the contested roll based on the initial, stat-based defense and strikethrough values. We could then add the linear percentage modifiers and subtract the linear strikethrough modifiers.
defense percentage = 100% x (((defensiveStat) * 100) / ((target.EffectiveLevel * 7.5 + 50) * 7.5)) / (100 + (((offensiveStat) * 100) / (((caster.EffectiveLevel * 7.5) + 50) * 7.5)) + x% linear defense modifiers - y% linear strikethrough modifiers
This fix would combine the new method of stat-based defense with the old method of adding and subtracting linear modifiers. It has the advantage of restoring the value of strikethrough modifiers, while also improving the value of all of the linear defense modifiers.
Second Possible Fix
The purpose of this fix is to restore the value of the strikethrough modifiers. It assumes that you really want to nerf all of the defense modifiers from abilities such as Eagle's Flight, Suppression, Wall of Darting Steel, etc, as well as all of the parry/dodge/disrupt/block tactics, renown, and gear.
So to restore the value of the strikethrough modifiers, they should be subtracted from the defender's secondaryDefense value instead of being added to the attacker's removedDefense value. So, this would look like:
secondaryDefense = (((defensiveStat) * 100) / ((target.EffectiveLevel * 7.5 + 50) * 7.5)) + x% linear defense modifiers - y% strikethrough modifiers
You would then make the contested check as you are currently doing.