I have a scenario where a child will join combat if he sees it happening, but when the adult he's fighting with is killed, he runs away scared to his mother. Afterwards, I want him to be reasonably scared of the players, but for some reason my dialog is overwritten by dialog I did not write asking for a gift in order to make everything OK again and which is totally inappropriate for a frightened child.
I have tried changing his alignment from the same as his father's to an ally; I've tried changing his default scripting; I've tried a couple different ways to enter combat*; none of it seems to make a difference.
Here's the code I'm currently using to make him run away:
---------------------------------------------------------
IF
CharacterKilledBy(CHARACTERGUID_Eldithas_Histerix_3347b77a-4b37-40e7-9e36-60caef04cbe8, _Character, _Character)
AND
CharacterIsPlayer(_Character, 1)
AND
CharacterIsInCombat(CHARACTERGUID_olofir_histerix_4b58b6fb-f628-4f73-9a3d-eaa0eef12d09, 1)
THEN
CharacterMoveToPosition(CHARACTERGUID_olofir_histerix_4b58b6fb-f628-4f73-9a3d-eaa0eef12d09, 25.858, 0.045, 67.123, 1, "scared_olofir");
DisplayText(CHARACTERGUID_olofir_histerix_4b58b6fb-f628-4f73-9a3d-eaa0eef12d09, "Aaaaaaaaaaaahhhhhhhh!!!!!!!");
SetCanJoinCombat(CHARACTERGUID_olofir_histerix_4b58b6fb-f628-4f73-9a3d-eaa0eef12d09, 0);
---------------------------------------------------------
Thanks in advance for any help anyone can offer. :)
* which I'm also having trouble with and I don't know if the two issues are related at all -- http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=636451#Post636451