Skip to content

Instantly share code, notes, and snippets.

@LaughingLeader
Created April 3, 2019 00:53
Show Gist options
  • Save LaughingLeader/893fd32057a6c63f49d8a3973a68aea9 to your computer and use it in GitHub Desktop.
Save LaughingLeader/893fd32057a6c63f49d8a3973a68aea9 to your computer and use it in GitHub Desktop.
A gameScript that applies a status influence (permanent status) to players with the Escapist talent.
INIT
INT:%MyMod_InitialTalentCheck = 0
EVENTS
//MYMOD_ESCAPIST_BONUS is a CONSUME status that applies a potion via the StatsId property that increases movement speed.
EVENT MyMod_EscapistTalent_Added
VARS
CHARACTER:_Player
ON
OnTalentUnlocked(_Player, Escapist)
ACTIONS
AddStatusInfluence(_Player, MYMOD_ESCAPIST_BONUS, 999.0, "", 0)
EVENT MyMod_EscapistTalent_Removed
VARS
CHARACTER:_Player
ON
OnTalentLocked(_Player, Escapist)
ACTIONS
RemoveStatusInfluence(_Player, MYMOD_ESCAPIST_BONUS, 1000.0, "", 0)
//Retroactively apply the status to players with the talent on saves that just added the mod.
EVENT MyMod_EscapistTalent_UpdateSaves
ON
OnLoaded(_,_,_,_)
ACTIONS
IF "!c1"
IsEqual(%MyMod_InitialTalentCheck, 1)
THEN
IterateParty("MyMod_EscapistTalent_AddBonus")
Set(%MyMod_InitialTalentCheck, 1)
ENDIF
//This event runs from the previous event that iterates on all party members
EVENT MyMod_EscapistTalent_Iterator
VARS
CHARACTER:_Player
ON
OnIterateCharacter(_Player, "MyMod_EscapistTalent_AddBonus")
ACTIONS
IF "c1"
CharacterHasTalent(_Player, Escapist)
THEN
AddStatusInfluence(_Player, MYMOD_ESCAPIST_BONUS, 999.0, "", 0)
ENDIF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment