I can't see where the dialog is triggered. I'd expect 'LAi_SetCivilianGuardianType(characterFromID("Mercer"))', in case "On_Port", to make him stop his attack, then stand and wait for you to talk to him. If he is to initiate the dialog rather than wait for you, I'd expect a line like 'LAi_ActorDialog(characterFromID("Mercer"), pchar, "", 0.0, 0.0);'.
In any case, the problem is likely to be that you're triggering case "On_Port" with 'LAi_QuestDelay("On_Port", 1.0);'. That means Mercer has exactly 1 second in which to finish the fight, then the quest progresses to "On_Port" regardless.
If you want the fight to end when "Eng Captain Near FdF" is dead, try this instead:
Code:
Pchar.quest.On_Port.win_condition.l1 = "NPC_Death";
Pchar.quest.On_Port.win_condition.l1.character = "Eng Captain Near FdF";
PChar.quest.On_Port.win_condition = "On_Port";
Incidentally, who is "Captain"? If you're trying to set the HP of the character fighting Mercer, this isn't going to work:
Code:
LAi_SetHP(characterFromID("Captain"), 10.0, 10.0);
Try setting the HP for "Eng Captain Near FdF" instead.
Also, this is going to be a one-sided fight because "Eng Captain Near FdF" isn't going to fight back. If you want to make it look like a duel, add this:
Code:
LAi_ActorAttack(characterFromID("Eng Captain Near FdF"), characterFromID("Mercer"), "");
It's still going to be a foregone conclusion because "Mercer" has been set to immortal, but at least it won't look so obvious.
@Pieter Boelen: 'LAi_ActorAttack' is defined:
Code:
void LAi_ActorAttack(aref chr, aref enemy, string quest)
What triggers "quest"? Is it when "enemy" is dead?