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();
        }
Exemple #2
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 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();
        }
Exemple #4
0
        public override void Update(Task caller)
        {
            base.Update(caller);

            // Reserve SiteLink for Place resource
            // This will also be done automatically by "place npc", "place foe", etc.
            if (!QuestMachine.HasSiteLink(ParentQuest, placeSymbol))
            {
                QuestMachine.CreateSiteLink(ParentQuest, placeSymbol);
            }

            // Possible historical note:
            //  Many quests are very strict about first reserving a site using "create npc at"
            //  before placing a quest resource like an NPC, Foe, Item at that site.
            //  More developed quests (e.g. guild quests) don't seem to have this requirement.
            //  One likely reason is that quest writers would commonly forget to reserve the site first,
            //  leading to developers making this a more automated process down the track.
            //  Daggerfall Unity will create a SiteLink either way to support both formats.

            SetComplete();
        }