# Calculations (The Hell)

The calculations (damage, chances to hit, spell duration, etc.) in Diablo: The Hell use almost the same functions and variables as Diablo I, except the function Rec can use multipliers other tan 9/8. Up-to-date formulas used in this mod can be found in its changelog.

## Variables

• slvl: the level of the spell
• clvl: the level of the character

## Functions

• [ ]: round down
• Rnd[x]: random number in the range 0 to x - 1
• Rec(n, value, k): a recursive function defined as follows,
• Rec(0, value, k) = [value]
• for n > 0; Rec(n, value, k) = [Rec(n - 1, value, k) * k]
• k is usually 9/8 or 17/16
• in other words, to calculate Rec(n, value, k), we need to multiply the initial value by k n times, each time rounding the result down.
• Itt(n, value): an iterative function, defined as follows,
• Itt(0, value) = value
• for n > 0; Itt(n, value) = Itt(n - 1, value) + value
• in other words, to calculate Itt(n, value), we need to calculate value (n + 1) times and add these values together.

## Frames

A frame is a time interval used for game computations, it equals 0.05 seconds. It's unrelated to FPS (visible frames per second). Regeneration of Life and Mana, as well as damage of some spells, happens each frame (i.e. 20 times per second). Duration of attack, casting, blocking and recovery from hit animations is also measured in number of frames.