Using strings is an awful idea, just think about what the code is actually doing. A string compare is slow. Also a string needs a lot more memory than an int
Reedbeta has already pointed out that, but I don't think you really have it in your head what your code does. Lets take one line of code and give you a breakdown of what it does
if (npcRarity == npcRarityArray[[/color][color=\#006666]0[/color][color=\#666600]])
What this has to do is ...
get sizeof array element
multiply 0 by sizeof array element
add base of array
get pointer to array element
get size of input string
foreach char in input string
compare char with equivalent char in array element
if match, continue loop
else return false
Since you are doing a set of if else statements, it will do this for every array element until it finds a match
If you had something like this
public enum NpcRarity
then you can use a switch statement
multiplier = 0.3;
Then what that ends up as after you have compiled it is
index = rarity - base;
index << 2;
If you can start thinking about what your code will end up doing at low level now, then as you progress your code will get better and better.
Too many times I see people get into bad habits when they are starting out and, because current machines are so fast, the code works so they just leave it alone.
Only later when they turn up in a real work place do people start to notice that the code is rubbish, then it's a real problem.
Start thinking the right way now and you'll end up a real coder.