Difference between revisions of "CalcLeveledItem"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
imported>Dev akm
(OBSE behavior differences from standard list behavior)
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. Oblivion 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 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.
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.
 
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==
==See Also==

Revision as of 16:22, 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, 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