//:://////////////////////////////////////////////////
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT7
/*
  Default OnDeath event handler for NPCs.

  Adjusts killer's alignment if appropriate and
  alerts allies to our death.
 */
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////

#include "x2_inc_compon"
#include "x0_i0_spawncond"

void main()
{
    object oKiller = GetLastKiller();
    int nAlign = GetAlignmentGoodEvil(oKiller);
    // Create appropriate gibs.
        object oGib = CreateObject(OBJECT_TYPE_PLACEABLE, "prop_holder", GetLocation(OBJECT_SELF));
        SetLocalObject(OBJECT_SELF, "gib", oGib);
        //DestroyObject(oGib, 595.0);

    // If we're a good/neutral commoner,
    // adjust the killer's alignment evil
    if (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL)
    {
        AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
        FloatingTextStringOnCreature("What an evil thing to do...", oKiller);
    }

ExecuteScript("prc_npc_death", OBJECT_SELF);
ExecuteScript("prc_pwondeath", OBJECT_SELF);
}
