示例#1
0
 public static void CheckBerserk(uint id, string mobtype)
 {
     if (Character.BerserkLevel == 5)
     {
         foreach (string eachline in Globals.MainWindow.berserk.Items)
         {
             string[] type = eachline.Split(':');
             if (mobtype == type[0])
             {
                 if (type[1] == " Yes")
                 {
                     Berserk.UseZerk();
                 }
                 break;
             }
         }
     }
 }
示例#2
0
        public static void SelectMonster()
        {
            {
                if (monster_selected)
                {
                    Berserk.CheckBerserk(Training.monster_id, monster_type_string);
                    Skills.CheckSkills();
                }
                else
                {
                    uint    id            = 0;
                    Monster selecting     = null;
                    int     prioritylevel = MonsterControl.CheckPriorityLevel(Monster.SpawnMob);
                    while (prioritylevel >= 0)
                    {
                        selecting = MonsterFilter(Monster.SpawnMob, prioritylevel);
                        if (selecting == null)
                        {
                            prioritylevel--;
                        }
                        else
                        {
                            id                  = selecting.UniqueID;
                            monster_type        = selecting.MobType;
                            monster_type_string = selecting.MobTypename;
                            monster_name        = selecting.AdvanceName;
                            distance            = selecting.Distance;
                            X = selecting.X;
                            Y = selecting.Y;
                            break;
                        }
                    }
                    if (id == 0)
                    {
                        Walking.walking_circle = true;
                        Walking.walking_path   = true;

                        if (Walking.running == false)
                        {
                            Walking.WalkManager();
                        }
                    }
                    else
                    {
                        monster_id = id;

                        if (Walking.walking_center)
                        {
                            Walking.walking_center = false;
                        }
                        if (Walking.walking_circle)
                        {
                            Walking.walking_circle = false;
                        }
                        if (Walking.walking_path)
                        {
                            Walking.walking_path = false;
                        }

                        Packet NewPacket = new Packet((ushort)WorldServerOpcodes.CLIENT_OPCODES.CLIENT_OBJECTSELECT);
                        NewPacket.WriteUInt32(monster_id);
                        Proxy.ag_remote_security.Send(NewPacket);

                        monster_selected = true;
                    }
                }
            }
        }
示例#3
0
        public static void Selected(Packet packet)
        {
            try
            {
                if (packet.ReadUInt8() == 1)
                {
                    Training.currentlyselected = packet.ReadUInt32();

                    try
                    {
                        Data.selectednpctype = Spawns.NPCType[Spawns.NPCID.IndexOf(Training.currentlyselected)];
                    }
                    catch { }

                    #region Loop
                    if (Data.loop && Data.bot)
                    {
                        if (Data.loopaction == "storage")
                        {
                            if (Data.storageopened == 0)
                            {
                                StorageControl.GetStorageItems(Spawns.NPCID[Spawns.NPCType.IndexOf(Data.selectednpctype)]);
                            }
                            else
                            {
                                StorageControl.OpenStorage1();
                            }
                        }
                        if (Data.loopaction == "blacksmith")
                        {
                            SellControl.SellManager(Spawns.NPCID[Spawns.NPCType.IndexOf(Data.selectednpctype)]);
                        }
                        if (Data.loopaction == "stable" || Data.loopaction == "accessory" || Data.loopaction == "potion")
                        {
                            BuyControl.BuyManager(Spawns.NPCID[Spawns.NPCType.IndexOf(Data.selectednpctype)]);
                        }
                    }
                    #endregion

                    else
                    {
                        if (Data.bot && monster_selected)
                        {
                            PortConfigs.TrainWindow.Label(PortConfigs.TrainWindow.monstername, monster_name);
                            PortConfigs.TrainWindow.Label(PortConfigs.TrainWindow.monstertype, monster_type_string);

                            if (packet.ReadUInt8() == 0x01)
                            {
                                if (Data.bot)
                                {
                                    if (monster_selected)
                                    {
                                        Movement.stuck_count = 0;
                                    }
                                }
                                uint hp = packet.ReadUInt32();
                                PortConfigs.TrainWindow.Label(PortConfigs.TrainWindow.monsterHP, Convert.ToString(hp));
                                if (hp > 0)
                                {
                                    if (currentlyselected == monster_id)
                                    {
                                        Skills.GhostWalk(distance, X, Y);
                                        if (Globals.MainWindow.Checked(Globals.MainWindow.petattack) == true)
                                        {
                                            BotAction.AttackWithPet();
                                        }
                                        Berserk.CheckBerserk(Training.monster_id, monster_type_string);

                                        /*if ((Globals.MainWindow.buffs_list3.Items.Count != 0 || Globals.MainWindow.buffs_list4.Items.Count != 0) && monster_type > 1)
                                         * {
                                         *  Buffas.buff_waiting = true;
                                         * }*/
                                        LogicControl.Manager();
                                    }
                                }
                                else
                                {
                                    Training.monster_selected = false;
                                    Training.monster_id       = 0;

                                    LogicControl.Manager();
                                }
                            }
                        }
                    }
                }
                else
                {
                    LeoBot.Stuck.AddMob(Training.monster_id, 3);

                    Training.monster_selected = false;
                    Training.monster_id       = 0;

                    LogicControl.Manager();
                }
            }
            catch (Exception)
            {
                Training.monster_selected = false;
                Training.monster_id       = 0;

                LogicControl.Manager();
            }
        }
示例#4
0
        public static void ParseMob(Packet packet, int index)
        {
            try
            {
                uint UniqueID = packet.ReadUInt32(); //ModID
                byte xsec     = packet.ReadUInt8();
                byte ysec     = packet.ReadUInt8();

                float xcoord = packet.ReadSingle();
                packet.ReadSingle();
                float ycoord = packet.ReadSingle();

                packet.ReadUInt8();             // Unknown
                packet.ReadUInt8();             // Unknown

                byte move = packet.ReadUInt8(); // Flag
                packet.ReadUInt8();             // Running
                if (move == 1)
                {
                    xsec   = packet.ReadUInt8();
                    ysec   = packet.ReadUInt8();
                    xcoord = packet.ReadUInt16();
                    packet.ReadUInt16();
                    ycoord = packet.ReadUInt16();
                }
                else
                {
                    packet.ReadUInt8();  // Unknown
                    packet.ReadUInt16(); // Unknwon
                }

                float X        = Convert.ToSingle((xsec - 135) * 192 + (xcoord / 10));
                float Y        = Convert.ToSingle((ysec - 92) * 192 + (ycoord / 10));
                int   Distance = (int)(Math.Abs((X - Character.X)) + Math.Abs((Y - Character.Y)));

                byte alive = packet.ReadUInt8(); // Alive
                packet.ReadUInt8();              // Unknown
                packet.ReadUInt8();              // Unknown
                packet.ReadUInt8();              // Zerk Active
                packet.ReadSingle();             // Walk Speed
                packet.ReadSingle();             // Run Speed
                packet.ReadSingle();             // Zerk Speed
                packet.ReadUInt32();             // Unknown
                byte type     = packet.ReadUInt8();
                int  priority = 0;
                switch (type)
                {
                case 0:
                    priority = NormalPriority;
                    break;

                case 1:
                    priority = ChampionPriority;
                    break;

                case 3:
                    priority = UniquePriority;
                    break;

                case 4:
                    priority = GiantPriority;
                    break;

                case 5:
                    priority = TitanPriority;
                    break;

                case 6:
                    priority = ElitePriority;
                    break;

                case 7:
                    priority = ElitePriority;
                    break;

                case 16:
                    priority = PartyPriority;
                    break;

                case 17:
                    priority = PartyChampionPriority;
                    break;

                case 20:
                    priority = PartyGiantPriority;
                    break;
                }

                Monster NewMonster = new Monster(UniqueID, Mobs_Info.mobstypelist[index], type, Berserk.GetTypeName(type),
                                                 Mobs_Info.mobsnamelist[index], Mobs_Info.mobslevellist[index], priority, 0,
                                                 Monster.ModNameList[Monster.ModTypeList.IndexOf(Mobs_Info.mobstypelist[index])]);
                NewMonster.X        = X;
                NewMonster.Y        = Y;
                NewMonster.Distance = Distance;

                if (alive == 1)
                {
                    Monster.SpawnMob.Add(NewMonster);
                }
            }
            catch { }
        }