Difference between revisions of "CalcLeveledItem"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Dev akm
(OBSE behavior differences from standard list behavior)
imported>Dev akm
Line 4: Line 4:
  (randomItem:ref) CalcLeveledItem leveledList:ref level:short ''useChanceNone:bool'' ''levelDiff:short''
  (randomItem:ref) CalcLeveledItem leveledList:ref level:short ''useChanceNone:bool'' ''levelDiff:short''


Returns one item from a leveled item list, selected randomly for a character of the specified level. OBSE selects a level range from which to choose using the game setting iLevItemLevelDifferenceMax. The item chosen is within the range [minLevel...maxLevel], where maxLevel is the level in the list closest to but not exceeding the character's level, and minLevel = maxLevel - levelDiff. If the “Calculate for all item <= level” flag is set for the leveled list, minLevel is always zero. This behavior differs significantly from the standard Oblivion [[Category:Leveled_Lists#General_List_Behavior|list behavior]], where iLevItemLevelDifferenceMax is not considered unless the "all levels" flag is set.
Returns one item from a leveled item list, selected randomly for a character of the specified level. OBSE selects a level range from which to choose using the game setting iLevItemLevelDifferenceMax. The item chosen is within the range [minLevel...maxLevel], where maxLevel is the level in the list closest to but not exceeding the character's level, and minLevel = maxLevel - levelDiff. If the “Calculate for all item <= level” flag is set for the leveled list, minLevel is always zero. This behavior differs significantly from the standard Oblivion [[Category:Leveled_Lists]] behavior, where iLevItemLevelDifferenceMax is not considered unless the "all levels" flag is set.


This function checks the "Chance None" property of the leveled list, so it may return nothing based on that chance; pass 0 for the third parameter to override this behavior. In the case of leveled lists containing nested leveled lists, the function recurses through each list until it finds a non-leveled item. Omit the levelDiff parameter to use the current value of iLevItemLevelDifferenceMax.
This function checks the "Chance None" property of the leveled list, so it may return nothing based on that chance; pass 0 for the third parameter to override this behavior. In the case of leveled lists containing nested leveled lists, the function recurses through each list until it finds a non-leveled item. Omit the levelDiff parameter to use the current value of iLevItemLevelDifferenceMax.

Revision as of 16:23, 27 October 2008

A command for Oblivion Script Extender

Syntax:

(randomItem:ref) CalcLeveledItem leveledList:ref level:short useChanceNone:bool levelDiff:short

Returns one item from a leveled item list, selected randomly for a character of the specified level. OBSE selects a level range from which to choose using the game setting iLevItemLevelDifferenceMax. The item chosen is within the range [minLevel...maxLevel], where maxLevel is the level in the list closest to but not exceeding the character's level, and minLevel = maxLevel - levelDiff. If the “Calculate for all item <= level” flag is set for the leveled list, minLevel is always zero. This behavior differs significantly from the standard Oblivion behavior, where iLevItemLevelDifferenceMax is not considered unless the "all levels" flag is set.

This function checks the "Chance None" property of the leveled list, so it may return nothing based on that chance; pass 0 for the third parameter to override this behavior. In the case of leveled lists containing nested leveled lists, the function recurses through each list until it finds a non-leveled item. Omit the levelDiff parameter to use the current value of iLevItemLevelDifferenceMax.

See Also