Quest functions

class QuestFunctions

Public Static Functions

void ClearJournalChanges(unsigned short pid)

Clear the last recorded journal changes for a player.

This is used to initialize the sending of new PlayerJournal packets.

Return
void
Parameters
  • pid: The player ID whose journal changes should be used.

void ClearKillChanges(unsigned short pid)

Clear the last recorded kill count changes for a player.

This is used to initialize the sending of new WorldKillCount packets.

Return
void
Parameters
  • pid: The player ID whose kill count changes should be used.

unsigned int GetJournalChangesSize(unsigned short pid)

Get the number of indexes in a player’s latest journal changes.

Return
The number of indexes.
Parameters
  • pid: The player ID whose journal changes should be used.

unsigned int GetKillChangesSize(unsigned short pid)

Get the number of indexes in a player’s latest kill count changes.

Return
The number of indexes.
Parameters
  • pid: The player ID whose kill count changes should be used.

void AddJournalEntry(unsigned short pid, const char *quest, unsigned int index, const char *actorRefId)

Add a new journal item of type ENTRY to the journal changes for a player, with a specific timestamp.

Return
void
Parameters
  • pid: The player ID whose journal changes should be used.
  • quest: The quest of the journal item.
  • index: The quest index of the journal item.
  • actorRefId: The actor refId of the journal item.

void AddJournalEntryWithTimestamp(unsigned short pid, const char *quest, unsigned int index, const char *actorRefId, unsigned int daysPassed, unsigned int month, unsigned int day)

Add a new journal item of type ENTRY to the journal changes for a player, with a specific timestamp.

Return
void
Parameters
  • pid: The player ID whose journal changes should be used.
  • quest: The quest of the journal item.
  • index: The quest index of the journal item.
  • actorRefId: The actor refId of the journal item.
  • The: daysPassed for the journal item.
  • The: month for the journal item.
  • The: day of the month for the journal item.

void AddJournalIndex(unsigned short pid, const char *quest, unsigned int index)

Add a new journal item of type INDEX to the journal changes for a player.

Return
void
Parameters
  • pid: The player ID whose journal changes should be used.
  • quest: The quest of the journal item.
  • index: The quest index of the journal item.

void AddKill(unsigned short pid, const char *refId, int number)

Add a new kill count to the kill count changes for a player.

Return
void
Parameters
  • pid: The player ID whose kill count changes should be used.
  • refId: The refId of the kill count.
  • number: The number of kills in the kill count.

void SetReputation(unsigned short pid, int value)

Set the reputation of a certain player.

Return
void
Parameters
  • pid: The player ID.
  • value: The reputation.

const char *GetJournalItemQuest(unsigned short pid, unsigned int index)

Get the quest at a certain index in a player’s latest journal changes.

Return
The quest.
Parameters
  • pid: The player ID whose journal changes should be used.
  • index: The index of the journalItem.

int GetJournalItemIndex(unsigned short pid, unsigned int index)

Get the quest index at a certain index in a player’s latest journal changes.

Return
The quest index.
Parameters
  • pid: The player ID whose journal changes should be used.
  • index: The index of the journalItem.

int GetJournalItemType(unsigned short pid, unsigned int index)

Get the journal item type at a certain index in a player’s latest journal changes.

Return
The type (0 for ENTRY, 1 for INDEX).
Parameters
  • pid: The player ID whose journal changes should be used.
  • index: The index of the journalItem.

const char *GetJournalItemActorRefId(unsigned short pid, unsigned int index)

Get the actor refId at a certain index in a player’s latest journal changes.

Every journal change has an associated actor, which is usually the quest giver.

Return
The actor refId.
Parameters
  • pid: The player ID whose journal changes should be used.
  • index: The index of the journalItem.

const char *GetKillRefId(unsigned short pid, unsigned int index)

Get the refId at a certain index in a player’s latest kill count changes.

Return
The refId.
Parameters
  • pid: The player ID whose kill count changes should be used.
  • index: The index of the kill count.

int GetKillNumber(unsigned short pid, unsigned int index)

Get the number of kills at a certain index in a player’s latest kill count changes.

Return
The number of kills.
Parameters
  • pid: The player ID whose kill count changes should be used.
  • index: The index of the kill count.

int GetReputation(unsigned short pid)

Get the a certain player’s reputation.

Return
The reputation.
Parameters
  • pid: The player ID.

void SendJournalChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer)

Send a PlayerJournal packet with a player’s recorded journal changes.

Return
void
Parameters
  • pid: The player ID whose journal changes should be used.
  • sendToOtherPlayers: Whether this packet should be sent to players other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendKillChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer)

Send a WorldKillCount packet with a player’s recorded kill count changes.

Return
void
Parameters
  • pid: The player ID whose kill count changes should be used.
  • sendToOtherPlayers: Whether this packet should be sent to players other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).

void SendReputation(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer)

Send a PlayerReputation packet with a player’s recorded reputation.

Return
void
Parameters
  • pid: The player ID whose reputation should be used.
  • sendToOtherPlayers: Whether this packet should be sent to players other than the player attached to the packet (false by default).
  • skipAttachedPlayer: Whether the packet should skip being sent to the player attached to the packet (false by default).