I want to disable an NPC’s combat AI entirely, so that he only takes actions added to his queue via script. This plot NPC is normally hostile and I want him to continue with his scripted actions, even if he takes damage from PCs. I don’t want anything interrupting his script. I don’t want to change his faction, because there are other hostiles nearby and I don’t want him to attack them or be attacked by them. As I understand it, even merchant and commoner factions will attack hostile faction creatures nearby. And, I would like this to be work via scripting on an otherwise normal creature, rather than creating a custom creature with a custom faction, etc.
Is there a constant or something that will accomplish this? Seems like there would be an easy way to do this, but I don’t know it.
BTW, I have tried
SetAILevel(oNPC, AI_LEVEL_VERY_LOW), but apparently that slows down OnPerception handling to the point where he isn’t aware the PCs are even there, which is trouble since an OnPerception event triggers what he needs to do.
I have also tried clearing the NPC’s OnAttacked event using
SetEventScript(oNPC, EVENT_SCRIPT_CREATURE_ON_MELEE_ATTACKED, ""), but it looks like that either doesn’t do what I think or it is ignored if the replacement script name is an empty string.