Table of Contents

Interface IQuestController

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

Interface for controllers that manage quest instances and lifecycle for a character.

public interface IQuestController : ICharacterBehaviour
Inherited Members

Fields

OnObjectiveUpdated

Raised when an objective is updated. Parameters: character, quest name, objective index, amount.

public static Action<ICharacter, string, int, long> OnObjectiveUpdated

Field Value

Action<ICharacter, string, int, long>

OnQuestAbandoned

Raised when a quest is abandoned and removed from the quest log. Parameters: character, quest name.

public static Action<ICharacter, string> OnQuestAbandoned

Field Value

Action<ICharacter, string>

OnQuestAccepted

Raised when a quest is accepted. Parameters: character, quest template.

public static Action<ICharacter, QuestTemplate> OnQuestAccepted

Field Value

Action<ICharacter, QuestTemplate>

OnQuestComplete

Raised when all objectives are met and the quest transitions to Complete. Parameters: character, quest name.

public static Action<ICharacter, string> OnQuestComplete

Field Value

Action<ICharacter, string>

OnQuestFailed

Raised when a quest is failed (timer expired, etc.). Parameters: character, quest name.

public static Action<ICharacter, string> OnQuestFailed

Field Value

Action<ICharacter, string>

OnQuestTurnedIn

Raised when a quest is turned in and rewards are granted. Parameters: character, quest name.

public static Action<ICharacter, string> OnQuestTurnedIn

Field Value

Action<ICharacter, string>

Properties

Quests

Read-only accessor for all active quests keyed by template name.

Dictionary<string, QuestInstance> Quests { get; }

Property Value

Dictionary<string, QuestInstance>

Methods

AbandonQuest(string)

Abandons a quest, removing it from the character's quest log.

bool AbandonQuest(string questName)

Parameters

questName string

The name of the quest to abandon.

Returns

bool

True if the quest was found and removed.

Acquire(QuestTemplate)

Accepts a new quest for the character. Ignored if already acquired.

void Acquire(QuestTemplate template)

Parameters

template QuestTemplate

The quest template to accept.

AdvanceObjective(string, int, long)

Advances a specific objective within a quest by the given amount.

void AdvanceObjective(string questName, int objectiveIndex, long amount)

Parameters

questName string

The name of the quest.

objectiveIndex int

The index of the objective to advance.

amount long

The amount to increment.

FailQuest(string)

Fails an active quest.

bool FailQuest(string questName)

Parameters

questName string

The name of the quest to fail.

Returns

bool

True if the quest was successfully failed.

SetQuest(QuestTemplate, QuestStatus, long[])

Sets quest state from broadcast or database load. Used by client-side sync.

void SetQuest(QuestTemplate template, QuestStatus status, long[] objectiveValues)

Parameters

template QuestTemplate

The quest template.

status QuestStatus

The status to set.

objectiveValues long[]

Per-objective progress values.

TryCompleteQuest(string)

Attempts to complete a quest, transitioning it from Active to Complete. Returns false if objectives are not met or the quest is not active.

bool TryCompleteQuest(string questName)

Parameters

questName string

The name of the quest to complete.

Returns

bool

True if the quest transitioned to Complete.

TryGetQuest(string, out QuestInstance)

Attempts to retrieve a quest instance by template name.

bool TryGetQuest(string name, out QuestInstance quest)

Parameters

name string

The name of the quest to look up.

quest QuestInstance

The found quest instance, or null if not found.

Returns

bool

True if the quest is found, false otherwise.

TurnInQuest(string)

Turns in a completed quest, granting rewards and transitioning to TurnedIn.

bool TurnInQuest(string questName)

Parameters

questName string

The name of the quest to turn in.

Returns

bool

True if the quest was successfully turned in.