int CheckPartyForItem(object oMember, string sItem);
int HasItem(object oCreature, string s);

void main()
{
object oObject=GetEnteringObject();
object oItem;

if (GetIsObjectValid(oObject)&&GetIsPC(oObject))

{
//SendMessageToPC(oObject,"checking you for the amulet");
//oItem=GetItemInSlot(INVENTORY_SLOT_NECK,oObject);

 if (CheckPartyForItem(oObject, "jw_am_cross"))


 //(GetTag(oItem)=="jw_am_cross")
 {
 //SendMessageToPC(oObject,"you have the amulet");
// SetLocalInt(GetObjectByTag("jw_invis_killer"),"safety",3);
 //DelayCommand(120.0,SetLocalInt(GetObjectByTag("jw_invis_killer"),"safety",1));
// FloatingTextStringOnCreature("The amulet glows",oObject);
 //ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20),oObject,120.0);
 }
 else
 {

SignalEvent(GetObjectByTag("jw_invis_killer"),EventUserDefined(100));

  }
}

}


int HasItem(object oCreature, string s)
{
    return  GetIsObjectValid(GetItemPossessedBy(oCreature, s));
}

int CheckPartyForItem(object oMember, string sItem)
{
    object oPartyMember = GetFirstFactionMember(oMember, TRUE);
    while (GetIsObjectValid(oPartyMember) == TRUE)
    {
        if (HasItem(oPartyMember, sItem)&&GetTag(GetArea(oPartyMember))=="TheCrypts")
{  FloatingTextStringOnCreature("The amulet glows",oPartyMember);
 ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20),oPartyMember,120.0);
            return TRUE;
            }
        oPartyMember = GetNextFactionMember(oMember, TRUE);
    }

    return FALSE;
}