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

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

//Put this on action taken in the conversation editor
void main()
{

object oPC = GetPCSpeaker();

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

DestroyObject(oTarget, 0.0);

oTarget = GetObjectByTag("c21block4");

DestroyObject(oTarget, 0.0);

oTarget = GetObjectByTag("c21block1");

DestroyObject(oTarget, 0.0);

oTarget = GetObjectByTag("c21block2");

DestroyObject(oTarget, 0.0);

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

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("Loc_North2");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("Loc_North3");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("Loc_North4");

lTarget = GetLocation(oTarget);

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

oTarget = GetWaypointByTag("c21_BlockPushedNorth");

lTarget = GetLocation(oTarget);

//only do the jump if the location is valid.
//though not flawless, we just check if it is in a valid area.
//the script will stop if the location isn't valid - meaning that
//nothing put after the teleport will fire either.
//the current location won't be stored, either

if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;

AssignCommand(oPC, ClearAllActions());

AssignCommand(oPC, ActionJumpToLocation(lTarget));

}
