Looking4Group / L4G_Core

Looking4Group Core
http://looking4group.eu
GNU General Public License v2.0
37 stars 69 forks source link

[Core Mechanics] Spells vs Resistance #3240

Open vexxedd opened 7 years ago

vexxedd commented 7 years ago

This post will be long, but it will provide all information about how should Spells vs Resistance work and why it's working or might work wrong in some cases. I was actually wrong on some points, but guess that research was healthy for everyone, even myself.

If you want to know what is actually wrong on L4G server skip to # 4. All tests on pet are tests on felhunter with 238 all resists. All tests on player are on warlock with 70 all resists (non-undead 5/5 master demonologist). All tests are without spell penetration.

1. Binary Spell vs. Non-Binary Spell

Talking about spells, there are different types of them. Instant spells, cast spells, spells that are doing instant damage, spells that are providing DoT effect, spells that are doing damage and providing some CC (frost nova). But all spells in WoW are determined by hidden value Binary or Non-Binary.

http://wowwiki.wikia.com/wiki/Resistance?oldid=2297931

Binary spells are spells which deal a debuff (like Frost Nova or Vampiric Embrace)

Non-binary spells are spells which only deal damage (like Fireball or Shadow Bolt)

Here is another description by Blizzard:

Binary - "most spells" Non-binary - "direct-damage spells (spells that deliver their full damage upon impact, such as Fireball, Mind Blast, and Earth Shock)"

There are few tricks and exceptions though:

So taking in mind those points we can assume:

This is very important gradation because there are 2 rules which are working depending on whether it is Binary Spell or Non-Binary Spell.

2. Binary Resist

http://wowwiki.wikia.com/wiki/Resistance?oldid=2297931 http://wowwiki.wikia.com/wiki/Formulas:Magical_resistance https://web.archive.org/web/20090206211016/http://www.worldofwarcraft.com/info/basics/resistances.html

For binary spells: resistance reduces the chance for the binary spell to land by a certain percentage.

The higher your resistance score in relation to the level of the attacking caster, the higher your average resistance percentage, up to a maximum of 75%. Against most spells, this resistance percentage is the straight % chance to completely resist the spell. ("most spells" here - are Binary Spells)

For binary spells, both spell penetration and spell hit rating can be used to overcome resistances.

If 1 point of penetration just removes 1 point of resistance (PROOF), spell hit formula on Binary spells is a little different. https://web.archive.org/web/20080518164254/http://www.wowwiki.com/Spell_hit_rating

For binary spells that do not partially resist, the resistance mitigation is combined with the spell hit chance to give an overall percentage for the spell to land or be resisted. The chance to hit is multiplied by the mitigation factor from the resistance to give an overall chance to hit. For the following formula, B is base chance to hit with spells, H is increased chance to hit from gear and talents, and R is the mitigation factor given from resistance.

(B + H) * R

For example, a caster with 6% increased chance to hit, attacking a mob 3 levels higher (83% base chance) that has enough resistance to mitigate 50% of spell damage, the overall chance to hit with a binary spell is 44.5%

(83% + 6%) * 50% = 44.5%

What is mitigation factor from resistance? Well it's bascially "Average Resistance". Formula for "Average Resistance"

Average Resistance = (Target's Resistance / (Caster's Level * 5)) * 0.75

Why is it called "average resistance"? For spells that have a non-damage effect—such as slow, root, stun - you'll either take the hit or avoid the hit altogether; these are examples of binary spells. The average resistance is the chance you'll totally avoid the hit. Adding the word "average" is a little redundant in this case.

If we try to cast Silence (on a warlock with 70 shadow resist (non-undead with 5/5 Master Demonologist) on the long distance we should have 15%+(1% miss with bonus 3% hit rating) resist.

Resistance = (70 /( 70 * 5)) * 0.75 = 15%

If we add for example 40 spell penetration with pvp off hand and cast Silence on the same target, calculation will be like this

Resistance = ((70-40) / (70 * 5)) * 0.75 = ~6%

Here is table of SpellHit vs Level in PvP and PvE. resist vs level Level 70 player will have 96% chance to hit another Level 70 player without any hit rating. Take in mind that, there are always 1% miss chance, or in other words, maximum SpellHit is 99%.

Chance to hit can be increased by talents or gear with spell hit rating up to a cap of 99%.

Also

Talents and gear combined, chance to hit with spells cannot exceed 99%

So if you PvP spell hit capped (3%) there will be NO difference, if you have additional spell hit on items or spell hit on talents. However

Note that some classes (for example Paladins and Rogues) can spec to gain extra chance to have spells miss them. Also, some abilities (e.g. - Cloak of Shadows) gives the player using the ability extra chance to have spells miss as well. Extra spell hit does in fact mitigate this extra chance to miss, but is otherwise useless.

This should be taken into considering.

3. Non-Binary Resist

For non-binary spells, resistance increases the chance to suffer only a fraction of the spell's normal damage. In The Burning Crusade, the percent resisted had a chance to be 0%, 25%, 50%, 75%, or 100%. The probabilities were weighted such that the average damage mitigated worked out to the same percentage as with binary spells.

https://web.archive.org/web/20080113124757/http://www.wowwiki.com/Resistance#Resistance_caps

Instead of Resist/Hit Non-Binary spells are rolled to do 100% (full effect)/75%/25%/0% (full resist) of damage

Table of Resist level You can only mitigate Non-Binary resists with Spell penetration. So if you are warlock, with 70 resists and eating Pyroblast in your face, you have 54% to take full damage of that Pyroblast, and another 46% distributed between 25%/50%/75% damage reduction. With that level of resistance, you have 0% to fully resist that spell (Take in mind, there are always 1% MISS chance, that also described as "resist" in BC).

4. What is actually wrong right now (or correct)

Alright, let's end with nerd shit, actual problems:

Drain Life Drain Life (a bit larger distance, 250 casts) with 33 spell penetration. Should be ~8%(+1%) - got 8.4%

Drain Life+penet

shadowbolts

UPD - Seems like it works correctly afterall. No talent no res

3/3 Demonic Resilience talent

Summarizing everything above. There are not that many problems.

miraco commented 7 years ago

I dont know if this belongs to this thread, but every boss should have a base resistance calculated from this: Base resistance for each magic school Formula: (4/3)(Caster Level /10) (Boss Level - Caster Level)

I had a WoW wiki thread about this but atm i dont find it.

miraco commented 7 years ago

I found the discussion we had on another privat realm about this: http://www.excalibur-nw.com/forum/tracker/issue-5457-swp-brutallus/

NPCs should have a base resistance that can not be reduced by CoE or Spell Pen.

AnonXS commented 7 years ago

https://github.com/OregonCore/OregonCore/commit/5a0e00a2c9c09296c80ba0421c2b281ee45b3ce5 https://github.com/OregonCore/OregonCore/commit/a7bf446e83c7b66647b11ec4d8468d22c2526a7d https://github.com/OregonCore/OregonCore/commit/ac029069ef70b92e8d3fc0e37d182b0a6f610a0d