Table of Contents

Class TimbnQuests

Namespace
Timbn.GraveyardKeeperTwo.Core.Framework
Assembly
Timbn.GraveyardKeeperTwo.Core.dll

Registers the quests plugins add as real QuestDefs, so the game's own quest system starts, finishes, saves and lists them. It also reads the status of any quest, the game's own included.

public static class TimbnQuests
Inheritance
TimbnQuests
Inherited Members

Methods

FireStoryTrigger(Type, string)

Fires one of the game's story triggers, the signals its quests and cutscenes wait on, as if the player had just built the building or won the fight. Use it to finish a game quest whose step was done before the quest started. Events.StoryTrigger hears it like any other. Nothing happens at the main menu.

public static void FireStoryTrigger(GlobalEventsSystem.Event.Type type, string id = "")

Parameters

type GlobalEventsSystem.Event.Type

The kind of trigger.

id string

The trigger's id, such as the building or the answer. Leave it out for a kind that has none.

Examples

if (TimbnPlayer.HasBuilt("zmb_choir_unlock_s"))
    TimbnQuests.FireStoryTrigger(GlobalEventsSystem.Event.Type.BuildBuilding, "zmb_choir_unlock");

HasQuestRun(string)

Whether the current run of any mod's quest names this NPC, such as the villager who asked for a dish. A quest's Setup can skip them, so one person never has two quests going at once.

public static bool HasQuestRun(string npcId)

Parameters

npcId string

The NPC, from TimbnGameIds.Npcs.

Returns

bool

True while a run names them. False at the main menu.

Examples

var villagers = TimbnNpcs.GroupMemberIds(TimbnGameIds.Groups.VillagersDayAll).Where(npc => !TimbnQuests.HasQuestRun(npc)).ToList();

StatusOf(string)

A quest's status in the loaded save, the game's own quests included, such as 6_intro_guards_burial. Null when no save is loaded or it has no such quest.

public static QuestStatus? StatusOf(string id)

Parameters

id string

The quest id.

Returns

QuestStatus?

The status, or null.

Examples

.OfferWhen(() => TimbnQuests.StatusOf("6_intro_guards_burial") is QuestStatus.InProgress or QuestStatus.Completed)