Aantioch_Infernum/_module/nss/hench_patrol.nss
EpicValor 07f4ebed49 Added henchman rental
Many areas, items, and creatures were adjusted for balance and aesthetics.
2023-08-24 15:20:50 -05:00

39 lines
1.3 KiB
Plaintext

//////////////////////////////////////////////////////////////////////////////
/* Original script by: <Unknown>
/ Concept explained by: Xovian
/
/ Henchman patrol script, upon using this ability, the henchmen will
/ go towards the nearest enemy that they can find. This script is useful
/ because many times henchmen follow the player insteead of taking an active
/ role in the front if they are a tank or the like. Very useful for the
/ support classes out there that could use a henchmen meat shield.
*/
/////////////////////////////////////////////////////////////////////////////
void main()
{
object oPC = GetFirstPC();
object oArea = GetArea(OBJECT_SELF);
object oMob = GetFirstObjectInArea(oArea);
object oTarg;
int iFlag;
while (GetIsObjectValid(oMob))
{
if (GetObjectType(oMob)==OBJECT_TYPE_CREATURE && !GetIsDead(oMob))
{
if (GetIsEnemy(oMob, oPC) && GetDistanceToObject(oMob)<50.0)
{
oTarg = oMob;
iFlag=1;
}
}
oMob = GetNextObjectInArea(oArea);
}
if (iFlag==1)
{
SpeakString("I think I hear something!");
ActionMoveToObject(oTarg, FALSE, 5.0);
ActionAttack(oTarg);
}
else SpeakString("I sense no enemies in the immediate area");
}