private BufferedImage getSpellTreeImage(ArrayList<SpellsStage> spells, int stage, int selected)
	{
		BufferedImage im = new BufferedImage(1000, 100+(spells.size()*100), BufferedImage.TYPE_INT_ARGB);
		Graphics2D g2d = im.createGraphics();

		g2d.setColor(Color.BLACK);

		for (int i = 0; i < spells.size(); i++)
		{
			SpellsStage ss = spells.get(i);

			for (int ii = 0; ii < ss.spells.size(); ii++)
			{
				SpellsStageEntry sse = ss.spells.get(ii);
				if (sse.unlocked > 0)
				{
					if ((i == stage) && (ii == selected))
					{
						g2d.drawImage(images[1], sse.pos[0]-28, sse.pos[1]-28, null);
					}
					else
					{
						g2d.drawImage(images[0], sse.pos[0]-28, sse.pos[1]-28, null);
					}
				}

				if (sse.unlocked == 3)
				{
					g2d.drawImage(sse.images[1], sse.pos[0]-28, sse.pos[1]-28, null);
				}
				
				if (sse.unlocked > 1)
				{
					g2d.drawImage(sse.images[0], sse.pos[0]-28, sse.pos[1]-28, null);
				}
				else if (sse.unlocked == 0)
				{
					continue;
				}

				for (String p : sse.parents)
				{
					SpellsStageEntry parent = spells.get(i-1).getSpellStageEntry(p);

					g2d.drawLine(sse.pos[0], sse.pos[1], parent.pos[0], parent.pos[1]);
				}
			}
		}

		g2d.dispose();


		return im;
	}