Difference between revisions of "GetSpellMasteryLevel"

916 bytes added ,  03:27, 8 July 2008
Getting value for autocalculated spells.
imported>DragoonWraith
(not a record variable function)
imported>Wrye
(Getting value for autocalculated spells.)
 
Line 12: Line 12:
   3:    Expert
   3:    Expert
   4:    Master
   4:    Master
==Auto Calculated Spells==
The function returns the statically assigned spell mastery level -- which may not be accurate for autocalculated spells. (And in particular, it is '''very likely''' to be wrong for player created spells.) To get the correct mastery level for any given spell, you'll need to check the cost against the spell mastery settings.
    set cost to getSpellMagickaCost rSpell
    if isMagicItemAutoCalc rSpell == 0
        set level to getSpellMasteryLevel rSpell
    elseif cost < fMinApprentice
        set level to 0
    elseif cost < fMinJourney
        set level to 1
    elseif cost < fMinExpert
        set level to 2
    elseif cost < fMinMaster
        set level to 3
    else
        set level to 4
    endif
Where fMinApprentice etc. are set from [[FMagicSpellLevelMasterMin]] game settings. Be sure to use [[getGS]] to get the settings, since mods may change from the default values.


==See Also==
==See Also==
Anonymous user