Skip to content

Mechanics Details

Tim Hultman edited this page Jun 28, 2019 · 20 revisions

Explanation

This page specifies how certain mechanics are implemented. We make no claims this is how Classic, Vanilla, or any private server worked/will work. We make this available to be transparent about how fundamental mechanics are modeled that are essential for the correctness of the tool. By providing this transparency the goal is that theorycrafters and domain experts can contribute without needing to understand the code. This page is aimed to always be up-to-date. If you find discrepancies in this page from how the actual code works, then consider opening an issue.

Missing a mechanic that you would like clarification on? Consider opening an issue.

Glancing Blows

Chance of Glancing Blow

Implemented as a stacking 10% chance, starting at 0% at (tlvl - plvl) <= -1, to 40% at (tlvl - plvl) >= 3.

Example: player level 60 vs 59 target has a 0% chance for a glancing blow, and vs 63 target player level 60 has a 40% chance for a glancing blow.

Note that Auto-Shot cannot glance.

Weapon Skill Impact

Glancing blows afflict a damage penalty on the affected melee swing. The penalty is rolled in a range of values, where the min and max of the range is dependent on target defense to weapon skill delta.

The penalty range averages to the following penalties where t_defense - wpn_skill is:

  • 15 - 65%
  • 10 - 85%
  • 5 - 95%
  • 0 - 95%

In other terms, the first +5 weapon skill points yield a significant boost to the final glancing blow damage. Between +5 to +10 the damage is slightly increased. After +10 there are no improvements in glancing blow damage.

Max penalty

The minimum value in the range (thus the maximum penalty) is calculated in the following way:

1.3 - 0.05 * (t_defense - wpn_skill)

The value is also capped at 0.55 minimum, and 0.91 max.

Min penalty

The maximum value in the range (thus the minimum penalty) is calculated in the following way:

1.2 - 0.03 * (t_defense - wpn_skill)

The value is also capped at 0.75 minimum, and 0.99 max.

Chance-on-hit Effects

The generic chance on hit effects are found on many items and can deal any school of damage (including physical). The current implementation of the chance-on-hit effects have the following implications:

1. Cannot proc recursively.

Example: the nature damage proc on Misplaced Servo Arm cannot trigger the nature damage proc.

2. Certain procs can trigger other procs, but most procs cannot.

The following procs can trigger more procs:

  • Extra attacks from Windfury Totem, Hand of Justice, Ironfoe, etc.
  • Seal of Command (see Seal of Command section below for more details).

3. All procs are only allowed a single successful trigger during a proc check.

As noted in (2) certain procs can trigger other procs. There is a restriction however that during a single proc "session" all active procs can only be triggered once in total.

Example:

Assume 3 procs are active; Fiery Weapon, Extra Attack, Misplaced Servo Arm. A possible proc check would be:

Mainhand procs Fiery Weapon, Extra Attack, but not Misplaced Servo Arm.

Extra Attack procs Misplaced Servo Arm.
Fiery Weapon and Extra Attack (itself) are ignored because they have already procced that session.

4. Mainhand and offhand have equal chance to trigger procs.

While probably true in general for weapon procs there are reports that for trinket procs this seem to not necessarily be the case. This is planned to be investigated further to find out if offhand proc rates should be less than its mainhand equivalent.

Extra attack procs

Extra attack procs were infamous during vanilla for the propensity of one-shotting mobs due to recursive effects. The implementation of extra attack procs is difficult to model since it is difficult to know what the exact behavior should be, and in particular its interaction with other procs. The extra attack effects follow the same rules as the general chance-on-hit procs described above. Thus the current implementation has the following implications:

1. Cannot proc recursively.

An extra attack from Hand of Justice cannot trigger another extra attack from Hand of Justice.

2. Can trigger extra attacks from other sources.

An extra attack from Windfury Totem can trigger Hand of Justice, and vice versa.

3. Cannot indirectly trigger itself via other sources.

Windfury Totem cannot trigger a Hand of Justice attack that then triggers Windfury Totem, and vice versa.

4. Can trigger other procs.

An extra attack can trigger e.g. Fiery Weapon, assuming the proc has not already succeeded during that proc "session" (see Chance-on-hit Effects above).

5. Rolls on the entire hit table.

Extra attacks can miss/dodge/parry/block/block crit/glance/hit/crit.

6. Provides Rage and renews seals.

Extra attacks do provide rage, renew seals, and other such effects that regular auto attacks have.

