#include "nw_i0_2q4luskan"
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 1.6

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

//Put this OnUsed
void main()
{

object oPC = GetLastOpenedBy();

if (!GetIsPC(oPC)) return;


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

if (DoOnce==FALSE)
{

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

FloatingTextStringOnCreature("Dust stirs up into clouds around the bones as the knit back together.  Within moments the dead figure rises.  With a wave of his arms a swarm of bats appear in the chamber.  Then he attacks.", oPC);

object oTarget;
location lTarget;
oTarget = GetWaypointByTag("loc_Tloques");

lTarget = GetLocation(oTarget);

DelayCommand(1.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "vampire001", lTarget));

effect eEffect;
eEffect = EffectVisualEffect(VFX_FNF_HORRID_WILTING);

DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, lTarget));

oTarget = GetWaypointByTag("loc_bats1");

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge002", lTarget));

oTarget = GetWaypointByTag("loc_bats1");

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = GetWaypointByTag("loc_bats1");

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = GetWaypointByTag("loc_bats2");

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = GetWaypointByTag("loc_bats1");

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = oPC;

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = oPC;

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = GetWaypointByTag("loc_bats3");

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = oPC;

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge002", lTarget));

oTarget = oPC;

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = oPC;

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));

oTarget = oPC;

lTarget = GetLocation(oTarget);

DelayCommand(3.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "stirge001", lTarget));
 }

if (DoOnce==TRUE)
    {
    OpenInventory(oPC, OBJECT_SELF);
    }
}
