aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut15
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 37b891699..4bfeb4f8f 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