AHAH! Ok, this might help (or might not). "rand() % armorEP" does NOT give you a number between 0 and armorEP. It gives you a number from 0 to armorEP - 1. Thus, you can avoid ever dividing by 0, and also get a random number between 0 and armorEP inclusive by doing this:

Code:
armorE = rand() % (armorEP + 1);
weaponE = rand() % (weaponEP + 1);