The situation is this: I have a "boss" type NPC that I'm trying to make work with heartbeats. Now, bear in mind that I KNOW heartbeats don't work in combat... So, therefore, I've created another NPC that spawns/dies with the boss mob. That creature's heartbeats are supposed to control the boss' non-attacking commands with heartbeats. I don't know, maybe it's a bad idea?
For some reason, the script can never compile the oTarget's.
void main(){ ExecuteScript("nw_c2_default1", OBJECT_SELF);
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
if (IsInConversation(OBJECT_SELF) || GetIsInCombat()) return;
int nInt;nInt = d4();if (nInt==1) { oTarget = GetObjectByTag("RalictheDevourer");
AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionMoveToObject(GetObjectByTag("ralicwp1")));
AssignCommand(oTarget, ActionWait(1.0f));
AssignCommand(oTarget, ActionSpeakString("*Ralic is breathing fire!*"));
oCaster = GetObjectByTag("RalictheDevourer");
oTarget = GetNearestObjectByTag("blueshaft");
AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_FIREBALL, oTarget, METAMAGIC_ANY, TRUE, 3, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
oCaster = GetObjectByTag("RalictheDevourer");
oTarget = GetObjectByTag("fbspot");
AssignCommand(oCaster, ActionCastSpellAtLocation(SPELL_FIREBALL, GetLocation(oTarget), METAMAGIC_ANY, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
oCaster = GetObjectByTag("RalictheDevourer");
oTarget = GetNearestObjectByTag("redshaft");
AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_FIREBALL, oTarget, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, FALSE));
}else if (nInt==2) { oTarget = GetObjectByTag("RalictheDevourer");
AssignCommand(oTarget, ActionMoveToObject(GetObjectByTag("ralicwp2")));
AssignCommand(oTarget, ActionWait(1.0f));
AssignCommand(oTarget, ActionSpeakString("*Ralic is setting a trap!*"));
oTarget = GetNearestObjectByTag("blueshaft");
lTarget = GetLocation(oTarget);
oTarget = CreateTrapAtLocation(TRAP_BASE_TYPE_AVERAGE_ACID, lTarget, 3.0);
SetTrapActive(oTarget, TRUE);
SetTrapDetectable(oTarget, TRUE);
SetTrapDetectedBy(oTarget, oPC, TRUE);
SetTrapDisarmable(oTarget, TRUE);
SetTrapOneShot(oTarget, TRUE);
SetTrapRecoverable(oTarget, FALSE);
}else { oTarget = GetObjectByTag("RalictheDevourer");
AssignCommand(oTarget, ActionAttack(oPC));
}
}
Any idea what I could do to make this work?