[Server] Rename variable i into index in script function arguments

Additionally, rename i into index in LangLua.
pull/471/head
David Cernat 7 years ago
parent 65de028e0d
commit 2e0b6e4e3e

@ -162,242 +162,242 @@ public:
/** /**
* \brief Get the cell description of the actor at a certain index in the read actor list. * \brief Get the cell description of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The cell description. * \return The cell description.
*/ */
static const char *GetActorCell(unsigned int i) noexcept; static const char *GetActorCell(unsigned int index) noexcept;
/** /**
* \brief Get the refId of the actor at a certain index in the read actor list. * \brief Get the refId of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The refId. * \return The refId.
*/ */
static const char *GetActorRefId(unsigned int i) noexcept; static const char *GetActorRefId(unsigned int index) noexcept;
/** /**
* \brief Get the refNum of the actor at a certain index in the read actor list. * \brief Get the refNum of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The refNum. * \return The refNum.
*/ */
static unsigned int GetActorRefNum(unsigned int i) noexcept; static unsigned int GetActorRefNum(unsigned int index) noexcept;
/** /**
* \brief Get the mpNum of the actor at a certain index in the read actor list. * \brief Get the mpNum of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The mpNum. * \return The mpNum.
*/ */
static unsigned int GetActorMpNum(unsigned int i) noexcept; static unsigned int GetActorMpNum(unsigned int index) noexcept;
/** /**
* \brief Get the X position of the actor at a certain index in the read actor list. * \brief Get the X position of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The X position. * \return The X position.
*/ */
static double GetActorPosX(unsigned int i) noexcept; static double GetActorPosX(unsigned int index) noexcept;
/** /**
* \brief Get the Y position of the actor at a certain index in the read actor list. * \brief Get the Y position of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The Y position. * \return The Y position.
*/ */
static double GetActorPosY(unsigned int i) noexcept; static double GetActorPosY(unsigned int index) noexcept;
/** /**
* \brief Get the Z position of the actor at a certain index in the read actor list. * \brief Get the Z position of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The Z position. * \return The Z position.
*/ */
static double GetActorPosZ(unsigned int i) noexcept; static double GetActorPosZ(unsigned int index) noexcept;
/** /**
* \brief Get the X rotation of the actor at a certain index in the read actor list. * \brief Get the X rotation of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The X rotation. * \return The X rotation.
*/ */
static double GetActorRotX(unsigned int i) noexcept; static double GetActorRotX(unsigned int index) noexcept;
/** /**
* \brief Get the Y rotation of the actor at a certain index in the read actor list. * \brief Get the Y rotation of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The Y rotation. * \return The Y rotation.
*/ */
static double GetActorRotY(unsigned int i) noexcept; static double GetActorRotY(unsigned int index) noexcept;
/** /**
* \brief Get the Z rotation of the actor at a certain index in the read actor list. * \brief Get the Z rotation of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The Z rotation. * \return The Z rotation.
*/ */
static double GetActorRotZ(unsigned int i) noexcept; static double GetActorRotZ(unsigned int index) noexcept;
/** /**
* \brief Get the base health of the actor at a certain index in the read actor list. * \brief Get the base health of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The base health. * \return The base health.
*/ */
static double GetActorHealthBase(unsigned int i) noexcept; static double GetActorHealthBase(unsigned int index) noexcept;
/** /**
* \brief Get the current health of the actor at a certain index in the read actor list. * \brief Get the current health of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The current health. * \return The current health.
*/ */
static double GetActorHealthCurrent(unsigned int i) noexcept; static double GetActorHealthCurrent(unsigned int index) noexcept;
/** /**
* \brief Get the modified health of the actor at a certain index in the read actor list. * \brief Get the modified health of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The modified health. * \return The modified health.
*/ */
static double GetActorHealthModified(unsigned int i) noexcept; static double GetActorHealthModified(unsigned int index) noexcept;
/** /**
* \brief Get the base magicka of the actor at a certain index in the read actor list. * \brief Get the base magicka of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The base magicka. * \return The base magicka.
*/ */
static double GetActorMagickaBase(unsigned int i) noexcept; static double GetActorMagickaBase(unsigned int index) noexcept;
/** /**
* \brief Get the current magicka of the actor at a certain index in the read actor list. * \brief Get the current magicka of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The current magicka. * \return The current magicka.
*/ */
static double GetActorMagickaCurrent(unsigned int i) noexcept; static double GetActorMagickaCurrent(unsigned int index) noexcept;
/** /**
* \brief Get the modified magicka of the actor at a certain index in the read actor list. * \brief Get the modified magicka of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The modified magicka. * \return The modified magicka.
*/ */
static double GetActorMagickaModified(unsigned int i) noexcept; static double GetActorMagickaModified(unsigned int index) noexcept;
/** /**
* \brief Get the base fatigue of the actor at a certain index in the read actor list. * \brief Get the base fatigue of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The base fatigue. * \return The base fatigue.
*/ */
static double GetActorFatigueBase(unsigned int i) noexcept; static double GetActorFatigueBase(unsigned int index) noexcept;
/** /**
* \brief Get the current fatigue of the actor at a certain index in the read actor list. * \brief Get the current fatigue of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The current fatigue. * \return The current fatigue.
*/ */
static double GetActorFatigueCurrent(unsigned int i) noexcept; static double GetActorFatigueCurrent(unsigned int index) noexcept;
/** /**
* \brief Get the modified fatigue of the actor at a certain index in the read actor list. * \brief Get the modified fatigue of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The modified fatigue. * \return The modified fatigue.
*/ */
static double GetActorFatigueModified(unsigned int i) noexcept; static double GetActorFatigueModified(unsigned int index) noexcept;
/** /**
* \brief Get the refId of the item in a certain slot of the equipment of the actor at a * \brief Get the refId of the item in a certain slot of the equipment of the actor at a
* certain index in the read actor list. * certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \param slot The slot of the equipment item. * \param slot The slot of the equipment item.
* \return The refId. * \return The refId.
*/ */
static const char *GetActorEquipmentItemRefId(unsigned int i, unsigned short slot) noexcept; static const char *GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept;
/** /**
* \brief Get the count of the item in a certain slot of the equipment of the actor at a * \brief Get the count of the item in a certain slot of the equipment of the actor at a
* certain index in the read actor list. * certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \param slot The slot of the equipment item. * \param slot The slot of the equipment item.
* \return The item count. * \return The item count.
*/ */
static int GetActorEquipmentItemCount(unsigned int i, unsigned short slot) noexcept; static int GetActorEquipmentItemCount(unsigned int index, unsigned short slot) noexcept;
/** /**
* \brief Get the charge of the item in a certain slot of the equipment of the actor at a * \brief Get the charge of the item in a certain slot of the equipment of the actor at a
* certain index in the read actor list. * certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \param slot The slot of the equipment item. * \param slot The slot of the equipment item.
* \return The charge. * \return The charge.
*/ */
static int GetActorEquipmentItemCharge(unsigned int i, unsigned short slot) noexcept; static int GetActorEquipmentItemCharge(unsigned int index, unsigned short slot) noexcept;
/** /**
* \brief Get the enchantment charge of the item in a certain slot of the equipment of the actor at a * \brief Get the enchantment charge of the item in a certain slot of the equipment of the actor at a
* certain index in the read actor list. * certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \param slot The slot of the equipment item. * \param slot The slot of the equipment item.
* \return The enchantment charge. * \return The enchantment charge.
*/ */
static double GetActorEquipmentItemEnchantmentCharge(unsigned int i, unsigned short slot) noexcept; static double GetActorEquipmentItemEnchantmentCharge(unsigned int index, unsigned short slot) noexcept;
/** /**
* \brief Check whether the killer of the actor at a certain index in the read actor list is a player. * \brief Check whether the killer of the actor at a certain index in the read actor list is a player.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return Whether the actor was killed by a player. * \return Whether the actor was killed by a player.
*/ */
static bool DoesActorHavePlayerKiller(unsigned int i) noexcept; static bool DoesActorHavePlayerKiller(unsigned int index) noexcept;
/** /**
* \brief Get the player ID of the killer of the actor at a certain index in the read actor list. * \brief Get the player ID of the killer of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The player ID of the killer. * \return The player ID of the killer.
*/ */
static int GetActorKillerPid(unsigned int i) noexcept; static int GetActorKillerPid(unsigned int index) noexcept;
/** /**
* \brief Get the refId of the actor killer of the actor at a certain index in the read actor list. * \brief Get the refId of the actor killer of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The refId of the killer. * \return The refId of the killer.
*/ */
static const char *GetActorKillerRefId(unsigned int i) noexcept; static const char *GetActorKillerRefId(unsigned int index) noexcept;
/** /**
* \brief Get the refNum of the actor killer of the actor at a certain index in the read actor list. * \brief Get the refNum of the actor killer of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The refNum of the killer. * \return The refNum of the killer.
*/ */
static unsigned int GetActorKillerRefNum(unsigned int i) noexcept; static unsigned int GetActorKillerRefNum(unsigned int index) noexcept;
/** /**
* \brief Get the mpNum of the actor killer of the actor at a certain index in the read actor list. * \brief Get the mpNum of the actor killer of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The mpNum of the killer. * \return The mpNum of the killer.
*/ */
static unsigned int GetActorKillerMpNum(unsigned int i) noexcept; static unsigned int GetActorKillerMpNum(unsigned int index) noexcept;
/** /**
* \brief Get the name of the actor killer of the actor at a certain index in the read actor list. * \brief Get the name of the actor killer of the actor at a certain index in the read actor list.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return The name of the killer. * \return The name of the killer.
*/ */
static const char *GetActorKillerName(unsigned int i) noexcept; static const char *GetActorKillerName(unsigned int index) noexcept;
/** /**
* \brief Check whether there is any positional data for the actor at a certain index in * \brief Check whether there is any positional data for the actor at a certain index in
@ -405,10 +405,10 @@ public:
* *
* This is only useful when reading the actor list data recorded for a particular cell. * This is only useful when reading the actor list data recorded for a particular cell.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return Whether the read actor list contains positional data. * \return Whether the read actor list contains positional data.
*/ */
static bool DoesActorHavePosition(unsigned int i) noexcept; static bool DoesActorHavePosition(unsigned int index) noexcept;
/** /**
* \brief Check whether there is any dynamic stats data for the actor at a certain index in * \brief Check whether there is any dynamic stats data for the actor at a certain index in
@ -416,10 +416,10 @@ public:
* *
* This is only useful when reading the actor list data recorded for a particular cell. * This is only useful when reading the actor list data recorded for a particular cell.
* *
* \param i The index of the actor. * \param index The index of the actor.
* \return Whether the read actor list contains dynamic stats data. * \return Whether the read actor list contains dynamic stats data.
*/ */
static bool DoesActorHaveStatsDynamic(unsigned int i) noexcept; static bool DoesActorHaveStatsDynamic(unsigned int index) noexcept;
/** /**
* \brief Set the cell of the temporary actor list stored on the server. * \brief Set the cell of the temporary actor list stored on the server.
@ -749,8 +749,8 @@ public:
static void ReadLastActorList() noexcept; static void ReadLastActorList() noexcept;
static void InitializeActorList(unsigned short pid) noexcept; static void InitializeActorList(unsigned short pid) noexcept;
static void CopyLastActorListToStore() noexcept; static void CopyLastActorListToStore() noexcept;
static unsigned int GetActorRefNumIndex(unsigned int i) noexcept; static unsigned int GetActorRefNumIndex(unsigned int index) noexcept;
static unsigned int GetActorKillerRefNumIndex(unsigned int i) noexcept; static unsigned int GetActorKillerRefNumIndex(unsigned int index) noexcept;
static void SetActorRefNumIndex(int refNum) noexcept; static void SetActorRefNumIndex(int refNum) noexcept;
}; };

@ -34,15 +34,15 @@ void BookFunctions::AddBook(unsigned short pid, const char* bookId) noexcept
player->bookChanges.books.push_back(book); player->bookChanges.books.push_back(book);
} }
const char *BookFunctions::GetBookId(unsigned short pid, unsigned int i) noexcept const char *BookFunctions::GetBookId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->bookChanges.count) if (index >= player->bookChanges.count)
return "invalid"; return "invalid";
return player->bookChanges.books.at(i).bookId.c_str(); return player->bookChanges.books.at(index).bookId.c_str();
} }
void BookFunctions::SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept void BookFunctions::SendBookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept

@ -47,10 +47,10 @@ public:
* \brief Get the bookId at a certain index in a player's latest book changes. * \brief Get the bookId at a certain index in a player's latest book changes.
* *
* \param pid The player ID whose book changes should be used. * \param pid The player ID whose book changes should be used.
* \param i The index of the book. * \param index The index of the book.
* \return The bookId. * \return The bookId.
*/ */
static const char *GetBookId(unsigned short pid, unsigned int i) noexcept; static const char *GetBookId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Send a PlayerBook packet with a player's recorded book changes. * \brief Send a PlayerBook packet with a player's recorded book changes.

@ -20,23 +20,23 @@ unsigned int CellFunctions::GetCellStateChangesSize(unsigned short pid) noexcept
return player->cellStateChanges.count; return player->cellStateChanges.count;
} }
unsigned int CellFunctions::GetCellStateType(unsigned short pid, unsigned int i) noexcept unsigned int CellFunctions::GetCellStateType(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->cellStateChanges.cellStates.at(i).type; return player->cellStateChanges.cellStates.at(index).type;
} }
const char *CellFunctions::GetCellStateDescription(unsigned short pid, unsigned int i) noexcept const char *CellFunctions::GetCellStateDescription(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->cellStateChanges.count) if (index >= player->cellStateChanges.count)
return "invalid"; return "invalid";
tempCellDescription = player->cellStateChanges.cellStates.at(i).cell.getDescription(); tempCellDescription = player->cellStateChanges.cellStates.at(index).cell.getDescription();
return tempCellDescription.c_str(); return tempCellDescription.c_str();
} }

@ -39,19 +39,19 @@ public:
* \brief Get the cell state type at a certain index in a player's latest cell state changes. * \brief Get the cell state type at a certain index in a player's latest cell state changes.
* *
* \param pid The player ID whose cell state changes should be used. * \param pid The player ID whose cell state changes should be used.
* \param i The index of the cell state. * \param index The index of the cell state.
* \return The cell state type (0 for LOAD, 1 for UNLOAD). * \return The cell state type (0 for LOAD, 1 for UNLOAD).
*/ */
static unsigned int GetCellStateType(unsigned short pid, unsigned int i) noexcept; static unsigned int GetCellStateType(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the cell description at a certain index in a player's latest cell state changes. * \brief Get the cell description at a certain index in a player's latest cell state changes.
* *
* \param pid The player ID whose cell state changes should be used. * \param pid The player ID whose cell state changes should be used.
* \param i The index of the cell state. * \param index The index of the cell state.
* \return The cell description. * \return The cell description.
*/ */
static const char *GetCellStateDescription(unsigned short pid, unsigned int i) noexcept; static const char *GetCellStateDescription(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the cell description of a player's cell. * \brief Get the cell description of a player's cell.

@ -34,15 +34,15 @@ void DialogueFunctions::AddTopic(unsigned short pid, const char* topicId) noexce
player->topicChanges.topics.push_back(topic); player->topicChanges.topics.push_back(topic);
} }
const char *DialogueFunctions::GetTopicId(unsigned short pid, unsigned int i) noexcept const char *DialogueFunctions::GetTopicId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->topicChanges.count) if (index >= player->topicChanges.count)
return "invalid"; return "invalid";
return player->topicChanges.topics.at(i).topicId.c_str(); return player->topicChanges.topics.at(index).topicId.c_str();
} }
void DialogueFunctions::SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept void DialogueFunctions::SendTopicChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept

@ -50,10 +50,10 @@ public:
* \brief Get the topicId at a certain index in a player's latest topic changes. * \brief Get the topicId at a certain index in a player's latest topic changes.
* *
* \param pid The player ID whose topic changes should be used. * \param pid The player ID whose topic changes should be used.
* \param i The index of the topic. * \param index The index of the topic.
* \return The topicId. * \return The topicId.
*/ */
static const char *GetTopicId(unsigned short pid, unsigned int i) noexcept; static const char *GetTopicId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Send a PlayerTopic packet with a player's recorded topic changes. * \brief Send a PlayerTopic packet with a player's recorded topic changes.

@ -35,39 +35,39 @@ unsigned char FactionFunctions::GetFactionChangesAction(unsigned short pid) noex
return player->factionChanges.action; return player->factionChanges.action;
} }
const char *FactionFunctions::GetFactionId(unsigned short pid, unsigned int i) noexcept const char *FactionFunctions::GetFactionId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->factionChanges.count) if (index >= player->factionChanges.count)
return "invalid"; return "invalid";
return player->factionChanges.factions.at(i).factionId.c_str(); return player->factionChanges.factions.at(index).factionId.c_str();
} }
int FactionFunctions::GetFactionRank(unsigned short pid, unsigned int i) noexcept int FactionFunctions::GetFactionRank(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->factionChanges.factions.at(i).rank; return player->factionChanges.factions.at(index).rank;
} }
bool FactionFunctions::GetFactionExpulsionState(unsigned short pid, unsigned int i) noexcept bool FactionFunctions::GetFactionExpulsionState(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, false); GET_PLAYER(pid, player, false);
return player->factionChanges.factions.at(i).isExpelled; return player->factionChanges.factions.at(index).isExpelled;
} }
int FactionFunctions::GetFactionReputation(unsigned short pid, unsigned int i) noexcept int FactionFunctions::GetFactionReputation(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->factionChanges.factions.at(i).reputation; return player->factionChanges.factions.at(index).reputation;
} }
void FactionFunctions::SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept void FactionFunctions::SetFactionChangesAction(unsigned short pid, unsigned char action) noexcept

@ -56,37 +56,37 @@ public:
* \brief Get the factionId at a certain index in a player's latest faction changes. * \brief Get the factionId at a certain index in a player's latest faction changes.
* *
* \param pid The player ID whose faction changes should be used. * \param pid The player ID whose faction changes should be used.
* \param i The index of the faction. * \param index The index of the faction.
* \return The factionId. * \return The factionId.
*/ */
static const char *GetFactionId(unsigned short pid, unsigned int i) noexcept; static const char *GetFactionId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the rank at a certain index in a player's latest faction changes. * \brief Get the rank at a certain index in a player's latest faction changes.
* *
* \param pid The player ID whose faction changes should be used. * \param pid The player ID whose faction changes should be used.
* \param i The index of the faction. * \param index The index of the faction.
* \return The rank. * \return The rank.
*/ */
static int GetFactionRank(unsigned short pid, unsigned int i) noexcept; static int GetFactionRank(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the expulsion state at a certain index in a player's latest faction changes. * \brief Get the expulsion state at a certain index in a player's latest faction changes.
* *
* \param pid The player ID whose faction changes should be used. * \param pid The player ID whose faction changes should be used.
* \param i The index of the faction. * \param index The index of the faction.
* \return The expulsion state. * \return The expulsion state.
*/ */
static bool GetFactionExpulsionState(unsigned short pid, unsigned int i) noexcept; static bool GetFactionExpulsionState(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the reputation at a certain index in a player's latest faction changes. * \brief Get the reputation at a certain index in a player's latest faction changes.
* *
* \param pid The player ID whose faction changes should be used. * \param pid The player ID whose faction changes should be used.
* \param i The index of the faction. * \param index The index of the faction.
* \return The reputation. * \return The reputation.
*/ */
static int GetFactionReputation(unsigned short pid, unsigned int i) noexcept; static int GetFactionReputation(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Set the action type in a player's faction changes. * \brief Set the action type in a player's faction changes.

@ -104,37 +104,37 @@ unsigned int GUIFunctions::GetQuickKeyChangesSize(unsigned short pid) noexcept
return player->quickKeyChanges.count; return player->quickKeyChanges.count;
} }
int GUIFunctions::GetQuickKeySlot(unsigned short pid, unsigned int i) noexcept int GUIFunctions::GetQuickKeySlot(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->quickKeyChanges.count) if (index >= player->quickKeyChanges.count)
return 0; return 0;
return player->quickKeyChanges.quickKeys.at(i).slot; return player->quickKeyChanges.quickKeys.at(index).slot;
} }
int GUIFunctions::GetQuickKeyType(unsigned short pid, unsigned int i) noexcept int GUIFunctions::GetQuickKeyType(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->quickKeyChanges.count) if (index >= player->quickKeyChanges.count)
return 0; return 0;
return player->quickKeyChanges.quickKeys.at(i).type; return player->quickKeyChanges.quickKeys.at(index).type;
} }
const char *GUIFunctions::GetQuickKeyItemId(unsigned short pid, unsigned int i) noexcept const char *GUIFunctions::GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->quickKeyChanges.count) if (index >= player->quickKeyChanges.count)
return "invalid"; return "invalid";
return player->quickKeyChanges.quickKeys.at(i).itemId.c_str(); return player->quickKeyChanges.quickKeys.at(index).itemId.c_str();
} }
void GUIFunctions::AddQuickKey(unsigned short pid, unsigned short slot, int type, const char* itemId) noexcept void GUIFunctions::AddQuickKey(unsigned short pid, unsigned short slot, int type, const char* itemId) noexcept

@ -128,28 +128,28 @@ public:
* \brief Get the slot of the quick key at a certain index in a player's latest quick key changes. * \brief Get the slot of the quick key at a certain index in a player's latest quick key changes.
* *
* \param pid The player ID whose quick key changes should be used. * \param pid The player ID whose quick key changes should be used.
* \param i The index of the quick key in the quick key changes vector. * \param index The index of the quick key in the quick key changes vector.
* \return The slot. * \return The slot.
*/ */
static int GetQuickKeySlot(unsigned short pid, unsigned int i) noexcept; static int GetQuickKeySlot(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the type of the quick key at a certain index in a player's latest quick key changes. * \brief Get the type of the quick key at a certain index in a player's latest quick key changes.
* *
* \param pid The player ID whose quick key changes should be used. * \param pid The player ID whose quick key changes should be used.
* \param i The index of the quick key in the quick key changes vector. * \param index The index of the quick key in the quick key changes vector.
* \return The quick key type. * \return The quick key type.
*/ */
static int GetQuickKeyType(unsigned short pid, unsigned int i) noexcept; static int GetQuickKeyType(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the itemId at a certain index in a player's latest quick key changes. * \brief Get the itemId at a certain index in a player's latest quick key changes.
* *
* \param pid The player ID whose quick key changes should be used. * \param pid The player ID whose quick key changes should be used.
* \param i The index of the quick key in the quick key changes vector. * \param index The index of the quick key in the quick key changes vector.
* \return The itemId. * \return The itemId.
*/ */
static const char *GetQuickKeyItemId(unsigned short pid, unsigned int i) noexcept; static const char *GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Send a PlayerQuickKeys packet with a player's recorded quick key changes. * \brief Send a PlayerQuickKeys packet with a player's recorded quick key changes.

@ -124,39 +124,39 @@ double ItemFunctions::GetEquipmentItemEnchantmentCharge(unsigned short pid, unsi
return player->equipmentItems[slot].enchantmentCharge; return player->equipmentItems[slot].enchantmentCharge;
} }
const char *ItemFunctions::GetInventoryItemRefId(unsigned short pid, unsigned int i) noexcept const char *ItemFunctions::GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->inventoryChanges.count) if (index >= player->inventoryChanges.count)
return "invalid"; return "invalid";
return player->inventoryChanges.items.at(i).refId.c_str(); return player->inventoryChanges.items.at(index).refId.c_str();
} }
int ItemFunctions::GetInventoryItemCount(unsigned short pid, unsigned int i) noexcept int ItemFunctions::GetInventoryItemCount(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->inventoryChanges.items.at(i).count; return player->inventoryChanges.items.at(index).count;
} }
int ItemFunctions::GetInventoryItemCharge(unsigned short pid, unsigned int i) noexcept int ItemFunctions::GetInventoryItemCharge(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->inventoryChanges.items.at(i).charge; return player->inventoryChanges.items.at(index).charge;
} }
double ItemFunctions::GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int i) noexcept double ItemFunctions::GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->inventoryChanges.items.at(i).enchantmentCharge; return player->inventoryChanges.items.at(index).enchantmentCharge;
} }
void ItemFunctions::SendEquipment(unsigned short pid) noexcept void ItemFunctions::SendEquipment(unsigned short pid) noexcept

@ -162,40 +162,40 @@ public:
* changes. * changes.
* *
* \param pid The player ID whose inventory changes should be used. * \param pid The player ID whose inventory changes should be used.
* \param i The index of the inventory item. * \param index The index of the inventory item.
* \return The refId. * \return The refId.
*/ */
static const char *GetInventoryItemRefId(unsigned short pid, unsigned int i) noexcept; static const char *GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the count of the item at a certain index in a player's latest inventory * \brief Get the count of the item at a certain index in a player's latest inventory
* changes. * changes.
* *
* \param pid The player ID whose inventory changes should be used. * \param pid The player ID whose inventory changes should be used.
* \param i The index of the inventory item. * \param index The index of the inventory item.
* \return The item count. * \return The item count.
*/ */
static int GetInventoryItemCount(unsigned short pid, unsigned int i) noexcept; static int GetInventoryItemCount(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the charge of the item at a certain index in a player's latest inventory * \brief Get the charge of the item at a certain index in a player's latest inventory
* changes. * changes.
* *
* \param pid The player ID whose inventory changes should be used. * \param pid The player ID whose inventory changes should be used.
* \param i The index of the inventory item. * \param index The index of the inventory item.
* \return The charge. * \return The charge.
*/ */
static int GetInventoryItemCharge(unsigned short pid, unsigned int i) noexcept; static int GetInventoryItemCharge(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the enchantment charge of the item at a certain index in a player's * \brief Get the enchantment charge of the item at a certain index in a player's
* latest inventory changes. * latest inventory changes.
* *
* \param pid The player ID whose inventory changes should be used. * \param pid The player ID whose inventory changes should be used.
* \param i The index of the inventory item. * \param index The index of the inventory item.
* \return The enchantment charge. * \return The enchantment charge.
*/ */
static double GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int i) noexcept; static double GetInventoryItemEnchantmentCharge(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Send a PlayerEquipment packet with a player's equipment. * \brief Send a PlayerEquipment packet with a player's equipment.

@ -69,14 +69,14 @@ unsigned char ObjectFunctions::GetObjectListContainerSubAction() noexcept
return readObjectList->containerSubAction; return readObjectList->containerSubAction;
} }
bool ObjectFunctions::IsObjectPlayer(unsigned int i) noexcept bool ObjectFunctions::IsObjectPlayer(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).isPlayer; return readObjectList->baseObjects.at(index).isPlayer;
} }
int ObjectFunctions::GetObjectPid(unsigned int i) noexcept int ObjectFunctions::GetObjectPid(unsigned int index) noexcept
{ {
Player *player = Players::getPlayer(readObjectList->baseObjects.at(i).guid); Player *player = Players::getPlayer(readObjectList->baseObjects.at(index).guid);
if (player != nullptr) if (player != nullptr)
return player->getId(); return player->getId();
@ -84,69 +84,69 @@ int ObjectFunctions::GetObjectPid(unsigned int i) noexcept
return -1; return -1;
} }
const char *ObjectFunctions::GetObjectRefId(unsigned int i) noexcept const char *ObjectFunctions::GetObjectRefId(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).refId.c_str(); return readObjectList->baseObjects.at(index).refId.c_str();
} }
unsigned int ObjectFunctions::GetObjectRefNum(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectRefNum(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).refNum; return readObjectList->baseObjects.at(index).refNum;
} }
unsigned int ObjectFunctions::GetObjectMpNum(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectMpNum(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).mpNum; return readObjectList->baseObjects.at(index).mpNum;
} }
int ObjectFunctions::GetObjectCount(unsigned int i) noexcept int ObjectFunctions::GetObjectCount(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).count; return readObjectList->baseObjects.at(index).count;
} }
int ObjectFunctions::GetObjectCharge(unsigned int i) noexcept int ObjectFunctions::GetObjectCharge(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).charge; return readObjectList->baseObjects.at(index).charge;
} }
double ObjectFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept double ObjectFunctions::GetObjectEnchantmentCharge(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).enchantmentCharge; return readObjectList->baseObjects.at(index).enchantmentCharge;
} }
int ObjectFunctions::GetObjectGoldValue(unsigned int i) noexcept int ObjectFunctions::GetObjectGoldValue(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).goldValue; return readObjectList->baseObjects.at(index).goldValue;
} }
double ObjectFunctions::GetObjectScale(unsigned int i) noexcept double ObjectFunctions::GetObjectScale(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).scale; return readObjectList->baseObjects.at(index).scale;
} }
bool ObjectFunctions::GetObjectState(unsigned int i) noexcept bool ObjectFunctions::GetObjectState(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).objectState; return readObjectList->baseObjects.at(index).objectState;
} }
int ObjectFunctions::GetObjectDoorState(unsigned int i) noexcept int ObjectFunctions::GetObjectDoorState(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).doorState; return readObjectList->baseObjects.at(index).doorState;
} }
int ObjectFunctions::GetObjectLockLevel(unsigned int i) noexcept int ObjectFunctions::GetObjectLockLevel(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).lockLevel; return readObjectList->baseObjects.at(index).lockLevel;
} }
bool ObjectFunctions::DoesObjectHavePlayerActivating(unsigned int i) noexcept bool ObjectFunctions::DoesObjectHavePlayerActivating(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).activatingActor.isPlayer; return readObjectList->baseObjects.at(index).activatingActor.isPlayer;
} }
int ObjectFunctions::GetObjectActivatingPid(unsigned int i) noexcept int ObjectFunctions::GetObjectActivatingPid(unsigned int index) noexcept
{ {
Player *player = Players::getPlayer(readObjectList->baseObjects.at(i).activatingActor.guid); Player *player = Players::getPlayer(readObjectList->baseObjects.at(index).activatingActor.guid);
if (player != nullptr) if (player != nullptr)
return player->getId(); return player->getId();
@ -154,44 +154,44 @@ int ObjectFunctions::GetObjectActivatingPid(unsigned int i) noexcept
return -1; return -1;
} }
const char *ObjectFunctions::GetObjectActivatingRefId(unsigned int i) noexcept const char *ObjectFunctions::GetObjectActivatingRefId(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).activatingActor.refId.c_str(); return readObjectList->baseObjects.at(index).activatingActor.refId.c_str();
} }
unsigned int ObjectFunctions::GetObjectActivatingRefNum(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectActivatingRefNum(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).activatingActor.refNum; return readObjectList->baseObjects.at(index).activatingActor.refNum;
} }
unsigned int ObjectFunctions::GetObjectActivatingMpNum(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectActivatingMpNum(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).activatingActor.mpNum; return readObjectList->baseObjects.at(index).activatingActor.mpNum;
} }
const char *ObjectFunctions::GetObjectActivatingName(unsigned int i) noexcept const char *ObjectFunctions::GetObjectActivatingName(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).activatingActor.name.c_str(); return readObjectList->baseObjects.at(index).activatingActor.name.c_str();
} }
bool ObjectFunctions::GetObjectSummonState(unsigned int i) noexcept bool ObjectFunctions::GetObjectSummonState(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).isSummon; return readObjectList->baseObjects.at(index).isSummon;
} }
double ObjectFunctions::GetObjectSummonDuration(unsigned int i) noexcept double ObjectFunctions::GetObjectSummonDuration(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).summonDuration; return readObjectList->baseObjects.at(index).summonDuration;
} }
bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int i) noexcept bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).master.isPlayer; return readObjectList->baseObjects.at(index).master.isPlayer;
} }
int ObjectFunctions::GetObjectSummonerPid(unsigned int i) noexcept int ObjectFunctions::GetObjectSummonerPid(unsigned int index) noexcept
{ {
Player *player = Players::getPlayer(readObjectList->baseObjects.at(i).master.guid); Player *player = Players::getPlayer(readObjectList->baseObjects.at(index).master.guid);
if (player != nullptr) if (player != nullptr)
return player->getId(); return player->getId();
@ -199,54 +199,54 @@ int ObjectFunctions::GetObjectSummonerPid(unsigned int i) noexcept
return -1; return -1;
} }
const char *ObjectFunctions::GetObjectSummonerRefId(unsigned int i) noexcept const char *ObjectFunctions::GetObjectSummonerRefId(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).master.refId.c_str(); return readObjectList->baseObjects.at(index).master.refId.c_str();
} }
unsigned int ObjectFunctions::GetObjectSummonerRefNum(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectSummonerRefNum(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).master.refNum; return readObjectList->baseObjects.at(index).master.refNum;
} }
unsigned int ObjectFunctions::GetObjectSummonerMpNum(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectSummonerMpNum(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).master.mpNum; return readObjectList->baseObjects.at(index).master.mpNum;
} }
double ObjectFunctions::GetObjectPosX(unsigned int i) noexcept double ObjectFunctions::GetObjectPosX(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[0]; return readObjectList->baseObjects.at(index).position.pos[0];
} }
double ObjectFunctions::GetObjectPosY(unsigned int i) noexcept double ObjectFunctions::GetObjectPosY(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[1]; return readObjectList->baseObjects.at(index).position.pos[1];
} }
double ObjectFunctions::GetObjectPosZ(unsigned int i) noexcept double ObjectFunctions::GetObjectPosZ(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[2]; return readObjectList->baseObjects.at(index).position.pos[2];
} }
double ObjectFunctions::GetObjectRotX(unsigned int i) noexcept double ObjectFunctions::GetObjectRotX(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).position.rot[0]; return readObjectList->baseObjects.at(index).position.rot[0];
} }
double ObjectFunctions::GetObjectRotY(unsigned int i) noexcept double ObjectFunctions::GetObjectRotY(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).position.rot[1]; return readObjectList->baseObjects.at(index).position.rot[1];
} }
double ObjectFunctions::GetObjectRotZ(unsigned int i) noexcept double ObjectFunctions::GetObjectRotZ(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).position.rot[2]; return readObjectList->baseObjects.at(index).position.rot[2];
} }
const char *ObjectFunctions::GetVideoFilename(unsigned int i) noexcept const char *ObjectFunctions::GetVideoFilename(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).videoFilename.c_str(); return readObjectList->baseObjects.at(index).videoFilename.c_str();
} }
unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
@ -284,9 +284,9 @@ int ObjectFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsig
.containerItems.at(itemIndex).actionCount; .containerItems.at(itemIndex).actionCount;
} }
bool ObjectFunctions::DoesObjectHaveContainer(unsigned int i) noexcept bool ObjectFunctions::DoesObjectHaveContainer(unsigned int index) noexcept
{ {
return readObjectList->baseObjects.at(i).hasContainer; return readObjectList->baseObjects.at(index).hasContainer;
} }
void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept
@ -647,14 +647,14 @@ unsigned char ObjectFunctions::GetEventContainerSubAction() noexcept
return GetObjectListContainerSubAction(); return GetObjectListContainerSubAction();
} }
unsigned int ObjectFunctions::GetObjectRefNumIndex(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectRefNumIndex(unsigned int index) noexcept
{ {
return GetObjectRefNum(i); return GetObjectRefNum(index);
} }
unsigned int ObjectFunctions::GetObjectSummonerRefNumIndex(unsigned int i) noexcept unsigned int ObjectFunctions::GetObjectSummonerRefNumIndex(unsigned int index) noexcept
{ {
return GetObjectSummonerRefNum(i); return GetObjectSummonerRefNum(index);
} }
void ObjectFunctions::SetEventCell(const char* cellDescription) noexcept void ObjectFunctions::SetEventCell(const char* cellDescription) noexcept

@ -212,10 +212,10 @@ public:
* object activation is general enough for players themselves to be included * object activation is general enough for players themselves to be included
* as objects in ObjectActivate packets. * as objects in ObjectActivate packets.
* *
* \param i The index of the object. * \param index The index of the object.
* \return Whether the object is a player. * \return Whether the object is a player.
*/ */
static bool IsObjectPlayer(unsigned int i) noexcept; static bool IsObjectPlayer(unsigned int index) noexcept;
/** /**
* \brief Get the player ID of the object at a certain index in the read object list, * \brief Get the player ID of the object at a certain index in the read object list,
@ -224,154 +224,154 @@ public:
* Note: Currently, players can only be objects in ObjectActivate and ConsoleCommand * Note: Currently, players can only be objects in ObjectActivate and ConsoleCommand
* packets. * packets.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The player ID of the object. * \return The player ID of the object.
*/ */
static int GetObjectPid(unsigned int i) noexcept; static int GetObjectPid(unsigned int index) noexcept;
/** /**
* \brief Get the refId of the object at a certain index in the read object list. * \brief Get the refId of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The refId. * \return The refId.
*/ */
static const char *GetObjectRefId(unsigned int i) noexcept; static const char *GetObjectRefId(unsigned int index) noexcept;
/** /**
* \brief Get the refNum of the object at a certain index in the read object list. * \brief Get the refNum of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The refNum. * \return The refNum.
*/ */
static unsigned int GetObjectRefNum(unsigned int i) noexcept; static unsigned int GetObjectRefNum(unsigned int index) noexcept;
/** /**
* \brief Get the mpNum of the object at a certain index in the read object list. * \brief Get the mpNum of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The mpNum. * \return The mpNum.
*/ */
static unsigned int GetObjectMpNum(unsigned int i) noexcept; static unsigned int GetObjectMpNum(unsigned int index) noexcept;
/** /**
* \brief Get the count of the object at a certain index in the read object list. * \brief Get the count of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The object count. * \return The object count.
*/ */
static int GetObjectCount(unsigned int i) noexcept; static int GetObjectCount(unsigned int index) noexcept;
/** /**
* \brief Get the charge of the object at a certain index in the read object list. * \brief Get the charge of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The charge. * \return The charge.
*/ */
static int GetObjectCharge(unsigned int i) noexcept; static int GetObjectCharge(unsigned int index) noexcept;
/** /**
* \brief Get the enchantment charge of the object at a certain index in the read object list. * \brief Get the enchantment charge of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The enchantment charge. * \return The enchantment charge.
*/ */
static double GetObjectEnchantmentCharge(unsigned int i) noexcept; static double GetObjectEnchantmentCharge(unsigned int index) noexcept;
/** /**
* \brief Get the gold value of the object at a certain index in the read object list. * \brief Get the gold value of the object at a certain index in the read object list.
* *
* This is used solely to get the gold value of gold. It is not used for other objects. * This is used solely to get the gold value of gold. It is not used for other objects.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The gold value. * \return The gold value.
*/ */
static int GetObjectGoldValue(unsigned int i) noexcept; static int GetObjectGoldValue(unsigned int index) noexcept;
/** /**
* \brief Get the object scale of the object at a certain index in the read object list. * \brief Get the object scale of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The object scale. * \return The object scale.
*/ */
static double GetObjectScale(unsigned int i) noexcept; static double GetObjectScale(unsigned int index) noexcept;
/** /**
* \brief Get the object state of the object at a certain index in the read object list. * \brief Get the object state of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The object state. * \return The object state.
*/ */
static bool GetObjectState(unsigned int i) noexcept; static bool GetObjectState(unsigned int index) noexcept;
/** /**
* \brief Get the door state of the object at a certain index in the read object list. * \brief Get the door state of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The door state. * \return The door state.
*/ */
static int GetObjectDoorState(unsigned int i) noexcept; static int GetObjectDoorState(unsigned int index) noexcept;
/** /**
* \brief Get the lock level of the object at a certain index in the read object list. * \brief Get the lock level of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The lock level. * \return The lock level.
*/ */
static int GetObjectLockLevel(unsigned int i) noexcept; static int GetObjectLockLevel(unsigned int index) noexcept;
/** /**
* \brief Check whether the object at a certain index in the read object list has been * \brief Check whether the object at a certain index in the read object list has been
* activated by a player. * activated by a player.
* *
* \param i The index of the object. * \param index The index of the object.
* \return Whether the object has been activated by a player. * \return Whether the object has been activated by a player.
*/ */
static bool DoesObjectHavePlayerActivating(unsigned int i) noexcept; static bool DoesObjectHavePlayerActivating(unsigned int index) noexcept;
/** /**
* \brief Get the player ID of the player activating the object at a certain index in the * \brief Get the player ID of the player activating the object at a certain index in the
* read object list. * read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The player ID of the activating player. * \return The player ID of the activating player.
*/ */
static int GetObjectActivatingPid(unsigned int i) noexcept; static int GetObjectActivatingPid(unsigned int index) noexcept;
/** /**
* \brief Get the refId of the actor activating the object at a certain index in the read * \brief Get the refId of the actor activating the object at a certain index in the read
* object list. * object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The refId of the activating actor. * \return The refId of the activating actor.
*/ */
static const char *GetObjectActivatingRefId(unsigned int i) noexcept; static const char *GetObjectActivatingRefId(unsigned int index) noexcept;
/** /**
* \brief Get the refNum of the actor activating the object at a certain index in the read * \brief Get the refNum of the actor activating the object at a certain index in the read
* object list. * object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The refNum of the activating actor. * \return The refNum of the activating actor.
*/ */
static unsigned int GetObjectActivatingRefNum(unsigned int i) noexcept; static unsigned int GetObjectActivatingRefNum(unsigned int index) noexcept;
/** /**
* \brief Get the mpNum of the actor activating the object at a certain index in the read * \brief Get the mpNum of the actor activating the object at a certain index in the read
* object list. * object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The mpNum of the activating actor. * \return The mpNum of the activating actor.
*/ */
static unsigned int GetObjectActivatingMpNum(unsigned int i) noexcept; static unsigned int GetObjectActivatingMpNum(unsigned int index) noexcept;
/** /**
* \brief Get the name of the actor activating the object at a certain index in the read * \brief Get the name of the actor activating the object at a certain index in the read
* object list. * object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The name of the activating actor. * \return The name of the activating actor.
*/ */
static const char *GetObjectActivatingName(unsigned int i) noexcept; static const char *GetObjectActivatingName(unsigned int index) noexcept;
/** /**
* \brief Check whether the object at a certain index in the read object list is a * \brief Check whether the object at a certain index in the read object list is a
@ -381,17 +381,17 @@ public:
* *
* \return The summon state. * \return The summon state.
*/ */
static bool GetObjectSummonState(unsigned int i) noexcept; static bool GetObjectSummonState(unsigned int index) noexcept;
/** /**
* \brief Get the summon duration of the object at a certain index in the read object list. * \brief Get the summon duration of the object at a certain index in the read object list.
* *
* Note: Returns -1 if indefinite. * Note: Returns -1 if indefinite.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The summon duration. * \return The summon duration.
*/ */
static double GetObjectSummonDuration(unsigned int i) noexcept; static double GetObjectSummonDuration(unsigned int index) noexcept;
/** /**
* \brief Check whether the object at a certain index in the read object list has a player * \brief Check whether the object at a certain index in the read object list has a player
@ -399,106 +399,106 @@ public:
* *
* Only living actors can be summoned. * Only living actors can be summoned.
* *
* \param i The index of the object. * \param index The index of the object.
* \return Whether a player is the summoner of the object. * \return Whether a player is the summoner of the object.
*/ */
static bool DoesObjectHavePlayerSummoner(unsigned int i) noexcept; static bool DoesObjectHavePlayerSummoner(unsigned int index) noexcept;
/** /**
* \brief Get the player ID of the summoner of the object at a certain index in the read object * \brief Get the player ID of the summoner of the object at a certain index in the read object
* list. * list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The player ID of the summoner. * \return The player ID of the summoner.
*/ */
static int GetObjectSummonerPid(unsigned int i) noexcept; static int GetObjectSummonerPid(unsigned int index) noexcept;
/** /**
* \brief Get the refId of the actor summoner of the object at a certain index in the read object * \brief Get the refId of the actor summoner of the object at a certain index in the read object
* list. * list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The refId of the summoner. * \return The refId of the summoner.
*/ */
static const char *GetObjectSummonerRefId(unsigned int i) noexcept; static const char *GetObjectSummonerRefId(unsigned int index) noexcept;
/** /**
* \brief Get the refNum of the actor summoner of the object at a certain index in the read object * \brief Get the refNum of the actor summoner of the object at a certain index in the read object
* list. * list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The refNum of the summoner. * \return The refNum of the summoner.
*/ */
static unsigned int GetObjectSummonerRefNum(unsigned int i) noexcept; static unsigned int GetObjectSummonerRefNum(unsigned int index) noexcept;
/** /**
* \brief Get the mpNum of the actor summoner of the object at a certain index in the read object list. * \brief Get the mpNum of the actor summoner of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The mpNum of the summoner. * \return The mpNum of the summoner.
*/ */
static unsigned int GetObjectSummonerMpNum(unsigned int i) noexcept; static unsigned int GetObjectSummonerMpNum(unsigned int index) noexcept;
/** /**
* \brief Get the X position of the object at a certain index in the read object list. * \brief Get the X position of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The X position. * \return The X position.
*/ */
static double GetObjectPosX(unsigned int i) noexcept; static double GetObjectPosX(unsigned int index) noexcept;
/** /**
* \brief Get the Y position of the object at a certain index in the read object list. * \brief Get the Y position of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The Y position. * \return The Y position.
*/ */
static double GetObjectPosY(unsigned int i) noexcept; static double GetObjectPosY(unsigned int index) noexcept;
/** /**
* \brief Get the Z position at a certain index in the read object list. * \brief Get the Z position at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The Z position. * \return The Z position.
*/ */
static double GetObjectPosZ(unsigned int i) noexcept; static double GetObjectPosZ(unsigned int index) noexcept;
/** /**
* \brief Get the X rotation of the object at a certain index in the read object list. * \brief Get the X rotation of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The X rotation. * \return The X rotation.
*/ */
static double GetObjectRotX(unsigned int i) noexcept; static double GetObjectRotX(unsigned int index) noexcept;
/** /**
* \brief Get the Y rotation of the object at a certain index in the read object list. * \brief Get the Y rotation of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The Y rotation. * \return The Y rotation.
*/ */
static double GetObjectRotY(unsigned int i) noexcept; static double GetObjectRotY(unsigned int index) noexcept;
/** /**
* \brief Get the Z rotation of the object at a certain index in the read object list. * \brief Get the Z rotation of the object at a certain index in the read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The Z rotation. * \return The Z rotation.
*/ */
static double GetObjectRotZ(unsigned int i) noexcept; static double GetObjectRotZ(unsigned int index) noexcept;
/** /**
* \brief Get the videoFilename of the object at a certain index in the read object list. * \brief Get the videoFilename of the object at a certain index in the read object list.
* *
* \return The videoFilename. * \return The videoFilename.
*/ */
static const char *GetVideoFilename(unsigned int i) noexcept; static const char *GetVideoFilename(unsigned int index) noexcept;
/** /**
* \brief Get the number of container item indexes of the object at a certain index in the * \brief Get the number of container item indexes of the object at a certain index in the
* read object list. * read object list.
* *
* \param i The index of the object. * \param index The index of the object.
* \return The number of container item indexes. * \return The number of container item indexes.
*/ */
static unsigned int GetContainerChangesSize(unsigned int objectIndex) noexcept; static unsigned int GetContainerChangesSize(unsigned int objectIndex) noexcept;
@ -559,10 +559,10 @@ public:
* Note: Only ObjectLists from ObjectPlace packets contain this information. Objects from * Note: Only ObjectLists from ObjectPlace packets contain this information. Objects from
* received ObjectSpawn packets can always be assumed to have a container. * received ObjectSpawn packets can always be assumed to have a container.
* *
* \param i The index of the object. * \param index The index of the object.
* \return Whether the object has a container. * \return Whether the object has a container.
*/ */
static bool DoesObjectHaveContainer(unsigned int i) noexcept; static bool DoesObjectHaveContainer(unsigned int index) noexcept;
/** /**
* \brief Set the cell of the temporary object list stored on the server. * \brief Set the cell of the temporary object list stored on the server.
@ -1029,8 +1029,8 @@ public:
static unsigned int GetObjectChangesSize() noexcept; static unsigned int GetObjectChangesSize() noexcept;
static unsigned char GetEventAction() noexcept; static unsigned char GetEventAction() noexcept;
static unsigned char GetEventContainerSubAction() noexcept; static unsigned char GetEventContainerSubAction() noexcept;
static unsigned int GetObjectRefNumIndex(unsigned int i) noexcept; static unsigned int GetObjectRefNumIndex(unsigned int index) noexcept;
static unsigned int GetObjectSummonerRefNumIndex(unsigned int i) noexcept; static unsigned int GetObjectSummonerRefNumIndex(unsigned int index) noexcept;
static void SetEventCell(const char* cellDescription) noexcept; static void SetEventCell(const char* cellDescription) noexcept;
static void SetEventAction(unsigned char action) noexcept; static void SetEventAction(unsigned char action) noexcept;
static void SetEventConsoleCommand(const char* consoleCommand) noexcept; static void SetEventConsoleCommand(const char* consoleCommand) noexcept;

@ -87,58 +87,58 @@ void QuestFunctions::SetReputation(unsigned short pid, int value) noexcept
player->npcStats.mReputation = value; player->npcStats.mReputation = value;
} }
const char *QuestFunctions::GetJournalItemQuest(unsigned short pid, unsigned int i) noexcept const char *QuestFunctions::GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->journalChanges.count) if (index >= player->journalChanges.count)
return "invalid"; return "invalid";
return player->journalChanges.journalItems.at(i).quest.c_str(); return player->journalChanges.journalItems.at(index).quest.c_str();
} }
int QuestFunctions::GetJournalItemIndex(unsigned short pid, unsigned int i) noexcept int QuestFunctions::GetJournalItemIndex(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->journalChanges.journalItems.at(i).index; return player->journalChanges.journalItems.at(index).index;
} }
int QuestFunctions::GetJournalItemType(unsigned short pid, unsigned int i) noexcept int QuestFunctions::GetJournalItemType(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->journalChanges.journalItems.at(i).type; return player->journalChanges.journalItems.at(index).type;
} }
const char *QuestFunctions::GetJournalItemActorRefId(unsigned short pid, unsigned int i) noexcept const char *QuestFunctions::GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->journalChanges.journalItems.at(i).actorRefId.c_str(); return player->journalChanges.journalItems.at(index).actorRefId.c_str();
} }
const char *QuestFunctions::GetKillRefId(unsigned short pid, unsigned int i) noexcept const char *QuestFunctions::GetKillRefId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->killChanges.count) if (index >= player->killChanges.count)
return "invalid"; return "invalid";
return player->killChanges.kills.at(i).refId.c_str(); return player->killChanges.kills.at(index).refId.c_str();
} }
int QuestFunctions::GetKillNumber(unsigned short pid, unsigned int i) noexcept int QuestFunctions::GetKillNumber(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
return player->killChanges.kills.at(i).number; return player->killChanges.kills.at(index).number;
} }
int QuestFunctions::GetReputation(unsigned short pid) noexcept int QuestFunctions::GetReputation(unsigned short pid) noexcept

@ -111,28 +111,28 @@ public:
* \brief Get the quest at a certain index in a player's latest journal changes. * \brief Get the quest at a certain index in a player's latest journal changes.
* *
* \param pid The player ID whose journal changes should be used. * \param pid The player ID whose journal changes should be used.
* \param i The index of the journalItem. * \param index The index of the journalItem.
* \return The quest. * \return The quest.
*/ */
static const char *GetJournalItemQuest(unsigned short pid, unsigned int i) noexcept; static const char *GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the quest index at a certain index in a player's latest journal changes. * \brief Get the quest index at a certain index in a player's latest journal changes.
* *
* \param pid The player ID whose journal changes should be used. * \param pid The player ID whose journal changes should be used.
* \param i The index of the journalItem. * \param index The index of the journalItem.
* \return The quest index. * \return The quest index.
*/ */
static int GetJournalItemIndex(unsigned short pid, unsigned int i) noexcept; static int GetJournalItemIndex(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the journal item type at a certain index in a player's latest journal changes. * \brief Get the journal item type at a certain index in a player's latest journal changes.
* *
* \param pid The player ID whose journal changes should be used. * \param pid The player ID whose journal changes should be used.
* \param i The index of the journalItem. * \param index The index of the journalItem.
* \return The type (0 for ENTRY, 1 for INDEX). * \return The type (0 for ENTRY, 1 for INDEX).
*/ */
static int GetJournalItemType(unsigned short pid, unsigned int i) noexcept; static int GetJournalItemType(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the actor refId at a certain index in a player's latest journal changes. * \brief Get the actor refId at a certain index in a player's latest journal changes.
@ -140,28 +140,28 @@ public:
* Every journal change has an associated actor, which is usually the quest giver. * Every journal change has an associated actor, which is usually the quest giver.
* *
* \param pid The player ID whose journal changes should be used. * \param pid The player ID whose journal changes should be used.
* \param i The index of the journalItem. * \param index The index of the journalItem.
* \return The actor refId. * \return The actor refId.
*/ */
static const char *GetJournalItemActorRefId(unsigned short pid, unsigned int i) noexcept; static const char *GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the refId at a certain index in a player's latest kill count changes. * \brief Get the refId at a certain index in a player's latest kill count changes.
* *
* \param pid The player ID whose kill count changes should be used. * \param pid The player ID whose kill count changes should be used.
* \param i The index of the kill count. * \param index The index of the kill count.
* \return The refId. * \return The refId.
*/ */
static const char *GetKillRefId(unsigned short pid, unsigned int i) noexcept; static const char *GetKillRefId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the number of kills at a certain index in a player's latest kill count changes. * \brief Get the number of kills at a certain index in a player's latest kill count changes.
* *
* \param pid The player ID whose kill count changes should be used. * \param pid The player ID whose kill count changes should be used.
* \param i The index of the kill count. * \param index The index of the kill count.
* \return The number of kills. * \return The number of kills.
*/ */
static int GetKillNumber(unsigned short pid, unsigned int i) noexcept; static int GetKillNumber(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the a certain player's reputation. * \brief Get the a certain player's reputation.

@ -71,7 +71,7 @@ void SpellFunctions::AddCustomSpellData(unsigned short pid, const char* spellId,
int index = -1; int index = -1;
for(int i = 0; i < player->spellbookChanges.spells.size(); i++) for(int i = 0; i < player->spellbookChanges.spells.size(); i++)
{ {
if( strcmp(player->spellbookChanges.spells.at(i).mId.c_str(), spellId) == 0) if( strcmp(player->spellbookChanges.spells.at(index).mId.c_str(), spellId) == 0)
{ {
index = i; index = i;
} }
@ -93,7 +93,7 @@ void SpellFunctions::AddCustomSpellEffect(unsigned short pid, const char* spellI
int index = -1; int index = -1;
for(int i = 0; i < player->spellbookChanges.spells.size(); i++) for(int i = 0; i < player->spellbookChanges.spells.size(); i++)
{ {
if( strcmp(player->spellbookChanges.spells.at(i).mId.c_str(), spellId) == 0) if( strcmp(player->spellbookChanges.spells.at(index).mId.c_str(), spellId) == 0)
{ {
index = i; index = i;
} }
@ -115,158 +115,158 @@ void SpellFunctions::AddCustomSpellEffect(unsigned short pid, const char* spellI
player->spellbookChanges.spells.at(index).mEffects.mList.push_back(effect); player->spellbookChanges.spells.at(index).mEffects.mList.push_back(effect);
} }
const char *SpellFunctions::GetSpellId(unsigned short pid, unsigned int i) noexcept const char *SpellFunctions::GetSpellId(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return "invalid"; return "invalid";
return player->spellbookChanges.spells.at(i).mId.c_str(); return player->spellbookChanges.spells.at(index).mId.c_str();
} }
const char *SpellFunctions::GetSpellName(unsigned short pid, unsigned int i) noexcept const char *SpellFunctions::GetSpellName(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ""); GET_PLAYER(pid, player, "");
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return "invalid"; return "invalid";
return player->spellbookChanges.spells.at(i).mName.c_str(); return player->spellbookChanges.spells.at(index).mName.c_str();
} }
int SpellFunctions::GetSpellType(unsigned short pid, unsigned int i) noexcept int SpellFunctions::GetSpellType(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mData.mType; return player->spellbookChanges.spells.at(index).mData.mType;
} }
int SpellFunctions::GetSpellCost(unsigned short pid, unsigned int i) noexcept int SpellFunctions::GetSpellCost(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mData.mCost; return player->spellbookChanges.spells.at(index).mData.mCost;
} }
int SpellFunctions::GetSpellFlags(unsigned short pid, unsigned int i) noexcept int SpellFunctions::GetSpellFlags(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mData.mFlags; return player->spellbookChanges.spells.at(index).mData.mFlags;
} }
unsigned int SpellFunctions::GetSpellEffectCount(unsigned short pid, unsigned int i) noexcept unsigned int SpellFunctions::GetSpellEffectCount(unsigned short pid, unsigned int index) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.size(); return player->spellbookChanges.spells.at(index).mEffects.mList.size();
} }
short SpellFunctions::GetSpellEffectId(unsigned short pid, unsigned int i, unsigned int j) noexcept short SpellFunctions::GetSpellEffectId(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mEffectID; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mEffectID;
} }
signed char SpellFunctions::GetSpellEffectSkill(unsigned short pid, unsigned int i, unsigned int j) noexcept signed char SpellFunctions::GetSpellEffectSkill(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mSkill; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mSkill;
} }
signed char SpellFunctions::GetSpellEffectAttribute(unsigned short pid, unsigned int i, unsigned int j) noexcept signed char SpellFunctions::GetSpellEffectAttribute(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mAttribute; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mAttribute;
} }
int SpellFunctions::GetSpellEffectRange(unsigned short pid, unsigned int i, unsigned int j) noexcept int SpellFunctions::GetSpellEffectRange(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mRange; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mRange;
} }
int SpellFunctions::GetSpellEffectArea(unsigned short pid, unsigned int i, unsigned int j) noexcept int SpellFunctions::GetSpellEffectArea(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mArea; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mArea;
} }
int SpellFunctions::GetSpellEffectDuration(unsigned short pid, unsigned int i, unsigned int j) noexcept int SpellFunctions::GetSpellEffectDuration(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mDuration; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mDuration;
} }
int SpellFunctions::GetSpellEffectMagnMin(unsigned short pid, unsigned int i, unsigned int j) noexcept int SpellFunctions::GetSpellEffectMagnMin(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mMagnMin; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mMagnMin;
} }
int SpellFunctions::GetSpellEffectMagnMax(unsigned short pid, unsigned int i, unsigned int j) noexcept int SpellFunctions::GetSpellEffectMagnMax(unsigned short pid, unsigned int index, unsigned int j) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0); GET_PLAYER(pid, player, 0);
if (i >= player->spellbookChanges.count) if (index >= player->spellbookChanges.count)
return 0; return 0;
return player->spellbookChanges.spells.at(i).mEffects.mList.at(j).mMagnMax; return player->spellbookChanges.spells.at(index).mEffects.mList.at(j).mMagnMax;
} }
void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept void SpellFunctions::SendSpellbookChanges(unsigned short pid, bool sendToOtherPlayers, bool skipAttachedPlayer) noexcept

