public override void RestoreSaveData(object dataIn) { if (dataIn == null) { return; } SaveData_v1 data = (SaveData_v1)dataIn; FactionFile.FactionData dsfactionData; if (!GameManager.Instance.PlayerEntity.FactionData.GetFactionData(data.factionID, out dsfactionData) && data.factionID != 0) { throw new Exception("Could not deserialize Person resource FactionID to FactionData"); } race = data.race; nameBank = data.nameBank; npcGender = data.npcGender; faceIndex = data.faceIndex; nameSeed = data.nameSeed; isQuestor = data.isQuestor; isIndividualNPC = data.isIndividualNPC; isIndividualAtHome = data.isIndividualAtHome; displayName = data.displayName; homePlaceSymbol = data.homePlaceSymbol; lastAssignedPlaceSymbol = data.lastAssignedPlaceSymbol; assignedToHome = data.assignedToHome; factionData = dsfactionData; factionTableKey = data.factionTableKey; questorData = data.questorData; discoveredThroughTalkManager = data.discoveredThroughTalkManager; isMuted = data.isMuted; isDestroyed = data.isDestroyed; }
public override void RestoreSaveData(object dataIn) { SaveData_v1 data = (SaveData_v1)dataIn; if (dataIn == null) { return; } FactionFile.FactionData dsfactionData; if (!GameManager.Instance.PlayerEntity.FactionData.GetFactionData(data.factionID, out dsfactionData)) { throw new Exception("Could not deserialize Person resource FactionID to FactionData"); } race = data.race; npcGender = data.npcGender; faceIndex = data.faceIndex; nameSeed = data.nameSeed; isQuestor = data.isQuestor; isIndividualNPC = data.isIndividualNPC; isIndividualAtHome = data.isIndividualAtHome; displayName = data.displayName; godName = data.godName; homeTownName = data.homeTownName; factionData = dsfactionData; questorData = data.questorData; }
/// <summary> /// Set Person as questor and assign questor data if needed. /// Uses last clicked NPC data so has to be called after talking to the actual questor. /// </summary> private void SetQuestorStatus(bool status) { isQuestor = status; if (isQuestor) { questorData = QuestMachine.Instance.LastNPCClicked.Data; } }
public DaggerfallQuestOfferWindow(IUserInterfaceManager uiManager, StaticNPC.NPCData npc, FactionFile.SocialGroups socialGroup) : base(uiManager) { questorNPC = npc; this.socialGroup = socialGroup; // Remove potential questor from pool after quest has been offered TalkManager.Instance.RemoveNpcQuestor(npc.nameSeed); // Clear background ParentPanel.BackgroundColor = Color.clear; }
/// <summary> /// Checks if two sets of StaticNPC data reference the same NPC. /// Notes: /// * Still working through some issues here. /// * Possible for Questor NPC to be moved. /// * This will likely become more robust and conditional as quest system progresses. /// </summary> /// <returns>True if person1 and person2 are considered the same.</returns> public bool IsNPCDataEqual(StaticNPC.NPCData person1, StaticNPC.NPCData person2) { if (person1.hash == person2.hash && person1.mapID == person2.mapID && person1.nameSeed == person2.nameSeed && person1.buildingKey == person2.buildingKey) { return true; } return false; }
// Creates NPC as Questor, a special Person resource mapped to an NPC who exists full-time in world // The QuestorData pack should have enough information for quest system to identify NPC in world // Questor NPC data is derived from last NPC player clicked, this seems to fit Daggerfall which // can offer quests from certain types of NPC at random in addition to usual guild questors. bool SetupQuestorNPC() { // Must have a questor set if (QuestMachine.Instance.LastNPCClicked == null) { Debug.LogErrorFormat("Quest Person _{0}_ is expecting a Questor NPC, but one has not been clicked. Proceeding with a virtual NPC so quest will compile.", Symbol.Name); return(false); } // Set questor data questorData = QuestMachine.Instance.LastNPCClicked.Data; isQuestor = true; // Setup Person resource FactionFile.FactionData factionData = GetFactionData(questorData.factionID); this.factionData = factionData; nameSeed = questorData.nameSeed; return(true); }
// Creates NPC as Questor, a special Person resource mapped to an NPC who exists full-time in world // The QuestorData pack should have enough information for quest system to identify NPC in world bool SetupQuestorNPC() { // Must have a questor set if (ParentQuest.QuestorNPC == null) { Debug.LogErrorFormat("Quest Person _{0}_ is expecting a Questor NPC, but one is not set. Proceeding with a random NPC so quest will compile.", Symbol.Name); return(false); } // Set questor data questorData = ParentQuest.QuestorNPC.Data; isQuestor = true; // Setup Person resource FactionFile.FactionData factionData = GetFactionData(questorData.factionID); this.factionData = factionData; nameSeed = questorData.nameSeed; return(true); }