[Server] Add script functions for getting a summoner's refId and indexes

0.6.3
David Cernat 7 years ago
parent 53346e2663
commit 3aa125ceda

@ -128,6 +128,21 @@ bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int i) noexcept
return readObjectList->baseObjects.at(i).master.isPlayer; return readObjectList->baseObjects.at(i).master.isPlayer;
} }
const char *ObjectFunctions::GetObjectSummonerRefId(unsigned int i) noexcept
{
return readObjectList->baseObjects.at(i).master.refId.c_str();
}
int ObjectFunctions::GetObjectSummonerRefNumIndex(unsigned int i) noexcept
{
return readObjectList->baseObjects.at(i).master.refNumIndex;
}
int ObjectFunctions::GetObjectSummonerMpNum(unsigned int i) noexcept
{
return readObjectList->baseObjects.at(i).master.mpNum;
}
double ObjectFunctions::GetObjectPosX(unsigned int i) noexcept double ObjectFunctions::GetObjectPosX(unsigned int i) noexcept
{ {
return readObjectList->baseObjects.at(i).position.pos[0]; return readObjectList->baseObjects.at(i).position.pos[0];

@ -24,9 +24,14 @@
{"GetObjectState", ObjectFunctions::GetObjectState},\ {"GetObjectState", ObjectFunctions::GetObjectState},\
{"GetObjectDoorState", ObjectFunctions::GetObjectDoorState},\ {"GetObjectDoorState", ObjectFunctions::GetObjectDoorState},\
{"GetObjectLockLevel", ObjectFunctions::GetObjectLockLevel},\ {"GetObjectLockLevel", ObjectFunctions::GetObjectLockLevel},\
\
{"GetObjectSummonState", ObjectFunctions::GetObjectSummonState},\ {"GetObjectSummonState", ObjectFunctions::GetObjectSummonState},\
{"GetObjectSummonDuration", ObjectFunctions::GetObjectSummonDuration},\ {"GetObjectSummonDuration", ObjectFunctions::GetObjectSummonDuration},\
{"DoesObjectHavePlayerSummoner", ObjectFunctions::DoesObjectHavePlayerSummoner},\ {"DoesObjectHavePlayerSummoner", ObjectFunctions::DoesObjectHavePlayerSummoner},\
{"GetObjectSummonerRefId", ObjectFunctions::GetObjectSummonerRefId},\
{"GetObjectSummonerRefNumIndex", ObjectFunctions::GetObjectSummonerRefNumIndex},\
{"GetObjectSummonerMpNum", ObjectFunctions::GetObjectSummonerMpNum},\
\
{"GetObjectPosX", ObjectFunctions::GetObjectPosX},\ {"GetObjectPosX", ObjectFunctions::GetObjectPosX},\
{"GetObjectPosY", ObjectFunctions::GetObjectPosY},\ {"GetObjectPosY", ObjectFunctions::GetObjectPosY},\
{"GetObjectPosZ", ObjectFunctions::GetObjectPosZ},\ {"GetObjectPosZ", ObjectFunctions::GetObjectPosZ},\
@ -281,10 +286,38 @@ public:
* *
* Only living actors can be summoned. * Only living actors can be summoned.
* *
* \return The summon state. * \return Whether a player is the summoner of the object.
*/ */
static bool DoesObjectHavePlayerSummoner(unsigned int i) noexcept; static bool DoesObjectHavePlayerSummoner(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.
*/
static const char *GetObjectSummonerRefId(unsigned int i) noexcept;
/**
* \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.
*/
static int GetObjectSummonerRefNumIndex(unsigned int i) noexcept;
/**
* \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.
*/
static int GetObjectSummonerMpNum(unsigned int i) noexcept;
/** /**
* \brief Get the X position of the object at a certain index in the read object list's object * \brief Get the X position of the object at a certain index in the read object list's object
* changes. * changes.

Loading…
Cancel
Save