//::///////////////////////////////////////////////
//:: Lycanthrope Change
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Changes someone into a Yuan-ti when they are
    attacked.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 27, 2002
//:://////////////////////////////////////////////

#include "nw_i0_2q4luskan"

void main()
{
    // Make sure the were creature has a custom on spawn in with the line Custom User On Attacked being
    // commented in.  This becomes the Userdefined script.

    int nUser = GetUserDefinedEventNumber();
    if(nUser == 1005)
    {
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD), OBJECT_SELF);
        location lTarget = GetLocation(OBJECT_SELF);
        SetPlotFlag(OBJECT_SELF, FALSE);
        DestroyObject(OBJECT_SELF, 1.0);
        DelayCommand(1.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "doppleganger", lTarget));
    }
}

