Mod:Creation Kit/CalculateEncounterLevel - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

Calculates the reference's encounter level, based on the player's level, the area's level, and the passed-in difficulty.

Syntax
int Function CalculateEncounterLevel(int aiDifficulty = 4) native

Parameters

 * aiDifficulty: The difficulty to adjust the counter level for
 * Default: 4 (None)
 * The following values are acceptable:
 * 0: Easy
 * 1: Medium
 * 2: Hard
 * 3: Very Hard
 * 4: None (default)

Return Value
The level of the reference, taking into account the player's level, area's level, and difficulty

Examples
int calculatedLevel = Bandit.CalculateEncounterLevel int calculatedLevel = Bandit.CalculateEncounterLevel(2)
 * Figure out what level the bandit should be (using his default encounter level)
 * Figure out what level the bandit should be if he was 'hard'