Inheritance: ALFA.Shared.IInformationStore, ALFA.Shared.IBackgroundLoadedResource, IDisposable
Example #1
0
        public Int32 ScriptMain([In] object[] ScriptParameters, [In] Int32 DefaultReturnCode)
        {
            int Value = (int)ScriptParameters[0]; // ScriptParameterTypes[0] is typeof(int)

            switch ((Commands)Value)
            {
            case Commands.INITIALIZE_ARCHIVES:
                Archivist worker = new Archivist();
                if (ArchivesInstance != null)
                {
                    break;
                }

                ArchivesInstance = new Archives(worker);
                ALFA.Shared.Modules.InfoStore = ArchivesInstance;
                worker.DoWork += worker.InitializeArchives;
                worker.RunWorkerAsync();

                Monks.LoadAreas(this);

                ShowLoadingProgressDebugString();

                break;

            case Commands.PRINT_DEBUG:
                SendMessageToAllDMs("Running ACR_Candlekeep");
                SendMessageToAllDMs(Archivist.debug);
                break;

            case Commands.LIST_AREAS:
                foreach (ALFA.Shared.ActiveArea area in ALFA.Shared.Modules.InfoStore.ActiveAreas.Values)
                {
                    SendMessageToAllDMs(area.Name);
                    foreach (ALFA.Shared.ActiveArea areaTarget in area.ExitTransitions.Values)
                    {
                        SendMessageToAllDMs(String.Format(" - {0}", areaTarget.Name));
                    }
                }
                break;

            case Commands.LIST_SPELLS:
                foreach (ALFA.Shared.SpellCastItemProperties ip in ALFA.Shared.Modules.InfoStore.IPCastSpells)
                {
                    SendMessageToAllDMs(ip.ToString());
                }
                break;

            case Commands.LIST_BASE_ITEMS:
                foreach (ALFA.Shared.BaseItem item in ALFA.Shared.Modules.InfoStore.BaseItems)
                {
                    SendMessageToAllDMs(item.ToString());
                }
                break;
            }

            return(0);
        }
        public Int32 ScriptMain([In] object[] ScriptParameters, [In] Int32 DefaultReturnCode)
        {
            int Value = (int)ScriptParameters[0]; // ScriptParameterTypes[0] is typeof(int)

            switch ((Commands)Value)
            {
                case Commands.INITIALIZE_ARCHIVES:
                        Archivist worker = new Archivist();
                        if (ArchivesInstance != null)
                            break;

                        ArchivesInstance = new Archives(worker);
                        ALFA.Shared.Modules.InfoStore = ArchivesInstance;
                        worker.DoWork += worker.InitializeArchives;
                        worker.RunWorkerAsync();

                        Monks.LoadAreas(this);

                        ShowLoadingProgressDebugString();

                        break;
                case Commands.PRINT_DEBUG:
                        SendMessageToAllDMs("Running ACR_Candlekeep");
                        SendMessageToAllDMs(Archivist.debug);
                        break;
                case Commands.LIST_AREAS:
                        foreach (ALFA.Shared.ActiveArea area in ALFA.Shared.Modules.InfoStore.ActiveAreas.Values)
                        {
                            SendMessageToAllDMs(area.Name);
                            foreach (ALFA.Shared.ActiveArea areaTarget in area.ExitTransitions.Values)
                            {
                                SendMessageToAllDMs(String.Format(" - {0}", areaTarget.Name));
                            }
                        }
                        break;
                case Commands.LIST_SPELLS:
                    foreach(ALFA.Shared.SpellCastItemProperties ip in ALFA.Shared.Modules.InfoStore.IPCastSpells)
                    {
                        SendMessageToAllDMs(ip.ToString());
                    }
                    break;
                case Commands.LIST_BASE_ITEMS:
                    foreach(ALFA.Shared.BaseItem item in ALFA.Shared.Modules.InfoStore.BaseItems)
                    {
                        SendMessageToAllDMs(item.ToString());
                    }
                    break;
            }

            return 0;
        }