void main()
{
    switch( GetUserDefinedEventNumber() )
    {
    case 1007:  // DEATH
        {
            object oArea = GetArea( OBJECT_SELF );
            object oCreature = GetFirstObjectInArea( oArea );

            object oTag1 = GetObjectByTag("spectralhero1");
            string sTag1 = GetTag(oTag1);
            object oTag2 = GetObjectByTag("spectralhero2");
            string sTag2 = GetTag(oTag2);
            object oTag3 = GetObjectByTag("spectralhero3");
            string sTag3 = GetTag(oTag3);
            object oTag4 = GetObjectByTag("spectralhero4");
            string sTag4 = GetTag(oTag4);
            object oTag5 = GetObjectByTag("spectralhero5");
            string sTag5 = GetTag(oTag5);
            object oTag6 = GetObjectByTag("spectralhero6");
            string sTag6 = GetTag(oTag6);
            object oTag7 = GetObjectByTag("spectralhero7");
            string sTag7 = GetTag(oTag7);
            object oTag8 = GetObjectByTag("spectralhero8");
            string sTag8 = GetTag(oTag8);
            object oTag9 = GetObjectByTag("spectralhero9");
            string sTag9 = GetTag(oTag9);;
            object oTag10 = GetObjectByTag("spectralhero10");
            string sTag10 = GetTag(oTag10);
            object oTag11 = GetObjectByTag("spectralhero11");
            string sTag11 = GetTag(oTag11);
            object oTag12 = GetObjectByTag("spectralhero12");
            string sTag12 = GetTag(oTag12);

            int bFound = FALSE;
            while(GetIsObjectValid(oCreature))
            {
            if(GetTag(oCreature) == sTag1 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag2 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag3 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag4 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag5 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag6 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag7 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag8 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag9 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag10 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag11 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            if(GetTag(oCreature) == sTag12 && oCreature != OBJECT_SELF && !GetIsDead(oCreature))
            bFound = TRUE;

            oCreature = GetNextObjectInArea(oArea);
            }

            if( !bFound && !(GetLocalInt(oArea, "BOSSFIGHT") == 1))
            {
             SetLocalInt(oArea, "BOSSFIGHT", 1);
            object oLure = GetObjectByTag("WP_BOSS");
            location lLure = GetLocation(oLure);

            CreateObject(OBJECT_TYPE_CREATURE,"spectralfigure",lLure,FALSE);
            }
       }
   }
}
