SetMaxHenchmen(int)

Sets the maximum number of henchmen

void SetMaxHenchmen(
    int nNumHenchmen
);

Parameters

nNumHenchmen

Maximum allowed number of henchmen in module


Description

Sets the maximum number of henchmen.



Remarks

Since Hordes of the Underdark, it has been possible for a PC to have more than one henchman. By default, the max number of henchmen will still be 1, so you must call this function manually, for instance in your OnModuleLoad event, to allow for more than one henchman.


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: AddHenchman | GetHenchman | GetMaxHenchmen
categories: Henchmen/Familiars/Summoned Functions


 author: Lilac Soul
 Send comments on this topic.