## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iQuestTrigger Struct Reference

This is a trigger for a quest. More...

`#include <tools/questmanager.h>`

List of all members.

## Public Member Functions

virtual void | ActivateTrigger ()=0
| Activate the trigger.
virtual bool | Check ()=0
| Check the trigger immediatelly and return true if it is valid.
virtual void | ClearCallback ()=0
| Clear the callback.
virtual void | DeactivateTrigger ()=0
| Deactivate the trigger.
virtual bool | LoadAndActivateTrigger (iCelDataBuffer *databuf)=0
| Activate the trigger and load state from databuf (persistence).
virtual void | RegisterCallback (iQuestTriggerCallback *callback)=0
| Register a callback with this trigger.
virtual void | SaveTriggerState (iCelDataBuffer *databuf)=0
| Save trigger state.

## Detailed Description

This is a trigger for a quest.

When a trigger fires the quest can go to another state and/or activate rewards. The quest manager knows a few standard triggers but you can also create your own triggers here. Triggers are created by trigger factories. To be able to use your own trigger implementations you must also make associated trigger factories which you then register with the quest manager. See iQuestTriggerFactory.

Triggers must start in deactivated state. They will be activated by the quest when the 'state' containing this trigger is activated.

Definition at line 108 of file questmanager.h.

## Member Function Documentation

virtual void iQuestTrigger::ActivateTrigger | ( |  | ) | `[pure virtual]`

| Activate the trigger. Note that triggers start deactivated.

virtual bool iQuestTrigger::Check | ( |  | ) | `[pure virtual]`

| Check the trigger immediatelly and return true if it is valid. This function does nothing else. Only the condition of the trigger is tested.

virtual void iQuestTrigger::ClearCallback | ( |  | ) | `[pure virtual]`

| Clear the callback.

virtual void iQuestTrigger::DeactivateTrigger | ( |  | ) | `[pure virtual]`

| Deactivate the trigger. Note that triggers start deactivated.

virtual bool iQuestTrigger::LoadAndActivateTrigger | ( | iCelDataBuffer * | databuf | ) | `[pure virtual]`

Activate the trigger and load state from databuf (persistence).

Returns:
  false on failure (data in buffer doesn't match what we expect).

virtual void iQuestTrigger::RegisterCallback | ( | iQuestTriggerCallback * | callback | ) | `[pure virtual]`

| Register a callback with this trigger. When the trigger fires it will call this callback. A trigger supports only one callback.

virtual void iQuestTrigger::SaveTriggerState | ( | iCelDataBuffer * | databuf | ) | `[pure virtual]`

| Save trigger state.

The documentation for this struct was generated from the following file:

- tools/questmanager.h