[Server] Add ObjectFunctions for setting summoner identity for spawns

pull/556/head
David Cernat 5 years ago
parent c6542ffec4
commit 47b666c1f9

@ -409,13 +409,34 @@ void ObjectFunctions::SetObjectSummonDuration(float summonDuration) noexcept
tempObject.summonDuration = summonDuration;
}
void ObjectFunctions::SetObjectSummonerPid(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
tempObject.master.isPlayer = true;
tempObject.master.guid = player->guid;
}
void ObjectFunctions::SetObjectSummonerRefNum(int refNum) noexcept
{
tempObject.master.isPlayer = false;
tempObject.master.refNum = refNum;
}
void ObjectFunctions::SetObjectSummonerMpNum(int mpNum) noexcept
{
tempObject.master.isPlayer = false;
tempObject.master.mpNum = mpNum;
}
void ObjectFunctions::SetObjectActivatingPid(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
tempObject.activatingActor.guid = player->guid;
tempObject.activatingActor.isPlayer = true;
tempObject.activatingActor.guid = player->guid;
}
void ObjectFunctions::SetObjectDoorState(int doorState) noexcept

@ -88,6 +88,9 @@
\
{"SetObjectSummonState", ObjectFunctions::SetObjectSummonState},\
{"SetObjectSummonDuration", ObjectFunctions::SetObjectSummonDuration},\
{"SetObjectSummonerPid", ObjectFunctions::SetObjectSummonerPid},\
{"SetObjectSummonerRefNum", ObjectFunctions::SetObjectSummonerRefNum},\
{"SetObjectSummonerMpNum", ObjectFunctions::SetObjectSummonerMpNum},\
\
{"SetObjectActivatingPid", ObjectFunctions::SetObjectActivatingPid},\
\
@ -789,6 +792,30 @@ public:
*/
static void SetObjectSummonDuration(float summonDuration) noexcept;
/**
* \brief Set the player ID of the summoner of the temporary object stored on the server.
*
* \param pid The player ID of the summoner.
* \return void
*/
static void SetObjectSummonerPid(unsigned short pid) noexcept;
/**
* \brief Set the refNum of the actor summoner of the temporary object stored on the server.
*
* \param refNum The refNum of the summoner.
* \return void
*/
static void SetObjectSummonerRefNum(int refNum) noexcept;
/**
* \brief Set the mpNum of the actor summoner of the temporary object stored on the server.
*
* \param mpNum The mpNum of the summoner.
* \return void
*/
static void SetObjectSummonerMpNum(int mpNum) noexcept;
/**
* \brief Set the player ID of the player activating the temporary object stored on the
* server. Currently only used for ObjectActivate packets.

Loading…
Cancel
Save