public void paintUnit(Graphics g)
	{
		Image person = playerWalkingU[3];


		if(killed == true || DungeonGame.mainPanel.panel.chatActive == true)
		{
			preventMovement = true;
			if(killed == true)
			{
				person = playerDead;
			}
		}
		else
		{
			if(count >= 10 || keyheld == false)
			{
				count = 0;
			}

			if(direction.equals("R"))
			{
				if(attack == true || defend == true)
				{
					if(attack == true)
					{

						if(attackCount == 0 || attackCount == 1)
						{
							person = playerWalkingR[0];
							attackCount++;
						}
						else if(attackCount == 2 || attackCount == 3)
						{
							person = playerWalkingR[10];
							if(playerType.equals("fire_mage"))
							{
								preventMovement = true;
								specFrameCount = specFrameCount + 10;
								//Image newImg = specialAbil.
								g.drawImage(specialAbil, x - ((specFrameCount/2)-25), y - ((specFrameCount/2)-25), specFrameCount, specFrameCount, DungeonGame.mainPanel.panel);
								//g.fillOval(x - (specFrameCount/2), y - (specFrameCount/2), specFrameCount, specFrameCount);
								attackCount = 2;
								
								if(specFrameCount%30 == 0)
								{
									initiateBattle(g);
								}
								
								
								if(specFrameCount >= 150)
								{
									specFrameCount = 0;
									attackCount = 3;
									preventMovement = false;
								}
							}
							else
							{
								
								initiateBattle(g);
							}
							attackCount++;
						}
						else if(attackCount == 4)
						{
							person = playerWalkingR[5];
							attackCount = 0;
							attack = false;
						}
					}
					else
					{
						person = playerWalkingR[11];
					}
				}
				else
				{
					if(keyheld == true)
					{
						person = playerWalkingR[count];
					}
					else
					{
						person = playerWalkingR[3];
					}
				}

			}
			if(direction.equals("L"))
			{
				if(attack == true || defend == true)
				{
					if(attack == true)
					{
						if(attackCount == 0 || attackCount == 1)
						{
							person = playerWalkingL[5];
							attackCount++;
						}
						else if(attackCount == 2 || attackCount == 3)
						{
							person = playerWalkingL[10];
							if(playerType.equals("fire_mage"))
							{
								preventMovement = true;
								specFrameCount = specFrameCount + 10;
								g.drawImage(specialAbil, x - ((specFrameCount/2)-25), y - ((specFrameCount/2)-25), specFrameCount, specFrameCount, DungeonGame.mainPanel.panel);
								//g.drawOval(x - ((specFrameCount/2)-25), y - ((specFrameCount/2)-25), specFrameCount, specFrameCount);
								attackCount = 2;
								initiateBattle(g);
								if(specFrameCount >= 150)
								{
									specFrameCount = 0;
									attackCount = 3;
									preventMovement = false;
								}
							}
							else
							{
								
								initiateBattle(g);
							}
							attackCount++;
						}
						else if(attackCount == 4)
						{
							person = playerWalkingL[0];
							attackCount = 0;
							initiateBattle(g);
							attack = false;
						}
					}
					else
					{
						person = playerWalkingL[11];
					}
				}
				else
				{
					if(keyheld == true)
					{
						person = playerWalkingL[count];
					}
					else
					{
						person = playerWalkingL[3];
					}
				}
			}
			if(direction.equals("D"))
			{
				if(attack == true || defend == true)
				{
					if(attack == true)
					{
						if(attackCount == 0 || attackCount == 1)
						{
							person = playerWalkingD[0];
							attackCount++;
						}
						else if(attackCount == 2 || attackCount == 3)
						{
							person = playerWalkingD[10];
							if(playerType.equals("fire_mage"))
							{
								preventMovement = true;
								specFrameCount = specFrameCount + 10;
								g.drawImage(specialAbil, x - ((specFrameCount/2)-25), y - ((specFrameCount/2)-25), specFrameCount, specFrameCount, DungeonGame.mainPanel.panel);
								//g.fillOval(x - (specFrameCount/2), y - (specFrameCount/2), specFrameCount, specFrameCount);
								attackCount = 2;
								initiateBattle(g);
								if(specFrameCount >= 150)
								{
									specFrameCount = 0;
									attackCount = 3;
									preventMovement = false;
								}
							}
							else
							{
								
								initiateBattle(g);
							}
							attackCount++;
						}
						else if(attackCount == 4)
						{
							person = playerWalkingD[5];
							attackCount = 0;
							initiateBattle(g);
							attack = false;
						}
					}
					else
					{
						person = playerWalkingD[11];
					}
				}
				else
				{
					if(keyheld == true)
					{
						person = playerWalkingD[count];
					}
					else
					{
						person = playerWalkingD[3];
					}
				}
			}
			if(direction.equals("U"))
			{
				if(attack == true || defend == true)
				{
					if(attack == true)
					{
						if(attackCount == 0 || attackCount == 1)
						{
							person = playerWalkingU[0];
							attackCount++;
						}
						else if(attackCount == 2 || attackCount == 3)
						{
							person = playerWalkingU[10];
							if(playerType.equals("fire_mage"))
							{
								preventMovement = true;
								specFrameCount = specFrameCount + 10;
								g.drawImage(specialAbil, x - ((specFrameCount/2)-25), y - ((specFrameCount/2)-25), specFrameCount, specFrameCount, DungeonGame.mainPanel.panel);
								//g.fillOval(x - (specFrameCount/2), y - (specFrameCount/2), specFrameCount, specFrameCount);
								attackCount = 2;
								initiateBattle(g);
								if(specFrameCount >= 150)
								{
									specFrameCount = 0;
									attackCount = 3;
									preventMovement = false;
								}
							}
							else
							{
								
								initiateBattle(g);
							}
							attackCount++;
						}
						else if(attackCount == 4)
						{
							person = playerWalkingU[5];
							attackCount = 0;
							attack = false;
						}
					}
					else
					{
						person = playerWalkingU[11];
					}
				}
				else
				{
					if(keyheld == true)
					{
						person = playerWalkingU[count];
					}
					else
					{
						person = playerWalkingU[3];
					}
				}
			}
		}

		if(preventMovement == false)
		{
			updatePosition();
		}

		g.drawImage(person, x, y, DungeonGame.mainPanel.panel);
		//g.drawImage(specialAbil, x, y, DungeonGame.mainPanel.panel);
		paintHealth(g);

		if(keyheld == true )
		{
			count = count + speed;
		}
		else
		{
			count++;
		}

		healCount++;
		if(healCount > 500 && health <= 10)
		{
			g.setColor(Color.white);
			g.setFont(textFont);
			g.drawString("+1" , x , y);
			if(healCount == 505)
			{
				health++;
				healCount = 0;
			}
		}

	}