Difference between revisions of "User talk:Lisselli"
Jump to navigation
Jump to search
m
no edit summary
imported>Lisselli |
imported>Lisselli m |
||
Line 2: | Line 2: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Actor property PlayerRef auto | |||
Float CurrentSkillLevel | |||
Float PreviousSkillLevel | |||
Int iCount | |||
Function AdvanceSkillEx(String asSkillName, Float afValue, Int aiClampValue=0) | |||
; Let's say Destruction is 50. This variable will store that. | |||
If | CurrentSkillLevel = PlayerRef.GetActorValue("asSKillName") | ||
if | ;If the skill is still 50. Keep counting the times advance skill was called. | ||
if CurrentSkillLevel == PlayerRef.GetActorValue("asSkillName") | |||
if iCount != aiClampValue | |||
Game.AdvanceSkill(asSkillName, afValue) | |||
iCount += 1 | |||
; Everytime advanceskill is called, iCount goes up until it reaches the clamp value. | |||
endif | endif | ||
elseif PlayerRef.GetActorValue("asSkillName") > CurrentSkillLevel | |||
; if the skill is greater than 50, it leveled up at some point. Reset iCount. | |||
iCount = 0 | |||
; Have the function call itself recursively. | |||
AdvanceSkillEx(asSKillName, afValue, aiClampValue) | |||
endif | endif | ||
EndFunction | EndFunction | ||
</source> | </source> |