I've brought more scripting woes. Anyway, here's a long userdefined script of mine (Ignore the poor spacing... please.):
Code:
void main()
{
object oNPC = GetObjectByTag("n_comm");
object oNPC1 = GetObjectByTag("n_merc01");
object oNPC2 = GetObjectByTag("n_merc02");
object oNPC3 = GetObjectByTag("n_laz");
object oNPC4 = GetObjectByTag("n_kar");
object oPM1 = GetPartyMemberByIndex(1);
object oPM2 = GetPartyMemberByIndex(2);
object oPM3 = GetPartyMemberByIndex(0);
object oPC = GetFirstPC();
int nCurrentHP;
int nUser = GetUserDefinedEventNumber();
if(nUser == 1006)
{
nCurrentHP=GetCurrentHitPoints();
if (nCurrentHP<2) {
ChangeToStandardFaction(OBJECT_SELF, 9);
AssignCommand(OBJECT_SELF, ClearAllActions());
CancelCombat (oNPC);
AssignCommand(OBJECT_SELF, ClearAllEffects());
SetLocalBoolean(OBJECT_SELF, 21, TRUE);
AssignCommand(oNPC, ActionPlayAnimation(26, 1.0, (145.0)));
AssignCommand(oNPC, SetLockOrientationInDialog(oNPC, TRUE));
DelayCommand(0.2, SetCommandable(FALSE, oNPC));
if(
GetIsDead(oNPC1) &&
GetIsDead(oNPC2) ) {
ExecuteScript("dt_fadeout", OBJECT_SELF);
SetPartyLeader(NPC_PLAYER);
DelayCommand(2.0, AssignCommand((GetObjectByTag("n_ethan")), ActionDoCommand(ActionStartConversation(oPC))));
}
DelayCommand(0.2, SetCommandable(FALSE, oNPC));
CancelCombat(oNPC3);
CancelCombat(oNPC4);
CancelCombat(oPM1);
CancelCombat(oPM2);
CancelCombat(oPM3);
if (GetIsDead(oNPC1))
AssignCommand(oNPC3, ActionAttack(oNPC2));
AssignCommand(oNPC4, ActionAttack(oNPC2));
AssignCommand(oPM1, ActionAttack(oNPC2));
AssignCommand(oPM2, ActionAttack(oNPC2));
AssignCommand(oPM3, ActionAttack(oNPC2));
else
AssignCommand(oNPC3, ActionAttack(oNPC1));
AssignCommand(oNPC4, ActionAttack(oNPC1));
AssignCommand(oPM1, ActionAttack(oNPC1));
AssignCommand(oPM2, ActionAttack(oNPC1));
AssignCommand(oPM3, ActionAttack(oNPC1));
}
}
}
The main issue with this lies in the last conditional at the bottom. The compiler tells me I have a syntax error at else.
Any ideas?