Thanks, that looks like the sort of solution I'm looking for.

The kind of consequences I need are rather broad, which is why a global flag is needed. Examples include the following:
NPC 1 sends the player to deliver a package to NPC 2. That's normal behaviour.
NPC 1 sends the player to deliver a package to NPC 2, but the player killed NPC 2 earlier. That's insane, and actually kind of cruel. Or a veiled threat, perhaps.

NPC 1 lives on another floor of their house than NPC 2, their brother. They greet people who wander into their house, including the player, with 'would you like a cookie?' from their fresh batch. That's normal behaviour.
The previous applies but the PC earlier went up a floor and killed NPC 1's brother. The PC comes down, strikes up conversation with NPC 1, and is offered a cookie. That's insane, and I wouldn't eat those cookies.

NPC 1 would probably still be sad if they talked to someone who was a player but wasn't part of the situation (something easily handled with a Characterdied and a global flag) but at the ones that were there when NPC 2 died, NPC 1 would be livid.

Now you might think that's an unreasonable thing to try and make contingencies for, but earlier I butchered the entire King Crab inn to find out if I could. That's not insane. That's science. Worryingly for this particular situation, I remember one-shotting one of the guests there and I'm fairly sure no combat started.
But that was a while ago, I'll re-check later.

Does .isPlayer() also pick follower NPCs?

EDIT: It seems like a good idea to throw in a
"NOT DB_InCombat(_Character, CombatID);"
in the CharacterLeftCombat bit in order to avoid DB bloat.
That might upset things a bit though, so I'll have a look if it works ASAP.

EDIT II:
That does break things.
Other sad news: it is, in fact, possible to kill someone without starting combat. You just need overwhelming damage, or their initial attitude to be high enough.


...maybe NPCs should just blame all the PCs and their lackeys for the deaths of their loved ones.
Which brings me to the matter of lackeys. IsPlayer does not appear to include followers.

Last edited by Ikul; 10/12/15 05:48 PM.