예제 #1
0
        public void OnDisabled()
        {
            Logging.Write("*******************QUESTTOOLS*****************", Version);
            Logging.Write("[[WAR] QuestTools] Plugin v{0} Desativado - mod by WAR!", Version);
            Logging.Write("*******************QUESTTOOLS*****************", Version);

            currentAct       = Act.Invalid;
            levelAreaId      = 0;
            questId          = 0;
            questStepId      = 0;
            worldId          = 0;
            somethingChanged = true;
            Zeta.CommonBot.GameEvents.OnPlayerDied -= GameEvents_OnPlayerDied;
            BotMain.OnStart -= BotMain_OnStart;

            Application.Current.Dispatcher.Invoke(
                new System.Action(
                    () =>
            {
                Window mainWindow = Application.Current.MainWindow;
                var tab           = mainWindow.FindName("tabControlMain") as TabControl;
                if (tab == null)
                {
                    return;
                }
                var mainTab = tab.Items[1] as TabItem;
                if (mainTab == null)
                {
                    return;
                }
                var grid = mainTab.Content as Grid;
                if (grid == null)
                {
                    return;
                }
                grid.Children.Remove(btnDumpActors);
                grid.Children.Remove(btnOpenLogFile);
                grid.Children.Remove(btnResetGrid);
            }
                    )
                );
        }
예제 #2
0
        private void CheckForChanges()
        {
            //if (ZetaDia.Me.SceneId != sceneId)
            //{
            //    Logging.WriteDiagnostic(String.Format("{0} Scene changed from {1} to {2}", myName, sceneId, ZetaDia.Me.SceneId));
            //    sceneId = ZetaDia.Me.SceneId;
            //    somethingChanged = true;
            //}

            if (!ZetaDia.IsInGame)
            {
                return;
            }

            if (!ZetaDia.Me.IsValid)
            {
                return;
            }

            if (ZetaDia.IsLoadingWorld)
            {
                return;
            }

            if (ZetaDia.ActInfo.IsValid && ZetaDia.CurrentAct != currentAct)
            {
                Logging.WriteVerbose(String.Format("{0} Act changed from {1} to {2} ({3}) SnoId={4}", myName, currentAct.ToString(), ZetaDia.CurrentAct.ToString(), (int)ZetaDia.CurrentAct, ZetaDia.CurrentActSNOId));
                currentAct       = ZetaDia.CurrentAct;
                somethingChanged = true;
                PositionCache.Clear();
            }

            if (ZetaDia.WorldInfo.IsValid && ZetaDia.CurrentWorldId != worldId)
            {
                Logging.WriteVerbose(String.Format("{0} worldId changed from {1} to {2}", myName, worldId, ZetaDia.CurrentWorldId));
                worldId          = ZetaDia.CurrentWorldId;
                somethingChanged = true;
                PositionCache.Clear();
            }

            if (ZetaDia.WorldInfo.IsValid && ZetaDia.CurrentLevelAreaId != levelAreaId)
            {
                Logging.WriteVerbose(String.Format("{0} levelAreaId changed from {1} to {2}", myName, levelAreaId, ZetaDia.CurrentLevelAreaId));
                levelAreaId      = ZetaDia.CurrentLevelAreaId;
                somethingChanged = true;
            }

            if (ZetaDia.CurrentQuest.IsValid && ZetaDia.CurrentQuest.QuestSNO != questId)
            {
                Logging.WriteVerbose(String.Format("{0} questId changed from {1} to {2}", myName, questId, ZetaDia.CurrentQuest.QuestSNO));
                questId          = ZetaDia.CurrentQuest.QuestSNO;
                somethingChanged = true;
            }

            if (ZetaDia.CurrentQuest.IsValid && ZetaDia.CurrentQuest.StepId != questStepId)
            {
                Logging.WriteVerbose(String.Format("{0} questStepId changed from {1} to {2}", myName, questStepId, ZetaDia.CurrentQuest.StepId));
                questStepId      = ZetaDia.CurrentQuest.StepId;
                somethingChanged = true;
            }

            if (somethingChanged && ZetaDia.IsInGame && !ZetaDia.IsLoadingWorld && ZetaDia.Me.Position != Vector3.Zero)
            {
                Logging.WriteVerbose(String.Format("{0} Change(s) occured at Position {1} ", myName, GetProfileCoordinates(ZetaDia.Me.Position)));
                somethingChanged = false;
            }
        }