#include "nw_i0_2q4luskan"
void main()
{

object oEO = GetEnteringObject();

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

object oWP00 = GetObjectByTag("WP_StoneBall00");
object oWP01 = GetObjectByTag("WP_StoneBall01");
object oWP02 = GetObjectByTag("WP_StoneBall02");
object oWP03 = GetObjectByTag("WP_StoneBall03");
object oWP04 = GetObjectByTag("WP_StoneBall04");
object oWP05 = GetObjectByTag("WP_StoneBall05");
object oWP06 = GetObjectByTag("WP_StoneBall06");
object oWP07 = GetObjectByTag("WP_StoneBall07");
object oWP08 = GetObjectByTag("WP_StoneBall08");
object oWP09 = GetObjectByTag("WP_StoneBall09");
object oWP10 = GetObjectByTag("WP_StoneBall10");
object oSound = GetNearestObjectByTag("StoneBallSound");
effect eShake = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);

if (DoOnce==TRUE) return;

if (GetIsPC(oEO))
 {
 SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
 ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eShake, GetLocation(oEO));
 SoundObjectPlay(oSound);
 CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball1", GetLocation(oWP00));
 DelayCommand(1.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball2", GetLocation(oWP01), FALSE));
 DelayCommand(2.0, FloatingTextStringOnCreature("Oh no!  It's a trap!", oEO));
 DelayCommand(1.75, DestroyObject(GetNearestObjectByTag("StoneBall1")));
 DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball1", GetLocation(oWP02), FALSE));
 DelayCommand(3.25, DestroyObject(GetNearestObjectByTag("StoneBall2")));
 DelayCommand(4.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball2", GetLocation(oWP03), FALSE));
 DelayCommand(4.75, DestroyObject(GetNearestObjectByTag("StoneBall1")));
 DelayCommand(6.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball1", GetLocation(oWP04), FALSE));
 DelayCommand(6.25, DestroyObject(GetNearestObjectByTag("StoneBall2")));
 DelayCommand(7.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball2", GetLocation(oWP05), FALSE));
 DelayCommand(7.75, DestroyObject(GetNearestObjectByTag("StoneBall1")));
 DelayCommand(9.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball1", GetLocation(oWP06), FALSE));
 DelayCommand(9.25, DestroyObject(GetNearestObjectByTag("StoneBall2")));
 DelayCommand(10.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball2", GetLocation(oWP07), FALSE));
 DelayCommand(10.75, DestroyObject(GetNearestObjectByTag("StoneBall1")));
 DelayCommand(12.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball1", GetLocation(oWP08), FALSE));
 DelayCommand(12.25, DestroyObject(GetNearestObjectByTag("StoneBall2")));
 DelayCommand(13.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball2", GetLocation(oWP09), FALSE));
 DelayCommand(13.75, DestroyObject(GetNearestObjectByTag("StoneBall1")));
 DelayCommand(15.0, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "stoneball1", GetLocation(oWP10), FALSE));
 DelayCommand(15.25, DestroyObject(GetNearestObjectByTag("StoneBall2"))); DelayCommand(3.25, DestroyObject(GetNearestObjectByTag("StoneBall2")));
//
 DelayCommand(16.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eShake, GetLocation(oWP10)));
 DelayCommand(16.5, PlaySound("sff_rainice"));
 DelayCommand(16.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM), GetLocation(oWP10)));
 DelayCommand(16.5, DestroyObject(GetNearestObjectByTag("StoneBall1"), 0.0));
 DelayCommand(18.0, DestroyObject(oSound, 0.0));
 DelayCommand(18.0, FloatingTextStringOnCreature("Whew!  It was only an illusion...", oEO));
 }
else return;
}

