import java.math.*;
public class Treasure
{

  private static String [] treasure = new String [3];

  public static void main (String args[])
  {
    boolean ElValid = false;
    boolean AnsValid = false;
    boolean cont = true;
    int el = 0;
    String answer;
    String Yes = "yes";
    String No = "no";


    while(cont)
    {

      ElValid = false;
      while(!(ElValid))
      {
        System.out.println("Encounter Level?");
        el = KeysIn.readInt();
        if((el>20)||(el<1))
        {
           ElValid = false;
           System.out.println("Invalid Entry. Retry!");
        }
        else if((el>=1)&&(el<=20)){ElValid = true;}
      }

      String coins = Coins(el);
      System.out.println(coins+" in coins");

      String goods = getGoods(el);
      System.out.println(goods);

      String items = getItems(el);
      System.out.println(items);

      System.out.println(getStaff("medium"));
      System.out.println(getStaff("major"));
      System.out.println(getWand("minor"));
      System.out.println(getWand("medium"));
      System.out.println(getWand("major"));
      System.out.println(getRod("medium"));
      System.out.println(getRod("major"));

      AnsValid = false;
      while(!(AnsValid))
      {
        System.out.println("Do you wish to generate more Treasure?");
        System.out.println("Please Answer yes or no");
        answer = KeysIn.readString();
        if(answer.equals(Yes))
        {
          cont = true;
          AnsValid = true;
        }
        else if(answer.equals(No))
        {
          cont = false;
          AnsValid = true;
        }
        else if((!(answer.equals(Yes)))&&(!(answer.equals(No))))
        {
          System.out.println("Invalid answer. Retry!");
          AnsValid = false;
        }
      }
    }

  }

