Amon_PRC8/_module/nss/henchdosum.nss

38 lines
958 B
Plaintext
Raw Permalink Normal View History

2025-04-03 19:00:46 -04:00
#include "hench_i0_generic"
int HenchTalentSummonAllies(int nForce = FALSE)
{
talent tUse;
if(!GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED))
&& (nForce || !GetLocalInt(OBJECT_SELF, sHenchDontSummon)))
{
tUse = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_OBTAIN_ALLIES, 20);
if(GetIsTalentValid(tUse))
{
ClearAllActions();
object oRealMaster = GetRealMaster();
//This is for henchmen wizards, so they do no run off and get killed
//summoning in allies.
if(GetIsObjectValid(oRealMaster))
{
ActionUseTalentAtLocation(tUse, GetLocation(oRealMaster));
}
else
{
ActionUseTalentAtLocation(tUse, GetLocation(OBJECT_SELF));
}
return TRUE;
}
}
return FALSE;
}
void main()
{
HenchTalentSummonAllies(TRUE);
}