void main()
{
    switch( GetUserDefinedEventNumber() )
    {
    case 1007:  // DEATH
    {
    object tv_1 = GetObjectByTag("WP_CAVE_GLAB");
    location lDest1 = GetLocation(tv_1);
    object oSummoner = GetObjectByTag("summoner");

    SetLocalInt(OBJECT_SELF, "duration", DURATION_TYPE_TEMPORARY);
    int duration = GetLocalInt(OBJECT_SELF, "duration");
    SetLocalInt(OBJECT_SELF, "vfx", VFX_FNF_SUMMON_GATE);
    int vfx = GetLocalInt(OBJECT_SELF, "vfx");
    effect eEffect = EffectVisualEffect(vfx);

    if (GetIsObjectValid(oSummoner))
    {
    ApplyEffectAtLocation(duration, eEffect, lDest1, 4.0);
    CreateObject(OBJECT_TYPE_CREATURE, "demon", lDest1, FALSE);
    }
    }
    }
}
