
void main()

{

    object oTarget;
    object oSpawn;
    effect eVFX;

    // Get the creature who triggered this event.
    object oPC = GetLastKiller();

    // Only fire once.
    if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
        return;
    SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

    // Spawn "ctenmiir".
    eVFX = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
    oTarget = GetWaypointByTag("WP_ctenmiir");
    oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ctenmiir", GetLocation(oTarget));
    AssignCommand(oSpawn, ActionStartConversation(oPC));
    DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSpawn));

    AddJournalQuestEntry("Treasure Hunt", 3, oPC, TRUE, FALSE);

}


