i've been fooling around with this script in the onenter of a trigger; but it's only working the first time a PC activates it, enemy doesn't appear again after this ---> DelayCommand(120.0, SetLocalInt(oPC, "Anti_Spawn", 0));
void CommandMonster(object oMonster, object oPC)
{
AssignCommand(oMonster, ActionMoveToObject(oPC, TRUE, 7.0f));
AssignCommand(oMonster, ActionDoCommand(PlayVoiceChat(VOICE_CHAT_BATTLECRY1, OBJECT_SELF)));
AssignCommand(oMonster, ActionDoCommand(ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT)));
AssignCommand(oMonster, ActionDoCommand(ActionAttack(oPC, FALSE)));
}
/*void DestroyMonster(object oMonster)
{
effect eDeath = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oMonster);
DestroyObject(oMonster, 0.01f);
} */
////////////////////////////////////////////////////////////
// The Main script
////////////////////////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
//location lLocation = GetLocation(GetWaypointByTag("Jumpbosz1fl"));
if (!GetIsPC(oPC)) return;
else if (GetLocalInt(oPC, "Anti_Spawn")) return;
else
{
SetLocalInt(oPC, "Anti_Spawn", 1);
object oNest = GetWaypointByTag("bos_supz1fl");
location lNest = GetLocation(oNest);
object oMonster = CreateObject(OBJECT_TYPE_CREATURE, "bos_fmeph1",lNest);
CommandMonster(oMonster, oPC);
//AssignCommand(oPC, ActionJumpToLocation(lLocation));
//DelayCommand(120.0f, DestroyMonster(oMonster));
DelayCommand(120.0, SetLocalInt(oPC, "Anti_Spawn", 0));
}
also curious about how i could make the enemy spawn a random chance.
thanks for any help