[Server] Add script function for getting a summoner's pid

Additionally, fix typos in the comments for other script functions relating to summoners.
0.6.3
David Cernat 7 years ago
parent 8a23a96da4
commit 3438061b55

@ -128,6 +128,14 @@ bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int i) noexcept
return readObjectList->baseObjects.at(i).master.isPlayer;
}
unsigned int ObjectFunctions::GetObjectSummonerPid(unsigned int i) noexcept
{
Player *player = Players::getPlayer(readObjectList->baseObjects.at(i).master.guid);
if (player != nullptr)
return player->getId();
}
const char *ObjectFunctions::GetObjectSummonerRefId(unsigned int i) noexcept
{
return readObjectList->baseObjects.at(i).master.refId.c_str();

@ -28,6 +28,7 @@
{"GetObjectSummonState", ObjectFunctions::GetObjectSummonState},\
{"GetObjectSummonDuration", ObjectFunctions::GetObjectSummonDuration},\
{"DoesObjectHavePlayerSummoner", ObjectFunctions::DoesObjectHavePlayerSummoner},\
{"GetObjectSummonerPid", ObjectFunctions::GetObjectSummonerPid},\
{"GetObjectSummonerRefId", ObjectFunctions::GetObjectSummonerRefId},\
{"GetObjectSummonerRefNumIndex", ObjectFunctions::GetObjectSummonerRefNumIndex},\
{"GetObjectSummonerMpNum", ObjectFunctions::GetObjectSummonerMpNum},\
@ -290,13 +291,21 @@ public:
*/
static bool DoesObjectHavePlayerSummoner(unsigned int i) noexcept;
/**
* \brief Get the player ID of the summoner of the object at a certain index in the read object
* list's object changes.
*
* \param i The index of the object.
* \return The player ID of the summoner.
*/
static unsigned int GetObjectSummonerPid(unsigned int i) noexcept;
/**
* \brief Get the refId of the summoner of the object at a certain index in the read object
* list's object changes.
*
* \param i The index of the summoner.
* \return The refNumIndex.
* \param i The index of the object.
* \return The refId of the summoner.
*/
static const char *GetObjectSummonerRefId(unsigned int i) noexcept;
@ -304,8 +313,8 @@ public:
* \brief Get the refNumIndex of the summoner of the object at a certain index in the read object
* list's object changes.
*
* \param i The index of the summoner.
* \return The refNumIndex.
* \param i The index of the object.
* \return The refNumIndex of the summoner.
*/
static int GetObjectSummonerRefNumIndex(unsigned int i) noexcept;
@ -313,8 +322,8 @@ public:
* \brief Get the mpNum of the summoner of the object at a certain index in the read object list's
* object changes.
*
* \param i The index of the summoner.
* \return The mpNum.
* \param i The index of the object.
* \return The mpNum of the summoner.
*/
static int GetObjectSummonerMpNum(unsigned int i) noexcept;

Loading…
Cancel
Save