//
// Well holy shit. Apparantly it repeatedly moves/attacks the exiting object.
// And I had so hoped to be able to do a reverse of the Drogan's Lab-Bounce-Back-Script.
// Bleh.
//
void main()
{
    object oPC = GetEnteringObject();
    object oKaleth = GetObjectByTag("Kaleth_End");
    effect eOuch = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_EVIL);

    if (oKaleth != OBJECT_INVALID && GetIsPC(oPC) == TRUE && GetLocalInt(OBJECT_SELF, "DoneOnce") != TRUE) {
        AssignCommand(oPC, ClearAllActions());
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(50, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_NORMAL), oPC);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eOuch, oPC);
        DelayCommand(1.0, AssignCommand(oKaleth, ActionSpeakString("The worship of my mistress is painful, is it not?")));
        DelayCommand(1.2, AssignCommand(oPC, ClearAllActions()));
        DelayCommand(1.8, AssignCommand(oKaleth, ActionStartConversation(oPC)));
        SetLocalInt(OBJECT_SELF, "DoneOnce", TRUE);
    }
    if (oKaleth != OBJECT_INVALID && GetIsPC(oPC) == TRUE && GetLocalInt(OBJECT_SELF, "DoneOnce") == TRUE) {
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(50, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_NORMAL), oPC);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eOuch, oPC);
    }
}

