#include "nw_i0_plot"

#include "nw_i0_2q4luskan"
//#include "c24trap"
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int nInt;
nInt=GetPLocalInt(oPC, "intStartTrap");
if ((nInt < 1))
   {
  //DebugSpeak("DEBUG: c24startrapalt started.  intStartTrap to 1");
SetPLocalInt(oPC, "intStartTrap", 1);
float fDelay;
//DelayCommand(RoundsToSeconds(2), SetPLocalInt(oPC, "intSandBoxRound ", 1));
//DelayCommand(RoundsToSeconds(3), SetPLocalInt(oPC, "intSandBoxRound ", 2));
//DelayCommand(RoundsToSeconds(4), SetPLocalInt(oPC, "intSandBoxRound ", 3));
//DelayCommand(RoundsToSeconds(5), SetPLocalInt(oPC, "intSandBoxRound ", 4));
//DelayCommand(RoundsToSeconds(6), SetPLocalInt(oPC, "intSandBoxRound ", 5));
//DelayCommand(RoundsToSeconds(7), SetPLocalInt(oPC, "intSandBoxRound ", 6));
//DelayCommand(RoundsToSeconds(8), SetPLocalInt(oPC, "intSandBoxRound ", 7));
//DelayCommand(RoundsToSeconds(9), SetPLocalInt(oPC, "intSandBoxRound ", 8));
//DelayCommand(RoundsToSeconds(10), SetPLocalInt(oPC, "intSandBoxRound ", 9));
//DelayCommand(RoundsToSeconds(11), SetPLocalInt(oPC, "intSandBoxRound ", 10));

  object oTarget;
      object oSpawn;
    location lTarget;
  //CREATE NORTH DOOR
    oTarget = GetWaypointByTag("LOC_c23DoorNorth");
    lTarget = GetLocation(oTarget);
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_doors012", lTarget);

    //CREATE SOUTH DOOR
    oTarget = GetWaypointByTag("LOC_c23South");
    lTarget = GetLocation(oTarget);
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_doors012", lTarget);

    //Display door text.
    FloatingTextStringOnCreature("You hear a click as copperbound doors come roaring down in front of you and behind you.", oPC);

    //Display open trap slots text.
    DelayCommand(3.0, FloatingTextStringOnCreature("After a moment of silence there is the sound of stone slowly grating on stone.  Rows of 8 slots open near the ceiling in both walls.  Some dust trickles in from each.", oPC));

    //Start Sandbox trap.
    DelayCommand(6.0, FloatingTextStringOnCreature("There is a crackling and rushing sound as golden sand starts to pour rapidly through the holes.  ", oPC));

    //Create Will-o-the-wisp
    oTarget = GetWaypointByTag("c24Willow");
    lTarget = GetLocation(oTarget);
    DelayCommand(6.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "willowisp003", lTarget));

    //Create Dirt 1
    oTarget = GetWaypointByTag("c24SmDirt1");
    lTarget = GetLocation(oTarget);
    DelayCommand(6.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "zep_dirt02", lTarget));

    //Create Dirt 2
    oTarget = GetWaypointByTag("c24SmDirt2");
    lTarget = GetLocation(oTarget);
    DelayCommand(6.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "zep_dirt02", lTarget));

    //Create Dirt 3
    oTarget = GetWaypointByTag("c24SmDirt3");
    lTarget = GetLocation(oTarget);
    DelayCommand(6.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "zep_dirt02", lTarget));

    //Create Dirt 4
    oTarget = GetWaypointByTag("c24SmDirt4");
    lTarget = GetLocation(oTarget);
    DelayCommand(6.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "zep_dirt02", lTarget));

SetPLocalInt(oPC, "intSandBoxRound", 1);
SetPLocalInt(oPC, "intStartTrap", 2);
    }
 //SpawnScriptDebugger();

}
