Difference between revisions of "CalcLeveledItem"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
m
imported>DragoonWraith
Line 15: Line 15:
[[Category:Inventory Functions]]
[[Category:Inventory Functions]]
[[Category:Inventory Functions (OBSE)]]
[[Category:Inventory Functions (OBSE)]]
[[Category:Leveled List Functions]]
[[Category:Leveled List Functions (OBSE)]]

Revision as of 14:03, 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. 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.

See Also