@ -121,135 +121,135 @@ public:
* \brief Get the spellId at a certain index in a player's latest spellbook changes. * \brief Get the spellId at a certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \return The spellId. * \return The spellId.
*/ */
static const char *GetSpellId(unsigned short pid, unsigned int i) noexcept; static const char *GetSpellId(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the name of the spell at a certain index in a player's latest spellbook changes. * \brief Get the name of the spell at a certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \return The spell name. * \return The spell name.
*/ */
static const char *GetSpellName(unsigned short pid, unsigned int i) noexcept; static const char *GetSpellName(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the type of the spell at a certain index in a player's latest spellbook changes. * \brief Get the type of the spell at a certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \return The spell type. * \return The spell type.
*/ */
static int GetSpellType(unsigned short pid, unsigned int i) noexcept; static int GetSpellType(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the cost of the spell at a certain index in a player's latest spellbook changes. * \brief Get the cost of the spell at a certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \return The spell cost. * \return The spell cost.
*/ */
static int GetSpellCost(unsigned short pid, unsigned int i) noexcept; static int GetSpellCost(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the flags of the spell at a certain index in a player's latest spellbook changes. * \brief Get the flags of the spell at a certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \return The spell flags. * \return The spell flags.
*/ */
static int GetSpellFlags(unsigned short pid, unsigned int i) noexcept; static int GetSpellFlags(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the number of effects on the spell at a certain index in a player's latest spellbook changes. * \brief Get the number of effects on the spell at a certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \return The spell effect count. * \return The spell effect count.
*/ */
static unsigned int GetSpellEffectCount(unsigned short pid, unsigned int i) noexcept; static unsigned int GetSpellEffectCount(unsigned short pid, unsigned int index) noexcept;
/** /**
* \brief Get the effectId of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the effectId of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The effectId. * \return The effectId.
*/ */
static short GetSpellEffectId(unsigned short pid, unsigned int i, unsigned int j) noexcept; static short GetSpellEffectId(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the affected skill of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the affected skill of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The affected skill. * \return The affected skill.
*/ */
static signed char GetSpellEffectSkill(unsigned short pid, unsigned int i, unsigned int j) noexcept; static signed char GetSpellEffectSkill(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the affected attribute of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the affected attribute of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The affected attribute. * \return The affected attribute.
*/ */
static signed char GetSpellEffectAttribute(unsigned short pid, unsigned int i, unsigned int j) noexcept; static signed char GetSpellEffectAttribute(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the range of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the range of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The range. * \return The range.
*/ */
static int GetSpellEffectRange(unsigned short pid, unsigned int i, unsigned int j) noexcept; static int GetSpellEffectRange(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the area of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the area of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The area. * \return The area.
*/ */
static int GetSpellEffectArea(unsigned short pid, unsigned int i, unsigned int j) noexcept; static int GetSpellEffectArea(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the duration of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the duration of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The duration. * \return The duration.
*/ */
static int GetSpellEffectDuration(unsigned short pid, unsigned int i, unsigned int j) noexcept; static int GetSpellEffectDuration(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the minimum magnitude of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the minimum magnitude of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The minimum magnitude. * \return The minimum magnitude.
*/ */
static int GetSpellEffectMagnMin(unsigned short pid, unsigned int i, unsigned int j) noexcept; static int GetSpellEffectMagnMin(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Get the maximum magnitude of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes. * \brief Get the maximum magnitude of the effect at a certain index in the spell at another certain index in a player's latest spellbook changes.
* *
* \param pid The player ID whose spellbook changes should be used. * \param pid The player ID whose spellbook changes should be used.
* \param i The index of the spell. * \param index The index of the spell.
* \param j The index of the effect. * \param j The index of the effect.
* \return The maximum magnitude. * \return The maximum magnitude.
*/ */
static int GetSpellEffectMagnMax(unsigned short pid, unsigned int i, unsigned int j) noexcept; static int GetSpellEffectMagnMax(unsigned short pid, unsigned int index, unsigned int j) noexcept;
/** /**
* \brief Send a PlayerSpellbook packet with a player's recorded spellbook changes. * \brief Send a PlayerSpellbook packet with a player's recorded spellbook changes.

@ -11,8 +11,8 @@
using namespace std; using namespace std;
using namespace mwmp; using namespace mwmp;
BaseWorldstate writeWorldstate;
BaseWorldstate *readWorldstate; BaseWorldstate *readWorldstate;
BaseWorldstate writeWorldstate;
void WorldstateFunctions::ReadReceivedWorldstate() noexcept void WorldstateFunctions::ReadReceivedWorldstate() noexcept
{ {

@ -132,7 +132,7 @@ public:
* \brief Get the X coordinate of the cell corresponding to the map tile at a certain index in * \brief Get the X coordinate of the cell corresponding to the map tile at a certain index in
* the read worldstate's map tiles. * the read worldstate's map tiles.
* *
* \param i The index of the map tile. * \param index The index of the map tile.
* \return The X coordinate of the cell. * \return The X coordinate of the cell.
*/ */
static int GetMapTileCellX(unsigned int index) noexcept; static int GetMapTileCellX(unsigned int index) noexcept;
@ -141,7 +141,7 @@ public:
* \brief Get the Y coordinate of the cell corresponding to the map tile at a certain index in * \brief Get the Y coordinate of the cell corresponding to the map tile at a certain index in
* the read worldstate's map tiles. * the read worldstate's map tiles.
* *
* \param i The index of the map tile. * \param index The index of the map tile.
* \return The Y coordinate of the cell. * \return The Y coordinate of the cell.
*/ */
static int GetMapTileCellY(unsigned int index) noexcept; static int GetMapTileCellY(unsigned int index) noexcept;
@ -310,7 +310,7 @@ public:
* \brief Save the .png image data of the map tile at a certain index in the read worldstate's * \brief Save the .png image data of the map tile at a certain index in the read worldstate's
* map changes. * map changes.
* *
* \param i The index of the map tile. * \param index The index of the map tile.
* \param filePath The file path of the resulting file. * \param filePath The file path of the resulting file.
* \return void * \return void
*/ */

@ -146,43 +146,43 @@ boost::any LangLua::Call(const char *name, const char *argl, const std::vector<b
lua_getglobal (lua, name); lua_getglobal (lua, name);
for (intptr_t i = 0; i < n_args; i++) for (intptr_t index = 0; index < n_args; index++)
{ {
switch (argl[i]) switch (argl[index])
{ {
case 'i': case 'i':
luabridge::Stack<unsigned int>::push(lua, boost::any_cast<unsigned int>(args.at(i))); luabridge::Stack<unsigned int>::push(lua, boost::any_cast<unsigned int>(args.at(index)));
break; break;
case 'q': case 'q':
luabridge::Stack<signed int>::push(lua, boost::any_cast<signed int>(args.at(i))); luabridge::Stack<signed int>::push(lua, boost::any_cast<signed int>(args.at(index)));
break; break;
case 'l': case 'l':
luabridge::Stack<unsigned long long>::push(lua, boost::any_cast<unsigned long long>(args.at(i))); luabridge::Stack<unsigned long long>::push(lua, boost::any_cast<unsigned long long>(args.at(index)));
break; break;
case 'w': case 'w':
luabridge::Stack<signed long long>::push(lua, boost::any_cast<signed long long>(args.at(i))); luabridge::Stack<signed long long>::push(lua, boost::any_cast<signed long long>(args.at(index)));
break; break;
case 'f': case 'f':
luabridge::Stack<double>::push(lua, boost::any_cast<double>(args.at(i))); luabridge::Stack<double>::push(lua, boost::any_cast<double>(args.at(index)));
break; break;
case 'p': case 'p':
luabridge::Stack<void *>::push(lua, boost::any_cast<void *>(args.at(i))); luabridge::Stack<void *>::push(lua, boost::any_cast<void *>(args.at(index)));
break; break;
case 's': case 's':
luabridge::Stack<const char *>::push(lua, boost::any_cast<const char *>(args.at(i))); luabridge::Stack<const char *>::push(lua, boost::any_cast<const char *>(args.at(index)));
break; break;
case 'b': case 'b':
luabridge::Stack<bool>::push(lua, boost::any_cast<int>(args.at(i))); luabridge::Stack<bool>::push(lua, boost::any_cast<int>(args.at(index)));
break; break;
default: default:
throw runtime_error("Lua call: Unknown argument identifier " + argl[i]); throw runtime_error("Lua call: Unknown argument identifier " + argl[index]);
} }
} }

Loading…
Cancel
Save