Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
38
_module/nss/rtrw_fleetrig.nss
Normal file
38
_module/nss/rtrw_fleetrig.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "prc_inc_racial"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCreature;
|
||||
object oGuard;
|
||||
location lLoc;
|
||||
string sTag;
|
||||
int iRace;
|
||||
int iFlag;
|
||||
|
||||
oCreature = GetEnteringObject();
|
||||
|
||||
//Use GetIsEnemy to tell them to flee
|
||||
|
||||
if (!GetIsPC(oCreature) && !GetIsPC(GetMaster(oCreature)))
|
||||
{
|
||||
iFlag = 0;
|
||||
iRace = MyPRCGetRacialType(oCreature);
|
||||
if (iRace == RACIAL_TYPE_ANIMAL || iRace == RACIAL_TYPE_BEAST || iRace == RACIAL_TYPE_UNDEAD || iRace == RACIAL_TYPE_VERMIN || iRace == RACIAL_TYPE_OOZE || iRace ==RACIAL_TYPE_CONSTRUCT)
|
||||
iFlag = 1;
|
||||
oGuard = GetObjectByTag("RTRW_cguard1_S");
|
||||
if (!GetIsObjectValid(oGuard))
|
||||
oGuard = GetObjectByTag("RTRW_cguard2_S");
|
||||
if (!GetIsEnemy(oGuard,oCreature))
|
||||
iFlag = 1;
|
||||
if (iFlag == 0)
|
||||
{
|
||||
sTag = "RTRW_FleeTo" + IntToString(Random(4)+1);
|
||||
lLoc = GetLocation(GetObjectByTag(sTag));
|
||||
|
||||
DelayCommand(0.1f,AssignCommand(oCreature,ClearAllActions()));
|
||||
DelayCommand(0.5f,AssignCommand(oCreature,ActionMoveToLocation(lLoc,TRUE)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user