#include "nw_i0_plot"

//Put this OnEnter
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int nInt;
nInt=GetPLocalInt(oPC, "02bambooTrap");

if (!(nInt <= 1))
   return;

SetPLocalInt(oPC, "02BambooTrap", 2);

object oTarget;
oTarget = GetObjectByTag("BambooMediumDestroy");

DestroyObject(oTarget, 0.0);

object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("02Bamboo1");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo2");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo3");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo4");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo5");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo6");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo7");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("02Bamboo8");

lTarget = GetLocation(oTarget);

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

effect eEffect;
eEffect = EffectDamage(4, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
FloatingTextStringOnCreature("Two sections of the bamboo wall swing out striking you and pushing you down the hall.  The also have created a barrier.", oPC);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

}
