#include "nw_i0_plot"

// Function to check combat status and despawn if not in combat
void DespawnIfNotInCombat(object oCreature)
{
    if (!GetIsInCombat(oCreature))
    {
        // Creature is not in combat, despawn it
        DestroyObject(oCreature);
    }
    else
    {
        // Creature is still in combat, check again after the next combat round
        DelayCommand(6.0, DespawnIfNotInCombat(oCreature)); // 6 seconds is a typical combat round duration
    }
}

// Main script for OnCombatRoundEnd event
void main()
{
    // Call the function to check combat status and despawn if not in combat
    DespawnIfNotInCombat(OBJECT_SELF);
}
