Exemple #1
0
        /// <summary>
        /// Get all Place site details for all active quests.
        /// </summary>
        /// <returns>SiteDetails[] array.</returns>
        public SiteDetails[] GetAllActiveQuestSites()
        {
            List <SiteDetails> sites = new List <SiteDetails>();

            foreach (var kvp in quests)
            {
                Quest           quest          = kvp.Value;
                QuestResource[] foundResources = quest.GetAllResources(typeof(Place));
                foreach (QuestResource resource in foundResources)
                {
                    sites.Add((resource as Place).SiteDetails);
                }
            }

            return(sites.ToArray());
        }
Exemple #2
0
        bool ClickAllIndividualNPCs(int factionID)
        {
            // Check active quests to see if any are using this NPC
            ulong[] questIDs = QuestMachine.Instance.GetAllActiveQuests();
            bool    matched  = false;

            foreach (ulong questID in questIDs)
            {
                // Get quest object
                Quest quest = QuestMachine.Instance.GetQuest(questID);
                if (quest == null)
                {
                    continue;
                }

                // Get all the Person resources in this quest
                QuestResource[] personResources = quest.GetAllResources(typeof(Person));
                if (personResources == null || personResources.Length == 0)
                {
                    continue;
                }

                // Check each Person for a match
                foreach (QuestResource resource in personResources)
                {
                    // Set click if individual matches Person factionID
                    Person person = (Person)resource;
                    if (person.IsIndividualNPC && person.FactionData.id == factionID)
                    {
                        person.SetPlayerClicked();
                        matched = true;
                    }
                }
            }

            return(matched);
        }
Exemple #3
0
        /// <summary>
        /// Checks all active quests for references to this special person and triggers player click across all quests.
        /// These special people may be involved in multiple quests which is different to singleton NPCs.
        /// </summary>
        public void DoClick()
        {
            if (IndividualFactionID == 0)
            {
                return;
            }

            // Check active quests to see if anyone has reserved this NPC
            ulong[] questIDs = QuestMachine.Instance.GetAllActiveQuests();
            foreach (ulong questID in questIDs)
            {
                // Get quest object
                Quest quest = QuestMachine.Instance.GetActiveQuest(questID);
                if (quest == null)
                {
                    continue;
                }

                // Get all the Person resources in this quest
                QuestResource[] personResources = quest.GetAllResources(typeof(Person));
                if (personResources == null || personResources.Length == 0)
                {
                    continue;
                }

                // Check each Person for a match
                foreach (QuestResource resource in personResources)
                {
                    // Set click if individual matches Person factionID
                    Person person = (Person)resource;
                    if (person.IsIndividualNPC && person.FactionData.id == IndividualFactionID)
                    {
                        person.SetPlayerClicked();
                    }
                }
            }
        }