Amon_PRC8/_module/nss/henchscout.nss

27 lines
831 B
Plaintext
Raw Permalink Normal View History

2025-04-03 19:00:46 -04:00
#include "hench_i0_assoc"
void main()
{
object oRealMaster = GetRealMaster();
object oClosest = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY,
oRealMaster, 1);
if (GetIsObjectValid(oClosest) && GetDistanceBetween(oClosest, oRealMaster) <= henchMaxScoutDistance)
{
SetLocalInt(OBJECT_SELF, sHenchScoutingFlag, TRUE);
SetLocalObject(OBJECT_SELF, sHenchScoutTarget, oClosest);
ClearAllActions();
if (CheckStealth())
{
SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE);
}
ActionMoveToObject(oClosest, FALSE, 1.0);
ActionMoveToObject(oClosest, FALSE, 1.0);
ActionMoveToObject(oClosest, FALSE, 1.0);
}
else
{
DeleteLocalInt(OBJECT_SELF,sHenchScoutingFlag);
}
}