7. Mainhand swing-timer is reset on extra attack procs.

Extra attack effects will reset the mainhand swing timer.

Seal of Command proc

1. The damage hit is delayed by 0.5 seconds after its initial proc.

Unlike the regular extra attack effects the Seal of Command proc check that determines whether Seal of Command was triggered or not is decoupled from the damage hit and its subsequent proc check. The damage hit occurs 0.5 seconds after the event that triggered the Seal of Command proc.

2. During the 0.5 second delay window it is not possible to queue further Seal of Command procs.

Even if the user has a weapon with 10s attack speed (yielding >100% proc rate on SoC) and 10000000000000% increased attack speed, Seal of Command will never occur more often than every 0.5 seconds.

3. Cannot proc recursively.

According to Chance-on-hit Effects(1) the initial Seal of Command proc may not proc itself. Further, according to (2) multiple Seal of Command procs "in the air" is not possible. Further, when the actual damage hit occurs after the 0.5 second delay, Seal of Command is "pre-triggered" so it is excluded from the proc check.

4. Can trigger all procs except itself.

Since the damage hit and subsequent proc check is decoupled with a 0.5 second delay from what originally triggered Seal of Command all procs are available to be triggered again (except itself, see (3) regarding pre-triggering the proc).

Example: Assume the following procs are available: Extra Attack, Fiery Weapon, Seal of Command.

A possible proc check would be

Mainhand attack triggers Extra Attack, Seal of Command, but not Fiery Weapon.
Extra attack triggers Fiery Weapon, but ignores itself and Seal of Command as they have triggered already.

0.5 seconds later:

Seal of Command triggers Extra Attack, Fiery Weapon.
Extra Attack cannot trigger anything as Seal of Command has been pre-triggered, and Fiery Weapon already triggered.

Attack speed effects

Implemented as immediate effects; increased attack speed effects immediately updates the swing timer and the next attack. When lost, the attack speed immediately delays the next swing. Note: this implementation will likely have to change as data become available. Although the chosen implementation is more precise, it seems the actual mechanic in place during vanilla updated the swing-timer on the next attack.

Example of gaining and losing an attack speed buff

Assume wielding a single weapon with 2s weapon speed.

Planned attacks:

  • 0.0 Mainhand
  • 2.0 Mainhand
  • 4.0 Mainhand
  • etc.

Then the following occurs if an increased attack speed effect is gained:

  • 0.0 Auto-attack HIT
  • 1.0 You gain Super Flurry of 100% Attack Speed: Reduce the 50% remaining on the swingtimer by 1 / (1 + 1), or 50%.
  • 1.5 Auto-attack HIT, next attack at 2.5
  • 2.5 Auto-attack HIT, next attack at 3.5
  • 3.5 Auto-attack HIT, next attack at 4.5
  • 4.0 You lose Super Flurry of 100% Attack Speed: Increase the 50% remaining on the swingtimer by (1 + 1), or 100%.
  • 5.0 Auto-attack HIT, next attack at 7.0
  • 7.0 Auto-attack HIT, next attack at 9.0
  • etc.

Spell tables

The implementation of spells dealing damage in schools other than physical uses a two-roll system.

  1. Roll to hit based on delta between target level and player level, adjusted by spell hit talents / equipment.
  2. If miss do not continue.
  3. If full resist do not continue.
  4. Roll crit.

This implies that spells has to hit before they can crit, unlike abilities rolling on the physical ability table (which uses a one-roll system).

The hit-check in (1) cannot be reduced below 1% and cannot exceed 39% (as returned by get_spell_miss_chance_from_lvl_diff in Mechanics/Mechanics.cpp). Example: a lvl 60 player vs a 63 target suffers a 17% miss chance, 16% of which can be mitigated via talents / equipment.

The full resist check in (3) does not trigger any spell hit effects if the spell is indeed fully resisted. Or more truthfully, they should not trigger spell hit effects, but because this is implemented on a per spell basis it has to be tested individually to make sure there are no inconsistencies.

Regarding (4): because crits are rolled on the subset of attack attempts that actually land and deal damage the percentage of crits per spell will always seem (and is) lower than the character sheet spell crit.

Partial resist table

The roll for determining partial resists uses a table that is based on the target's resistance to the specific magic school. The implemented table should (barring any bugs) implement a behavior identical to the table given in this link for a private server implementation. The implementation is found in Mechanics.cpp, and in particular the get_partial_N_chance where N is 25, 50, 75, and get_full_resist_chance for full resists.