aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/titan_xp.gnut
blob: 4bfeb4f8fd88fb7068ff2bbddaaba165d63b3736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 ) )
}