Difference between revisions of "GetSpellMasteryLevel"

879 bytes added ,  03:27, 8 July 2008
Getting value for autocalculated spells.
imported>Quetzilla
imported>Wrye
(Getting value for autocalculated spells.)
 
(2 intermediate revisions by one other user not shown)
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==
Line 20: Line 38:
[[Category: Magic Functions]]
[[Category: Magic Functions]]
[[Category: Magic Functions (OBSE)]]
[[Category: Magic Functions (OBSE)]]
[[Category: Record Variable Functions]]
[[Category: Magic Functions - Magic Item (OBSE)]]
[[Category: Record Variable Functions (OBSE)]]
Anonymous user