

public spirit_check(id)
{
	if(g_player_spirit[id] > g_player_max_spirit[id])
	{
		g_player_spirit[id] = g_player_max_spirit[id];
	}
}

public spirit_set(id,amount)
{
	if(g_player_class[id] == 0) return PLUGIN_CONTINUE;
	
	if(amount < 0) amount = 0;
	
	g_player_spirit[id] = amount;
	
	spirit_check(id);
	print_hud_player(id);
	
	return PLUGIN_CONTINUE;
}

public spirit_regenerate()
{
	if(get_pcvar_num(cvar_bleach) != 1) return PLUGIN_CONTINUE;
	
	new players[MAXPLAYERS],bonus_spirit,id;
	static num;
	
	get_players(players,num,"ach");
	for (new i; i < num; ++i)
	{
		id=players[i];
		bonus_spirit = g_player_spirit[id] + 1*g_player_level[id];
		spirit_set(id,bonus_spirit);
	}
	
	return PLUGIN_CONTINUE;
}
