context: using System;
  using System.Collections.Generic;
  using System.Text;
  
  namespace L2_login
  {
      public partial class L2NET
      {
          delegate void DeadButtons_Callback(uint town, uint clanhall, uint castle, uint siege, uint fort);
          public void DeadButtons(uint town, uint clanhall, uint castle, uint siege, uint fort)
          {
              if (this.label_clan_level.InvokeRequired)
              {
                  DeadButtons_Callback d = new DeadButtons_Callback(DeadButtons);
                  label_clan_level.Invoke(d, new object[] { town, clanhall, castle, siege, fort });
                  return;
              }
  
              if (town == 1)
                  button_dead_town.Visible = true;
              else
                  button_dead_town.Visible = false;
              if (clanhall == 1)
                  button_dead_clanhall.Visible = true;
              else
                  button_dead_clanhall.Visible = false;
              if (castle == 1)
                  button_dead_castle.Visible = true;
              else
                  button_dead_castle.Visible = false;
              if (siege == 1)
                  button_dead_siege.Visible = true;
              else
                  button_dead_siege.Visible = false;
              if (fort == 1)
                  button_dead_fort.Visible = true;
              else
                  button_dead_fort.Visible = false;
          }
  
          delegate void Do_Equip_Callback(InventoryInfo inv_inf);
          public void Do_Equip(InventoryInfo inv_inf)
          {
              if (this.panel_inven_lear.InvokeRequired)
              {
                  Do_Equip_Callback d = new Do_Equip_Callback(Do_Equip);
                  panel_inven_lear.Invoke(d, new object[] { inv_inf });
                  return;
              }
  
              string name = Util.GetItemName(inv_inf.ItemID);
              string description = Util.GetItemDescription(inv_inf.ItemID);
              string path = Util.GetItemImagePath(inv_inf.ItemID);
              bool bmp = System.IO.File.Exists(path);
  
      		switch(inv_inf.Slot)
  			{
                  case InventorySlots.Shirt:
                      toolTip1.SetToolTip(panel_inven_shirt, "+" + inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
                      if (panel_inven_shirt.BackgroundImage != null)
                      {
                          panel_inven_shirt.BackgroundImage.Dispose();
                          panel_inven_shirt.BackgroundImage = null;
                      }
                      if (bmp)
                          panel_inven_shirt.BackgroundImage = new System.Drawing.Bitmap(path);
                      break;
                  case InventorySlots.Ear:
  					if(panel_inven_lear.BackgroundImage == null)
  					{
  						//load to lear
  						toolTip1.SetToolTip(panel_inven_lear,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  						if(panel_inven_lear.BackgroundImage != null)
  						{
  							panel_inven_lear.BackgroundImage.Dispose();
  							panel_inven_lear.BackgroundImage = null;
  						}
  						if(bmp)
                              panel_inven_lear.BackgroundImage = new System.Drawing.Bitmap(path);
  					}
  					else
  					{
  						//load to rear
  						toolTip1.SetToolTip(panel_inven_rear,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  						if(panel_inven_rear.BackgroundImage != null)
  						{
  							panel_inven_rear.BackgroundImage.Dispose();
  							panel_inven_rear.BackgroundImage = null;
  						}
  						if(bmp)
                              panel_inven_rear.BackgroundImage = new System.Drawing.Bitmap(path);
  					}
  					break;
                  case InventorySlots.Neck:
  					toolTip1.SetToolTip(panel_inven_neck,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_neck.BackgroundImage != null)
  					{
  						panel_inven_neck.BackgroundImage.Dispose();
  						panel_inven_neck.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_neck.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Finger:
  					if(panel_inven_lfinger.BackgroundImage == null)
  					{
  						//load to lear
  						toolTip1.SetToolTip(panel_inven_lfinger,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  						if(panel_inven_lfinger.BackgroundImage != null)
  						{
  							panel_inven_lfinger.BackgroundImage.Dispose();
  							panel_inven_lfinger.BackgroundImage = null;
  						}
  						if(bmp)
                              panel_inven_lfinger.BackgroundImage = new System.Drawing.Bitmap(path);
  					}
  					else
  					{
  						//load to rear
  						toolTip1.SetToolTip(panel_inven_rfinger,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  						if(panel_inven_rfinger.BackgroundImage != null)
  						{
  							panel_inven_rfinger.BackgroundImage.Dispose();
  							panel_inven_rfinger.BackgroundImage = null;
  						}
  						if(bmp)
                              panel_inven_rfinger.BackgroundImage = new System.Drawing.Bitmap(path);
  					}
  					break;
                  case InventorySlots.Head:
  					toolTip1.SetToolTip(panel_inven_head,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_head.BackgroundImage != null)
  					{
  						panel_inven_head.BackgroundImage.Dispose();
  						panel_inven_head.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_head.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.RHand:
  					toolTip1.SetToolTip(panel_inven_rhand,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_rhand.BackgroundImage != null)
  					{
  						panel_inven_rhand.BackgroundImage.Dispose();
  						panel_inven_rhand.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_rhand.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.LHand:
  					toolTip1.SetToolTip(panel_inven_lhand,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_lhand.BackgroundImage != null)
  					{
  						panel_inven_lhand.BackgroundImage.Dispose();
  						panel_inven_lhand.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_lhand.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Gloves:
  					toolTip1.SetToolTip(panel_inven_gloves,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_gloves.BackgroundImage != null)
  					{
  						panel_inven_gloves.BackgroundImage.Dispose();
  						panel_inven_gloves.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_gloves.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Chest:
  					toolTip1.SetToolTip(panel_inven_top,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_top.BackgroundImage != null)
  					{
  						panel_inven_top.BackgroundImage.Dispose();
  						panel_inven_top.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_top.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Pants:
  					toolTip1.SetToolTip(panel_inven_pants,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_pants.BackgroundImage != null)
  					{
  						panel_inven_pants.BackgroundImage.Dispose();
  						panel_inven_pants.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_pants.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Feet:
  					toolTip1.SetToolTip(panel_inven_boots,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_boots.BackgroundImage != null)
  					{
  						panel_inven_boots.BackgroundImage.Dispose();
  						panel_inven_boots.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_boots.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Dunno:
  					break;
                  case InventorySlots.LRHand:
  					toolTip1.SetToolTip(panel_inven_rhand,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_rhand.BackgroundImage != null)
  					{
  						panel_inven_rhand.BackgroundImage.Dispose();
  						panel_inven_rhand.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_rhand.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.FullBody:
  					//just use the top image for now
  					toolTip1.SetToolTip(panel_inven_top,"+"+inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
  					if(panel_inven_top.BackgroundImage != null)
  					{
  						panel_inven_top.BackgroundImage.Dispose();
  						panel_inven_top.BackgroundImage = null;
  					}
  					if(bmp)
                          panel_inven_top.BackgroundImage = new System.Drawing.Bitmap(path);
  					break;
                  case InventorySlots.Accessory:
                      toolTip1.SetToolTip(panel_inven_acc, "+" + inv_inf.Enchant.ToString() + " " + name + Environment.NewLine + description);
                      if (panel_inven_acc.BackgroundImage != null)
                      {
                          panel_inven_acc.BackgroundImage.Dispose();
                          panel_inven_acc.BackgroundImage = null;
                      }
                      if (bmp)
                          panel_inven_acc.BackgroundImage = new System.Drawing.Bitmap(path);
                      break;
              }
  		}
  
          delegate void Clear_Equip2_Callback(InventorySlots slot);
          public void Clear_Equip(InventorySlots slot)
          {
              if (this.panel_inven_lear.InvokeRequired)
              {
                  Clear_Equip2_Callback d = new Clear_Equip2_Callback(Clear_Equip);
                  panel_inven_lear.Invoke(d, new object[] { slot });
                  return;
              }
  
              switch (slot)
              {
                  case InventorySlots.Shirt:
                      toolTip1.SetToolTip(panel_inven_shirt, "");
                      if (panel_inven_shirt.BackgroundImage != null)
                      {
                          panel_inven_shirt.BackgroundImage.Dispose();
                          panel_inven_shirt.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Ear:
                      break;
                  case InventorySlots.Neck:
                      toolTip1.SetToolTip(panel_inven_neck, "");
                      if (panel_inven_neck.BackgroundImage != null)
                      {
                          panel_inven_neck.BackgroundImage.Dispose();
                          panel_inven_neck.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Finger:
                      break;
                  case InventorySlots.Head:
                      toolTip1.SetToolTip(panel_inven_head, "");
                      if (panel_inven_head.BackgroundImage != null)
                      {
                          panel_inven_head.BackgroundImage.Dispose();
                          panel_inven_head.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.RHand:
                      toolTip1.SetToolTip(panel_inven_rhand, "");
                      if (panel_inven_rhand.BackgroundImage != null)
                      {
                          panel_inven_rhand.BackgroundImage.Dispose();
                          panel_inven_rhand.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.LHand:
                      toolTip1.SetToolTip(panel_inven_lhand, "");
                      if (panel_inven_lhand.BackgroundImage != null)
                      {
                          panel_inven_lhand.BackgroundImage.Dispose();
                          panel_inven_lhand.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Gloves:
                      toolTip1.SetToolTip(panel_inven_gloves, "");
                      if (panel_inven_gloves.BackgroundImage != null)
                      {
                          panel_inven_gloves.BackgroundImage.Dispose();
                          panel_inven_gloves.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Chest:
                      toolTip1.SetToolTip(panel_inven_top, "");
                      if (panel_inven_top.BackgroundImage != null)
                      {
                          panel_inven_top.BackgroundImage.Dispose();
                          panel_inven_top.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Pants:
                      toolTip1.SetToolTip(panel_inven_pants, "");
                      if (panel_inven_pants.BackgroundImage != null)
                      {
                          panel_inven_pants.BackgroundImage.Dispose();
                          panel_inven_pants.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Feet:
                      toolTip1.SetToolTip(panel_inven_boots, "");
                      if (panel_inven_boots.BackgroundImage != null)
                      {
                          panel_inven_boots.BackgroundImage.Dispose();
                          panel_inven_boots.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Dunno:
                      break;
                  case InventorySlots.LRHand:
                      toolTip1.SetToolTip(panel_inven_lhand, "");
                      toolTip1.SetToolTip(panel_inven_rhand, "");
                      if (panel_inven_lhand.BackgroundImage != null)
                      {
                          panel_inven_lhand.BackgroundImage.Dispose();
                          panel_inven_lhand.BackgroundImage = null;
                      }
                      if (panel_inven_rhand.BackgroundImage != null)
                      {
                          panel_inven_rhand.BackgroundImage.Dispose();
                          panel_inven_rhand.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.FullBody:
                      toolTip1.SetToolTip(panel_inven_top, "");
                      toolTip1.SetToolTip(panel_inven_pants, "");
                      if (panel_inven_top.BackgroundImage != null)
                      {
                          panel_inven_top.BackgroundImage.Dispose();
                          panel_inven_top.BackgroundImage = null;
                      }
                      if (panel_inven_pants.BackgroundImage != null)
                      {
                          panel_inven_pants.BackgroundImage.Dispose();
                          panel_inven_pants.BackgroundImage = null;
                      }
                      break;
                  case InventorySlots.Accessory:
                      toolTip1.SetToolTip(panel_inven_acc, "");
                      if (panel_inven_acc.BackgroundImage != null)
                      {
                          panel_inven_acc.BackgroundImage.Dispose();
                          panel_inven_acc.BackgroundImage = null;
                      }
                      break;
              }
          }
  
          delegate void Clear_Equip_Callback();
          public void Clear_Equip()
          {
              if (this.panel_inven_lear.InvokeRequired)
              {
                  Clear_Equip_Callback d = new Clear_Equip_Callback(Clear_Equip);
                  panel_inven_lear.Invoke(d);
                  return;
              }
  
              if (panel_inven_lear.BackgroundImage != null)
              {
                  panel_inven_lear.BackgroundImage.Dispose();
                  panel_inven_lear.BackgroundImage = null;
              }
              if (panel_inven_rear.BackgroundImage != null)
              {
                  panel_inven_rear.BackgroundImage.Dispose();
                  panel_inven_rear.BackgroundImage = null;
              }
              if (panel_inven_neck.BackgroundImage != null)
              {
                  panel_inven_neck.BackgroundImage.Dispose();
                  panel_inven_neck.BackgroundImage = null;
              }
              if (panel_inven_lfinger.BackgroundImage != null)
              {
                  panel_inven_lfinger.BackgroundImage.Dispose();
                  panel_inven_lfinger.BackgroundImage = null;
              }
              if (panel_inven_rfinger.BackgroundImage != null)
              {
                  panel_inven_rfinger.BackgroundImage.Dispose();
                  panel_inven_rfinger.BackgroundImage = null;
              }
              if (panel_inven_head.BackgroundImage != null)
              {
                  panel_inven_head.BackgroundImage.Dispose();
                  panel_inven_head.BackgroundImage = null;
              }
              if (panel_inven_rhand.BackgroundImage != null)
              {
                  panel_inven_rhand.BackgroundImage.Dispose();
                  panel_inven_rhand.BackgroundImage = null;
              }
              if (panel_inven_lhand.BackgroundImage != null)
              {
                  panel_inven_lhand.BackgroundImage.Dispose();
                  panel_inven_lhand.BackgroundImage = null;
              }
              if (panel_inven_gloves.BackgroundImage != null)
              {
                  panel_inven_gloves.BackgroundImage.Dispose();
                  panel_inven_gloves.BackgroundImage = null;
              }
              if (panel_inven_top.BackgroundImage != null)
              {
                  panel_inven_top.BackgroundImage.Dispose();
                  panel_inven_top.BackgroundImage = null;
              }
              if (panel_inven_pants.BackgroundImage != null)
              {
                  panel_inven_pants.BackgroundImage.Dispose();
                  panel_inven_pants.BackgroundImage = null;
              }
              if (panel_inven_boots.BackgroundImage != null)
              {
                  panel_inven_boots.BackgroundImage.Dispose();
                  panel_inven_boots.BackgroundImage = null;
              }
          }
          
          delegate void Set_HennaTips_Callback();
          public void Set_HennaTips()
          {
              if (this.panel_tat1.InvokeRequired)
              {
                  Set_HennaTips_Callback d = new Set_HennaTips_Callback(Set_HennaTips);
                  panel_tat1.Invoke(d);
                  return;
              }
  
              try
              {
                  if (Globals.gamedata.my_char.Symbol1 != 0)
                  {
                      panel_tat1.BackgroundImage = new System.Drawing.Bitmap(Globals.PATH + "\\Icons\\" + ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol1]).Icon + "_0.BMP");
                      toolTip1.SetToolTip(Globals.l2net_home.panel_tat1, ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol1]).Name + " : " + ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol1]).Add_Name);
                  }
                  else
                  {
                      toolTip1.SetToolTip(Globals.l2net_home.panel_tat1, "");
                      panel_tat1.BackgroundImage = null;
                  }
              }
              catch
              {
              }
  
              try
              {
                  if (Globals.gamedata.my_char.Symbol2 != 0)
                  {
                      panel_tat2.BackgroundImage = new System.Drawing.Bitmap(Globals.PATH + "\\Icons\\" + ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol2]).Icon + "_0.BMP");
                      toolTip1.SetToolTip(Globals.l2net_home.panel_tat2, ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol2]).Name + " +" + ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol2]).Add_Name);
                  }
                  else
                  {
                      toolTip1.SetToolTip(Globals.l2net_home.panel_tat2, "");
                      panel_tat2.BackgroundImage = null;
                  }
              }
              catch
              {
              }
  
              try
              {
                  if (Globals.gamedata.my_char.Symbol3 != 0)
                  {
                      panel_tat3.BackgroundImage = new System.Drawing.Bitmap(Globals.PATH + "\\Icons\\" + ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol3]).Icon + "_0.BMP");
                      toolTip1.SetToolTip(Globals.l2net_home.panel_tat3, ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol3]).Name + " +" + ((HennaGroup)Globals.hennagrp[Globals.gamedata.my_char.Symbol3]).Add_Name);
                  }
                  else
                  {
                      toolTip1.SetToolTip(Globals.l2net_home.panel_tat3, "");
                      panel_tat3.BackgroundImage = null;
                  }
              }
              catch
              {
              }
          }
  
          delegate void Hide_Dead_Callback();
          public void Hide_Dead()
          {
              if (this.panel_dead.InvokeRequired)
              {
                  Hide_Dead_Callback d = new Hide_Dead_Callback(Hide_Dead);
                  panel_dead.Invoke(d);
                  return;
              }
  
              this.panel_dead.Hide();
          }
  
          delegate void Show_Dead_Callback();
          public void Show_Dead()
          {
              if (this.panel_dead.InvokeRequired)
              {
                  Show_Dead_Callback d = new Show_Dead_Callback(Show_Dead);
                  panel_dead.Invoke(d);
                  return;
              }
  
              this.panel_dead.Show();
              tabControl_char.SelectedIndex = 0;
          }
  
          delegate void Hide_YesNo_Callback();
          public void Hide_YesNo()
          {
              if (this.panel_yesno.InvokeRequired)
              {
                  Hide_YesNo_Callback d = new Hide_YesNo_Callback(Hide_YesNo);
                  panel_yesno.Invoke(d);
                  return;
              }
  
              this.panel_yesno.Hide();
          }
  
          delegate void Show_YesNo_Callback();
          public void Show_YesNo()
          {
              if (this.panel_yesno.InvokeRequired)
              {
                  Show_YesNo_Callback d = new Show_YesNo_Callback(Show_YesNo);
                  panel_yesno.Invoke(d);
                  return;
              }
  
              this.panel_yesno.Show();
              tabControl_char.SelectedIndex = 0;
          }
  
          delegate void Set_YesNo_Callback(string text);
          public void Set_YesNo(string text)
          {
              if (this.label_yesno.InvokeRequired)
              {
                  Set_YesNo_Callback d = new Set_YesNo_Callback(Set_YesNo);
                  label_yesno.Invoke(d, new object[] { text });
                  return;
              }
  
              label_yesno.Text = text;
          }
  
          delegate void Set_Target_CP_Callback(string text);
          public void Set_Target_CP(string text)
          {
              if (this.label_target_cp.InvokeRequired)
              {
                  Set_Target_CP_Callback d = new Set_Target_CP_Callback(Set_Target_CP);
                  label_target_cp.Invoke(d, new object[] { text });
                  return;
              }
  
              label_target_cp.Text = text;
          }
  
          delegate void Set_Target_MP_Callback(string text);
          public void Set_Target_MP(string text)
          {
              if (this.label_target_mp.InvokeRequired)
              {
                  Set_Target_MP_Callback d = new Set_Target_MP_Callback(Set_Target_MP);
                  label_target_mp.Invoke(d, new object[] { text });
                  return;
              }
  
              label_target_mp.Text = text;
          }
  
          delegate void Set_Target_HP_Callback(string text);
          public void Set_Target_HP(string text)
          {
              if (this.label_target_hp.InvokeRequired)
              {
                  Set_Target_HP_Callback d = new Set_Target_HP_Callback(Set_Target_HP);
                  label_target_hp.Invoke(d, new object[] { text });
                  return;
              }
  
              label_target_hp.Text = text;
          }
  
          delegate void Set_Target_Name_Callback(string name);
          public void Set_Target_Name(string name)
          {
              if (this.label_target_name.InvokeRequired)
              {
                  Set_Target_Name_Callback d = new Set_Target_Name_Callback(Set_Target_Name);
                  label_target_name.Invoke(d, new object[] { name });
                  return;
              }
  
              label_target_name.Text = name;
          }
  
          delegate void Set_Char_Info_Basic_Callback();
          public void Set_Char_Info_Basic()
          {
              if (this.label_char_hp.InvokeRequired)
              {
                  Set_Char_Info_Basic_Callback d = new Set_Char_Info_Basic_Callback(Set_Char_Info_Basic);
                  label_char_hp.Invoke(d);
                  return;
              }
  
              label_char_hp.Text = Globals.gamedata.my_char.Cur_HP.ToString() + "/" + Globals.gamedata.my_char.Max_HP.ToString();
              try
              {
                  progressBar_char_HP.Value = System.Convert.ToInt32((Globals.gamedata.my_char.Cur_HP / Globals.gamedata.my_char.Max_HP) * 100);
                  progressBar_char_HP.BarText = Globals.gamedata.my_char.Cur_HP.ToString() + "/" + Globals.gamedata.my_char.Max_HP.ToString();
              }
              catch
              {
                  progressBar_char_HP.Value = 0;
              }
              label_char_mp.Text = Globals.gamedata.my_char.Cur_MP.ToString() + "/" + Globals.gamedata.my_char.Max_MP.ToString();
              try
              {
                  progressBar_char_MP.Value = System.Convert.ToInt32((Globals.gamedata.my_char.Cur_MP / Globals.gamedata.my_char.Max_MP) * 100);
                  progressBar_char_MP.BarText = Globals.gamedata.my_char.Cur_MP.ToString() + "/" + Globals.gamedata.my_char.Max_MP.ToString();
              }
              catch
              {
                  progressBar_char_MP.Value = 0;
              }
              label_char_cp.Text = Globals.gamedata.my_char.Cur_CP.ToString() + "/" + Globals.gamedata.my_char.Max_CP.ToString();
              try
              {
                  progressBar_char_CP.Value = System.Convert.ToInt32((Globals.gamedata.my_char.Cur_CP / Globals.gamedata.my_char.Max_CP) * 100);
                  progressBar_char_CP.BarText = Globals.gamedata.my_char.Cur_CP.ToString() + "/" + Globals.gamedata.my_char.Max_CP.ToString();
              }
              catch
              {
                  progressBar_char_CP.Value = 0;
              }
  
              label_info_hp.Text = Globals.gamedata.my_char.Cur_HP.ToString() + "/" + Globals.gamedata.my_char.Max_HP.ToString();
              label_info_mp.Text = Globals.gamedata.my_char.Cur_MP.ToString() + "/" + Globals.gamedata.my_char.Max_MP.ToString();
              label_info_cp.Text = Globals.gamedata.my_char.Cur_CP.ToString() + "/" + Globals.gamedata.my_char.Max_CP.ToString();
              //lets do our xp %
              label_info_xp.Text = Globals.gamedata.my_char.XP.ToString();
              label_char_xp.Text = AddInfo.Get_XP_Percent();
              try
              {
                  if (Globals.gamedata.Chron >= Chronicle.CT2_6)
                  {
                      progressBar_char_XP.Value = System.Convert.ToInt32(Globals.gamedata.my_char.XPPercent * 100); //AddInfo.Get_XP_Percent_Int();
                      progressBar_char_XP.BarText = Globals.gamedata.my_char.XPPercent.ToString("P", System.Globalization.CultureInfo.InvariantCulture); //AddInfo.Get_XP_Percent();
                  }
                  else
                  {
                      progressBar_char_XP.Value = AddInfo.Get_XP_Percent_Int();
                      progressBar_char_XP.BarText = AddInfo.Get_XP_Percent();
                  }
              }
              catch
              {
                  progressBar_char_XP.Value = 0;
              }
              //end of xp
              label_info_sp.Text = Globals.gamedata.my_char.SP.ToString();
              label_char_vitality.Text = AddInfo.Get_Vitality_Level();
  
              label_info_str.Text = Globals.gamedata.my_char.STR.ToString();
              label_info_dex.Text = Globals.gamedata.my_char.DEX.ToString();
              label_info_con.Text = Globals.gamedata.my_char.CON.ToString();
              label_info_int.Text = Globals.gamedata.my_char.INT.ToString();
              label_info_wit.Text = Globals.gamedata.my_char.WIT.ToString();
              label_info_men.Text = Globals.gamedata.my_char.MEN.ToString();
  
              label_info_patk.Text = Globals.gamedata.my_char.Patk.ToString();
              label_info_pdef.Text = Globals.gamedata.my_char.PDef.ToString();
              label_info_acc.Text = Globals.gamedata.my_char.Accuracy.ToString();
              label_info_crit.Text = Globals.gamedata.my_char.Focus.ToString();
              label_info_atkspd.Text = Globals.gamedata.my_char.PatkSpeed.ToString();
              label_info_matk.Text = Globals.gamedata.my_char.Matk.ToString();
              label_info_mdef.Text = Globals.gamedata.my_char.MDef.ToString();
              label_info_eva.Text = Globals.gamedata.my_char.Evasion.ToString();
              label_info_spd.Text = ((int)(Globals.gamedata.my_char.RunSpeed * Globals.gamedata.my_char.MoveSpeedMult)).ToString();
              label_info_matkspd.Text = Globals.gamedata.my_char.MatkSpeed.ToString();
              label_info_maccuracy.Text = Globals.gamedata.my_char.MAccuracy.ToString();
              label_info_mevasion.Text = Globals.gamedata.my_char.MEvasion.ToString();
              label_info_mcritical.Text = Globals.gamedata.my_char.MCritical.ToString();
  
              //label_info_load.Text = Globals.gamedata.my_char.Cur_Load.ToString() + "/" + Globals.gamedata.my_char.Max_Load.ToString();
              if (Globals.gamedata.my_char.Max_Load > 0)
              {
                  label_info_load.Text = (System.Convert.ToDecimal(Globals.gamedata.my_char.Cur_Load) / System.Convert.ToDecimal(Globals.gamedata.my_char.Max_Load)).ToString("P", System.Globalization.CultureInfo.InvariantCulture);
              }
              else
              {
                  label_info_load.Text = Globals.gamedata.my_char.Cur_Load.ToString() + "/" + Globals.gamedata.my_char.Max_Load.ToString();
              }
              label_info_karma.Text = Globals.gamedata.my_char.Karma.ToString();
              label_info_pvp.Text = Globals.gamedata.my_char.PvPCount.ToString() + "/" + Globals.gamedata.my_char.PKCount.ToString();
              label_info_eval.Text = Globals.gamedata.my_char.RecAmount.ToString() + "/" + Globals.gamedata.my_char.RecLeft.ToString();
  
              //new stuff
              if (Globals.gamedata.Chron >= Chronicle.CT2_3)
              {
                  switch (Globals.gamedata.my_char.AtkAttrib)
                  {
                      case -2:
                          label_info_atk_attrib.Text = "None";
                          break;
                      case 0:
                          label_info_atk_attrib.Text = "Fire";
                          break;
                      case 1:
                          label_info_atk_attrib.Text = "Water";
                          break;
                      case 2:
                          label_info_atk_attrib.Text = "Wind";
                          break;
                      case 3:
                          label_info_atk_attrib.Text = "Earth";
                          break;
                      case 4:
                          label_info_atk_attrib.Text = "Holy";
                          break;
                      case 5:
                          label_info_atk_attrib.Text = "Dark";
                          break;
                      default:
                          label_info_atk_attrib.Text = "None";
                          break;
                  }
  
                  //label_info_atk_attrib.Text = Globals.gamedata.my_char.AtkAttrib.ToString();
                  label_info_atk_attrib_value.Text = Globals.gamedata.my_char.AtkAttribVal.ToString();
                  label_info_fire.Text = Globals.gamedata.my_char.DefAttribFire.ToString();
                  label_info_water.Text = Globals.gamedata.my_char.DefAttribWater.ToString();
                  label_info_wind.Text = Globals.gamedata.my_char.DefAttribWind.ToString();
                  label_info_earth.Text = Globals.gamedata.my_char.DefAttribEarth.ToString();
                  label_info_divinity.Text = Globals.gamedata.my_char.DefAttribHoly.ToString();
                  label_info_darkness.Text = Globals.gamedata.my_char.DefAttribUnholy.ToString();
                  label_info_fame.Text = Globals.gamedata.my_char.Fame.ToString();
              }
              
              //stats stuff
              DateTime temp = DateTime.Now;
              TimeSpan ts = Globals.start_time - temp;
  
              //negative values by default, converting to positive
              int hours = ts.Hours * -1;
              int minutes = ts.Minutes * -1;
              int seconds = ts.Seconds * -1;
  
  
              ulong tempXPGained = ((ulong)Globals.gamedata.my_char.XP - (ulong)GameData.initial_XP);
  
gt:             if (tempXPGained > 0)