| Author |
Sticky:
Post Working Scripts Here |
|
darthx86
|
Posted: Tuesday, 02 July 05:25AM
|
ATTENTION MODERATOR Please delete my other post in this thread (just two or three above this one). The script has been updated/fixed. Thanks!
Hmm... Since I can't go back and zorch my previous post in this thread, I'll just post the modified version of the _NPC_Flee script here.
NWScript:
void main()
{
object oCreature;
object oRunTo;
int iRunLikeHell = 0;
oRunTo = GetWaypointByTag("NPC_Flee1");
oCreature = GetLastPerceived();
if (GetObjectByTag("ENEMY", 1) == oCreature)
{
iRunLikeHell = 1;
}
if (iRunLikeHell = 1)
{
ActionMoveToObject(oRunTo, TRUE);
}
}
This version doesn't make the NPCs "stutter" when they're fleeing. Once they see an enemy, they're off to the races.
Add this instead to make the NPCs flee on factionsetting lower than 10
void main()
{
object oCreature;
oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1);
{
ActionMoveAwayFromObject(oCreature, TRUE, 40.0);
}
}
|
|