#include "inc_misc_tools"
// Randomly Generates Magic Rods
// iType 2 = Medium Rod
// iType 3 = Major Rod
// No other value will work.

object Table820b();
object Table820c();

object Table820b()
    {
    int iRoll =  d100();
    string sString;
    if (iRoll <= 6) {Table820b();} //Reroll
    else if (iRoll <= 12) {sString = "rod108";}
    else if (iRoll <= 20) {sString = "rod101";}
    else if (iRoll <= 25) {sString = "rod102";}
    else if (iRoll <= 29) {sString = "rod103";}
    else if (iRoll <= 34) {sString = "rod104";}
    else if (iRoll <= 40) {sString = "rod105";}
    else if (iRoll <= 45) {sString = "rod106";}
    else if (iRoll <= 52) {sString = "rod107";}
    else if (iRoll <= 60) {sString = "rod108";}
    else if (iRoll <= 68) {sString = "rod109";}
    else if (iRoll <= 78) {sString = "rod110";}
    else if (iRoll <= 90) {sString = "rod111";}
    else if (iRoll <= 96) {sString = "rod113";}
    else if (iRoll <= 99) {sString = "rod112";}
    else if (iRoll <= 100) {sString = "rod108";}
    return CreateItemOnObject(sString);
    }
object Table820c()
    {
    int iRoll =  d100();
    string sString;
    if (iRoll <= 5) {sString = "rod101";}
    else if (iRoll <= 10) {sString = "rod102";}
    else if (iRoll <= 15) {sString = "rod103";}
    else if (iRoll <= 20) {sString = "rod104";}
    else if (iRoll <= 27) {sString = "rod105";}
    else if (iRoll <= 33) {sString = "rod106";}
    else if (iRoll <= 40) {sString = "rod107";}
    else if (iRoll <= 50) {sString = "rod108";}
    else if (iRoll <= 55) {sString = "rod109";}
    else if (iRoll <= 65) {sString = "rod110";}
    else if (iRoll <= 80) {sString = "rod111";}
    else if (iRoll <= 85) {sString = "rod113";}
    else if (iRoll <= 90) {sString = "rod112";}
    else if (iRoll <= 94) {sString = "rod108";}
    else if (iRoll <= 98) {sString = "rod114";}
    else if (iRoll <= 100) {sString = "rod108";}
    return CreateItemOnObject(sString);
    }
