Exemple #1
0
        public override void Update(Task caller)
        {
            base.Update(caller);

            // Create SiteLink if not already present
            if (!QuestMachine.HasSiteLink(ParentQuest, placeSymbol))
            {
                QuestMachine.CreateSiteLink(ParentQuest, placeSymbol);
            }

            // Attempt to get Item resource
            Item item = ParentQuest.GetItem(itemSymbol);

            if (item == null)
            {
                throw new Exception(string.Format("Could not find Item resource symbol {0}", itemSymbol));
            }

            // Attempt to get Place resource
            Place place = ParentQuest.GetPlace(placeSymbol);

            if (place == null)
            {
                throw new Exception(string.Format("Could not find Place resource symbol {0}", placeSymbol));
            }

            // Assign Item to Place
            place.AssignQuestResource(item.Symbol);

            SetComplete();
        }
        public override void Update(Task caller)
        {
            base.Update(caller);

            // Create SiteLink if not already present
            if (!QuestMachine.HasSiteLink(ParentQuest, placeSymbol))
            {
                QuestMachine.CreateSiteLink(ParentQuest, placeSymbol);
            }

            // Attempt to get Foe resource
            Foe foe = ParentQuest.GetFoe(foeSymbol);

            if (foe == null)
            {
                SetComplete();
                throw new Exception(string.Format("Could not find Foe resource symbol {0}", foeSymbol));
            }

            // Attempt to get Place resource
            Place place = ParentQuest.GetPlace(placeSymbol);

            if (place == null)
            {
                SetComplete();
                throw new Exception(string.Format("Could not find Place resource symbol {0}", placeSymbol));
            }

            // Assign Foe to Place
            place.AssignQuestResource(foeSymbol, marker);

            SetComplete();
        }
        public override void Update(Task caller)
        {
            base.Update(caller);

            // Create SiteLink if not already present
            if (!QuestMachine.HasSiteLink(ParentQuest, placeSymbol))
            {
                QuestMachine.CreateSiteLink(ParentQuest, placeSymbol);
            }

            // Attempt to get Person resource
            Person person = ParentQuest.GetPerson(npcSymbol);

            if (person == null)
            {
                SetComplete();
                throw new Exception(string.Format("Could not find Person resource symbol {0}", npcSymbol));
            }

            // Do nothing if Person is destroyed
            if (person.IsDestroyed)
            {
                SetComplete();
                return;
            }

            // Attempt to get Place resource
            Place place = ParentQuest.GetPlace(placeSymbol);

            if (place == null)
            {
                SetComplete();
                throw new Exception(string.Format("Could not find Place resource symbol {0}", placeSymbol));
            }

            // Is target an individual NPC that is supposed to be at home
            // Daggerfall never seems to use "create npc at" or "place npc" for "athome" NPCs
            // Treating this as an error and logging as such, but don't throw an exception
            // Just log, terminate action, and get out of dodge
            if (person.IsIndividualNPC && person.IsIndividualAtHome)
            {
                Debug.LogErrorFormat("Quest tried to place Person {0} [_{1}_] at Place _{2}_ but they are supposed to be atHome", person.DisplayName, person.Symbol.Name, place.Symbol.Name);
                SetComplete();
                return;
            }

            // Assign Person to Place
            place.AssignQuestResource(person.Symbol, marker);
            person.SetAssignedPlaceSymbol(placeSymbol);

            // Person is also unhidden when placed
            person.IsHidden = false;

            TalkManager.Instance.ForceTopicListsUpdate();

            SetComplete();
        }