How might I use this function to determine probability? I am trying to make a random number generator that is sorta special.  Basically it generates a number between 5, and 17.  The twist that I need math help on is that I want to have a variable "P" that works like the following.
The higher p is the more likely numbers closer to 17 are to appear, the lower it is the more likely for number closer to 5 to appear.
I have found the perfect function to model this, 
1 /( 1 + abs((x - c) / a)^2B)
you can play around what it here
Anyway when I see that function I am considering the X axis as each of the numbers (5 - 17) and the y axis as the probability that it will be randomly picked. Notice how if you change the value of "C" you change where the hump is.  This is what will be the "P" variable.  As you can see the higher C is the higher the numbers the hump is over are.
How exactly would I mathmatically do this?  I have taken 1d data like the result of a dice before and turned it into a 2d bar graph before, but what I need to do this time is the opposite way around.
Edit: The gausian function might work well too
https://www.desmos.com/calculator/i4aydcx5ts
 A: To answer the question of what kind of distribution to use (as opposed to David K's good answer regarding how to "implement" a distribution), you might consider the beta distribution, scaled and translated appropriately (multiply by $12$ and add $5$).  By adjusting the parameters $\alpha$ and $\beta$, you can achieve something akin to the shape you want.
A: In principle, you can turn a uniform random number generator into a
generator of any probability distribution you want, using the following procedure. (I'll also suggest some simplifications and shortcuts later in the answer.)
Assuming the desired probability distribution has been specified by a
density function $f(x)$, which gives the relative likelihood of observing
a value near $x$, compute the definite integral of that function in order
to produce the cumulative distribution function, $F(x)$.
Of course this means you must first have a valid density function $f(x)$.
This has two important properties: it is never negative
(another way to write this requirement is $f \geq 0$), and
$$\int_{-\infty}^{\infty} f(x) \;dx = 1. $$
The function
$$g(x) = \dfrac{1}{1 + \left|\frac{x - c}{a}\right|^{2B}}$$
that you proposed has the property $g \geq 0$ but it does not generally
satisfy the second condition.
It also has non-zero values below $5$ and above $17$, which
is undesirable to you because that says the random number is not always
between $5$ and $17$.
To fix these problems, we can do a little surgery like this:
\begin{align}
G & = \int_5^{17} g(x), \\
\\
f(x) & = \begin{cases}
     \frac{g(x)}{G} & \text{if $5 \leq x \leq 17$}, \\
     0 & \text{if $x < 5$ or $x > 17$}.
 \end{cases}
\end{align}
The cumulative distribution function of $f$ is
$$ F(x) = \int_5^x f(t) \;dt, $$
which is $0$ if $x < 5$ and $1$ if $x > 17$.
In principle, the lower bound of the integral should be $-\infty$,
but since $f(x) = 0$ for all $x < 5$, either lower bound will come out
to the same result.
We then invert the function $F$ on the part of its domain where this is
possible, that is, we define a new function $F^{-1}$
such that $F^{-1}(F(x)) = x$ whenever $F(x)$ is a unique output of $F$.
Since $F$ was a cumulative distribution function, $F^{-1}(t)$ will be
defined only when $0 \leq t \leq 1$.
If we started with a reasonably "nice" distribution in the first place,
we will have only a few "holes" in the inverse function between
$t = 0$ and $t = 1$, and you can assign these to whatever value you
like as long as $F^{-1}$ is non-decreasing (that is, $F^{-1}(t)$
never decreases when you increase $t$).
In your example, you would probably want to set
$F^{-1}(0) = 5$ and $F^{-1}(1) = 17$.
Now generate a random real-valued (not necessarily integer) number $U$
from a uniform distribution over the interval $[0,1]$,
and return $F^{-1}(U)$ as the output of your random number generator
that generates a random number with density $f(x)$.

That's the hard way to do it. The easy way is to just create an
appropriate function to use instead of $F^{-1}$.
This means you don't actually get to use any of the density functions
you graphed, but it saves you the trouble of integrating the density and inverting the resulting cumulative distribution; the Gaussian is notoriously
hard to integrate anyway.
Assuming that you want to use a uniform random number generator whose
minimum value is $U_{\text{min}}$ and whose maximum value is $U_{\text{max}}$,
and that you want the result to be between $5$ and $17$ (inclusive),
you want a non-decreasing function $G$ such that $G(U)$ is defined
for every possible number $U$ that your uniform RNG might produce,
$G(U_{\text{min}}) \geq 5$, and $G(U_{\text{max}}) \leq 17$.
Within those constraints, you can make $G$ be anything you want.
In order to get distributions bunched around $5$ when $P$ is small and
bunched around $17$ when $P$ is large, you make a family of functions
with parameter $P$, much like the way you used the value $C$ as
a parameter to change the functions you were graphing.
For small $P$ you could make $G$ be something like the function graphed in
the left-hand graph below; this will produce mostly values nearer to $5$.
For large $P$ you could make $G$ something like the function graphed in
the right-hand graph below, which will produce mostly values nearer to $17$.
And for middling values of $P$ you can make $G$ like the function
in the middle graph, which tends to concentrate its output around a
particular number between $5$ and $17$.

It may be useful for you to know that if you want the distribution
to be "uniform" over part of the interval between $5$ and $17$
(like the "flat topped" graphs that your first formula sometimes produces),
you can make part of the graph of $G$ be a line segment with constant
positive slope.
For example, if the line segment goes from $G(U_1) = 10$ to $G(U_2) = 15$,
with $U_{\text{min}} \leq U_1 < U_2 \leq U_{\text{max}}$,
all numbers in the range $10$ to $15$ will be (at least approximately)
equally likely.
On the other hand, if you want to completely eliminate some output values
for a certain value of $P$, then the function $G$ for that value of $P$
should "jump over" those values. For example, if you want to prevent any
output less than $10$ when $P$ is large, set $G(U_{\text{min}}) = 10$
in that case.
