Spell functions

class SpellFunctions

Public Static Functions

void ClearSpellbookChanges(unsigned short pid)

Clear the last recorded spellbook changes for a player.

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

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

unsigned int GetSpellbookChangesSize(unsigned short pid)

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

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

unsigned int GetSpellbookChangesAction(unsigned short pid)

Get the action type used in a player’s latest spellbook changes.

Return
The action type (0 for SET, 1 for ADD, 2 for REMOVE).
Parameters
  • pid: The player ID whose spellbook changes should be used.

void SetSpellbookChangesAction(unsigned short pid, unsigned char action)

Set the action type in a player’s spellbook changes.

Return
void
Parameters
  • pid: The player ID whose spellbook changes should be used.
  • action: The action (0 for SET, 1 for ADD, 2 for REMOVE).

void AddSpell(unsigned short pid, const char *spellId)

Add a new spell to the spellbook changes for a player.

Return
void
Parameters
  • pid: The player ID whose spellbook changes should be used.
  • spellId: The spellId of the spell.

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

Get the spellId at a certain index in a player’s latest spellbook changes.

Return
The spellId.
Parameters
  • pid: The player ID whose spellbook changes should be used.
  • index: The index of the spell.

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

Send a PlayerSpellbook packet with a player’s recorded spellbook changes.

Return
void
Parameters
  • pid: The player ID whose spellbook 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).