Exemplo n.º 1
0
 public static void CheckSkills()
 {
     {
         if (Data.bot && Training.monster_selected == true)
         {
             if (Globals.MainWindow.secondbuff.Items.Count == 0)
             {
                 if (Training.monster_type == 0 || Training.monster_type == 1 || Training.monster_type == 4 || Globals.MainWindow.partyattack.Items.Count == 0)
                 {
                     if (Globals.MainWindow.generalattack.Items.Count == 0)
                     {
                         ImbueCast();
                         Training.Attack(Training.monster_id);
                     }
                     else
                     {
                         for (int i = 0; i < Globals.MainWindow.generalattack.Items.Count; i++)
                         {
                             if (Skill.Skills[Skill.AttackSkills[i].index].Status == 0 && Skill.AttackSkills[i].MinMP <= Character.CurrentMP)
                             {
                                 ImbueCast();
                                 CastSkill(Skill.AttackSkills[i], Training.monster_id);
                                 break;
                             }
                             if (i + 1 == Globals.MainWindow.generalattack.Items.Count) /*&& (Globals.MainWindow.no_normal_attack.unchecked)*/
                             {
                                 ImbueCast();
                                 Training.Attack(Training.monster_id);
                                 //No more skills, normal attack
                             }
                         }
                     }
                 }
                 else
                 {
                     for (int i = 0; i < Globals.MainWindow.partyattack.Items.Count; i++)
                     {
                         if (Skill.Skills[Skill.PartyAttackSkills[i].index].Status == 0 && Skill.PartyAttackSkills[i].MinMP <= Character.CurrentMP)
                         {
                             ImbueCast();
                             CastSkill(Skill.PartyAttackSkills[i], Training.monster_id);
                             break;
                         }
                         if (i + 1 == Globals.MainWindow.partyattack.Items.Count) /*&& (Globals.MainWindow.no_normal_attack.unchecked)*/
                         {
                             ImbueCast();
                             Training.Attack(Training.monster_id);
                             //No more skills, normal attack
                         }
                     }
                 }
             }
             else
             {
                 if (Training.monster_type == 0 || Training.monster_type == 1 || Training.monster_type == 4 || Globals.MainWindow.partyattack.Items.Count == 0)
                 {
                     if (Globals.MainWindow.generalattack.Items.Count == 0)
                     {
                         if (Data.f_wep_name != "" && Data.f_wep_name != null)
                         {
                             int index = Data.inventorytype.IndexOf(Data.f_wep_name);
                             if (index == -1)
                             {
                                 Data.f_wep_name = "";
                             }
                         }
                         System.Threading.Thread.Sleep(1);
                         if (Data.f_wep_name != "")
                         {
                             int index1 = Data.inventorytype.IndexOf(Data.f_wep_name);
                             if (Data.inventoryslot[index1] != 6)
                             {
                                 System.Threading.Thread.Sleep(1);
                                 Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_INVENTORYMOVEMENT);
                                 NewPacket.WriteUInt8(0);
                                 NewPacket.WriteUInt8((byte)Data.inventoryslot[index1]);
                                 NewPacket.WriteUInt8(6);
                                 NewPacket.WriteUInt16(0x0000);
                                 Proxy.ag_remote_security.Send(NewPacket);
                             }
                             else
                             {
                                 ImbueCast();
                                 Training.Attack(Training.monster_id);
                             }
                         }
                         else
                         {
                             Data.bot  = false;
                             Data.loop = false;
                             Globals.MainWindow.Content(Globals.MainWindow.startbot, "Start Bot");
                             Globals.MainWindow.UpdateLogs("Bot Stops! Cannot Find 1st Weapon");
                         }
                     }
                     else
                     {
                         for (int i = 0; i < Globals.MainWindow.generalattack.Items.Count; i++)
                         {
                             if (Data.f_wep_name != "" && Data.f_wep_name != null)
                             {
                                 int index = Data.inventorytype.IndexOf(Data.f_wep_name);
                                 if (index == -1)
                                 {
                                     Data.f_wep_name = "";
                                 }
                             }
                             System.Threading.Thread.Sleep(1);
                             if (Data.f_wep_name != "")
                             {
                                 if (Skill.Skills[Skill.AttackSkills[i].index].Status == 0 && Skill.AttackSkills[i].MinMP <= Character.CurrentMP)
                                 {
                                     System.Threading.Thread.Sleep(1);
                                     int index1 = Data.inventorytype.IndexOf(Data.f_wep_name);
                                     if (Data.inventoryslot[index1] != 6)
                                     {
                                         System.Threading.Thread.Sleep(1);
                                         Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_INVENTORYMOVEMENT);
                                         NewPacket.WriteUInt8(0);
                                         NewPacket.WriteUInt8((byte)Data.inventoryslot[index1]);
                                         NewPacket.WriteUInt8(6);
                                         NewPacket.WriteUInt16(0x0000);
                                         Proxy.ag_remote_security.Send(NewPacket);
                                         break;
                                     }
                                     else
                                     {
                                         ImbueCast();
                                         CastSkill(Skill.AttackSkills[i], Training.monster_id);
                                         break;
                                     }
                                 }
                                 if (i + 1 == Globals.MainWindow.generalattack.Items.Count) /*&& (Globals.MainWindow.no_normal_attack.unchecked)*/
                                 {
                                     int index1 = Data.inventorytype.IndexOf(Data.f_wep_name);
                                     if (Data.inventoryslot[index1] != 6)
                                     {
                                         System.Threading.Thread.Sleep(1);
                                         Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_INVENTORYMOVEMENT);
                                         NewPacket.WriteUInt8(0);
                                         NewPacket.WriteUInt8((byte)Data.inventoryslot[index1]);
                                         NewPacket.WriteUInt8(6);
                                         NewPacket.WriteUInt16(0x0000);
                                         Proxy.ag_remote_security.Send(NewPacket);
                                     }
                                     else
                                     {
                                         ImbueCast();
                                         Training.Attack(Training.monster_id);
                                         //No more skills, normal attack
                                     }
                                 }
                             }
                             else
                             {
                                 Data.bot  = false;
                                 Data.loop = false;
                                 Globals.MainWindow.Content(Globals.MainWindow.startbot, "Start Bot");
                                 Globals.MainWindow.UpdateLogs("Bot Stops! Cannot Find 1st Weapon");
                                 break;
                             }
                         }
                     }
                 }
                 else
                 {
                     for (int i = 0; i < Globals.MainWindow.partyattack.Items.Count; i++)
                     {
                         if (Data.f_wep_name != "" && Data.f_wep_name != null)
                         {
                             int index = Data.inventorytype.IndexOf(Data.f_wep_name);
                             if (index == -1)
                             {
                                 Data.f_wep_name = "";
                             }
                         }
                         System.Threading.Thread.Sleep(1);
                         if (Data.f_wep_name != "")
                         {
                             if (Skill.Skills[Skill.PartyAttackSkills[i].index].Status == 0 && Skill.PartyAttackSkills[i].MinMP <= Character.CurrentMP)
                             {
                                 System.Threading.Thread.Sleep(1);
                                 int index1 = Data.inventorytype.IndexOf(Data.f_wep_name);
                                 if (Data.inventoryslot[index1] != 6)
                                 {
                                     System.Threading.Thread.Sleep(1);
                                     Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_INVENTORYMOVEMENT);
                                     NewPacket.WriteUInt8(0);
                                     NewPacket.WriteUInt8((byte)Data.inventoryslot[index1]);
                                     NewPacket.WriteUInt8(6);
                                     NewPacket.WriteUInt16(0x0000);
                                     Proxy.ag_remote_security.Send(NewPacket);
                                     break;
                                 }
                                 else
                                 {
                                     ImbueCast();
                                     CastSkill(Skill.PartyAttackSkills[i], Training.monster_id);
                                     break;
                                 }
                             }
                             if (i + 1 == Globals.MainWindow.partyattack.Items.Count) /*&& (Globals.MainWindow.no_normal_attack.unchecked)*/
                             {
                                 System.Threading.Thread.Sleep(1);
                                 int index1 = Data.inventorytype.IndexOf(Data.f_wep_name);
                                 if (Data.inventoryslot[index1] != 6)
                                 {
                                     System.Threading.Thread.Sleep(1);
                                     Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_INVENTORYMOVEMENT);
                                     NewPacket.WriteUInt8(0);
                                     NewPacket.WriteUInt8((byte)Data.inventoryslot[index1]);
                                     NewPacket.WriteUInt8(6);
                                     NewPacket.WriteUInt16(0x0000);
                                     Proxy.ag_remote_security.Send(NewPacket);
                                 }
                                 else
                                 {
                                     ImbueCast();
                                     Training.Attack(Training.monster_id);
                                     //No more skills, normal attack
                                 }
                             }
                         }
                         else
                         {
                             Data.bot  = false;
                             Data.loop = false;
                             Globals.MainWindow.Content(Globals.MainWindow.startbot, "Start Bot");;
                             Globals.MainWindow.UpdateLogs("Bot Stops! Cannot Find 1st Weapon");
                             break;
                         }
                     }
                 }
             }
         }
     }
 }