Script Name: AI - NPC run if too low level
What it does: If NPC is too low of a level vs. PC it will run vs. fight.
This script is mainly for worlds having multiple PC levels -
I have a newbie zone with low level wandering monsters that 1st level PC's
can fight for experience. But, I wanted it so that my high level characters
wouldn't be harrassed if having to travel through a zone with low level
encounters.
I call my script lf_combatround...here it is:
NWScript:
#include "NW_I0_GENERIC"
void main()
{
object oPC = GetLastPerceived();
int iHDpc = GetHitDice(oPC);
int iHDcr = GetHitDice(OBJECT_SELF) + 3;
if ((iHDpc > iHDcr) && GetIsPC(oPC))
{
ActionMoveAwayFromObject(oPC,TRUE,60.0f);
}
else
{
ClearAllActions();
DetermineCombatRound();
}
}
Instructions:
1. Save script above.
2. Find Bioware's nw_c2_default2 script, and on lines 35, and 54 place -
ExecuteScript("lf_combatround", OBJECT_SELF); in place of
DetermineCombatRound();
3. Save file, or save under a different name (I saved mine under a different
name - simply because I like keeping all of Bioware's default scripts
untouched, and I selectively use this AI script depending on the mob/zone
types.
You can change how high of level you want the PC to be before the NPC runs.
You can also set it that the NPC won't run and do nothing by just commenting
out the else section.
Good luck and I hope this script helps you.
Nilyan
|