//NPC yell something to you when you come into their range
//
//Inside of the OnSpawn script un-comment the line that has //Optional behavior - Fire User Defined Event 1002, then do save as and use that for the //npc you want to speak.
//
//Then for the OnUserDefined add this:




int nUser = GetUserDefinedEventNumber();
if(nUser == 1002)
{
if (GetLocalInt(OBJECT_SELF, "spoken") != 2)
{
SpeakString("Leave me alone, peasant");
SetLocalInt(OBJECT_SELF,"spoken",2);
}
}