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.



Remarks

Since Hordes of the Underdark, PCs can have more than one henchman. Use the nInt parameter to determine which henchman to get.


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: GetAssociate | GetAssociateState | GetFamiliarName | GetMaxHenchmen | RemoveHenchman | ResetHenchmenState | SetAssociateState | SetFormerMaster | SetMaxHenchmen
categories: Henchmen/Familiars/Summoned Functions


 author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul