Example #1
0
        internal void InvokeTraining(bool returnToStart)
        {
            if (AccountsPanel.CheckedIndices.Count < 1)
            {
                LogPanel.Log("E: Check the accounts you want to move");
                return;
            }

            Toggle(false);

            foreach (int index in AccountsPanel.CheckedIndices)
            {
                AccountsPanel.Engine[index].Mover.RefreshRoom();
                AccountsPanel.Engine[index].Mover.ReturnToStartHandler.SetOriginal();
                ThreadEngine.DefaultInstance.Enqueue(AccountsPanel.Engine[index].Mover.Train);
            }

            // TODO this needs to go - convert to ThreadPool
            ThreadEngine.DefaultInstance.ProcessAll();

            if (returnToStart)
            {
                foreach (int index in AccountsPanel.CheckedIndices)
                {
                    AccountsPanel.Engine[index].Mover.ReturnToStartHandler.InvokeReturn();
                    // TODO not necessary to thread this - it already is threaded
                    //InvokeReturn(index);
                }
            }

            Toggle(true);
        }
Example #2
0
        internal void DoAttackRooms(List <int> rooms)
        {
            Account mAccount = AccountsPanel.Engine.MainAccount;

            foreach (int rm in rooms)
            {
                if (!Globals.AttackMode || mAccount.Mover.Location == null)
                {
                    goto quit;
                }

                Globals.AttackOn = false;

                mAccount.Mover.PathfindTo(rm);

                if (!Globals.AttackMode)
                {
                    goto quit;
                }

                Globals.AttackOn = true;

                AccountsPanel.Engine.MainAccount.Mover.Location.Attack();
                if (!Globals.AttackOn)
                {
                    return;
                }
            }
            return;

quit:
            LogPanel.Log("Rooms coverage quit");
            StopAttacking(true);
        }
Example #3
0
        internal void AttackMobs()
        {
            if (MobsPanel.CheckedIndices.Count < 1)
            {
                LogPanel.Log("E: Choose at least 1 mob to attack");
                return;
            }

            // sort by value - ie., sort by room number
            List <AttackHandler.MobArg> mobs = new List <AttackHandler.MobArg>();

            foreach (int i in MobsPanel.CheckedIndices)
            {
                int    id   = int.Parse(MobsPanel.Mobs[i].SubItems[1].Text);
                int    room = int.Parse(MobsPanel.Mobs[i].SubItems[2].Text);
                string name = MobsPanel.Mobs[i].SubItems[0].Text;
                AttackHandler.MobArg arg = new AttackHandler.MobArg(id, room, name);
                if (!mobs.Contains(arg))
                {
                    mobs.Add(arg);
                }
            }
            mobs.Sort(
                delegate(
                    AttackHandler.MobArg first,
                    AttackHandler.MobArg second)
            {
                return(second.RoomId.CompareTo(first.RoomId));
            }
                );

            SetUpHandler();
            AttackHandler.BeginMobs(mobs);
        }
Example #4
0
        internal void DoAttackArea()
        {
            Globals.AttackOn = true;

            AccountsPanel.Engine.MainAccount.Mover.CoverArea();

            if (!Globals.AttackMode)
            {
                LogPanel.Log("Single-area coverage quit");
                StopAttacking(true);
            }
        }
Example #5
0
        internal void InvokePathfind(int room)
        {
            if (AccountsPanel.CheckedIndices.Count < 1)
            {
                LogPanel.Log("E: Check the accounts you want to move");
                return;
            }
            if (!Pathfinder.Exists(room))
            {
                LogPanel.Log("E: Select a room that exists in the map database.  If you are moving to a mob, its room information may be invalid.");
                return;
            }

            InvokeBulkMove(room);
        }
Example #6
0
        private void reloadMapDataToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Toggle(false);
            Pathfinder.Rooms.Clear();
            Pathfinder.Mobs.Clear();
            Pathfinder.Spawns.Clear();
            Pathfinder.Adventures.Clear();

            LogPanel.Log("Downloading map data...");
            ThreadEngine.DefaultInstance.DoParameterized(Pathfinder.BuildMap, true);

            LogPanel.Log("Rebuilding views...");
            BuildViews();

            LogPanel.Log("Done.");
            Toggle(true);
        }
Example #7
0
        internal void DoAttackMultiAreas(Dictionary <int, string> rooms)
        {
            // TODO shouldn't need room name as string...

            Account       mAccount = AccountsPanel.Engine.MainAccount;
            List <string> done     = new List <string>();

            foreach (int rm in rooms.Keys)
            {
                if (!Globals.AttackMode || mAccount.Mover.Location == null)
                {
                    goto quit;
                }

                if (done.Contains(rooms[rm]))
                {
                    continue;
                }

                done.Add(rooms[rm]);

                Globals.AttackOn = false;

                mAccount.Mover.PathfindTo(rm);

                if (!Globals.AttackMode)
                {
                    goto quit;
                }

                Globals.AttackOn = true;

                AccountsPanel.Engine.MainAccount.Mover.CoverArea();

                if (!Globals.AttackOn || !Globals.AttackMode)
                {
                    goto quit;
                }
            }
            return;

quit:
            LogPanel.Log("Multi-area coverage quit");
            StopAttacking(true);
        }
Example #8
0
        internal void AttackAreas()
        {
            if (RoomsPanel.CheckedRooms.Count < 1)
            {
                LogPanel.Log("E: Choose at least 1 area to cover");
                return;
            }

            Dictionary <int, string> rooms = new Dictionary <int, string>();

            foreach (int i in RoomsPanel.CheckedIndices)
            {
                rooms.Add(int.Parse(RoomsPanel.Rooms[i].SubItems[1].Text), RoomsPanel.Rooms[i].Text);
            }

            SetUpHandler();
            AttackHandler.BeginMultiArea(rooms);
        }
Example #9
0
        internal void DoAttackMobs(List <AttackHandler.MobArg> mobs)
        {
            Account mAccount = AccountsPanel.Engine.MainAccount;

            foreach (AttackHandler.MobArg arg in mobs)
            {
                if (!Globals.AttackMode || mAccount.Mover.Location == null)
                {
                    goto quit;
                }

                Globals.AttackOn = false;

                mAccount.Mover.PathfindTo(arg.RoomId);

                if (!Globals.AttackMode)
                {
                    goto quit;
                }

                Globals.AttackOn = true;

                if (arg.Id < 0)
                {
                    // userspawn
                    AccountsPanel.Engine.MainAccount.Mover.Location.AttackMob(arg.Name);
                }
                else
                {
                    AccountsPanel.Engine.MainAccount.Mover.Location.AttackMob(arg.Id);
                }
                if (!Globals.AttackOn)
                {
                    return;
                }
            }
            return;

quit:
            LogPanel.Log("Mob coverage quit");
            StopAttacking(true);
        }
Example #10
0
        private void CoreUI_Load(object sender, EventArgs e)
        {
            StartDialog ff = new StartDialog();

            ff.ShowDialog();
            ff.Dispose();
            if (Globals.Terminate)
            {
                Application.Exit();
            }

            BuildViews();
            RegistryUtil.Load();
            IniWriter.Get();
            SyncSettings();
            MobsPanel.CalcMobRage();
            ChatPanel.Init();

            LogPanel.Log("Started.");
            LogPanel.LogAttack("No attacks yet...");
        }