Here is the script you had the compile error on, fixed. It had an extra left bracket on the line you had the error on, and two of the fuctions had unnecessary parameters - GetFirstPC() instead of GetFirstPC(TRUE), and removed the last two FALSES from the StartConvo functions. That's one reason why cribbing scripts from NWN 2 is probably not a great idea.
void main() {
object oSelf = OBJECT_SELF;
location lLoc = GetLocation(oSelf);
int nHP = GetCurrentHitPoints(oSelf);
// If the NPC currently has 1 Hit Point left
if(nHP == 1) {
// Search through all creatures in a 20 meter radius centered on oSelf
object oNPC = GetFirstObjectInShape(SHAPE_SPHERE, 20.0f, lLoc, FALSE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oNPC)) {
// Clear combat states for every creature found in search
AssignCommand(oNPC, ClearAllActions(TRUE));
// Change NPC to Commoner Faction so no longer hostile
if (!GetIsObjectValid(oNPC)) {
ChangeToStandardFaction(oNPC, STANDARD_FACTION_COMMONER);
}
oNPC = GetNextObjectInShape(SHAPE_SPHERE, 20.0f, lLoc, FALSE, OBJECT_TYPE_CREATURE);
}
// Have the NPC begin a conversation with PC
object oPC = GetFirstPC(); // In a SP module, this is the player’s originally created character
AssignCommand(oSelf, ActionStartConversation(oPC, "vampirelord", FALSE, FALSE));
}
// Else NPC is not yet at 1 Hitpoint, so fire normal OnDamaged script
else {
ExecuteScript("x2_def_ondamage", oSelf);
}
}
That script, as some have pointed out, has many issues - only firing on exactly one hp, which only works if immortal is set, and only resetting in a 20.0 meter sphere are the ones that lept out at me.
Funky