GetHenchman

From NWN Lexicon



Contents

[edit] GetHenchman(object, int)

Determines the henchman of a PC.

object GetHenchman(
    object oMaster = OBJECT_SELF,
    int nInt = 1
);

[edit] Parameters

oMaster

Target PC whose henchman is sought. (Default: OBJECT_SELF)

nInt

Which henchman to return (Default: 1)


[edit] Description

Returns the henchman belonging to oMaster, and OBJECT_INVALID if oMaster does not have a henchman.



[edit] Remarks

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


[edit] Version

1.61

[edit] 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;
}

[edit] See Also

functions: 

SetMaxHenchmen



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

Personal tools
Categories