diff options
author | William Miller <william-millennium@hotmail.com> | 2024-06-28 15:10:45 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 20:10:45 +0200 |
commit | 6581c4e800e5cec0e4d6f5b3f87b80bd6989233c (patch) | |
tree | ee4b1825304312ac4ce24f1d1ee1ab077483159e /Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut | |
parent | 83e97763b3421e59d13e9a40bf20c0d987da9129 (diff) | |
download | NorthstarMods-1.26.0-rc4.tar.gz NorthstarMods-1.26.0-rc4.zip |
Implement Match Goals menu and XP tracking (#756)v1.26.0-rc4v1.26.0
for vanilla parity when it comes to the progression system.
See PR description for full details
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut index 6555c875..5aee1104 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/faction_xp.gnut @@ -4,10 +4,19 @@ void function AddFactionXP( entity player, int amount ) { string faction = GetFactionChoice( player ) int oldLevel = FactionGetLevel( player, faction ) + int FactionXPMatch = player.GetPersistentVarAsInt( "xp_match[" + XP_TYPE.FACTION_LEVELED + "]" ) + // increment xp player.SetPersistentVar( "factionXP[" + faction + "]", min( FactionGetXP( player, faction ) + amount, FactionGetMaxXP( faction ) ) ) // note: no notif for faction level up if ( FactionGetLevel( player, faction ) != oldLevel ) + { AddPlayerScore( player, "FactionLevelUp" ) + IncrementPlayerChallengeFactionLeveledUp( player ) + player.SetPersistentVar( "xp_match[" + XP_TYPE.FACTION_LEVELED + "]", FactionXPMatch + 1 ) + + if( ProgressionEnabledForPlayer( player ) ) + AwardRandomItemsForFactionLevels( player, faction, oldLevel, FactionGetLevel( player, faction ) ) + } }
\ No newline at end of file |