/*   Script generated by
Lilac Soul's NWN Script Generator, v. 1.6

For download info, please visit:
http://www.lilacsoul.revility.com    */

//Put this OnEnter
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);

FloatingTextStringOnCreature("Bars spring up from the floor, creating a cage. ", oPC);

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("c42gate1");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cagebars", lTarget);

oTarget = GetWaypointByTag("c42gate2");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cagebars", lTarget);

oTarget = GetWaypointByTag("c42gate3");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cagebars", lTarget);

oTarget = GetWaypointByTag("c42gate4");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cagebars", lTarget);

oTarget = GetWaypointByTag("c42gate5");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cagebars", lTarget);

oTarget = GetWaypointByTag("c42gate6");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cagebars", lTarget);

}

