Jump to content

[LE] Script a button to reset legendary skills?


Recommended Posts

Gonna copy and paste my reddit post:

 

Don't know where to ask this but I've been trying to figure out a way to reset my legendary skills back to zero, so that it doesn't show the legendary symbol below the skill. I came across a forum that said SKSE had a function that can do this and even gave an example:
ActorValueInfo.GetActorValueInfo("Marksman").SetSkillLegendaryLevel(0)
I decided to make a button that will reset all the skill legendaries back to zero at the press of a button, but I'm not fluent in the creation kit let alone scripting. So I'm asking how do I make a script that will reset the legendary skills upon pressing the button?
Link to comment
Share on other sites

You will need a script obviously.

You need to decide if you will use an object that the player interacts with, a spell that they cast or simply a key to be pressed on the keyboard.

This decision will determine how your script needs to be written. While the end result will be the same, i.e. the calling of the SetSkillLegendaryLevel function for each skill, the way to get there will be different.

 

Let us assume that you will make some custom location where the player can approach a shrine. Upon praying at the shrine (i.e. using the activator that has been placed there) their legendary skills will be reset.

You would have a script on the activator utilizing the following:

OnActivate event

Check that the akActionRef parameter equals the player by using GetPlayer

Check each skill for legendary level with: ActorValueInfo.GetSkillLegendaryLevel

Adjust the level as needed with: ActorValueInfo.SetSkillLegendaryLevel

An untested example:

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 2/15/2020 at 12:22 AM, TheDoodlerDude said:

I decided to make a button that will reset all the skill legendaries back to zero at the press of a button [...]

 

 

This can be done with a short script, added to the button. No properties needed.

ActorValueInfo AVInfo

Event OnActivate(ObjectReference akActionRef)
    if (akActionRef == Game.GetPlayer())
        int i = 6
        While (i < 24)
            AVInfo = ActorValueInfo.GetActorValueInfoByID(i)
            if (AVInfo.GetSkillLegendaryLevel() > 0)
                AVInfo.SetSkillLegendaryLevel(0)
            endif
            i += 1
        EndWhile
    endif
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...