  public static String Coins(int Level)
  {
     int Chance = 0;
     String coins = "";
     Chance = (int)(1+Math.random()*99);
     if(Level==1)
     {
       if((Chance>=1)&&(Chance<=14))
       {coins = ""+"no coins";}
       else if((Chance>=15)&&(Chance<=29))
       {coins = ""+((int)(1+Math.random()*5)*10)+"gp";}
       else if((Chance>=30)&&(Chance<=52))
       {coins = ""+((int)(1+Math.random()*7)*10)+"gp";}
       else if((Chance>=53)&&(Chance<=95))
       {coins = ""+((int)(2+Math.random()*14)*10)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*3)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==2)
     {
       if((Chance>=1)&&(Chance<=13))
       {coins = ""+"no coins";}
       else if((Chance>=14)&&(Chance<=23))
       {coins = ""+((int)(1+Math.random()*9)*10)+"gp";}
       else if((Chance>=24)&&(Chance<=43))
       {coins = ""+((int)(2+Math.random()*18)*10)+"gp";}
       else if((Chance>=44)&&(Chance<=95))
       {coins = ""+((int)(4+Math.random()*36)*10)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(2+Math.random()*14)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==3)
     {
       if((Chance>=1)&&(Chance<=11))
       {coins = ""+"no coins";}
       else if((Chance>=12)&&(Chance<=21))
       {coins = ""+((int)(2+Math.random()*14)*10)+"gp";}
       else if((Chance>=22)&&(Chance<=41))
       {coins = ""+((int)(4+Math.random()*36)*10)+"gp";}
       else if((Chance>=42)&&(Chance<=95))
       {coins = ""+((int)(1+Math.random()*3)*100)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*9)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==4)
     {
       if((Chance>=1)&&(Chance<=11))
       {coins = ""+"no coins";}
       else if((Chance>=12)&&(Chance<=21))
       {coins = ""+((int)(3+Math.random()*27)*10)+"gp";}
       else if((Chance>=22)&&(Chance<=41))
       {coins = ""+((int)(4+Math.random()*28)*100)+"gp";}
       else if((Chance>=42)&&(Chance<=95))
       {coins = ""+((int)(1+Math.random()*5)*100)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*7)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==5)
     {
       if((Chance>=1)&&(Chance<=10))
       {coins = ""+"no coins";}
       else if((Chance>=11)&&(Chance<=19))
       {coins = ""+((int)(1+Math.random()*3)*100)+"gp";}
       else if((Chance>=20)&&(Chance<=38))
       {coins = ""+((int)(1+Math.random()*5)*100)+"gp";}
       else if((Chance>=39)&&(Chance<=95))
       {coins = ""+((int)(1+Math.random()*7)*100)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*9)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==6)
     {
       if((Chance>=1)&&(Chance<=10))
       {coins = ""+"no coins";}
       else if((Chance>=11)&&(Chance<=18))
       {coins = ""+((int)(1+Math.random()*5)*100)+"gp";}
       else if((Chance>=19)&&(Chance<=37))
       {coins = ""+((int)(1+Math.random()*7)*100)+"gp";}
       else if((Chance>=38)&&(Chance<=95))
       {coins = ""+((int)(1+Math.random()*9)*100)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*11)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==7)
     {
       if((Chance>=1)&&(Chance<=11))
       {coins = ""+"no coins";}
       else if((Chance>=12)&&(Chance<=18))
       {coins = ""+((int)(1+Math.random()*9)*100)+"gp";}
       else if((Chance>=19)&&(Chance<=35))
       {coins = ""+((int)(1+Math.random()*11)*100)+"gp";}
       else if((Chance>=36)&&(Chance<=93))
       {coins = ""+((int)(2+Math.random()*10)*100)+"gp";}
       else if((Chance>=94)&&(Chance<=100))
       {coins = ""+((int)(3+Math.random()*9)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==8)
     {
       if((Chance>=1)&&(Chance<=10))
       {coins = ""+"no coins";}
       else if((Chance>=11)&&(Chance<=15))
       {coins = ""+((int)(1+Math.random()*11)*100)+"gp";}
       else if((Chance>=16)&&(Chance<=29))
       {coins = ""+((int)(2+Math.random()*10)*100)+"gp";}
       else if((Chance>=30)&&(Chance<=93))
       {coins = ""+((int)(2+Math.random()*14)*100)+"gp";}
       else if((Chance>=94)&&(Chance<=100))
       {coins = ""+((int)(3+Math.random()*15)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==9)
     {
       if((Chance>=1)&&(Chance<=10))
       {coins = ""+"no coins";}
       else if((Chance>=11)&&(Chance<=15))
       {coins = ""+((int)(2+Math.random()*10)*100)+"gp";}
       else if((Chance>=16)&&(Chance<=29))
       {coins = ""+((int)(2+Math.random()*14)*100)+"gp";}
       else if((Chance>=30)&&(Chance<=85))
       {coins = ""+((int)(5+Math.random()*15)*100)+"gp";}
       else if((Chance>=86)&&(Chance<=100))
       {coins = ""+((int)(2+Math.random()*22)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==10)
     {
       if((Chance>=1)&&(Chance<=10))
       {coins = ""+"no coins";}
       else if((Chance>=11)&&(Chance<=24))
       {coins = ""+((int)(2+Math.random()*18)*100)+"gp";}
       else if((Chance>=25)&&(Chance<=79))
       {coins = ""+((int)(6+Math.random()*18)*100)+"gp";}
       else if((Chance>=80)&&(Chance<=100))
       {coins = ""+((int)(5+Math.random()*25)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==11)
     {
       if((Chance>=1)&&(Chance<=8))
       {coins = ""+"no coins";}
       else if((Chance>=9)&&(Chance<=14))
       {coins = ""+((int)(3+Math.random()*27)*100)+"gp";}
       else if((Chance>=15)&&(Chance<=75))
       {coins = ""+((int)(4+Math.random()*28)*100)+"gp";}
       else if((Chance>=76)&&(Chance<=100))
       {coins = ""+((int)(4+Math.random()*36)*100)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==12)
     {
       if((Chance>=1)&&(Chance<=10))
       {coins = ""+"no coins";}
       else if((Chance>=11)&&(Chance<=24))
       {coins = ""+((int)(3+Math.random()*33)*100)+"gp";}
       else if((Chance>=25)&&(Chance<=79))
       {coins = ""+((int)(1+Math.random()*3)*1000)+"gp";}
       else if((Chance>=80)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*3)*1000)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==13)
     {
       if((Chance>=1)&&(Chance<=8))
       {coins = ""+"no coins";}
       else if((Chance>=9)&&(Chance<=75))
       {coins = ""+((int)(1+Math.random()*3)*1000)+"gp";}
       else if((Chance>=76)&&(Chance<=95))
       {coins = ""+((int)(1+Math.random()*9)*1000)+"gp";}
       else if((Chance>=96)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*9)*1000)+"gp";
        coins += getMajorItem(1);
       }
       else
       {coins = ""+"no coins";}
     }
     else if(Level==14)
     {
       if((Chance>=1)&&(Chance<=8))
       {coins = ""+"no coins";}
       else if((Chance>=9)&&(Chance<=75))
       {coins = ""+((int)(1+Math.random()*5)*1000)+"gp";}
       else if((Chance>=76)&&(Chance<=92))
       {coins = ""+((int)(1+Math.random()*11)*1000)+"gp";}
       else if((Chance>=93)&&(Chance<=100))
       {coins = ""+((int)(1+Math.random()*11)*1000)+"gp";
        coins += getMajorItem(1);
       }
       else
       {coins = ""+"no coins";}
     }
     else if(Level==15)
     {
       if((Chance>=1)&&(Chance<=3))
       {coins = ""+"no coins";}
       else if((Chance>=4)&&(Chance<=74))
       {coins = ""+((int)(1+Math.random()*7)*1000)+"gp";}
       else if((Chance>=75)&&(Chance<=90))
       {coins = ""+((int)(3+Math.random()*9)*1000)+"gp";}
       else if((Chance>=91)&&(Chance<=100))
       {coins = ""+((int)(3+Math.random()*9)*1000)+"gp";
        coins +=  getMajorItem(1);
       }
       else
       {coins = ""+"no coins";}
     }
     else if(Level==16)
     {
       if((Chance>=1)&&(Chance<=3))
       {coins = ""+"no coins";}
       else if((Chance>=4)&&(Chance<=74))
       {coins = ""+((int)(1+Math.random()*8)*1000)+"gp";}
       else if((Chance>=75)&&(Chance<=90))
       {coins = ""+((int)(3+Math.random()*9)*1000)+"gp";}
       else if((Chance>=91)&&(Chance<=100))
       {coins = ""+((int)(3+Math.random()*9)*1000)+"gp";
        coins += getMajorItem(1);
       }
       else
       {coins = ""+"no coins";}
     }
     else if(Level==17)
     {
       if((Chance>=1)&&(Chance<=3))
       {coins = ""+"no coins";}
       else if((Chance>=4)&&(Chance<=68))
       {coins = ""+((int)(3+Math.random()*9)*1000)+"gp";}
       else if((Chance>=69)&&(Chance<=100))
       {coins = ""+((int)(2+Math.random()*18)*1000)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==18)
     {
       if((Chance>=1)&&(Chance<=2))
       {coins = ""+"no coins";}
       else if((Chance>=3)&&(Chance<=65))
       {coins = ""+((int)(3+Math.random()*15)*1000)+"gp";}
       else if((Chance>=66)&&(Chance<=100))
       {coins = ""+((int)(5+Math.random()*15)*1000)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==19)
     {
       if((Chance>=1)&&(Chance<=2))
       {coins = ""+"no coins";}
       else if((Chance>=3)&&(Chance<=65))
       {coins = ""+((int)(3+Math.random()*21)*1000)+"gp";}
       else if((Chance>=66)&&(Chance<=100))
       {coins = ""+((int)(3+Math.random()*27)*1000)+"gp";}
       else
       {coins = ""+"no coins";}
     }
     else if(Level==20)
     {
       if((Chance>=1)&&(Chance<=2))
       {coins = ""+"no coins";}
       else if ((Chance>=3)&&(Chance<=65))
       {coins = ""+((int)(3+Math.random()*21)*1000)+"gp";}
       else if((Chance>=66)&&(Chance<=100))
       {coins = ""+((int)(3+Math.random()*27)*1000)+"gp";}
       else
       {coins = ""+"no coins";}
     }

     return coins;
   }

   public static String getGoods(int Level)
   {
     int Chance = 0;
     String goods = "";
     Chance = (int)(1+Math.random()*99);
     if(Level==1)
     {
       if((Chance>=1)&&(Chance<=90))
       {goods = ""+"no goods";}
       else if((Chance>=91)&&(Chance<=95))
       {goods = getGems(1);}
       else if((Chance>=96)&&(Chance<=100))
       {goods = getArt(1);}
     }
     else if(Level==2)
     {
       if((Chance>=1)&&(Chance<=81))
       {goods = ""+"no goods";}
       else if((Chance>=82)&&(Chance<=95))
       {goods = getGems(((int)(1+Math.random()*2)));}
       else if((Chance>=96)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*2)));}
     }
     else if(Level==3)
     {
       if((Chance>=1)&&(Chance<=77))
       {goods = ""+"no goods";}
       else if((Chance>=78)&&(Chance<=95))
       {goods = getGems(((int)(1+Math.random()*2)));}
       else if((Chance>=96)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*2)));}

     }
     else if(Level==4)
     {
       if((Chance>=1)&&(Chance<=70))
       {goods = ""+"no goods";}
       else if((Chance>=71)&&(Chance<=95))
       {goods = getGems(((int)(1+Math.random()*3)));}
       else if((Chance>=96)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*2)));}
     }
     else if(Level==5)
     {
       if((Chance>=1)&&(Chance<=60))
       {goods = ""+"no goods";}
       else if((Chance>=61)&&(Chance<=95))
       {goods = getGems(((int)(1+Math.random()*3)));}
       else if((Chance>=96)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*3)));}
     }
     else if(Level==6)
     {
       if((Chance>=1)&&(Chance<=56))
       {goods = ""+"no goods";}
       else if((Chance>=57)&&(Chance<=92))
       {goods = getGems(((int)(1+Math.random()*2)));}
       else if((Chance>=93)&&(Chance<=99))
       {goods = getArt(((int)(1+Math.random()*2)));}
       else if((Chance==100))
       {goods = getArt(((int)(1+Math.random()*2)))+" "+getMediumItem(1);}
     }
     else if(Level==7)
     {
       if((Chance>=1)&&(Chance<=48))
       {goods = ""+"no goods";}
       else if((Chance>=49)&&(Chance<=88))
       {goods = getGems(((int)(1+Math.random()*3)));}
       else if((Chance>=89)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*3)));}
     }
     else if(Level==8)
     {
       if((Chance>=1)&&(Chance<=48))
       {goods = ""+"no goods";}
       else if((Chance>=49)&&(Chance<=88))
       {goods = getGems(((int)(1+Math.random()*5)));}
       else if((Chance>=89)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*3)));}
     }
     else if(Level==9)
     {
       if((Chance>=1)&&(Chance<=40))
       {goods = ""+"no goods";}
       else if((Chance>=41)&&(Chance<=80))
       {goods = getGems(((int)(1+Math.random()*7)));}
       else if((Chance>=81)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*3)));}
     }
     else if(Level==10)
     {
       if((Chance>=1)&&(Chance<=35))
       {goods = ""+"no goods";}
       else if((Chance>=36)&&(Chance<=79))
       {goods = getGems(((int)(1+Math.random()*7)));}
       else if((Chance>=80)&&(Chance<=99))
       {goods = getArt(((int)(1+Math.random()*5)));}
       else if((Chance==100))
       {goods = getArt(((int)(1+Math.random()*5)))+" "+getMajorItem(1);}
     }
     else if(Level==11)
     {
       if((Chance>=1)&&(Chance<=24))
       {goods = ""+"no goods";}
       else if((Chance>=25)&&(Chance<=74))
       {goods = getGems(((int)(1+Math.random()*9)));}
       else if((Chance>=75)&&(Chance<=99))
       {goods = getArt(((int)(1+Math.random()*5)));}
       else if((Chance==100))
       {goods = getArt(((int)(1+Math.random()*5)))+" "+getMajorItem(1);}
     }
     else if(Level==12)
     {
       if((Chance>=1)&&(Chance<=17))
       {goods = ""+"no goods";}
       else if((Chance>=18)&&(Chance<=70))
       {goods = getGems(((int)(1+Math.random()*9)));}
       else if((Chance>=71)&&(Chance<=97))
       {goods = getArt(((int)(1+Math.random()*7)));}
       else if((Chance>=98)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*7)))+" "+getMajorItem(1);}
     }
     else if(Level==13)
     {
       if((Chance>=1)&&(Chance<=11))
       {goods = ""+"no goods";}
       else if((Chance>=12)&&(Chance<=66))
       {goods = getGems(((int)(1+Math.random()*11)));}
       else if((Chance>=67)&&(Chance<=100))
       {goods = getArt(((int)(1+Math.random()*9)));}
     }
     else if(Level==14)
     {
       if((Chance>=1)&&(Chance<=11))
       {goods = ""+"no goods";}
       else if((Chance>=12)&&(Chance<=66))
       {goods = getGems(((int)(2+Math.random()*14)));}
       else if((Chance>=67)&&(Chance<=100))
       {goods = getArt(((int)(2+Math.random()*10)));}
     }
     else if(Level==15)
     {
       if((Chance>=1)&&(Chance<=10))
       {goods = ""+"no goods";}
       else if((Chance>=11)&&(Chance<=65))
       {goods = getGems(((int)(2+Math.random()*18)));}
       else if((Chance>=66)&&(Chance<=100))
       {goods = getArt(((int)(2+Math.random()*14)));}
     }
     else if(Level==16)
     {
       if((Chance>=1)&&(Chance<=7))
       {goods = ""+"no goods";}
       else if((Chance>=8)&&(Chance<=64))
       {goods = getGems(((int)(4+Math.random()*20)));}
       else if((Chance>=65)&&(Chance<=100))
       {goods = getArt(((int)(2+Math.random()*18)));}
     }
     else if(Level==17)
     {
       if((Chance>=1)&&(Chance<=4))
       {goods = ""+"no goods";}
       else if((Chance>=5)&&(Chance<=63))
       {goods = getGems(((int)(4+Math.random()*28)));}
       else if((Chance>=64)&&(Chance<=100))
       {goods = getArt(((int)(3+Math.random()*21)));}
     }
     else if(Level==18)
     {
       if((Chance>=1)&&(Chance<=4))
       {goods = ""+"no goods";}
       else if((Chance>=5)&&(Chance<=54))
       {goods = getGems(((int)(3+Math.random()*33)));}
       else if((Chance>=55)&&(Chance<=100))
       {goods = getArt(((int)(3+Math.random()*27)));}
     }
     else if(Level==19)
     {
       if((Chance>=1)&&(Chance<=3))
       {goods = ""+"no goods";}
       else if((Chance>=4)&&(Chance<=50))
       {goods = getGems(((int)(6+Math.random()*30)));}
       else if((Chance>=51)&&(Chance<=100))
       {goods = getArt(((int)(6+Math.random()*30)));}
     }
     else if(Level==20)
     {
       if((Chance>=1)&&(Chance<=2))
       {goods = ""+"no goods";}
       else if((Chance>=3)&&(Chance<=38))
       {goods = getGems(((int)(4+Math.random()*36)));}
       else if((Chance>=39)&&(Chance<=100))
       {goods = getArt(((int)(7+Math.random()*35)));}
     }
     return goods;
   }
   public static String getItems(int Level)
   {
      String items = "";
      int Chance = 0;
      Chance = (int)(1+Math.random()*99);
      if(Level==1)
      {
        if((Chance>=1)&&(Chance<=71))
        {items = ""+"no items";}
        else if((Chance>=72)&&(Chance<=95))
        {items = getMundaneItem(1);}
        else if((Chance>=96)&&(Chance<=100))
        {items = getMinorItem(1);}
      }
      if(Level==2)
      {
        if((Chance>=1)&&(Chance<=49))
        {items = ""+"no items";}
        else if((Chance>=50)&&(Chance<=85))
        {items = getMundaneItem(1);}
        else if((Chance>=86)&&(Chance<=100))
        {items = getMinorItem(1);}
      }
      if(Level==3)
      {
        if((Chance>=1)&&(Chance<=49))
        {items = ""+"no items";}
        else if((Chance>=50)&&(Chance<=79))
        {items = getMundaneItem((int)(1+Math.random()*2));}
        else if((Chance>=80)&&(Chance<=100))
        {items = getMinorItem(1);}

      }
      if(Level==4)
      {
        if((Chance>=1)&&(Chance<=42))
        {items = ""+"no items";}
        else if((Chance>=43)&&(Chance<=62))
        {items = getMundaneItem((int)(1+Math.random()*3));}
        else if((Chance>=63)&&(Chance<=100))
        {items = getMinorItem(1);}

      }
      if(Level==5)
      {
        if((Chance>=1)&&(Chance<=57))
        {items = ""+"no items";}
        else if((Chance>=58)&&(Chance<=67))
        {items = getMundaneItem((int)(1+Math.random()*3));}
        else if((Chance>=68)&&(Chance<=100))
        {items = getMinorItem((int)(1+Math.random()*2));}

      }
      if(Level==6)
      {
        if((Chance>=1)&&(Chance<=54))
        {items = ""+"no items";}
        else if((Chance>=55)&&(Chance<=59))
        {items = getMundaneItem((int)(1+Math.random()*3));}
        else if((Chance>=60)&&(Chance<=99))
        {items = getMinorItem((int)(1+Math.random()*2));}
      }
      if(Level==7)
      {
        if((Chance>=1)&&(Chance<=51))
        {items = ""+"no items";}
        else if((Chance>=52)&&(Chance<=97))
        {items = getMinorItem((int)(1+Math.random()*3));}
        else if((Chance>=98)&&(Chance<=100))
        {items = getMediumItem(1);}

      }
      if(Level==8)
      {
        if((Chance>=1)&&(Chance<=48))
        {items = ""+"no items";}
        else if((Chance>=49)&&(Chance<=96))
        {items = getMinorItem((int)(1+Math.random()*3));}
        else if((Chance>=97)&&(Chance<=100))
        {items = getMediumItem(1);}

      }
      if(Level==9)
      {
        if((Chance>=1)&&(Chance<=43))
        {items = ""+"no items";}
        else if((Chance>=44)&&(Chance<=91))
        {items = getMinorItem((int)(1+Math.random()*3));}
        else if((Chance>=92)&&(Chance<=100))
        {items = getMediumItem(1);}

      }
      if(Level==10)
      {
        if((Chance>=1)&&(Chance<=40))
        {items = ""+"no items";}
        else if((Chance>=41)&&(Chance<=88))
        {items = getMinorItem((int)(1+Math.random()*3));}
        else if((Chance>=89)&&(Chance<=99))
        {items = getMediumItem(1);}
        else if((Chance==100))
        {items = getMajorItem(1);}
      }
      if(Level==11)
      {
        if((Chance>=1)&&(Chance<=31))
        {items = ""+"no items";}
        else if((Chance>=32)&&(Chance<=84))
        {items = getMinorItem((int)(1+Math.random()*3));}
        else if((Chance>=85)&&(Chance<=98))
        {items = getMediumItem(1);}
        else if((Chance>=99)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==12)
      {
        if((Chance>=1)&&(Chance<=27))
        {items = ""+"no items";}
        else if((Chance>=28)&&(Chance<=82))
        {items = getMinorItem((int)(1+Math.random()*5));}
        else if((Chance>=83)&&(Chance<=97))
        {items = getMediumItem(1);}
        else if((Chance>=98)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==13)
      {
        if((Chance>=1)&&(Chance<=19))
        {items = ""+"no items";}
        else if((Chance>=20)&&(Chance<=73))
        {items = getMinorItem((int)(1+Math.random()*5));}
        else if((Chance>=74)&&(Chance<=95))
        {items = getMediumItem(1);}
        else if((Chance>=96)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==14)
      {
        if((Chance>=1)&&(Chance<=19))
        {items = ""+"no items";}
        else if((Chance>=20)&&(Chance<=58))
        {items = getMinorItem((int)(1+Math.random()*5));}
        else if((Chance>=59)&&(Chance<=92))
        {items = getMediumItem(1);}
        else if((Chance>=93)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==15)
      {
        if((Chance>=1)&&(Chance<=11))
        {items = ""+"no items";}
        else if((Chance>=12)&&(Chance<=46))
        {items = getMinorItem((int)(1+Math.random()*9));}
        else if((Chance>=47)&&(Chance<=90))
        {items = getMediumItem(1);}
        else if((Chance>=91)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==16)
      {
        if((Chance>=1)&&(Chance<=40))
        {items = ""+"no items";}
        else if((Chance>=41)&&(Chance<=46))
        {items = getMinorItem((int)(1+Math.random()*9));}
        else if((Chance>=47)&&(Chance<=90))
        {items = getMediumItem((int)(1+Math.random()*2));}
        else if((Chance>=91)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==17)
      {
        if((Chance>=1)&&(Chance<=33))
        {items = ""+"no items";}
        else if((Chance>=34)&&(Chance<=83))
        {items = getMediumItem((int)(1+Math.random()*2));}
        else if((Chance>=84)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==18)
      {
        if((Chance>=1)&&(Chance<=24))
        {items = ""+"no items";}
        else if((Chance>=25)&&(Chance<=80))
        {items = getMediumItem((int)(1+Math.random()*3));}
        else if((Chance>=81)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==19)
      {
        if((Chance>=1)&&(Chance<=4))
        {items = ""+"no items";}
        else if((Chance>=5)&&(Chance<=70))
        {items = getMediumItem((int)(1+Math.random()*3));}
        else if((Chance>=71)&&(Chance<=100))
        {items = getMajorItem(1);}
      }
      if(Level==20)
      {
        if((Chance>=1)&&(Chance<=25))
        {items = ""+"no items";}
        else if((Chance>=26)&&(Chance<=65))
        {items = getMediumItem((int)(1+Math.random()*3));}
        else if((Chance>=65)&&(Chance<=100))
        {items = getMajorItem((int)(1+Math.random()*2));}
      }
      return items;
   }

   public static String getMundaneItem(int amount)
   {
     String mundane = "";
     int Chance = 0;
     for(int i = 0;i<amount;i++)
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=17))
       {
         mundane += getAlchemicalItem()+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=18)&&(Chance<=50))
       {
         mundane += getArmour()+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=51)&&(Chance<=83))
       {
         mundane += getWeapon()+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=84)&&(Chance<=100))
       {
         mundane += getToolsAndGear()+(i<(amount-1)?",":".")+"\n";
       }
     }
     return mundane;
   }

   public static String getMinorItem(int amount)
   {
     String minor = amount + " Minor Item(s)"+"\n";
     String m = "minor";
     int Chance = 0;
     for(int i = 0;i<amount;i++)
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=4))
       {
         minor += getMagicArmour(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=5)&&(Chance<=9))
       {
         minor += getMagicWeapon(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=10)&&(Chance<=44))
       {
         minor += getPotion(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=45)&&(Chance<=46))
       {
         minor += getRing(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=47)&&(Chance<=81))
       {
         minor += getScroll(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=82)&&(Chance<=91))
       {
         minor += getWand(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=92)&&(Chance<=100))
       {
         minor += getWondrousItem(m)+(i<(amount-1)?",":".")+"\n";
       }
     }
     return minor;
   }
   public static String getMediumItem(int amount)
   {
     String medium = amount + " Medium Item(s)"+"\n";
     String m = "medium";
     int Chance = 0;
     for(int i = 0;i<amount;i++)
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=10))
       {
         medium += getMagicArmour(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=11)&&(Chance<=20))
       {
         medium += getMagicWeapon(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=21)&&(Chance<=30))
       {
         medium += getPotion(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=31)&&(Chance<=40))
       {
         medium += getRing(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=41)&&(Chance<=50))
       {
         medium += getRod(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=51)&&(Chance<=65))
       {
         medium += getScroll(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=66)&&(Chance<=68))
       {
         medium += getStaff(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=69)&&(Chance<=83))
       {
         medium += getWand(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=84)&&(Chance<=100))
       {
         medium += getWondrousItem(m)+(i<(amount-1)?",":".")+"\n";
       }
     }
     return medium;
   }
   public static String getMajorItem(int amount)
   {
     String major = amount + " Major Item(s)"+"\n";
     String m = "major";
     int Chance = 0;
     for(int i = 0;i<amount;i++)
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=10))
       {
         major += getMagicArmour(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=11)&&(Chance<=20))
       {
         major += getMagicWeapon(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=21)&&(Chance<=25))
       {
         major += getPotion(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=26)&&(Chance<=35))
       {
         major += getRing(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=36)&&(Chance<=45))
       {
         major += getRod(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=46)&&(Chance<=55))
       {
         major += getScroll(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=56)&&(Chance<=75))
       {
         major += getStaff(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=76)&&(Chance<=80))
       {
         major += getWand(m)+(i<(amount-1)?",":".")+"\n";
       }
       else if((Chance>=81)&&(Chance<=100))
       {
         major += getWondrousItem(m)+(i<(amount-1)?",":".")+"\n";
       }
     }
     return major;
   }
   public static String getGems(int amount)
   {
     String gems = amount+" Gems in total \n";
     int Chance  = 0;
     int [] tvalue = new int [amount];
     for(int i = 0;i<amount;i++)
     {
       Chance = ((int)(1+Math.random()*99));
       if((Chance>=1)&&(Chance<=25))
       {
         tvalue[i] = ((int)(4+Math.random()*12));
         gems += " gems worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=26)&&(Chance<=50))
       {
         tvalue[i] = ((int)(2+Math.random()*6)*10);
         gems += " gems worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=51)&&(Chance<=70))
       {
         tvalue[i] = ((int)(4+Math.random()*12)*10);
         gems += " gems worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=71)&&(Chance<=90))
       {
         tvalue[i] = ((int)(2+Math.random()*6)*100);
         gems += " gems worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=91)&&(Chance<=99))
       {
         tvalue[i] = ((int)(4+Math.random()*12)*100);
         gems += " gems worth "+tvalue[i]+"gp \n";
       }
       else if((Chance==100))
       {
         tvalue[i] = ((int)(2+Math.random()*6)*1000);
         gems += " gems worth "+tvalue[i]+"gp \n";
       }
     }
     gems += "In total worth "+ getArraySum(tvalue)+" gp";
     return gems;
   }
   public static String getArt(int amount)
   {
      String art = amount+" Art objects in total \n";
     int Chance  = 0;
     int [] tvalue = new int [amount];
     for(int i = 0;i<amount;i++)
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=10))
       {
         tvalue[i] = ((int)(1+Math.random()*9)*10);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=11)&&(Chance<=25))
       {
         tvalue[i] = ((int)(3+Math.random()*15)*10);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=26)&&(Chance<=40))
       {
         tvalue[i] = ((int)(1+Math.random()*5)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=41)&&(Chance<=50))
       {
         tvalue[i] = ((int)(1+Math.random()*9)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=51)&&(Chance<=60))
       {
         tvalue[i] = ((int)(2+Math.random()*10)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=61)&&(Chance<=70))
       {
         tvalue[i] = ((int)(3+Math.random()*15)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=71)&&(Chance<=80))
       {
         tvalue[i] = ((int)(4+Math.random()*20)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=81)&&(Chance<=85))
       {
         tvalue[i] = ((int)(5+Math.random()*26)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=86)&&(Chance<=90))
       {
         tvalue[i] = ((int)(1+Math.random()*3)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=91)&&(Chance<=95))
       {
         tvalue[i] = ((int)(1+Math.random()*5)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance>=96)&&(Chance<=99))
       {
         tvalue[i] = ((int)(2+Math.random()*6)*100);
         art += " art worth "+tvalue[i]+"gp \n";
       }
       else if((Chance==100))
       {
         tvalue[i] = ((int)(2+Math.random()*10)*1000);
         art += " art worth "+tvalue[i]+"gp \n";
       }
     }
     art += "In total worth "+ getArraySum(tvalue)+" gp";
     return art;
   }
   public static String getAlchemicalItem()
   {
     String item = "";
     String [] items = {"Alchemist's fire (1d4 flasks, 20 gp each)", "Acid (2d4 flasks, 10 gp each)", "Smokesticks (1d4 sticks, 20 gp each)", "Holy water (1d4 flasks, 25 gp each)", "Antitoxin (1d4 doses, 50 gp each)", "Everburning torch", "Tanglefoot bags (1d4 bags, 50 gp each)", "Thunderstones (1d4 stones, 30 gp each)"};
     int Chance  = 0;
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=12))item = items[0];
       else if((Chance>=13)&&(Chance<=24))item = items[1];
       else if((Chance>=25)&&(Chance<=36))item = items[2];
       else if((Chance>=37)&&(Chance<=48))item = items[3];
       else if((Chance>=49)&&(Chance<=62))item = items[4];
       else if((Chance>=63)&&(Chance<=74))item = items[5];
       else if((Chance>=75)&&(Chance<=88))item = items[6];
       else if((Chance>=89)&&(Chance<=100))item = items[7];
     return item;
   }
   public static String getToolsAndGear()
   {
     String tool = "";
     String [] tools = {"Backpack, empty (2 gp)", "Crowbar (2 gp)", "Lantern, bullseye (12 gp)", "Lock, simple (20 gp)", "Lock, average (40 gp)", "Lock, good (80 gp)", "Lock, superior (150 gp)", "Manacles, masterwork (50 gp)", "Mirror, small steel (10 gp)", "Rope, silk (50 ft.) (10 gp)", "Spyglass (1,000 gp)", "Artisan's tools", "masterwork (55 gp)", "Climber's kit (80 gp)", "Disguise kit (50 gp)", "Healer's kit (50 gp)", "Holy symbol", "silver (25 gp)", "Hourglass (25 gp)", "Magnifying glass (100 gp)", "Musical instrument, masterwork (100 gp)", "Thieves' tools, masterwork (50 gp)"};
     int Chance = 0;
     Chance = (int)(1+Math.random()*99);
     if((Chance>=1)&&(Chance<=3)) tool = tools[0];
     else if((Chance>=4)&&(Chance<=6)) tool = tools[1];
     else if((Chance>=7)&&(Chance<=11)) tool = tools[2];
     else if((Chance>=12)&&(Chance<=16)) tool = tools[3];
     else if((Chance>=17)&&(Chance<=21)) tool = tools[4];
     else if((Chance>=22)&&(Chance<=28)) tool = tools[5];
     else if((Chance>=29)&&(Chance<=35)) tool = tools[6];
     else if((Chance>=36)&&(Chance<=40)) tool = tools[7];
     else if((Chance>=41)&&(Chance<=43)) tool = tools[8];
     else if((Chance>=44)&&(Chance<=46)) tool = tools[9];
     else if((Chance>=47)&&(Chance<=53)) tool = tools[10];
     else if((Chance>=54)&&(Chance<=56)) tool = tools[11];
     else if((Chance>=57)&&(Chance<=63)) tool = tools[12];
     else if((Chance>=64)&&(Chance<=68)) tool = tools[13];
     else if((Chance>=69)&&(Chance<=77)) tool = tools[14];
     else if((Chance>=78)&&(Chance<=81)) tool = tools[15];
     else if((Chance>=82)&&(Chance<=88)) tool = tools[16];
     else if((Chance>=89)&&(Chance<=95)) tool = tools[17];
     else if((Chance>=96)&&(Chance<=100)) tool = tools[18];
     return tool;
   }
   public static String getWeapon()
   {
     String weapon = "";
     int Chance = 0;
     Chance = (int)(1+Math.random()*99);
     if((Chance>=1)&&(Chance<=70)){ weapon = getCommonWeapon();}
     else if((Chance>=71)&&(Chance<=80)){ weapon = getUncommonWeapon();}
     else if((Chance>=81)&&(Chance<=100)){ weapon = getRangedWeapon();}
     return weapon;
   }

   public static String getCommonWeapon()
   {
     String weapon = "";
     int Chance = 0;
     Chance = (int)(1+Math.random()*99);
     String [] weapons = {"Dagger", "Greataxe", "Greatsword", "Kama", "Longsword", "Mace, light", "Mace, heavy", "Nunchaku", "Quarterstaff", "Rapier", "Scimitar", "Shortspear", "Siangham", "Sword, bastard", "Sword, short", "Waraxe, dwarven" };
     if((Chance>=1)&&(Chance<=4)) weapon = weapons[0];
     else if((Chance>=5)&&(Chance<=14)) weapon = weapons[1];
     else if((Chance>=15)&&(Chance<=24)) weapon = weapons[2];
     else if((Chance>=25)&&(Chance<=28)) weapon = weapons[3];
     else if((Chance>=29)&&(Chance<=41)) weapon = weapons[4];
     else if((Chance>=42)&&(Chance<=45)) weapon = weapons[5];
     else if((Chance>=46)&&(Chance<=50)) weapon = weapons[6];
     else if((Chance>=51)&&(Chance<=54)) weapon = weapons[7];
     else if((Chance>=55)&&(Chance<=57)) weapon = weapons[8];
     else if((Chance>=58)&&(Chance<=61)) weapon = weapons[9];
     else if((Chance>=62)&&(Chance<=66)) weapon = weapons[10];
     else if((Chance>=67)&&(Chance<=70)) weapon = weapons[11];
     else if((Chance>=71)&&(Chance<=74)) weapon = weapons[12];
     else if((Chance>=75)&&(Chance<=84)) weapon = weapons[13];
     else if((Chance>=85)&&(Chance<=89)) weapon = weapons[14];
     else if((Chance>=90)&&(Chance<=100)) weapon = weapons[15];
     return weapon;
   }
   public static String getUncommonWeapon()
   {
     String weapon = "";
     int Chance = 0;
     Chance = (int)(1+Math.random()*99);
     String [] weapons = {"Axe, orc double", "Battleaxe", "Chain, spiked", "Club", "Crossbow, hand", "Crossbow, repeating", "Dagger, punching",	"Falchion","Flail, dire", "Flail, heavy", "Flail, light", "Gauntlet", "Gauntlet, spiked", "Glaive", "Greatclub", "Guisarme", "Halberd", "Spear", "Hammer, gnome hooked", "Hammer, light", "Handaxe", "Kukri", "Lance", "Longspear", "Morningstar", "Net", "Pick, heavy", "Pick, light", "Ranseur", "Sap", "Scythe", "Shuriken", "Sickle", "Sword, two-bladed", "Trident", "Urgrosh", "dwarven","Warhammer", "Whip"};
     if((Chance>=1)&&(Chance<=3)) weapon = weapons[0];
     else if((Chance>=4)&&(Chance<=7)) weapon = weapons[1];
     else if((Chance>=8)&&(Chance<=10)) weapon = weapons[2];
     else if((Chance>=11)&&(Chance<=12)) weapon = weapons[3];
     else if((Chance>=13)&&(Chance<=16)) weapon = weapons[4];
     else if((Chance>=14)&&(Chance<=19)) weapon = weapons[5];
     else if((Chance>=20)&&(Chance<=21)) weapon = weapons[6];
     else if((Chance>=22)&&(Chance<=23)) weapon = weapons[7];
     else if((Chance>=24)&&(Chance<=26)) weapon = weapons[8];
     else if((Chance>=27)&&(Chance<=31)) weapon = weapons[9];
     else if((Chance>=32)&&(Chance<=35)) weapon = weapons[10];
     else if((Chance>=36)&&(Chance<=37)) weapon = weapons[11];
     else if((Chance>=38)&&(Chance<=39)) weapon = weapons[12];
     else if((Chance>=40)&&(Chance<=41)) weapon = weapons[13];
     else if((Chance>=42)&&(Chance<=43)) weapon = weapons[14];
     else if((Chance>=44)&&(Chance<=45)) weapon = weapons[15];
     else if((Chance>=46)&&(Chance<=48)) weapon = weapons[16];
     else if((Chance>=49)&&(Chance<=51)) weapon = weapons[17];
     else if((Chance>=52)&&(Chance<=54)) weapon = weapons[18];
     else if((Chance>=55)&&(Chance<=56)) weapon = weapons[19];
     else if((Chance>=57)&&(Chance<=58)) weapon = weapons[20];
     else if((Chance>=59)&&(Chance<=61)) weapon = weapons[21];
     else if((Chance>=62)&&(Chance<=64)) weapon = weapons[22];
     else if((Chance>=65)&&(Chance<=67)) weapon = weapons[23];
     else if((Chance>=68)&&(Chance<=70)) weapon = weapons[24];
     else if((Chance>=71)&&(Chance<=72)) weapon = weapons[25];
     else if((Chance>=73)&&(Chance<=74)) weapon = weapons[26];
     else if((Chance>=75)&&(Chance<=76)) weapon = weapons[27];
     else if((Chance>=77)&&(Chance<=78)) weapon = weapons[28];
     else if((Chance>=79)&&(Chance<=80)) weapon = weapons[29];
     else if((Chance>=81)&&(Chance<=82)) weapon = weapons[30];
     else if((Chance>=83)&&(Chance<=84)) weapon = weapons[31];
     else if((Chance>=85)&&(Chance<=86)) weapon = weapons[32];
     else if((Chance>=87)&&(Chance<=89)) weapon = weapons[33];
     else if((Chance>=90)&&(Chance<=91)) weapon = weapons[34];
     else if((Chance>=92)&&(Chance<=94)) weapon = weapons[35];
     else if((Chance>=95)&&(Chance<=97)) weapon = weapons[36];
     else if((Chance>=98)&&(Chance<=100)) weapon = weapons[37];

     return weapon;
   }
   public static String getRangedWeapon()
   {
     String weapon = "";
     int Chance = 0;
     Chance = (int)(1+Math.random()*99);
     String [] weapons = {"Arrows (50)", "Bolts, crossbow (50)", "Bullets, sling (50)", "Axe, throwing", "Crossbow, heavy", "Crossbow, light", "Dart", "Javelin", "Shortbow", "Shortbow, composite (+0 Str bonus)", "Shortbow, composite (+1 Str bonus)", "Shortbow, composite (+2 Str bonus)", "Sling", "Longbow", "Longbow, composite", "Longbow, composite (+1 Str bonus)", "Longbow, composite (+2 Str bonus)", "Longbow, composite (+3 Str bonus)", "Longbow, composite (+4 Str bonus)"};
     if((Chance>=1)&&(Chance<=5)) weapon = weapons[0];
     else if((Chance>=6)&&(Chance<=8)) weapon = weapons[1];
     else if((Chance>=9)&&(Chance<=10)) weapon = weapons[2];
     else if((Chance>=11)&&(Chance<=15)) weapon = weapons[3];
     else if((Chance>=16)&&(Chance<=25)) weapon = weapons[4];
     else if((Chance>=26)&&(Chance<=35)) weapon = weapons[5];
     else if((Chance>=36)&&(Chance<=39)) weapon = weapons[6];
     else if((Chance>=40)&&(Chance<=41)) weapon = weapons[7];
     else if((Chance>=42)&&(Chance<=46)) weapon = weapons[8];
     else if((Chance>=47)&&(Chance<=51)) weapon = weapons[9];
     else if((Chance>=52)&&(Chance<=56)) weapon = weapons[10];
     else if((Chance>=57)&&(Chance<=61)) weapon = weapons[11];
     else if((Chance>=62)&&(Chance<=65)) weapon = weapons[12];
     else if((Chance>=66)&&(Chance<=75)) weapon = weapons[13];
     else if((Chance>=76)&&(Chance<=80)) weapon = weapons[14];
     else if((Chance>=81)&&(Chance<=85)) weapon = weapons[15];
     else if((Chance>=86)&&(Chance<=90)) weapon = weapons[16];
     else if((Chance>=91)&&(Chance<=95)) weapon = weapons[17];
     else if((Chance>=96)&&(Chance<=100)) weapon = weapons[18];
     return weapon;
   }
   public static String getMagicWeapon(String level)
   {
     String weapon = "Magic Weapon";
     weapon += getWeapon();
     if(level.equals("minor"))
     {}
     else if(level.equals("medium"))
     {}
     else if(level.equals("major"))
     {}

     return weapon;
   }
   public static String getSpecificWeapon(String level)
   {
     String weapon = "Specific Weapon";
     return weapon;
   }
   public static String getMeleeAbility(String level)
   {
     String ability = "Melee Ability";
     return ability;
   }
   public static String getRangedAbility(String level)
   {
     String ability = "Ranged Ability";
     return ability;
   }
   public static String getArmour()
   {
     String armour = "";
     int Chance = 0;
     Chance = (int)(1+Math.random()*99);
     String [] armours = {"Chain shirt (100 gp)", "Masterwork studded leather (175 gp)", "Breastplate (200 gp)", "Banded mail (250 gp)", "Half-plate (600 gp)", "Full plate (1,500 gp)", "Darkwood Buckler (205 gp)", "Darkwood Shield (257 gp)", "Masterwork Buckler (165 gp)", "Masterwork Light wooden shield (153 gp)", "Masterwork Light steel shield (159 gp)", "Masterwork Heavy wooden shield (157 gp)"," Masterwork Heavy steel shield (170 gp)"};
     if((Chance>=1)&&(Chance<=12)) armour = armours[0];
     else if((Chance>=13)&&(Chance<=18)) armour = armours[1];
     else if((Chance>=19)&&(Chance<=26)) armour = armours[2];
     else if((Chance>=27)&&(Chance<=34)) armour = armours[3];
     else if((Chance>=36)&&(Chance<=54)) armour = armours[4];
     else if((Chance>=55)&&(Chance<=80)) armour = armours[5];
     else if((Chance>=81)&&(Chance<=85)) armour = armours[6];
     else if((Chance>=86)&&(Chance<=90)) armour = armours[7];
     else if((Chance>=91)&&(Chance<=92)) armour = armours[8];
     else if((Chance>=93)&&(Chance<=94)) armour = armours[9];
     else if((Chance>=94)&&(Chance<=96)) armour = armours[10];
     else if((Chance>=97)&&(Chance<=98)) armour = armours[11];
     else if((Chance>=99)&&(Chance<=100)) armour = armours[12];
     return armour;
   }
   public static String getShield()
   {
     String shield = "";
     String [] shields = {"Buckler", "Light Wooden Shield", "Light Steel Shield", "Heavy Wooden Shield", "Heavy Steel Shield", "Tower Shield"};
     int Chance  = (int)(1+Math.random()*99);
     if((Chance>=1)&&(Chance<=10)) armour = armours[0];
     else if((Chance>=11)&&(Chance<=15)) armour = armours[1];
     else if((Chance>=16)&&(Chance<=20)) armour = armours[2];
     else if((Chance>=21)&&(Chance<=30)) armour = armours[3];
     else if((Chance>=31)&&(Chance<=95)) armour = armours[4];
     else if((Chance>=96)&&(Chance<=100)) armour = armours[5];
     return shield;

   }
   public static String getMagicArmour(String level)
   {
     String armour = "Magic Armour";
     int Chance = 0;
     String [] armour = {"+1 shield (1,000 gp)", "+1 armor (1,000 gp)", "+2 shield (4,000 gp)", "+2 armor (4,000 gp)", "+3 shield (9,000 gp)", "+3 armor (9,000 gp)", "+4 shield (16,000 gp)", "+4 armor (16,000 gp)", "+5 shield (25,000 gp)", "+5 armor (25,000 gp)", "+6 armor/shield (36,000 gp)", "+7 armor/shield (49,000 gp)", "+8 armor/shield (64,000 gp)", "+9 armor/shield (81,000 gp)", "+10 armor/shield (100,000 gp)"};
     if(level.equals("minor"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=60)) armour += armours[0];
       else if((Chance>=61)&&(Chance<=80)) armour += armours[1];
       else if((Chance>=81)&&(Chance<=85)) armour += armours[2];
       else if((Chance>=86)&&(Chance<=87)) armour += armours[3];
       else if((Chance>=88)&&(Chance<=89)) armour += getSpecificArmour(level);
       else if((Chance>=90)&&(Chance<=91)) armour += getSpecificShield(level);
       else if((Chance>=92)&&(Chance<=100))armour += getSpecialAbility(level);
     }
     else if(level.equals("medium"))
     {

       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=5)) armour += armours[0];
       else if((Chance>=6)&&(Chance<=10)) armour += armours[1];
       else if((Chance>=11)&&(Chance<=20)) armour += armours[2];
       else if((Chance>=21)&&(Chance<=30)) armour += armours[3];
       else if((Chance>=31)&&(Chance<=40)) armour += armours[4];
       else if((Chance>=41)&&(Chance<=50)) armour += armours[5];
       else if((Chance>=51)&&(Chance<=55)) armour += armours[6];
       else if((Chance>=56)&&(Chance<=57)) armour += armours[7];
       else if((Chance>=58)&&(Chance<=60)) armour += getSpecificArmour(level);
       else if((Chance>=61)&&(Chance<=63)) armour += getSpecificShield(level);
       else if((Chance>=64)&&(Chance<=100)) armour += getSpecialAbility(level);


     }
     else if(level.equals("major"))
     {

       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=8)) armour += armours[4];
       else if((Chance>=9)&&(Chance<=16)) armour += armours[5];
       else if((Chance>=17)&&(Chance<=27)) armour += armours[6];
       else if((Chance>=28)&&(Chance<=38)) armour += armours[7];
       else if((Chance>=39)&&(Chance<=49)) armour += armours[8];
       else if((Chance>=50)&&(Chance<=57)) armour += armours[9];
       else if((Chance>=58)&&(Chance<=60)) armour += getSpecificArmour(level);
       else if((Chance>=61)&&(Chance<=63)) armour += getSpecificShield(level);
       else if((Chance>=64)&&(Chance<=100)) armour += getArmourAbility(level);

     }
     return armour;
   }
   public static String getSpecificArmour(String level)
   {
     String armour = "";
     int Chance = 0;
     String [] armours ={"Mithral shirt (1,100 gp)","Dragonhide plate (3,300 gp)","Elven chain (4,150 gp)","Rhino hide (5,165 gp)","Adamantine breastplate (10,200 gp)","Dwarven plate (16,500 gp)","Banded mail of luck (18,900 gp)","Celestial armor (22,400 gp)","Plate armor of the deep (24,650 gp)","Breastplate of command (25,400 gp)","Mithral full plate of speed (26,500 gp)","Demon armor (52,260 gp)"};
     if(level.equals("minor"))
     {
       Chacne = (int)(1+Math.random()*99);
       if((Chance>=01)&&(Chance<=50)) armour += armours[0];
       else if((Chance>=51)&&(Chance<=80)) armour += armours[1];
       else if((Chance>=81)&&(Chance<=100)) armour += armours[2];
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=01)&&(Chance<=25)) armour += armours[0];
       else if((Chance>=26)&&(Chance<=45)) armour += armours[1];
       else if((Chance>=46)&&(Chance<=57)) armour += armours[2];
       else if((Chance>=58)&&(Chance<=67)) armour += armours[3];
       else if((Chance>=68)&&(Chance<=82)) armour += armours[4];
       else if((Chance>=83)&&(Chance<=97)) armour += armours[5];
       else if((Chance>=98)&&(Chance<=100)) armour += armours[6];
     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=10)) armour += armours[4];
       else if((Chance>=11)&&(Chance<=20)) armour += armours[5];
       else if((Chance>=21)&&(Chance<=32)) armour += armours[6];
       else if((Chance>=33)&&(Chance<=50)) armour += armours[7];
       else if((Chance>=51)&&(Chance<=60)) armour += armours[8];
       else if((Chance>=61)&&(Chance<=75)) armour += armours[9];
       else if((Chance>=76)&&(Chance<=90)) armour += armours[10];
       else if((Chance>=91)&&(Chance<=100)) armour += armours[11];
     }
     return armour;
   }
   public static String getSpecificShield(String level)
   {
     String shield = "Specific Shield";
     int Chance = 0;
     String [] shields = {"Darkwood buckler (205 gp)","Darkwood shield (257 gp)", "Mithral heavy shield (1,020 gp)", "Caster's shield (3,153 gp)", "Spined shield (5,580 gp)", "Lion's shield (9,170 gp)", "Winged shield (17,257 gp)", "Absorbing shield (50,170 gp)"};
     if(level.equals("minor"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=30)) shield += shield[0];
       else if((Chance>=31)&&(Chance<=80)) shield += shield[1];
       else if((Chance>=81)&&(Chance<=95)) shield += shield[2];
       else if((Chance>=96)&&(Chance<=100)) shield += shield[3];
     }
     else if(level.equals("medium"))
     {
        Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=20)) shield += shield[0];
       else if((Chance>=21)&&(Chance<=45)) shield += shield[1];
       else if((Chance>=46)&&(Chance<=70)) shield += shield[2];
       else if((Chance>=71)&&(Chance<=85)) shield += shield[3];
       else if((Chance>=86)&&(Chance<=90)) shield += shield[4];
       else if((Chance>=91)&&(Chance<=95)) shield += shield[5];
       else if((Chance>=96)&&(Chance<=100)) shield += shield[6];
     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=20)) shield += shield[3];
       else if((Chance>=21)&&(Chance<=40)) shield += shield[4];
       else if((Chance>=41)&&(Chance<=60)) shield += shield[5];
       else if((Chance>=61)&&(Chance<=90)) shield += shield[6];
       else if((Chance>=91)&&(Chance<=100)) shield += shield[7];
     }
     return shield;
   }
   public static String getArmourAbility(String level)
   {
     String ability ="Special Ablility";
     int Chance = 0;
     String [] abilities = {"Glamered (+2,700 gp)","Fortification, light (+1 bonus1)","Slick (+3,750 gp)","Shadow (+3,750 gp)","Silent moves (+3,750 gp)","Spell resistance (13) (+2 bonus1)","Slick, improved (+15,000 gp)","Shadow, improved (+15,000 gp)","Silent moves, improved (+15,000 gp)","Acid resistance (+18,000 gp)","Cold resistance (+18,000 gp)","Electricity resistance (+18,000 gp)","Fire resistance (+18,000 gp)","Sonic resistance (+18,000 gp)","Ghost touch (+3 bonus1)","Invulnerability (+3 bonus1)","Fortification, moderate (+3 bonus1)","Spell resistance (15) (+3 bonus1)","Wild (+3 bonus1)","Slick, greater (+33,750 gp)","Shadow, greater (+33,750 gp)","Silent moves, greater (+33,750 gp)","Acid resistance, improved (+42,000 gp)","Cold resistance, improved (+42,000 gp)","Electricity resistance, improved (+42,000 gp)","Fire resistance, improved (+42,000 gp)","Sonic resistance, improved (+42,000 gp)","Spell resistance (17) (+4 bonus1)","Etherealness (+49,000 gp)","Undead controlling (+49,000 gp)","Fortification, heavy (+5 bonus1)","Spell resistance (19) (+5 bonus1)","Acid resistance, greater (+66,000 gp)","Cold resistance, greater (+66,000 gp)","Electricity resistance, greater (+66,000 gp)","Fire resistance, greater (+66,000 gp)","Sonic resistance, greater (+66,000 gp)"};
     if(level.equals("minor"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=25)) ability += abilities[0];
       else if((Chance>=26)&&(Chance<=32)) ability += abilities[1];
       else if((Chance>=33)&&(Chance<=52)) ability += abilities[2];
       else if((Chance>=53)&&(Chance<=72)) ability += abilities[3];
       else if((Chance>=73)&&(Chance<=92)) ability += abilities[4];
       else if((Chance>=93)&&(Chance<=96)) ability += abilities[5];
       else if((Chance==97)) ability += abilities[6];
       else if((Chance==98)) ability += abilities[7];
       else if((Chance==99)) ability += abilities[8];
       else if((Chance==100)) ability += getShieldAbility(level);
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
        if((Chance>=1)&&(Chance<=5)) ability += abilities[0];
        else if((Chance>=6)&&(Chance<=8)) ability += abilities[1];
        else if((Chance>=9)&&(Chance<=11)) ability += abilities[2];
        else if((Chance>=12)&&(Chance<=14)) ability += abilities[3];
        else if((Chance>=15)&&(Chance<=17)) ability += abilities[4];
        else if((Chance>=18)&&(Chance<=19)) ability += abilities[5];
        else if((Chance>=20)&&(Chance<=29)) ability += abilities[6];
        else if((Chance>=30)&&(Chance<=39)) ability += abilities[7];
        else if((Chance>=40)&&(Chance<=49)) ability += abilities[8];
        else if((Chance>=50)&&(Chance<=54)) ability += abilities[9];
        else if((Chance>=55)&&(Chance<=59)) ability += abilities[10];
        else if((Chance>=60)&&(Chance<=64)) ability += abilities[11];
        else if((Chance>=65)&&(Chance<=69)) ability += abilities[12];
        else if((Chance>=70)&&(Chance<=74)) ability += abilities[13];
        else if((Chance>=75)&&(Chance<=79)) ability += abilities[14];
        else if((Chance>=80)&&(Chance<=84)) ability += abilities[15];
        else if((Chance>=85)&&(Chance<=89)) ability += abilities[16];
        else if((Chance>=90)&&(Chance<=94)) ability += abilities[16];
        else if((Chance>=95)&&(Chance<=99)) ability += abilities[17];
        else if((Chance==100)) ability += getShieldAbility(level);

     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
        if((Chance>=1)&&(Chance<=3)) ability += abilities[0];
        else if((Chance==4)) ability += abilities[1];
        else if((Chance>=5)&&(Chance<=7)) ability += abilities[6];
        else if((Chance>=8)&&(Chance<=10)) ability += abilities[7];
        else if((Chance>=11)&&(Chance<=13)) ability += abilities[8];
        else if((Chance>=14)&&(Chance<=16)) ability += abilities[9];
        else if((Chance>=17)&&(Chance<=19)) ability += abilities[10];
        else if((Chance>=20)&&(Chance<=22)) ability += abilities[11];
        else if((Chance>=23)&&(Chance<=25)) ability += abilities[12];
        else if((Chance>=26)&&(Chance<=28)) ability += abilities[13];
        else if((Chance>=29)&&(Chance<=33)) ability += abilities[14];
        else if((Chance>=34)&&(Chance<=35)) ability += abilities[15];
        else if((Chance>=36)&&(Chance<=40)) ability += abilities[16];
        else if((Chance>=41)&&(Chance<=42)) ability += abilities[17];
        else if((Chance==43)) ability += abilities[18];
        else if((Chance>=44)&&(Chance<=48)) ability += abilities[19];
        else if((Chance>=49)&&(Chance<=53)) ability += abilities[20];
        else if((Chance>=54)&&(Chance<=58)) ability += abilities[21];
        else if((Chance>=59)&&(Chance<=63)) ability += abilities[22];
        else if((Chance>=64)&&(Chance<=68)) ability += abilities[23];
        else if((Chance>=69)&&(Chance<=73)) ability += abilities[24];
        else if((Chance>=74)&&(Chance<=78)) ability += abilities[25];
        else if((Chance>=79)&&(Chance<=83)) ability += abilities[26];
        else if((Chance>=84)&&(Chance<=88)) ability += abilities[27];
        else if((Chance==89)) ability += abilities[28];
        else if((Chance==90)) ability += abilities[29];
        else if((Chance>=91)&&(Chance<=92)) ability += abilities[30];
        else if((Chance>=93)&&(Chance<=94)) ability += abilities[31];
        else if((Chance==95)) ability += abilities[32];
        else if((Chance==96)) ability += abilities[33];
        else if((Chance==97)) ability += abilities[34];
        else if((Chance==98)) ability += abilities[35];
        else if((Chance==99)) ability += abilities[36];
        else if((Chance==100)) ability += getShieldAbility(level);
     }
     return ability;
   }
   public static String getShieldAbility(String level)
   {
     String ability ="Special Ablility";
     int Chance = 0;
     String [] abilities = {"Arrow catching (+1 bonus1)","Bashing (+1 bonus1)","Blinding (+1 bonus1)","Fortification, light (+1 bonus1)","Arrow deflection (+2 bonus1)","Animated (+2 bonus1)","Spell resistance (13) (+2 bonus1)","Acid resistance (+18,000 gp)","Cold resistance (+18,000 gp)","Electricity resistance (+18,000 gp)","Fire resistance (+18,000 gp)","Sonic resistance (+18,000 gp)","Ghost touch (+3 bonus1)","Fortification, moderate (+3 bonus1)","Spell resistance (15) (+3 bonus1)","Wild (+3 bonus1)","Acid resistance, improved (+42,000 gp)","Cold resistance, improved (+42,000 gp)","Electricity resistance, improved (+42,000 gp)","Fire resistance, improved (+42,000 gp)","Sonic resistance, improved (+42,000 gp)","Spell resistance (17) (+4 bonus1)","Undead controlling (+49,000 gp)","Fortification, heavy (+5 bonus1)","Reflecting (+5 bonus1)","Spell resistance (19) (+5 bonus1)","Acid resistance, greater (+66,000 gp)","Cold resistance, greater (+66,000 gp)","Electricity resistance, greater (+66,000 gp)","Fire resistance, greater (+66,000 gp)","Sonic resistance, greater (+66,000 gp)"};
     if(level.equals("minor"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=20)) ability += abilities[];
       else if((Chance>=21)&&(Chance<=40)) ability += abilities[];
       else if((Chance>=41)&&(Chance<=50)) ability += abilities[];
       else if((Chance>=51)&&(Chance<=75)) ability += abilities[];
       else if((Chance>=76)&&(Chance<=92)) ability += abilities[];
       else if((Chance>=93)&&(Chance<=97)) ability += abilities[];
       else if((Chance>=98)&&(Chance<=99)) ability += abilities[];
       else if((Chance==100)) ability += getShieldAbility(level);
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=10)) ability += abilities[];
       else if((Chance>=11)&&(Chance<=20)) ability += abilities[];
       else if((Chance>=21)&&(Chance<=25)) ability += abilities[];
       else if((Chance>=26)&&(Chance<=40)) ability += abilities[];
       else if((Chance>=41)&&(Chance<=50)) ability += abilities[];
       else if((Chance>=51)&&(Chance<=57)) ability += abilities[];
       else if((Chance>=58)&&(Chance<=59)) ability += abilities[];
       else if((Chance>=60)&&(Chance<=63)) ability += abilities[];
       else if((Chance>=64)&&(Chance<=67)) ability += abilities[];
       else if((Chance>=68)&&(Chance<=71)) ability += abilities[];
       else if((Chance>=72)&&(Chance<=75)) ability += abilities[];
       else if((Chance>=76)&&(Chance<=79)) ability += abilities[];
       else if((Chance>=80)&&(Chance<=85)) ability += abilities[];
       else if((Chance>=86)&&(Chance<=95)) ability += abilities[];
       else if((Chance>=96)&&(Chance<=98)) ability += abilities[];
       else if((Chance==99)) ability += abilities[];
       else if((Chance==100)) ability += getSheildAbility(level);
     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=5)) ability += abilities[];
       else if((Chance>=6)&&(Chance<=8)) ability += abilities[];
       else if((Chance>=9)&&(Chance<=10)) ability += abilities[];
       else if((Chance>=11)&&(Chance<=15)) ability += abilities[];
       else if((Chance>=16)&&(Chance<=20)) ability += abilities[];
       else if((Chance>=21)&&(Chance<=25)) ability += abilities[];
       else if((Chance>=26)&&(Chance<=28)) ability += abilities[];
       else if((Chance>=29)&&(Chance<=31)) ability += abilities[];
       else if((Chance>=32)&&(Chance<=34)) ability += abilities[];
       else if((Chance>=35)&&(Chance<=37)) ability += abilities[];
       else if((Chance>=38)&&(Chance<=40)) ability += abilities[];
       else if((Chance>=41)&&(Chance<=46)) ability += abilities[];
       else if((Chance>=47)&&(Chance<=56)) ability += abilities[];
       else if((Chance>=57)&&(Chance<=58)) ability += abilities[];
       else if((Chance==59)) ability += abilities[];
       else if((Chance>=60)&&(Chance<=64)) ability += abilities[];
       else if((Chance>=65)&&(Chance<=69)) ability += abilities[];
       else if((Chance>=70)&&(Chance<=74)) ability += abilities[];
       else if((Chance>=75)&&(Chance<=79)) ability += abilities[];
       else if((Chance>=80)&&(Chance<=84)) ability += abilities[];
       else if((Chance>=85)&&(Chance<=86)) ability += abilities[];
       else if((Chance==87)) ability += abilities[];
       else if((Chance>=88)&&(Chance<=91)) ability += abilities[];
       else if((Chance>=92)&&(Chance<=93)) ability += abilities[];
       else if((Chance==94)) ability += abilities[];
       else if((Chance==95)) ability += abilities[];
       else if((Chance==96)) ability += abilities[];
       else if((Chance==97)) ability += abilities[];
       else if((Chance==98)) ability += abilities[];
       else if((Chance==99)) ability += abilities[];
       else if((Chance==100)) ability += getShieldAbility(level);
     }
     return ability;
   }
   public static String getScroll(String level)
   {
     String scroll = "Scroll";
     if(level.equals("minor"))
     {}
     else if(level.equals("medium"))
     {}
     else if(level.equals("major"))
     {}
     return scroll;
   }
   public static String getRing(String level)
   {
     String ring = "Ring of ";
     String [] rings = {"Protection +1 (2,000 gp)", "Feather falling (2,200 gp)", "Sustenance (2,500 gp)","Climbing (2,500 gp)", "Jumping (2,500 gp)", "Swimming( 2,500 gp)", "Counterspells (4,000 gp)", "Mind shielding (8,000 gp)", "Protection +2 (8,000 gp)", "Force shield (8,500 gp)", "Ram (8,600 gp)", "Climbing, improved (10,000 gp)", "Jumping, improved (10,000 gp)", "Swimming, improved (10,000 gp)", "Animal friendship (10,800 gp)", "Energy resistance, minor (12,000 gp)", "Chameleon power (12,700 gp)", "Water walking (15,000 gp)", "Protection +3 (18,000 gp)", "Spell storing, minor (18,000 gp)", "invisibility (20,000 gp)", "Wizardry (I) (20,000 gp)", "Evasion (25,000 gp)", "X-ray vision (25,000 gp)", "Blinking (27,000 gp)", "Energy resistance, major (28,000 gp)", "Protection +4 (32,000 gp)", "Wizardry (II) (40,000 gp)", "Freedom of movement (40,000 gp)", "Energy resistance, greater (44,000 gp)", "friend shield (pair) (50,000 gp)", "Protection +5 (50,000 gp)", "Shooting stars (50,000 gp)", "Spell storing (50,000 gp)", "Wizardry (III) (70,000 gp)", "Telekinesis (75,000 gp)", "Regeneration (90,000 gp)", "Three wishes (97,950 gp)", "Spell turning (98,280 gp)", "Wizardry (IV) (100,000 gp)", "Djinni calling (125,000 gp)", "Elemental command (air) (200,000 gp)", "Elemental command (earth) (200,000 gp)", "Elemental command (fire) (200,000 gp)", "Elemental command (water) (200,000 gp)", "Spell storing, major (200,000 gp)"};
     int Chance = 0;
     if(level.equals("minor"))
     {
        Chance += (int)(1+Math.random()*99);
        if((Chance>=1)&&(Chance<=18)) ring += rings[0];
        else if((Chance>=19)&&(Chance<=28)) ring += rings[1];
        else if((Chance>=29)&&(Chance<=36)) ring += rings[2];
        else if((Chance>=37)&&(Chance<=44)) ring += rings[3];
        else if((Chance>=45)&&(Chance<=52)) ring += rings[4];
        else if((Chance>=53)&&(Chance<=60)) ring += rings[5];
        else if((Chance>=61)&&(Chance<=70)) ring += rings[6];
        else if((Chance>=71)&&(Chance<=75)) ring += rings[7];
        else if((Chance>=76)&&(Chance<=74)) ring += rings[8];
        else if((Chance>=81)&&(Chance<=85)) ring += rings[9];
        else if((Chance>=86)&&(Chance<=90)) ring += rings[10];
        else if((Chance>=91)&&(Chance<=93)) ring += rings[14];
        else if((Chance>=94)&&(Chance<=96)) ring += rings[15];
        else if((Chance>=97)&&(Chance<=98)) ring += rings[16];
        else if((Chance>=99)&&(Chance<=100)) ring += rings[17];
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
        if((Chance>=1)&&(Chance<=5)) ring += rings[6];
        else if((Chance>=6)&&(Chance<=8)) ring += rings[7];
        else if((Chance>=9)&&(Chance<=18)) ring += rings[8];
        else if((Chance>=19)&&(Chance<=23)) ring += rings[9];
        else if((Chance>=24)&&(Chance<=28)) ring += rings[10];
        else if((Chance>=29)&&(Chance<=34)) ring += rings[11];
        else if((Chance>=35)&&(Chance<=40)) ring += rings[12];
        else if((Chance>=41)&&(Chance<=46)) ring += rings[13];
        else if((Chance>=47)&&(Chance<=50)) ring += rings[14];
        else if((Chance>=51)&&(Chance<=56)) ring += rings[15];
        else if((Chance>=57)&&(Chance<=61)) ring += rings[16];
        else if((Chance>=62)&&(Chance<=66)) ring += rings[17];
        else if((Chance>=67)&&(Chance<=71)) ring += rings[18];
        else if((Chance>=72)&&(Chance<=76)) ring += rings[19];
        else if((Chance>=77)&&(Chance<=81)) ring += rings[20];
        else if((Chance>=82)&&(Chance<=85)) ring += rings[21];
        else if((Chance>=86)&&(Chance<=90)) ring += rings[22];
        else if((Chance>=91)&&(Chance<=93)) ring += rings[23];
        else if((Chance>=94)&&(Chance<=97)) ring += rings[24];
        else if((Chance>=98)&&(Chance<=100)) ring += rings[25];
     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
        if((Chance>=1)&&(Chance<=2)) ring  += rings[15];
        else if((Chance>=3)&&(Chance<=7)) ring += rings[18];
        else if((Chance>=8)&&(Chance<=10)) ring += rings[19];
        else if((Chance>=11)&&(Chance<=15)) ring += rings[20];
        else if((Chance>=16)&&(Chance<=19)) ring += rings[21];
        else if((Chance>=20)&&(Chance<=25)) ring += rings[22];
        else if((Chance>=26)&&(Chance<=28)) ring += rings[23];
        else if((Chance>=29)&&(Chance<=32)) ring += rings[24];
        else if((Chance>=33)&&(Chance<=39)) ring += rings[25];
        else if((Chance>=40)&&(Chance<=49)) ring += rings[26];
        else if((Chance>=50)&&(Chance<=55)) ring += rings[27];
        else if((Chance>=56)&&(Chance<=60)) ring += rings[28];
        else if((Chance>=61)&&(Chance<=63)) ring += rings[29];
        else if((Chance>=64)&&(Chance<=65)) ring += rings[30];
        else if((Chance>=66)&&(Chance<=70)) ring += rings[31];
        else if((Chance>=71)&&(Chance<=74)) ring += rings[32];
        else if((Chance>=75)&&(Chance<=79)) ring += rings[33];
        else if((Chance>=80)&&(Chance<=83)) ring += rings[34];
        else if((Chance>=84)&&(Chance<=86)) ring += rings[35];
        else if((Chance>=87)&&(Chance<=88)) ring += rings[36];
        else if((Chance>=89)) ring += rings[37];
        else if((Chance>=90)&&(Chance<=92)) ring += rings[38];
        else if((Chance>=93)&&(Chance<=94)) ring += rings[39];
        else if((Chance==95)) ring += rings[40];
        else if((Chance==96)) ring += rings[41];
        else if((Chance==97)) ring += rings[42];
        else if((Chance==98)) ring += rings[43];
        else if((Chance==99)) ring += rings[44];
        else if((Chance==100)) ring += rings[45];

     }
     return ring;
   }
   public static String getWand(String level)
   {
     String wand = "Wand of ";
     String [] wands = {"Detect magic (375 gp)", "light (375 gp)Burning hands (750 gp)", "Charm animal (750 gp)", "Charm person (750 gp)", "Color spray (750 gp)", "cure light wounds (750 gp)", "detect secret doors (750 gp)", "Enlarge person (750 gp)", "Magic missile (1st) (750 gp)", "Shocking grasp (750 gp)", "Summon monster I (750 gp)", "Magic missile (3rd) (2,250 gp)", "Magic missile (5th) (3,750 gp)", "Bear's endurance (4,500 gp)", "Bull's strength (4,500 gp)", "cat's grace (4,500 gp)", "cure moderate wounds (4,500 gp)", "darkness (4,500 gp)", "daylight (4,500 gp)", "Delay poison (4,500 gp)", "Eagle's splendor (4,500 gp)", "false life (4,500 gp)", "fox's cunning (4,500 gp)", "ghoul touch (4,500 gp)", "Hold person (4,500 gp)", "Invisibility (4,500 gp)", "Knock (4,500 gp)", "Levitate (4,500 gp)", "Acid arrow (4,500 gp)", "Mirror image (4,500 gp)", "owl's wisdom (4,500 gp)", "shatter (4,500 gp)", "Silence (4,500 gp)", "summon monster II (4,500 gp)", "Web (4,500 gp)", "Magic missile (7th) (5,250 gp)", "Magic missile (9th) (6,750 gp)", "Call lightning (5th) (11,250 gp)", "Charm person, heightened (3rd-level spell) (11,250 gp)", "contagion (11,250 gp)", "cure serious wounds (11,250 gp)", "dispel magic (11,250 gp)", "Fireball (5th) (11,250 gp)", "keen edge (11,250 gp)", "Lightning bolt (5th) (11,250 gp)", "Major image (11,250 gp)", "Slow (11,250 gp)", "Suggestion (11,250 gp)", "summon monster III (11,250 gp)", "Fireball (6th) (13,500 gp)", "Lightning bolt (6th) (13,500 gp)", "Searing light (6th) (13,500 gp)", "Call lightning (8th) (18,000 gp)", "Fireball (8th) (18,000 gp)", "Lightning bolt (8th) (18,000 gp)", "Charm monster (21,000 gp)", "Cure critical wounds (21,000 gp)", "Dimensional anchor (21,000 gp)", "Fear (21,000 gp)", "Greater invisibility (21,000 gp)", "Hold person, heightened (4th level) (21,000 gp)", "ice storm (21,000 gp)", "inflict critical wounds (21,000 gp)", "Neutralize poison (21,000 gp)", "Poison (21,000 gp)", "polymorph (21,000 gp)", "ray of enfeeblement heightened (4th level) (21,000 gp)", "Suggestion, heightened (4th level) (21,000 gp)", "Summon monster IV (21,000 gp)", "wall of fire (21,000 gp)", "wall of ice (21,000 gp)", "Dispel magic (10th) (22,500 gp)", "Fireball (10th) (22,500 gp)", "Lightning bolt (10th) (22,500 gp)", "Chaos hammer (8th) (24,000 gp)", "Holy smite (8th) (24,000 gp)", "Order's wrath (8th) (24,000 gp)", "Unholy blight (8th) (24,000 gp)", "Restoration (26,000 gp)", "Stoneskin (33,500 gp)"};
     int Chance = 0;
     if(level.equals("minor"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=2)) wand += wands[0];
       else if((Chance>=3)&&(Chance<=4)) wand += wands[1];
       else if((Chance>=5)&&(Chance<=7)) wand += wands[2];
       else if((Chance>=8)&&(Chance<=10)) wand += wands[3];
       else if((Chance>=11)&&(Chance<=13)) wand += wands[4];
       else if((Chance>=14)&&(Chance<=16)) wand += wands[5];
       else if((Chance>=17)&&(Chance<=19)) wand += wands[6];
       else if((Chance>=20)&&(Chance<=22)) wand += wands[7];
       else if((Chance>=23)&&(Chance<=25)) wand += wands[8];
       else if((Chance>=26)&&(Chance<=28)) wand += wands[9];
       else if((Chance>=29)&&(Chance<=31)) wand += wands[10];
       else if((Chance>=32)&&(Chance<=34)) wand += wands[11];
       else if((Chance>=35)&&(Chance<=36)) wand += wands[12];
       else if((Chance==37)) wand +=wands[13];
       else if((Chance>=38)&&(Chance<=40)) wand += wands[14];
       else if((Chance>=41)&&(Chance<=43)) wand += wands[15];
       else if((Chance>=44)&&(Chance<=46)) wand += wands[16];
       else if((Chance>=47)&&(Chance<=49)) wand += wands[17];
       else if((Chance>=50)&&(Chance<=51)) wand += wands[18];
       else if((Chance>=52)&&(Chance<=54)) wand += wands[19];
       else if((Chance>=55)&&(Chance<=57)) wand += wands[20];
       else if((Chance>=58)&&(Chance<=60)) wand += wands[21];
       else if((Chance>=61)&&(Chance<=63)) wand += wands[22];
       else if((Chance>=64)&&(Chance<=66)) wand += wands[23];
       else if((Chance>=67)&&(Chance<=68)) wand += wands[24];
       else if((Chance>=69)&&(Chance<=71)) wand += wands[25];
       else if((Chance>=72)&&(Chance<=74)) wand += wands[26];
       else if((Chance>=75)&&(Chance<=77)) wand += wands[27];
       else if((Chance>=78)&&(Chance<=80)) wand += wands[28];
       else if((Chance>=81)&&(Chance<=83)) wand += wands[29];
       else if((Chance>=84)&&(Chance<=86)) wand += wands[30];
       else if((Chance>=87)&&(Chance<=89)) wand += wands[31];
       else if((Chance>=90)&&(Chance<=91)) wand += wands[32];
       else if((Chance>=92)&&(Chance<=94)) wand += wands[33];
       else if((Chance>=95)&&(Chance<=97)) wand += wands[34];
       else if((Chance>=98)&&(Chance<=100)) wand += wands[35];
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=3)) wand += wands[13];
       else if((Chance>=4)&&(Chance<=7)) wand += wands[14];
       else if((Chance>=8)&&(Chance<=11)) wand += wands[15];
       else if((Chance>=12)&&(Chance<=15)) wand += wands[16];
       else if((Chance>=16)&&(Chance<=20)) wand += wands[17];
       else if((Chance>=21)&&(Chance<=22)) wand += wands[18];
       else if((Chance>=23)&&(Chance<=24)) wand += wands[19];
       else if((Chance>=25)&&(Chance<=27)) wand += wands[20];
       else if((Chance>=28)&&(Chance<=31)) wand += wands[21];
       else if((Chance>=32)&&(Chance<=33)) wand += wands[22];
       else if((Chance>=34)&&(Chance<=37)) wand += wands[23];
       else if((Chance>=38)&&(Chance<=39)) wand += wands[24];
       else if((Chance>=40)&&(Chance<=42)) wand += wands[25];
       else if((Chance>=43)&&(Chance<=44)) wand += wands[26];
       else if((Chance==45)) wand += wands[27];
       else if((Chance>=46)&&(Chance<=47)) wand += wands[28];
       else if((Chance>=48)&&(Chance<=49)) wand += wands[29];
       else if((Chance>=50)&&(Chance<=53)) wand += wands[30];
       else if((Chance==54)) wand += wands[31];
       else if((Chance>=55)&&(Chance<=56)) wand += wands[32];
       else if((Chance==57)) wand += wands[33];
       else if((Chance>=58)&&(Chance<=59)) wand += wands[34];
       else if((Chance>=60)&&(Chance<=62)) wand += wands[35];
       else if((Chance>=63)&&(Chance<=64)) wand += wands[36];
       else if((Chance>=65)&&(Chance<=67)) wand += wands[37];
       else if((Chance==68)) wand += wands[38];
       else if((Chance>=69)&&(Chance<=70)) wand += wands[39];
       else if((Chance>=71)&&(Chance<=74)) wand += wands[40];
       else if((Chance>=75)&&(Chance<=77)) wand += wands[41];
       else if((Chance>=78)&&(Chance<=81)) wand += wands[42];
       else if((Chance>=82)&&(Chance<=83)) wand += wands[43];
       else if((Chance>=84)&&(Chance<=87)) wand += wands[44];
       else if((Chance>=88)&&(Chance<=89)) wand += wands[45];
       else if((Chance>=90)&&(Chance<=91)) wand += wands[46];
       else if((Chance>=92)&&(Chance<=94)) wand += wands[47];
       else if((Chance>=95)&&(Chance<=97)) wand += wands[48];
       else if((Chance==98)) wand += wands[49];
       else if((Chance==99)) wand += wands[50];
       else if((Chance==100)) wand += wands[51];

     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=2)) wand += wands[36];
       else if((Chance>=3)&&(Chance<=05)) wand += wands[37];
       else if((Chance>=6)&&(Chance<=07)) wand += wands[38];
       else if((Chance==8)) wand += wands[39];
       else if((Chance>=9)&&(Chance<=10)) wand += wands[40];
       else if((Chance>=11)&&(Chance<=13)) wand += wands[41];
       else if((Chance>=14)&&(Chance<=15)) wand += wands[42];
       else if((Chance>=16)&&(Chance<=17)) wand += wands[43];
       else if((Chance>=18)&&(Chance<=19)) wand += wands[44];
       else if((Chance>=20)&&(Chance<=21)) wand += wands[45];
       else if((Chance>=22)&&(Chance<=23)) wand += wands[46];
       else if((Chance>=24)&&(Chance<=25)) wand += wands[47];
       else if((Chance>=26)&&(Chance<=27)) wand += wands[48];
       else if((Chance>=28)&&(Chance<=29)) wand += wands[49];
       else if((Chance>=30)&&(Chance<=31)) wand += wands[50];
       else if((Chance>=32)&&(Chance<=33)) wand += wands[51];
       else if((Chance>=34)&&(Chance<=35)) wand += wands[52];
       else if((Chance>=36)&&(Chance<=37)) wand += wands[53];
       else if((Chance>=38)&&(Chance<=39)) wand += wands[54];
       else if((Chance>=40)&&(Chance<=41)) wand += wands[55];
       else if((Chance>=42)&&(Chance<=45)) wand += wands[56];
       else if((Chance>=46)&&(Chance<=50)) wand += wands[57];
       else if((Chance>=51)&&(Chance<=52)) wand += wands[58];
       else if((Chance>=53)&&(Chance<=55)) wand += wands[59];
       else if((Chance>=56)&&(Chance<=59)) wand += wands[60];
       else if((Chance==60)) wand += wands[61];
       else if((Chance>=61)&&(Chance<=65)) wand += wands[62];
       else if((Chance>=66)&&(Chance<=68)) wand += wands[63];
       else if((Chance>=69)&&(Chance<=72)) wand += wands[64];
       else if((Chance>=73)&&(Chance<=74)) wand += wands[65];
       else if((Chance>=75)&&(Chance<=77)) wand += wands[66];
       else if((Chance==78)) wand += wands[67];
       else if((Chance==79)) wand += wands[68];
       else if((Chance>=80)&&(Chance<=82)) wand += wands[69];
       else if((Chance>=83)&&(Chance<=86)) wand += wands[70];
       else if((Chance>=87)&&(Chance<=90)) wand += wands[71];
       else if((Chance==91)) wand += wands[72];
       else if((Chance==92)) wand += wands[73];
       else if((Chance==93)) wand += wands[74];
       else if((Chance==94)) wand += wands[75];
       else if((Chance==95)) wand += wands[76];
       else if((Chance==96)) wand += wands[77];
       else if((Chance==97)) wand += wands[78];
       else if((Chance>=98)&&(Chance<=99)) wand += wands[79];
       else if((Chance==100)) wand += wands[80];

     }
     return wand;
   }
   public static String getStaff(String level)
   {
     String staff = "Staff of ";
     int Chance = 0;
     String [] staffs = {"Charming (16,500 gp)","Fire (17,750 gp)","Swarming insects (24,750 gp)","Healing (27,750 gp)","Size alteration (29,000 gp)","Illumination (48,250 gp)","Frost (56,250 gp)","Defense (58,250 gp)","Abjuration (65,000 gp)","Conjuration (65,000 gp)","Enchantment (65,000 gp)","Evocation (65,000 gp)","Illusion (65,000 gp)","Necromancy (65,000 gp)","Transmutation (65,000 gp)","divination (73,500 gp)","Earth and stone (80,500 gp)","Woodlands (101,250 gp)","Life (155,750 gp)","Passage (170,500 gp)","Power (211,000 gp)"};
     if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=15)) staff += staffs[0];
       else if((Chance>=16)&&(Chance<=30)) staff += staffs[1];
       else if((Chance>=31)&&(Chance<=40)) staff += staffs[2];
       else if((Chance>=41)&&(Chance<=60)) staff += staffs[3];
       else if((Chance>=61)&&(Chance<=75)) staff += staffs[4];
       else if((Chance>=76)&&(Chance<=90)) staff += staffs[5];
       else if((Chance>=91)&&(Chance<=95)) staff += staffs[6];
       else if((Chance>=96)&&(Chance<=100)) staff += staffs[7];

     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=3)) staff += staffs[0];
       else if((Chance>=4)&&(Chance<=9)) staff += staffs[1];
       else if((Chance>=10)&&(Chance<=11)) staff += staffs[2];
       else if((Chance>=12)&&(Chance<=17)) staff += staffs[3];
       else if((Chance>=18)&&(Chance<=19)) staff += staffs[4];
       else if((Chance>=20)&&(Chance<=24)) staff += staffs[5];
       else if((Chance>=25)&&(Chance<=31)) staff += staffs[6];
       else if((Chance>=32)&&(Chance<=38)) staff += staffs[7];
       else if((Chance>=39)&&(Chance<=43)) staff += staffs[8];
       else if((Chance>=44)&&(Chance<=48)) staff += staffs[9];
       else if((Chance>=49)&&(Chance<=53)) staff += staffs[10];
       else if((Chance>=54)&&(Chance<=58)) staff += staffs[11];
       else if((Chance>=59)&&(Chance<=63)) staff += staffs[12];
       else if((Chance>=64)&&(Chance<=68)) staff += staffs[13];
       else if((Chance>=69)&&(Chance<=73)) staff += staffs[14];
       else if((Chance>=74)&&(Chance<=77)) staff += staffs[15];
       else if((Chance>=78)&&(Chance<=82)) staff += staffs[16];
       else if((Chance>=83)&&(Chance<=87)) staff += staffs[17];
       else if((Chance>=88)&&(Chance<=92)) staff += staffs[18];
       else if((Chance>=93)&&(Chance<=97)) staff += staffs[19];
       else if((Chance>=98)&&(Chance<=100)) staff += staffs[20];
     }
     return staff;
   }
   public static String getPotion(String level)
   {
     String potion = "Potion of ";
     String [] potions = {"Cure light wounds (potion) (50 gp)", "Endure elements (potion) (50 gp)", "Hide from animals (potion) (50 gp)", "Hide from undead (potion) (50 gp)", "Jump (potion) (50 gp)", "Mage armor (potion) (50 gp)", "Magic fang (potion) (50 gp)", "Magic stone (oil) (50 gp)", "Magic weapon (oil) (50 gp)", "Pass without trace (potion) (50 gp)", "Protection from (alignment) (potion) (50 gp)", "Remove fear (potion) (50 gp)", "Sanctuary (potion) (50 gp)", "Shield of faith +2 (potion) (50 gp)", "Shillelagh (oil) (50 gp)", "Bless weapon (oil) (100 gp)", "Enlarge person (potion) (250 gp)", "Reduce person (potion) (250 gp)", "Aid (potion) (300 gp)", "Barkskin +2 (potion) (300 gp)", "Bear's endurance (potion) (300 gp)", "Blur (potion) (300 gp)", "Bull's strength (potion) (300 gp)", "Cat's grace (potion) (300 gp)", "Cure moderate wounds (potion) (300 gp)", "Darkness (oil) (300 gp)", "Darkvision (potion) (300 gp)", "Delay poison (potion) (300 gp)", "Eagle's splendor (potion) (300 gp)", "Fox's cunning (potion) (300 gp)", "Invisibility (potion or oil) (300 gp)", "Lesser restoration (potion) (300 gp)", "Levitate (potion or oil) (300 gp)", "Misdirection (potion) (300 gp)", "Owl's wisdom (potion) (300 gp)", "Protection from arrows 10/magic (potion) (300 gp)", "Remove paralysis (potion) (300 gp)", "Resist energy (type) 10 (potion) (300 gp)", "Shield of faith +3 (potion) (300 gp)", "Spider climb (potion) (300 gp)", "Undetectable alignment (potion) (300 gp)", "Barkskin +3 (potion) (600 gp)", "Shield of faith +4 (potion) (600 gp)", "Resist energy (type) 20 (potion) (700 gp)", "Cure serious wounds (potion) (750 gp)", "Daylight (oil) (750 gp)", "Displacement (potion) (750 gp)", "Flame arrow (oil) (750 gp)", "Fly (potion) (750 gp)", "Gaseous form (potion) (750 gp)", "Greater magic fang +1 (potion) (750 gp)", "Greater magic weapon +1 (oil) (750 gp)", "Haste (potion) (750 gp)", "Heroism (potion) (750 gp)", "Keen edge (oil) (750 gp)", "Magic circle against (alignment) (potion) (750 gp)", "Magic vestment +1 (oil) (750 gp)", "Neutralize poison (potion) (750 gp)", "Nondetection (potion) (750 gp)", "Protection from energy (type) (potion) (750 gp)", "Rage (potion) (750 gp)", "Remove blindness/deafness (potion) (750 gp)", "Remove curse (potion) (750 gp)", "Remove disease (potion) (750 gp)", "Tongues (potion) (750 gp)", "Water breathing (potion) (750 gp)", "Water walk (potion) (750 gp)", "Barkskin +4 (potion) (900 gp)", "Shield of faith +5 (potion) (900 gp)", "Good hope (potion) (1,050 gp)", "Resist energy (type) 30 (potion) (1,100 gp)", "Barkskin +5 (potion) (1,200 gp)", "Greater magic fang +2 (potion) (1,200 gp)", "Greater magic weapon +2 (oil) (1,200 gp)", "Magic vestment +2 (oil) (1,200 gp)", "Protection from arrows 15/magic (potion) (1,500 gp)", "Greater magic fang +3 (potion) (1,800 gp)", "Greater magic weapon +3 (oil) (1,800 gp)", "Magic vestment +3 (oil) (1,800 gp)", "Greater magic fang +4 (potion) (2,400 gp)", "Greater magic weapon +4 (oil) (2,400 gp)", "Magic vestment +4 (oil) (2,400 gp)", "Greater magic fang +5 (potion) (3,000 gp)", "Greater magic weapon +5 (oil) (3,000 gp)"};
     int Chance = 0;
     if(level.equals("minor"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=10)) potion += potions[0];
       else if((Chance>=11)&&(Chance<=13)) potion += potions[1];
       else if((Chance>=14)&&(Chance<=15)) potion += potions[2];
       else if((Chance>=16)&&(Chance<=17)) potion += potions[3];
       else if((Chance>=18)&&(Chance<=19)) potion += potions[4];
       else if((Chance>=20)&&(Chance<=22)) potion += potions[5];
       else if((Chance>=23)&&(Chance<=25)) potion += potions[6];
       else if((Chance==26)) potion += potions[7];
       else if((Chance>=27)&&(Chance<=29)) potion += potions[8];
       else if((Chance==30)) potion += potions[9];
       else if((Chance>=31)&&(Chance<=32)) potion += potions[10];
       else if((Chance>=33)&&(Chance<=34)) potion += potions[11];
       else if((Chance==35)) potion += potions[12];
       else if((Chance>=36)&&(Chance<=38)) potion += potions[13];
       else if((Chance==39)) potion += potions[14];
       else if((Chance>=40)&&(Chance<=41)) potion += potions[15];
       else if((Chance>=42)&&(Chance<=44)) potion += potions[16];
       else if((Chance==45)) potion += potions[17];
       else if((Chance>=46)&&(Chance<=47)) potion += potions[18];
       else if((Chance>=48)&&(Chance<=50)) potion += potions[19];
       else if((Chance>=51)&&(Chance<=53)) potion += potions[20];
       else if((Chance>=54)&&(Chance<=56)) potion += potions[21];
       else if((Chance>=57)&&(Chance<=59)) potion += potions[22];
       else if((Chance>=60)&&(Chance<=62)) potion += potions[23];
       else if((Chance>=63)&&(Chance<=67)) potion += potions[24];
       else if((Chance==68)) potion += potions[25];
       else if((Chance>=69)&&(Chance<=71)) potion += potions[26];
       else if((Chance>=72)&&(Chance<=74)) potion += potions[27];
       else if((Chance>=75)&&(Chance<=76)) potion += potions[28];
       else if((Chance>=77)&&(Chance<=78)) potion += potions[29];
       else if((Chance>=79)&&(Chance<=81)) potion += potions[30];
       else if((Chance>=82)&&(Chance<=84)) potion += potions[31];
       else if((Chance>=85)&&(Chance<=86)) potion += potions[32];
       else if((Chance==87)) potion += potions[33];
       else if((Chance>=88)&&(Chance<=89)) potion += potions[34];
       else if((Chance>=90)&&(Chance<=91)) potion += potions[35];
       else if((Chance>=92)&&(Chance<=93)) potion += potions[36];
       else if((Chance>=94)&&(Chance<=96)) potion += potions[37];
       else if((Chance==97)) potion += potions[38];
       else if((Chance>=98)&&(Chance<=99)) potion += potions[39];
       else if((Chance==100)) potion += potions[40];
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=2)) potion += potions[15];
       else if((Chance>=3)&&(Chance<=4)) potion += potions[16];
       else if((Chance==5)) potion += potions[17];
       else if((Chance==6)) potion += potions[18];
       else if((Chance==7)) potion += potions[19];
       else if((Chance>=8)&&(Chance<=10)) potion += potions[20];
       else if((Chance>=11)&&(Chance<=13)) potion += potions[21];
       else if((Chance>=14)&&(Chance<=16)) potion += potions[22];
       else if((Chance>=17)&&(Chance<=19)) potion += potions[23];
       else if((Chance>=20)&&(Chance<=27)) potion += potions[24];
       else if((Chance==28)) potion += potions[25];
       else if((Chance>=29)&&(Chance<=30)) potion += potions[26];
       else if((Chance==31)) potion += potions[27];
       else if((Chance>=32)&&(Chance<=33)) potion += potions[28];
       else if((Chance>=34)&&(Chance<=35)) potion += potions[29];
       else if((Chance>=36)&&(Chance<=37)) potion += potions[30];
       else if((Chance==38)) potion += potions[31];
       else if((Chance==39)) potion += potions[32];
       else if((Chance==40)) potion += potions[33];
       else if((Chance>=41)&&(Chance<=42)) potion += potions[34];
       else if((Chance==43)) potion += potions[35];
       else if((Chance==44)) potion += potions[36];
       else if((Chance>=45)&&(Chance<=46)) potion += potions[37];
       else if((Chance>=47)&&(Chance<=48)) potion += potions[38];
       else if((Chance==50)) potion += potions[39];
       else if((Chance==51)) potion += potions[40];
       else if((Chance==52)) potion += potions[41];
       else if((Chance>=53)&&(Chance<=55)) potion += potions[42];
       else if((Chance>=56)&&(Chance<=60)) potion += potions[43];
       else if((Chance==61)) potion += potions[44];
       else if((Chance>=62)&&(Chance<=64)) potion += potions[45];
       else if((Chance==65)) potion += potions[46];
       else if((Chance>=66)&&(Chance<=68)) potion += potions[47];
       else if((Chance==69)) potion += potions[48];
       else if((Chance>=70)&&(Chance<=71)) potion += potions[49];
       else if((Chance>=72)&&(Chance<=73)) potion += potions[50];
       else if((Chance>=74)&&(Chance<=75)) potion += potions[51];
       else if((Chance>=76)&&(Chance<=78)) potion += potions[52];
       else if((Chance>=79)&&(Chance<=80)) potion += potions[53];
       else if((Chance==81)) potion += potions[54];
       else if((Chance>=82)&&(Chance<=83)) potion += potions[55];
       else if((Chance>=84)&&(Chance<=86)) potion += potions[56];
       else if((Chance>=87)&&(Chance<=88)) potion += potions[57];
       else if((Chance>=89)&&(Chance<=91)) potion += potions[58];
       else if((Chance>=92)&&(Chance<=93)) potion += potions[59];
       else if((Chance==94)) potion += potions[60];
       else if((Chance==95)) potion += potions[61];
       else if((Chance==96)) potion += potions[62];
       else if((Chance==97)) potion += potions[63];
       else if((Chance>=98)&&(Chance<=99)) potion += potions[64];
       else if((Chance==100)) potion +=potions[65];

     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=2)) potion += potions[21];
       else if((Chance>=8)&&(Chance<=9)) potion += potions[24];
       else if((Chance>=10)&&(Chance<=11)) potion += potions[26];
       else if((Chance==12)) potion += potions[30];
       else if((Chance==13)) potion += potions[31];
       else if((Chance==14)) potion += potions[36];
       else if((Chance==15)) potion += potions[38];
       else if((Chance==16)) potion += potions[40];
       else if((Chance>=17)&&(Chance<=18)) potion += potions[41];
       else if((Chance>=19)&&(Chance<=20)) potion += potions[42];
       else if((Chance>=21)&&(Chance<=28)) potion += potions[43];
       else if((Chance==29)) potion += potions[44];
       else if((Chance>=30)&&(Chance<=32)) potion += potions[45];
       else if((Chance==33)) potion += potions[46];
       else if((Chance>=34)&&(Chance<=38)) potion += potions[47];
       else if((Chance==39)) potion += potions[48];
       else if((Chance>=40)&&(Chance<=41)) potion += potions[49];
       else if((Chance>=42)&&(Chance<=44)) potion += potions[52];
       else if((Chance>=45)&&(Chance<=46)) potion += potions[53];
       else if((Chance==47)) potion += potions[54];
       else if((Chance>=48)&&(Chance<=50)) potion += potions[55];
       else if((Chance>=51)&&(Chance<=52)) potion += potions[57];
       else if((Chance>=53)&&(Chance<=54)) potion += potions[58];
       else if((Chance==55)) potion += potions[59];
       else if((Chance==56)) potion += potions[60];
       else if((Chance==57)) potion += potions[61];
       else if((Chance==58)) potion += potions[62];
       else if((Chance==59)) potion += potions[63];
       else if((Chance==60)) potion += potions[64];
       else if((Chance==61)) potion += potions[65];
       else if((Chance>=62)&&(Chance<=63)) potion += potions[66];
       else if((Chance==64)) potion += potions[66];
       else if((Chance==65)) potion += potions[68];
       else if((Chance>=66)&&(Chance<=68)) potion += potions[69];
       else if((Chance==69)) potion += potions[70];
       else if((Chance>=70)&&(Chance<=73)) potion += potions[71];
       else if((Chance>=74)&&(Chance<=77)) potion += potions[72];
       else if((Chance>=78)&&(Chance<=81)) potion += potions[73];
       else if((Chance==82)) potion += potions[74];
       else if((Chance>=83)&&(Chance<=85)) potion += potions[75];
       else if((Chance>=86)&&(Chance<=88)) potion += potions[76];
       else if((Chance>=89)&&(Chance<=91)) potion += potions[77];
       else if((Chance>=92)&&(Chance<=93)) potion += potions[78];
       else if((Chance>=94)&&(Chance<=95)) potion += potions[79];
       else if((Chance>=96)&&(Chance<=97)) potion += potions[80];
       else if((Chance==98)) potion += potions[81];
       else if((Chance==99)) potion += potions[82];
       else if((Chance==100)) potion += potions[83];

     }
     return potion;
   }
   public static String getRod(String level)
   {
     String rod = "Rod of ";
     int Chance = 0;
     String [] rods = {"Metamagic, Enlarge, lesser (3,000 gp)","Metamagic, Extend, lesser (3,000 gp)","Metamagic, Silent, lesser (3,000 gp)","Immovable (5,000 gp)","Metamagic, Empower, lesser (9,000 gp)","Metal and mineral detection (10,500 gp)","Cancellation (11,000 gp)","Metamagic, Enlarge (11,000 gp)","Metamagic, Extend (11,000 gp)","Metamagic, Silent (11,000 gp)","Wonder (12,000 gp)","Python (13,000 gp)","Metamagic, Maximize, lesser (14,000 gp)","Flame extinguishing (15,000 gp)","Viper (19,000 gp)","Enemy detection (23,500 gp)","Metamagic, Enlarge, greater (24,500 gp)","Metamagic, Extend, greater (24,500 gp)","Metamagic, Silent, greater (24,500 gp)","Splendor (25,000 gp)","Withering (25,000 gp)","Metamagic, Empower (32,500 gp)","Thunder and lightning (33,000 gp)","Metamagic, Quicken, lesser (35,000 gp)","Negation (37,000 gp)","Absorption (50,000 gp)","Flailing (50,000 gp)","Metamagic, Maximize (54,000 gp)","Rulership (60,000 gp)","Security (61,000 gp)","Lordly might (70,000 gp)","Metamagic, Empower, greater (73,000 gp)","Metamagic, Quicken (75,500 gp)","Alertness (85,000 gp)","Metamagic, Maximize, greater (121,500 gp)","Metamagic, Quicken, greater (170,000 gp)"};
     if(level.equals("minor"))
     {
       rod = "no Rod";
     }
     else if(level.equals("medium"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=7)) rod +=rods[0];
       else if((Chance>=8)&&(Chance<=14)) rod +=rods[1];
       else if((Chance>=15)&&(Chance<=21)) rod +=rods[2];
       else if((Chance>=22)&&(Chance<=28)) rod +=rods[3];
       else if((Chance>=29)&&(Chance<=35)) rod +=rods[4];
       else if((Chance>=36)&&(Chance<=42)) rod +=rods[5];
       else if((Chance>=43)&&(Chance<=53)) rod +=rods[6];
       else if((Chance>=54)&&(Chance<=57)) rod +=rods[7];
       else if((Chance>=58)&&(Chance<=61)) rod +=rods[8];
       else if((Chance>=62)&&(Chance<=65)) rod +=rods[9];
       else if((Chance>=66)&&(Chance<=71)) rod +=rods[10];
       else if((Chance>=72)&&(Chance<=79)) rod +=rods[11];
       else if((Chance>=80)&&(Chance<=83)) rod +=rods[12];
       else if((Chance>=84)&&(Chance<=89)) rod +=rods[13];
       else if((Chance>=90)&&(Chance<=97)) rod +=rods[14];
       else if((Chance>=98)&&(Chance<=99)) rod +=rods[21];
       else if((Chance==100)) rod += rods[23];
     }
     else if(level.equals("major"))
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance>=1)&&(Chance<=4)) rod +=rods[6];
       else if((Chance>=5)&&(Chance<=6)) rod +=rods[7];
       else if((Chance>=7)&&(Chance<=8)) rod +=rods[8];
       else if((Chance>=9)&&(Chance<=10)) rod +=rods[9];
       else if((Chance>=11)&&(Chance<=14)) rod +=rods[10];
       else if((Chance>=15)&&(Chance<=18)) rod +=rods[11];
       else if((Chance>=19)&&(Chance<=21)) rod +=rods[13];
       else if((Chance>=22)&&(Chance<=25)) rod +=rods[14];
       else if((Chance>=26)&&(Chance<=30)) rod +=rods[15];
       else if((Chance>=31)&&(Chance<=36)) rod +=rods[16];
       else if((Chance>=37)&&(Chance<=42)) rod +=rods[17];
       else if((Chance>=43)&&(Chance<=48)) rod +=rods[18];
       else if((Chance>=49)&&(Chance<=53)) rod +=rods[19];
       else if((Chance>=54)&&(Chance<=58)) rod +=rods[20];
       else if((Chance>=59)&&(Chance<=64)) rod +=rods[21];
       else if((Chance>=65)&&(Chance<=69)) rod +=rods[22];
       else if((Chance>=70)&&(Chance<=73)) rod +=rods[23];
       else if((Chance>=74)&&(Chance<=77)) rod +=rods[24];
       else if((Chance>=78)&&(Chance<=80)) rod +=rods[25];
       else if((Chance>=81)&&(Chance<=84)) rod +=rods[26];
       else if((Chance>=85)&&(Chance<=86)) rod +=rods[27];
       else if((Chance>=87)&&(Chance<=88)) rod +=rods[28];
       else if((Chance>=89)&&(Chance<=90)) rod +=rods[29];
       else if((Chance>=91)&&(Chance<=92)) rod +=rods[30];
       else if((Chance>=93)&&(Chance<=94)) rod +=rods[31];
       else if((Chance>=95)&&(Chance<=96)) rod +=rods[32];
       else if((Chance>=97)&&(Chance<=98)) rod +=rods[33];
       else if((Chance==99)) rod += rods[34];
       else if((Chance==100)) rod += rods[35];

     }
     return rod;
   }
   public static String getWondrousItem(String level)
   {
     String wondrous = "";
     int Chance = 0;
     if(level.equals("minor"));
     {
       Chance = (int)(1+Math.random()*99);
       if((Chance==1)) wondrous = "Feather token, anchor (50 gp)";
       else if((Chance==2)) wondrous = "Universal solvent (50 gp)";
       else if((Chance==3)) wondrous = "Elixir of love	(150 gp)";
       else if((Chance==4)) wondrous = "Unguent of timelessness (150 gp)";
       else if((Chance==5)) wondrous = "Feather token, fan (200 gp)";
       else if((Chance==6)) wondrous = "Dust of tracelessness (250 gp)";
       else if((Chance==7)) wondrous = "Elixir of hiding (250 gp)";
       else if((Chance==8)) wondrous = "Elixir of sneaking (250 gp)";
       else if((Chance==9)) wondrous = "Elixir of swimming (250 gp)";
       else if((Chance==10)) wondrous = "Elixir of vision (250 gp)";
       else if((Chance==11)) wondrous = "Silversheen (250 gp)";
       else if((Chance==12)) wondrous = "Feather token, bird (300 gp)";
       else if((Chance==13)) wondrous = "Feather token, tree (400 gp)";
       else if((Chance==14)) wondrous = "Feather token, swan boat (450 gp)";
       else if((Chance==15)) wondrous = "Elixir of truth (500 gp)";
       else if((Chance==16)) wondrous = "Feather token, whip (500 gp)";
       else if((Chance==17)) wondrous = "Dust of dryness (850 gp)";
       else if((Chance==18)) wondrous = "Bag of tricks, gray (900 gp)";
       else if((Chance==19)) wondrous = "Hand of the mage (900 gp)";
       else if((Chance==20)) wondrous = "Bracers of armor +1 (1,000 gp)";
       else if((Chance==21)) wondrous = "Cloak of resistance +1 (1,000 gp)";
       else if((Chance==22)) wondrous = "Pearl of power, 1st-level spell (1,000 gp)";
       else if((Chance==23)) wondrous = "Phylactery of faithfulness (1,000 gp)";
       else if((Chance==24)) wondrous = "salve of slipperiness (1,000 gp)";
       else if((Chance==25)) wondrous = "Elixir of fire breath (1,100 gp)";
       else if((Chance==26)) wondrous = "Pipes of the sewers (1,150 gp)";
       else if((Chance==27)) wondrous = "Dust of illusion (1,200 gp)";
       else if((Chance==28)) wondrous = "Goggles of minute seeing (1,250 gp)";
       else if((Chance==29)) wondrous = "Brooch of shielding (1,500 gp)";
       else if((Chance==30)) wondrous = "Necklace of fireballs type I (1,650 gp)";
       else if((Chance==31)) wondrous = "Dust of appearance (1,800 gp)";
       else if((Chance==32)) wondrous = "Hat of disguise (1,800 gp)";
       else if((Chance==33)) wondrous = "Pipes of sounding (1,800 gp)";
       else if((Chance==34)) wondrous = "Efficient quiver (1,800 gp)";
       else if((Chance==35)) wondrous = "Amulet of natural armor +1 (2,000 gp)";
       else if((Chance==36)) wondrous = "Handy haversack (2,000 gp)";
       else if((Chance==37)) wondrous = "Horn of fog (2,000 gp)";
       else if((Chance==38)) wondrous = "Elemental gem (2,250 gp)";
       else if((Chance==39)) wondrous = "Robe of bones (2,400 gp)";
       else if((Chance==40)) wondrous = "sovereign glue (2,400 gp)";
       else if((Chance==41)) wondrous = "Bag of holding type I (2,500 gp)";
       else if((Chance==42)) wondrous = "Boots of elvenkind (2,500 gp)";
       else if((Chance==43)) wondrous = "Boots of the winterlands (2,500 gp)";
       else if((Chance==44)) wondrous = "Candle of truth (2,500 gp)";
       else if((Chance==45)) wondrous = "Cloak of elvenkind (2,500 gp)";
       else if((Chance==46)) wondrous = "Eyes of the eagle (2,500 gp)";
       else if((Chance==47)) wondrous = "Scarab, golembane (2,500 gp)";
       else if((Chance==48)) wondrous = "Necklace of fireballs type II (2,700 gp)";
       else if((Chance==49)) wondrous = "Stone of alarm (2,700 gp)";
       else if((Chance==50)) wondrous = "Bag of tricks, rust (3,000 gp)";
       else if((Chance==51)) wondrous = "Bead of force (3,000 gp)";
       else if((Chance==52)) wondrous = "Chime of opening (3,000 gp)";
       else if((Chance==53)) wondrous = "Horseshoes of speed (3,000 gp)";
       else if((Chance==54)) wondrous = "Rope of climbing (3,000 gp)";
       else if((Chance==55)) wondrous = "Dust of disappearance (3,500 gp)";
       else if((Chance==56)) wondrous = "Lens of detection (3,500 gp)";
       else if((Chance==57)) wondrous = "Vestment, druid's (3,750 gp)";
       else if((Chance==58)) wondrous = "Figurine of wondrous power, silver raven (3,800 gp)";
       else if((Chance==59)) wondrous = "Amulet of health +2 (4,000 gp)";
       else if((Chance==60)) wondrous = "Bracers of armor +2 (4,000 gp)";
       else if((Chance==61)) wondrous = "Cloak of Charisma +2 (4,000 gp)";
       else if((Chance==62)) wondrous = "Cloak of resistance +2 (4,000 gp)";
       else if((Chance==63)) wondrous = "Gauntlets of ogre power (4,000 gp)";
       else if((Chance==64)) wondrous = "Gloves of arrow snaring (4,000 gp)";
       else if((Chance==65)) wondrous = "Gloves of Dexterity +2 (4,000 gp)";
       else if((Chance==66)) wondrous = "Headband of intellect +2 (4,000 gp)";
       else if((Chance==67)) wondrous = "Ioun stone, clear spindle (4,000 gp)";
       else if((Chance==68)) wondrous = "Restorative ointment (4,000 gp)";
       else if((Chance==69)) wondrous = "Marvelous pigments (4,000 gp)";
       else if((Chance==70)) wondrous = "Pearl of power, 2nd-level spell (4,000 gp)";
       else if((Chance==71)) wondrous = "Periapt of Wisdom +2 (4,000 gp)";
       else if((Chance==72)) wondrous = "Stone salve (4,000 gp)";
       else if((Chance==73)) wondrous = "Necklace of fireballs type III (4,350 gp)";
       else if((Chance==74)) wondrous = "Circlet of persuasion (4,500 gp)";
       else if((Chance==75)) wondrous = "Slippers of spider climbing (4,800 gp)";
       else if((Chance==76)) wondrous = "Incense of meditation (4,900 gp)";
       else if((Chance==77)) wondrous = "Bag of holding type II (5,000 gp)";
       else if((Chance==78)) wondrous = "Bracers of archery, lesser (5,000 gp)";
       else if((Chance==79)) wondrous = "Ioun stone, dusty rose prism (5,000 gp)";
       else if((Chance==80)) wondrous = "Helm of comprehend languages and read magic (5,200 gp)";
       else if((Chance==81)) wondrous = "Vest of escape (5,200 gp)";
       else if((Chance==82)) wondrous = "Eversmoking bottle (5,400 gp)";
       else if((Chance==83)) wondrous = "Sustaining spoon (5,400 gp)";
       else if((Chance==84)) wondrous = "Necklace of fireballs type IV (5,400 gp)";
       else if((Chance==85)) wondrous = "Boots of striding and springing (5,500 gp)";
       else if((Chance==86)) wondrous = "Wind fan (5,500 gp)";
       else if((Chance==87)) wondrous = "Amulet of mighty fists +1 (6,000 gp)";
       else if((Chance==88)) wondrous = "Horseshoes of a zephyr (6,000 gp)";
       else if((Chance==89)) wondrous = "Pipes of haunting (6,000 gp)";
       else if((Chance==90)) wondrous = "Necklace of fireballs type V (6,150 gp)";
       else if((Chance==91)) wondrous = "Gloves of swimming and climbing (6,250 gp)";
       else if((Chance==92)) wondrous = "Bag of tricks, tan (6,300 gp)";
       else if((Chance==93)) wondrous = "Circlet of blasting, minor (6,480 gp)";
       else if((Chance==94)) wondrous = "Horn of goodness/evil (6,500 gp)";
       else if((Chance==95)) wondrous = "Robe of useful items (7,000 gp)";
       else if((Chance==96)) wondrous = "Boat, folding (7,200 gp)";
       else if((Chance==97)) wondrous = "Cloak of the manta ray (7,200 gp)";
       else if((Chance==98)) wondrous = "Bottle of air (7,250 gp)";
       else if((Chance==99)) wondrous = "Bag of holding type III (7,400 gp)";
       else if((Chance==100)) wondrous = "Periapt of health (7,400 gp)";
     }

     if(level.equals("medium"));
     {
       Chance = (int)(1+Math.random()*99);
                if((Chance==1)) wondrous = "Boots of levitation (7,500 gp)";
                else if((Chance==2)) wondrous = "Harp of charming (7,500 gp)";
                else if((Chance==3)) wondrous = "Amulet of natural armor +2 (8,000 gp)";
                else if((Chance==4)) wondrous = "Golem manual, flesh (8,000 gp)";
                else if((Chance==5)) wondrous = "Hand of glory (8,000 gp)";
                else if((Chance==6)) wondrous = "Ioun stone, deep red sphere (8,000 gp)";
                else if((Chance==7)) wondrous = "Ioun stone, incandescent blue sphere (8,000 gp)";
                else if((Chance==8)) wondrous = "Ioun stone, pale blue rhomboid (8,000 gp)";
                else if((Chance==9)) wondrous = "Ioun stone, pink and green sphere (8,000 gp)";
                else if((Chance==10)) wondrous = "Ioun stone, pink rhomboid (8,000 gp)";
                else if((Chance==11)) wondrous = "Ioun stone, scarlet and blue sphere (8,000 gp)";
                else if((Chance==12)) wondrous = "Deck of illusions (8,100 gp)";
                else if((Chance==13)) wondrous = "Necklace of fireballs type VI (8,100 gp)";
                else if((Chance==14)) wondrous = "Candle of invocation (8,400 gp)";
                else if((Chance==15)) wondrous = "Bracers of armor +3 (9,000 gp)";
                else if((Chance==16)) wondrous = "Cloak of resistance +3 (9,000 gp)";
                else if((Chance==17)) wondrous = "Decanter of endless water (9,000 gp)";
                else if((Chance==18)) wondrous = "Necklace of adaptation (9,000 gp)";
                else if((Chance==19)) wondrous = "Pearl of power, 3rd-level spell (9,000 gp)";
                else if((Chance==20)) wondrous = "Talisman of the sphere (9,000 gp)";
                else if((Chance==21)) wondrous = "Figurine of wondrous power, serpentine owl (9,100 gp)";
                else if((Chance==22)) wondrous = "Necklace of fireballs type VII (9,150 gp)";
                else if((Chance==23)) wondrous = "Strand of prayer beads, lesser (9,600 gp)";
                else if((Chance==24)) wondrous = "Bag of holding type IV (10,000 gp)";
                else if((Chance==25)) wondrous = "Figurine of wondrous power, bronze griffon (10,000 gp)";
                else if((Chance==26)) wondrous = "Figurine of wondrous power, ebony fly (10,000 gp)";
                else if((Chance==27)) wondrous = "Glove of storing (10,000 gp)";
                else if((Chance==28)) wondrous = "Ioun stone, dark blue rhomboid (10,000 gp)";
                else if((Chance==29)) wondrous = "Stone horse, courser (10,000 gp)";
                else if((Chance==30)) wondrous = "Cape of the mountebank (10,080 gp)";
                else if((Chance==31)) wondrous = "Phylactery of undead turning (11,000 gp)";
                else if((Chance==32)) wondrous = "Gauntlet of rust (11,500 gp)";
                else if((Chance==33)) wondrous = "Boots of speed (12,000 gp)";
                else if((Chance==34)) wondrous = "Goggles of night (12,000 gp)";
                else if((Chance==35)) wondrous = "Golem manual, clay (12,000 gp)";
                else if((Chance==36)) wondrous = "Medallion of thoughts (12,000 gp)";
                else if((Chance==37)) wondrous = "Pipes of pain (12,000 gp)";
                else if((Chance==38)) wondrous = "Blessed book (12,500 gp)";
                else if((Chance==39)) wondrous = "Belt, monk's (13,000 gp)";
                else if((Chance==40)) wondrous = "Gem of brightness (13,000 gp)";
                else if((Chance==41)) wondrous = "Lyre of building (13,000 gp)";
                else if((Chance==42)) wondrous = "Cloak of arachnida (14,000 gp)";
                else if((Chance==43)) wondrous = "Stone horse, destrier (14,800 gp)";
                else if((Chance==44)) wondrous = "Belt of dwarvenkind (14,900 gp)";
                else if((Chance==45)) wondrous = "Periapt of wound closure (15,000 gp)";
                else if((Chance==46)) wondrous = "Horn of the tritons (15,100 gp)";
                else if((Chance==47)) wondrous = "Pearl of the sirines (15,300 gp)";
                else if((Chance==48)) wondrous = "Figurine of wondrous power, onyx dog (15,500 gp)";
                else if((Chance==49)) wondrous = "Amulet of health +4 (16,000 gp)";
                else if((Chance==50)) wondrous = "Belt of giant Strength +4 (16,000 gp)";
                else if((Chance==51)) wondrous = "Boots, winged (16,000 gp)";
                else if((Chance==52)) wondrous = "Bracers of armor +4 (16,000 gp)";
                else if((Chance==53)) wondrous = "Cloak of Charisma +4 (16,000 gp)";
                else if((Chance==54)) wondrous = "Cloak of resistance +4 (16,000 gp)";
                else if((Chance==55)) wondrous = "Gloves of Dexterity +4 (16,000 gp)";
                else if((Chance==56)) wondrous = "Headband of intellect +4 (16,000 gp)";
                else if((Chance==57)) wondrous = "Pearl of power, 4th-level spell (16,000 gp)";
                else if((Chance==58)) wondrous = "Periapt of Wisdom +4 (16,000 gp)";
                else if((Chance==59)) wondrous = "Scabbard of keen edges (16,000 gp)";
                else if((Chance==60)) wondrous = "Figurine of wondrous power, golden lions (16,500 gp)";
                else if((Chance==61)) wondrous = "Chime of interruption (16,800 gp)";
                else if((Chance==62)) wondrous = "Broom of flying (17,000 gp)";
                else if((Chance==63)) wondrous = "Figurine of wondrous power, marble elephant (17,000 gp)";
                else if((Chance==64)) wondrous = "Amulet of natural armor +3 (18,000 gp)";
                else if((Chance==65)) wondrous = "Ioun stone, iridescent spindle (18,000 gp)";
                else if((Chance==66)) wondrous = "Bracelet of friends (19,000 gp)";
                else if((Chance==67)) wondrous = "Carpet of flying, 5 ft. by 5 ft. (20,000 gp)";
                else if((Chance==68)) wondrous = "Horn of blasting (20,000 gp)";
                else if((Chance==69)) wondrous = "Ioun stone, pale lavender ellipsoid (20,000 gp)";
                else if((Chance==70)) wondrous = "Ioun stone, pearly white spindle (20,000 gp)";
                else if((Chance==71)) wondrous = "Portable hole (20,000 gp)";
                else if((Chance==72)) wondrous = "Stone of good luck (luckstone) (20,000 gp)";
                else if((Chance==73)) wondrous = "Figurine of wondrous power, ivory goats (21,000 gp)";
                else if((Chance==74)) wondrous = "Rope of entanglement (21,000 gp)";
                else if((Chance==75)) wondrous = "Golem manual, stone (22,000 gp)";
                else if((Chance==76)) wondrous = "Mask of the skull (22,000 gp)";
                else if((Chance==77)) wondrous = "Mattock of the titans (23,348 gp)";
                else if((Chance==78)) wondrous = "Circlet of blasting, major (23,760 gp)";
                else if((Chance==79)) wondrous = "Amulet of mighty fists +2 (24,000 gp)";
                else if((Chance==80)) wondrous = "Cloak of displacement, minor (24,000 gp)";
                else if((Chance==81)) wondrous = "Helm of underwater action (24,000 gp)";
                else if((Chance==82)) wondrous = "Bracers of archery, greater (25,000 gp)";
                else if((Chance==83)) wondrous = "Bracers of armor +5 (25,000 gp)";
                else if((Chance==84)) wondrous = "Cloak of resistance +5 (25,000 gp)";
                else if((Chance==85)) wondrous = "Eyes of doom (25,000 gp)";
                else if((Chance==86)) wondrous = "Pearl of power, 5th-level spell (25,000 gp)";
                else if((Chance==87)) wondrous = "Maul of the titans (25,305 gp)";
                else if((Chance==88)) wondrous = "Strand of prayer beads (25,800 gp)";
                else if((Chance==89)) wondrous = "Cloak of the bat (26,000 gp)";
                else if((Chance==90)) wondrous = "Iron bands of binding (26,000 gp)";
                else if((Chance==91)) wondrous = "Cube of frost resistance (27,000 gp)";
                else if((Chance==92)) wondrous = "Helm of telepathy (27,000 gp)";
                else if((Chance==93)) wondrous = "Periapt of proof against poison (27,000 gp)";
                else if((Chance==94)) wondrous = "Robe of scintillating colors (27,000 gp)";
                else if((Chance==95)) wondrous = "Manual of bodily health +1 (27,500 gp)";
                else if((Chance==96)) wondrous = "Manual of gainful exercise +1 (27,500 gp)";
                else if((Chance==97)) wondrous = "Manual of quickness in action +1 (27,500 gp)";
                else if((Chance==98)) wondrous = "Tome of clear thought +1 (27,500 gp)";
                else if((Chance==99)) wondrous = "Tome of leadership and influence +1 (27,500 gp)";
                else if((Chance==100)) wondrous = "Tome of understanding +1 (27,500 gp)";
     }
     if(level.equals("major"));
     {
       Chance = (int)(1+Math.random()*99);
                if((Chance==1)) wondrous = "Dimensional shackles (28,000 gp)";
                else if((Chance==2)) wondrous = "Figurine of wondrous power, obsidian steed (28,500 gp)";
                else if((Chance==3)) wondrous = "Drums of panic (30,000 gp)";
                else if((Chance==4)) wondrous = "Ioun stone, orange (30,000 gp)";
                else if((Chance==5)) wondrous = "Ioun stone, pale green prism (30,000 gp)";
                else if((Chance==6)) wondrous = "Lantern of revealing (30,000 gp)";
                else if((Chance==7)) wondrous = "Robe of blending (30,000 gp)";
                else if((Chance==8)) wondrous = "Amulet of natural armor +4 (32,000 gp)";
                else if((Chance==9)) wondrous = "Amulet of proof against detection and location (35,000 gp)";
                else if((Chance==10)) wondrous = "Carpet of flying, 5 ft. by 10 ft. (35,000 gp)";
                else if((Chance==11)) wondrous = "Golem manual, iron (35,000 gp)";
                else if((Chance==12)) wondrous = "Amulet of health +6 (36,000 gp)";
                else if((Chance==13)) wondrous = "Belt of giant Strength +6 (36,000 gp)";
                else if((Chance==14)) wondrous = "Bracers of armor +6 (36,000 gp)";
                else if((Chance==15)) wondrous = "Cloak of Charisma +6 (36,000 gp)";
                else if((Chance==16)) wondrous = "Gloves of Dexterity +6 (36,000 gp)";
                else if((Chance==17)) wondrous = "Headband of intellect +6 (36,000 gp)";
                else if((Chance==18)) wondrous = "Ioun stone, vibrant purple prism (36,000 gp)";
                else if((Chance==19)) wondrous = "Pearl of power, 6th-level spell (36,000 gp)";
                else if((Chance==20)) wondrous = "Periapt of Wisdom +6 (36,000 gp)";
                else if((Chance==21)) wondrous = "Scarab of protection (38,000 gp)";
                else if((Chance==22)) wondrous = "Ioun stone, lavender and green ellipsoid (40,000 gp)";
                else if((Chance==23)) wondrous = "Ring gates (40,000 gp)";
                else if((Chance==24)) wondrous = "Crystal ball (42,000 gp)";
                else if((Chance==25)) wondrous = "Golem manual, greater stone (44,000 gp)";
                else if((Chance==26)) wondrous = "Orb of storms (48,000 gp)";
                else if((Chance==27)) wondrous = "Boots of teleportation (49,000 gp)";
                else if((Chance==28)) wondrous = "Bracers of armor +7 (49,000 gp)";
                else if((Chance==29)) wondrous = "Pearl of power, 7th-level spell (49,000 gp)";
                else if((Chance==30)) wondrous = "Amulet of natural armor +5 (50,000 gp)";
                else if((Chance==31)) wondrous = "Cloak of displacement, major (50,000 gp)";
                else if((Chance==32)) wondrous = "Crystal ball with see invisibility (50,000 gp)";
                else if((Chance==33)) wondrous = "Horn of Valhalla (50,000 gp)";
                else if((Chance==34)) wondrous = "Crystal ball with detect thoughts (51,000 gp)";
                else if((Chance==35)) wondrous = "Carpet of flying, 6 ft. by 9 ft. (53,000 gp)";
                else if((Chance==36)) wondrous = "Amulet of mighty fists +3 (54,000 gp)";
                else if((Chance==37)) wondrous = "Wings of flying (54,000 gp)";
                else if((Chance==38)) wondrous = "Cloak of etherealness (55,000 gp)";
                else if((Chance==39)) wondrous = "Instant fortress (55,000 gp)";
                else if((Chance==40)) wondrous = "Manual of bodily health +2 (55,000 gp)";
                else if((Chance==41)) wondrous = "Manual of gainful exercise +2 (55,000 gp)";
                else if((Chance==42)) wondrous = "Manual of quickness in action +2 (55,000 gp)";
                else if((Chance==43)) wondrous = "Tome of clear thought +2 (55,000 gp)";
                else if((Chance==44)) wondrous = "Tome of leadership and influence +2 (55,000 gp)";
                else if((Chance==45)) wondrous = "Tome of understanding +2 (55,000 gp)";
                else if((Chance==46)) wondrous = "Eyes of charming (56,000 gp)";
                else if((Chance==47)) wondrous = "Robe of stars (58,000 gp)";
                else if((Chance==48)) wondrous = "Carpet of flying, 10 ft. by 10 ft. (60,000 gp)";
                else if((Chance==49)) wondrous = "Darkskull (60,000 gp)";
                else if((Chance==50)) wondrous = "Cube of force (62,000 gp)";
                else if((Chance==51)) wondrous = "Bracers of armor +8 (64,000 gp)";
                else if((Chance==52)) wondrous = "Pearl of power, 8th-level spell (64,000 gp)";
                else if((Chance==53)) wondrous = "Crystal ball with telepathy (70,000 gp)";
                else if((Chance==54)) wondrous = "Horn of blasting, greater (70,000 gp)";
                else if((Chance==55)) wondrous = "Pearl of power, two spells (70,000 gp)";
                else if((Chance==56)) wondrous = "Helm of teleportation (73,500 gp)";
                else if((Chance==57)) wondrous = "Gem of seeing (75,000 gp)";
                else if((Chance==58)) wondrous = "Robe of the archmagi (75,000 gp)";
                else if((Chance==59)) wondrous = "Mantle of faith (76,000 gp)";
                else if((Chance==60)) wondrous = "Crystal ball with true seeing (80,000 gp)";
                else if((Chance==61)) wondrous = "Pearl of power, 9th-level spell (81,000 gp)";
                else if((Chance==62)) wondrous = "Well of many worlds (82,000 gp)";
                else if((Chance==63)) wondrous = "Manual of bodily health +3 (82,500 gp)";
                else if((Chance==64)) wondrous = "Manual of gainful exercise +3 (82,500 gp)";
                else if((Chance==65)) wondrous = "Manual of quickness in action +3 (82,500 gp)";
                else if((Chance==66)) wondrous = "Tome of clear thought +3 (82,500 gp)";
                else if((Chance==67)) wondrous = "Tome of leadership and influence +3 (82,500 gp)";
                else if((Chance==68)) wondrous = "Tome of understanding +3 (82,500 gp)";
                else if((Chance==69)) wondrous = "Apparatus of the crab (90,000 gp)";
                else if((Chance==70)) wondrous = "Mantle of spell resistance (90,000 gp)";
                else if((Chance==71)) wondrous = "Mirror of opposition (92,000 gp)";
                else if((Chance==72)) wondrous = "Strand of prayer beads, greater (95,800 gp)";
                else if((Chance==73)) wondrous = "Amulet of mighty fists +4 (96,000 gp)";
                else if((Chance==74)) wondrous = "Eyes of petrification (98,000 gp)";
                else if((Chance==75)) wondrous = "Bowl of commanding water elementals (100,000 gp)";
                else if((Chance==76)) wondrous = "Brazier of commanding fire elementals (100,000 gp)";
                else if((Chance==77)) wondrous = "Censer of controlling air elementals (100,000 gp)";
                else if((Chance==78)) wondrous = "Stone of controlling earth elementals (100,000 gp)";
                else if((Chance==79)) wondrous = "Manual of bodily health +4 (110,000 gp)";
                else if((Chance==80)) wondrous = "Manual of gainful exercise +4 (110,000 gp)";
                else if((Chance==81)) wondrous = "Manual of quickness in action +4 (110,000 gp)";
                else if((Chance==82)) wondrous = "Tome of clear thought +4 (110,000 gp)";
                else if((Chance==83)) wondrous = "Tome of leadership and influence +4 (110,000 gp)";
                else if((Chance==84)) wondrous = "Tome of understanding +4 (110,000 gp)";
                else if((Chance==85)) wondrous = "Amulet of the planes (120,000 gp)";
                else if((Chance==86)) wondrous = "Robe of eyes (120,000 gp)";
                else if((Chance==87)) wondrous = "Helm of brilliance (125,000 gp)";
                else if((Chance==88)) wondrous = "Manual of bodily health +5 (137,500 gp)";
                else if((Chance==89)) wondrous = "Manual of gainful exercise +5 (137,500 gp)";
                else if((Chance==90)) wondrous = "Manual of quickness in action +5 (137,500 gp)";
                else if((Chance==91)) wondrous = "Tome of clear thought +5 (137,500 gp)";
                else if((Chance==92)) wondrous = "Tome of leadership and influence +5 (137,500 gp)";
                else if((Chance==93)) wondrous = "Tome of understanding +5 (137,500 gp)";
                else if((Chance==94)) wondrous = "Efreeti bottle (145,000 gp)";
                else if((Chance==95)) wondrous = "Amulet of mighty fists +5 (150,000 gp)";
                else if((Chance==96)) wondrous = "Chaos diamond (160,000 gp)";
                else if((Chance==97)) wondrous = "Cubic gate (164,000 gp)";
                else if((Chance==98)) wondrous = "Iron flask (170,000 gp)";
                else if((Chance==99)) wondrous = "Mirror of mental prowess (175,000 gp)";
                else if((Chance==100)) wondrous = "Mirror of life trapping (200,000 gp)";
     }

     return wondrous;
   }

   public static int getArraySum(int [] array)
   {
     int sum = 0;
     for(int i = 0;i<array.length;i++)
     {
       sum = sum+array[i];
     }
     return sum;
 }

   public static void PrintArray(String [] array)
   {
     for(int i = 0;i<=array.length;i++)
     {
       System.out.println(array[i]);
     }
   }
}

