diff --git a/apps/openmw-mp/Script/Functions/Objects.cpp b/apps/openmw-mp/Script/Functions/Objects.cpp index f569b8c58..36cd8f99b 100644 --- a/apps/openmw-mp/Script/Functions/Objects.cpp +++ b/apps/openmw-mp/Script/Functions/Objects.cpp @@ -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; diff --git a/apps/openmw-mp/Script/Functions/Objects.hpp b/apps/openmw-mp/Script/Functions/Objects.hpp index ee8ce3bb0..e006e1980 100644 --- a/apps/openmw-mp/Script/Functions/Objects.hpp +++ b/apps/openmw-mp/Script/Functions/Objects.hpp @@ -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. *