GetHenchman
GetHenchman(object, int)
Determines the henchman of a PC.
object GetHenchman(
object oMaster = OBJECT_SELF,
int nInt = 1
);
Parameters
oMaster
Target PC whose henchman is sought. (Default: OBJECT_SELF)
nInt
Which henchman to return (Default: 1)
Description
Returns the henchman belonging to oMaster, and OBJECT_INVALID if oMaster does not have a henchman. See Remarks regarding types of associate that this will or will not return.
Remarks
Since Hordes of the Underdark, PCs can have more than one henchman. Use the nInt parameter to determine which henchman to get.
Note that 'henchman' appears to be a specific type of associate, such that for example this function will not return a wizard/sorceror's familiar. To fetch other types of associate, use GetAssociate instead.
Version
1.61
Example
//Returns the number of henchmen oPC has employed
//Returns -1 if oPC isn't a valid PC
int GetNumHenchmen(object oPC)
{
if (!GetIsPC(oPC)) return -1;
int nLoop, nCount;
for (nLoop=1; nLoop<=GetMaxHenchmen(); nLoop++)
{
if (GetIsObjectValid(GetHenchman(oPC, nLoop)))
nCount++;
}
return nCount;
}
See Also
| functions: |
author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul