예제 #1
0
        public void NetworkTask(AmbuscadeTaskType task, int parameter = 0)
        {
            if (!_ambuscade)
            {
                return;
            }

            if (!job.Tracking())
            {
                job.TrackBuffs(true);
            }

            switch (task)
            {
            case AmbuscadeTaskType.GotoMonsterZone:
            {
                WriteLog($"[TASK] >> PERFORMING ({task}) ...");
                DoRoute(_route2);
                NavigateToZone(_hpMenuItemString, 41);
                client.Send("DOCK_ROE");
                WriteLog($"[REPLY] >> TASK COMPLETED ({task})");
                break;
            }

            case AmbuscadeTaskType.ReturnHome:
            {
                WriteLog($"[TASK] >> PERFORMING ({task}) ...");
                ReturnHome();
                client.Send("DOCK_MHAURA");
                WriteLog($"[REPLY] >> TASK COMPLETED ({task})");
                break;
            }

            case AmbuscadeTaskType.Fight:
            {
                WriteLog($"[TASK] >> PERFORMING ({task}) ...");
                if (fface.Player.Zone == Zone.Maquette_Abdhaljs_Legion)
                {
                    _hasKeyItem     = false;
                    _initialKeyItem = false;
                    _KeyCapped      = false;
                }
                Fight(parameter, Combat.Mode.None);
                WriteLog($"[REPLY] >> TASK COMPLETED ({task})");
                break;
            }

            case AmbuscadeTaskType.CancelEngage:
            {
                WriteLog($"[TASK] >> PERFORMING ({task}) ...");
                Combat.Interrupt();
                WriteLog($"[REPLY] >> TASK COMPLETED ({task})");
                break;
            }

            case AmbuscadeTaskType.ObtainKI:
            {
                WriteLog($"[TASK] >> PERFORMING ({task}) ...");
                ObtainKI();
                client.Send("DOCK_KI");
                WriteLog($"[REPLY] >> TASK COMPLETED ({task}) (Everyone has a KI!)");

                break;
            }

            case AmbuscadeTaskType.CappedKI:
            {
                WriteLog($"[TASK] >> PERFORMING ({task}) ...");
                _KeyCapped = true;
                if (Combat.InCombat)
                {
                    WriteLog("[TASK INFO] I'm in Combat, and attempting to stop Combat!");
                    Combat.Interrupt();
                }
                else
                {
                    WriteLog("[TASK INFO] I'm not currently in combat! .. Waiting for CappedKI to Complete");
                }
                if (!job.Engages() && Combat.InCombat)
                {
                    WriteLog("[TASK INFO INNER] Attempting to Interrupt Combat...");
                    Combat.Interrupt();
                }
                WriteLog($"[REPLY] >> TASK COMPLETED ({task})");
                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(task), task, null);
            }
            WriteLog("[TASK] >> IDLE. Waiting for a new task...");
            _inTask = false;
        }