1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

[Server] Add script functions relating to summons' effect & spell IDs

This commit is contained in:
David Cernat 2019-12-01 13:32:34 +02:00
parent d78bdefc01
commit 9a772d737f
2 changed files with 56 additions and 0 deletions

View file

@ -189,6 +189,16 @@ double ObjectFunctions::GetObjectSummonDuration(unsigned int index) noexcept
return readObjectList->baseObjects.at(index).summonDuration;
}
double ObjectFunctions::GetObjectSummonEffectId(unsigned int index) noexcept
{
return readObjectList->baseObjects.at(index).summonEffectId;
}
const char *ObjectFunctions::GetObjectSummonSpellId(unsigned int index) noexcept
{
return readObjectList->baseObjects.at(index).summonSpellId.c_str();
}
bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int index) noexcept
{
return readObjectList->baseObjects.at(index).master.isPlayer;
@ -404,6 +414,16 @@ void ObjectFunctions::SetObjectSummonState(bool summonState) noexcept
tempObject.isSummon = summonState;
}
void ObjectFunctions::SetObjectSummonEffectId(int summonEffectId) noexcept
{
tempObject.summonEffectId = summonEffectId;
}
void ObjectFunctions::SetObjectSummonSpellId(const char* summonSpellId) noexcept
{
tempObject.summonSpellId = summonSpellId;
}
void ObjectFunctions::SetObjectSummonDuration(double summonDuration) noexcept
{
tempObject.summonDuration = summonDuration;

View file

@ -38,6 +38,8 @@
{"GetObjectActivatingName", ObjectFunctions::GetObjectActivatingName},\
\
{"GetObjectSummonState", ObjectFunctions::GetObjectSummonState},\
{"GetObjectSummonEffectId", ObjectFunctions::GetObjectSummonEffectId},\
{"GetObjectSummonSpellId", ObjectFunctions::GetObjectSummonSpellId},\
{"GetObjectSummonDuration", ObjectFunctions::GetObjectSummonDuration},\
{"DoesObjectHavePlayerSummoner", ObjectFunctions::DoesObjectHavePlayerSummoner},\
{"GetObjectSummonerPid", ObjectFunctions::GetObjectSummonerPid},\
@ -87,6 +89,8 @@
{"SetObjectRotation", ObjectFunctions::SetObjectRotation},\
\
{"SetObjectSummonState", ObjectFunctions::SetObjectSummonState},\
{"SetObjectSummonEffectId", ObjectFunctions::SetObjectSummonEffectId},\
{"SetObjectSummonSpellId", ObjectFunctions::SetObjectSummonSpellId},\
{"SetObjectSummonDuration", ObjectFunctions::SetObjectSummonDuration},\
{"SetObjectSummonerPid", ObjectFunctions::SetObjectSummonerPid},\
{"SetObjectSummonerRefNum", ObjectFunctions::SetObjectSummonerRefNum},\
@ -408,6 +412,22 @@ public:
*/
static bool GetObjectSummonState(unsigned int index) noexcept;
/**
* \brief Get the summon effect ID of the object at a certain index in the read object list.
*
* \param index The index of the object.
* \return The summon effect ID.
*/
static double GetObjectSummonEffectId(unsigned int index) noexcept;
/**
* \brief Get the summon spell ID of the object at a certain index in the read object list.
*
* \param index The index of the object.
* \return The summon spell ID.
*/
static const char *GetObjectSummonSpellId(unsigned int index) noexcept;
/**
* \brief Get the summon duration of the object at a certain index in the read object list.
*
@ -784,6 +804,22 @@ public:
*/
static void SetObjectSummonState(bool summonState) noexcept;
/**
* \brief Set the summon effect ID of the temporary object stored on the server.
*
* \param summonEffectId The summon effect ID.
* \return void
*/
static void SetObjectSummonEffectId(int summonEffectId) noexcept;
/**
* \brief Set the summon spell ID of the temporary object stored on the server.
*
* \param summonSpellId The summon spell ID.
* \return void
*/
static void SetObjectSummonSpellId(const char* summonSpellId) noexcept;
/**
* \brief Set the summon duration of the temporary object stored on the server.
*