public override string God() { // Get god of last Person referenced by dialog stream if (parent.lastResourceReferenced is Person) { if (parent.lastResourceReferenced != null) { return((parent.lastResourceReferenced as Person).GodName); } } // Attempt to get god of questor Person // This fixes a crash when handing in quest and expanding questor dialog without a previous Person reference Symbol[] questors = parent.GetQuestors(); if (questors != null && questors.Length > 0) { return(parent.GetPerson(questors[0]).GodName); } // Otherwise just provide a random god name for whomever is speaking to player // Better just to provide something than let let game loop crash return(Person.GetRandomGodName()); // Fall-through to non-quest macro handling // Disabling this at it causes exception stream from null MCP //return "%god"; }
// Oaths are declared by NPC race according to the race index used in FACTION.TXT. // Unfortunately, classic never uses this faction race ID but, instead, uses the // hardcoded index race of each region, which is not the same. In classic, this // results in all NPCs from High Rock saying Nord oaths, while all NPCs in Hammerfell // will say Khajiit oaths. // Instead, DFU uses the faction race ID to return the correct oath. // For the list of oaths, see https://www.imperial-library.info/content/daggerfall-oaths-and-expletives public override string Oath() { // Get the questor race to find the correct oath Races race = Races.None; Symbol[] questors = parent.GetQuestors(); if (questors.Length > 0) { race = parent.GetPerson(questors[0]).Race; } else if (QuestMachine.Instance.LastNPCClicked != null) { // %oth is used in some of the main quests before the questor is actually set. In this // case try to use the data from the last clicked NPC, which should be the questor. race = QuestMachine.Instance.LastNPCClicked.Data.race; } // Fallback to race of current region if (race == Races.None) { race = GameManager.Instance.PlayerGPS.GetRaceOfCurrentRegion(); } int oathId = (int)RaceTemplate.GetFactionRaceFromRace(race); return(DaggerfallUnity.Instance.TextProvider.GetRandomText(201 + oathId)); }
// Oaths are declared by NPC race according to the race index used in FACTION.TXT. // Unfortunately, classic never uses this faction race ID but, instead, uses the // hardcoded index race of each region, which is not the same. In classic, this // results in all NPCs from High Rock saying Nord oaths, while all NPCs in Hammerfell // will say Khajiit oaths. // Instead, DFU uses the faction race ID to return the correct oath. // For the list of oaths, see https://www.imperial-library.info/content/daggerfall-oaths-and-expletives public override string Oath() { // Get the questor race to find the correct oath Races race = Races.None; Symbol[] questors = parent.GetQuestors(); if (questors.Length > 0) { race = parent.GetPerson(questors[0]).Race; } int oathId = (int)RaceTemplate.GetFactionRaceFromRace(race); return(DaggerfallUnity.Instance.TextProvider.GetRandomText(201 + oathId)); }