void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

object oSpawn;
object oTarget;
object oWP1 = GetWaypointByTag("WP_Firebats1");
location lWP1 = GetLocation(oWP1);
object oWP2 = GetWaypointByTag("WP_Firebats2");
location lWP2 = GetLocation(oWP2);
object oWP3 = GetWaypointByTag("WP_Firebats3");
location lWP3 = GetLocation(oWP3);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP1);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP1);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP1);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP1);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP2);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP2);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP2);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP2);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP3);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP3);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP3);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "firebat", lWP3);
oTarget = oSpawn;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget);
AssignCommand(oTarget, ActionAttack(oPC));


}

