2012-03-02, 11:23 PM
The reason for this, which took me a bit to discern poking through Fiel's decompiled code, is:
Each attack gets 6 random numbers.
It cycles through these in order, using the next every time it needs a random input, instead of an expensive random number call each time (on a 12 hit attack, it would need ~60 random numbers, this way 6 always suffices and performance is even between classes. Plus, since they're passed in as an array of 6 numbers, less function calls).
Blast, in certain conditions (against boss flagged mobs, maybe elsewhere) ends up using exactly 6 per hit, resulting in each hit using the same for each attribute, dealing the same damage, since it starts over at the first.
Regular mobs don't have all the same random needs - for example, Blast's chance to 1hko is only on non-bosses. So jamming these other features in results in exactly 6 random numbers used on some hits but not others.
It's kinda like February 1 and March 1 being the same day of the week, but only on non-leap years. February cycles through the week exactly 4 times landing on the same day in one situation, but fails in another.
I can't name off hand what all the random numbers it needs are, but the obvious ones which sync up are:
- chance to hit
- mastery (from mastery% to 100% damage)
- critical (from crit chance)
- critical damage (from min crit to max crit) - only applied when crit is successful
Since it grabs these 3 in order, if it gets another 3 in between, it uses the same number to determine the value each time.
Chance to hit only matters if the player can miss. If an attack uses 5 numbers, thus appearing random, and the mob is blinded, requiring a roll for chance to hit, it becomes 6 - thus syncing up, and dealing exactly the same damage on all the hits.
Potential other random needs per hit
* number display offset (I don't know offhand if this is at all random, or if they just stack up like that because the digits are different widths)
* chance to blind, stun, etc.
* instant death from items
* blast's "21% chance to ignore def"
* 1 or 2 orbs on hero attacks
* chance to drain HP
The $1000000 question is: Does the server use the same calculation? I'm gonna try to get to LHC and test that.
Each attack gets 6 random numbers.
It cycles through these in order, using the next every time it needs a random input, instead of an expensive random number call each time (on a 12 hit attack, it would need ~60 random numbers, this way 6 always suffices and performance is even between classes. Plus, since they're passed in as an array of 6 numbers, less function calls).
Blast, in certain conditions (against boss flagged mobs, maybe elsewhere) ends up using exactly 6 per hit, resulting in each hit using the same for each attribute, dealing the same damage, since it starts over at the first.
Regular mobs don't have all the same random needs - for example, Blast's chance to 1hko is only on non-bosses. So jamming these other features in results in exactly 6 random numbers used on some hits but not others.
It's kinda like February 1 and March 1 being the same day of the week, but only on non-leap years. February cycles through the week exactly 4 times landing on the same day in one situation, but fails in another.
I can't name off hand what all the random numbers it needs are, but the obvious ones which sync up are:
- chance to hit
- mastery (from mastery% to 100% damage)
- critical (from crit chance)
- critical damage (from min crit to max crit) - only applied when crit is successful
Since it grabs these 3 in order, if it gets another 3 in between, it uses the same number to determine the value each time.
Chance to hit only matters if the player can miss. If an attack uses 5 numbers, thus appearing random, and the mob is blinded, requiring a roll for chance to hit, it becomes 6 - thus syncing up, and dealing exactly the same damage on all the hits.
Potential other random needs per hit
* number display offset (I don't know offhand if this is at all random, or if they just stack up like that because the digits are different widths)
* chance to blind, stun, etc.
* instant death from items
* blast's "21% chance to ignore def"
* 1 or 2 orbs on hero attacks
* chance to drain HP
The $1000000 question is: Does the server use the same calculation? I'm gonna try to get to LHC and test that.

