SetJohnnyOnRemovePerkEventHandler
From GECK
A function added by the JohnnyGuitar NVSE Plugin.
Description
Sets/removes the specified UDF Script as a handler that will be invoked when a specified Perk (or any Perk) is removed from the player. FormLists are also accepted as filters.
When invoked, the script is passed with a single argument - a perk than was removed.
Syntax
SetJohnnyOnRemovePerkEventHandler setORremove:1/0 handlerScript:ref flag:int perk:filter
Or:
SetOnRemovePerkEventHandler setORremove:1/0 handlerScript:ref flag:int perk:filter
Example
SetJohnnyOnRemovePerkEventHandler 1 OnRemovePerkUDF 0 BloodyMess
Sets the OnRemovePerkUDF script as a handler to be invoked when Bloody Mess perk is removed from the player.
SetJohnnyOnRemovePerkEventHandler 0 OnRemovePerkUDF 0 BloodyMess
Removes the OnRemovePerkUDF script as a handler of the above.
Handler Script
A skeleton handler script for this event:
scn OnRemovePerkUDF ref rPerk ref rPerkOwner begin Function {rPerk} set rPerkOwner to this (code) end
Notes
- Flag argument is reserved for future use and should always be 0.
- Since JIP LN version 56.24, it is possible for actors other than the player character to receive and hold perks directly. And since JohnnyGuitar version 4.0, this handler can thus fire for any actor and not just the player. Since it cannot be filtered for a specific actor on which the perk is removed, you may want to check inside the script through GetSelf.