mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 17:56:47 +00:00 
			
		
		
		
	[Server] Add script functions for getting a summoner's refId and indexes
This commit is contained in:
		
							parent
							
								
									53346e2663
								
							
						
					
					
						commit
						3aa125ceda
					
				
					 2 changed files with 49 additions and 1 deletions
				
			
		|  | @ -128,6 +128,21 @@ bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int i) noexcept | |||
|     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 | ||||
| { | ||||
|     return readObjectList->baseObjects.at(i).position.pos[0]; | ||||
|  |  | |||
|  | @ -24,9 +24,14 @@ | |||
|     {"GetObjectState",                        ObjectFunctions::GetObjectState},\ | ||||
|     {"GetObjectDoorState",                    ObjectFunctions::GetObjectDoorState},\ | ||||
|     {"GetObjectLockLevel",                    ObjectFunctions::GetObjectLockLevel},\ | ||||
|     \ | ||||
|     {"GetObjectSummonState",                  ObjectFunctions::GetObjectSummonState},\ | ||||
|     {"GetObjectSummonDuration",               ObjectFunctions::GetObjectSummonDuration},\ | ||||
|     {"DoesObjectHavePlayerSummoner",          ObjectFunctions::DoesObjectHavePlayerSummoner},\ | ||||
|     {"GetObjectSummonerRefId",                ObjectFunctions::GetObjectSummonerRefId},\ | ||||
|     {"GetObjectSummonerRefNumIndex",          ObjectFunctions::GetObjectSummonerRefNumIndex},\ | ||||
|     {"GetObjectSummonerMpNum",                ObjectFunctions::GetObjectSummonerMpNum},\ | ||||
|     \ | ||||
|     {"GetObjectPosX",                         ObjectFunctions::GetObjectPosX},\ | ||||
|     {"GetObjectPosY",                         ObjectFunctions::GetObjectPosY},\ | ||||
|     {"GetObjectPosZ",                         ObjectFunctions::GetObjectPosZ},\ | ||||
|  | @ -281,10 +286,38 @@ public: | |||
|     * | ||||
|     * 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; | ||||
| 
 | ||||
| 
 | ||||
|     /**
 | ||||
|     * \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 | ||||
|     * changes. | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue