Added henchman rental
Many areas, items, and creatures were adjusted for balance and aesthetics.
This commit is contained in:
38
_module/nss/hench_patrol.nss
Normal file
38
_module/nss/hench_patrol.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/* 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");
|
||||
}
|
Reference in New Issue
Block a user