Difference between revisions of "CalcLeveledItem"
Jump to navigation
Jump to search
no edit summary
imported>Dev akm |
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]] | 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|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. |