diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-11-07 03:53:07 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-11-07 03:53:07 +0000 |
commit | 35dfd937798d105238db23ea86f90f21be46694b (patch) | |
tree | d0e1ee639bc6177649dbcbde054f1e6094fc054c /Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut | |
parent | e79a58640e1ef1ea1c3c954aefccd36c3cb55286 (diff) | |
download | NorthstarMods-35dfd937798d105238db23ea86f90f21be46694b.tar.gz NorthstarMods-35dfd937798d105238db23ea86f90f21be46694b.zip |
code cleanup, xp, postgame and some small changes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut index 37b89169..4bfeb4f8 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut @@ -1 +1,14 @@ -//fuck
\ No newline at end of file +global function AddTitanXP + +void function AddTitanXP( entity player, int amount ) +{ + string titan = GetActiveTitanLoadout( player ).titanClass + int oldLevel = TitanGetLevel( player, titan ) + + // increment xp + player.SetPersistentVar( "titanXP[" + titan + "]", min( TitanGetXP( player, titan ) + amount, TitanGetMaxXP( titan ) ) ) + + // level up notif + if ( TitanGetLevel( player, titan ) != oldLevel ) + Remote_CallFunction_NonReplay( player, "ServerCallback_TitanLeveledUp", shTitanXP.titanClasses.find( titan ), TitanGetGen( player, titan ), TitanGetLevel( player, titan ) ) +}
\ No newline at end of file |