//::///////////////////////////////////////////////
//:: lycan_userdef.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
    OnUserDefined scrip for Wererats.

*/
//:://////////////////////////////////////////////
//:: Created By:  Jaysyn
//:: Created On:  20220730
//:://////////////////////////////////////////////

const int EVENT_USER_DEFINED_PRESPAWN = 1510;
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
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();
    int nChange = GetLocalInt(OBJECT_SELF,"NW_LYCANTHROPE");
    effect eShape = EffectPolymorph(POLYMORPH_TYPE_WERERAT); //Use one of the polymorph constants here (WERE_RAT, WERE_WOLF or WERE_CAT)
    effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
    if(nUser == 1005 && nChange == 0)
    {
        DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eShape, OBJECT_SELF));
        DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(OBJECT_SELF)));
        SetLocalInt(OBJECT_SELF, "NW_LYCANTHROPE", 1);
    }

    if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT
    {

    }
    else if(nUser == EVENT_PERCEIVE) // PERCEIVE
    {

    }
    else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT
    {

    }
    else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE
    {

    }
    else if(nUser == EVENT_ATTACKED) // ATTACKED
    {

    }
    else if(nUser == EVENT_DAMAGED) // DAMAGED
    {

    }
    else if(nUser == 1007) // DEATH  - do not use for critical code, does not fire reliably all the time
    {

    }
    else if(nUser == EVENT_DISTURBED) // DISTURBED
    {

    }
    else if (nUser == EVENT_USER_DEFINED_PRESPAWN)
    {

    }
    else if (nUser == EVENT_USER_DEFINED_POSTSPAWN)
    {

    }

//:: Execute the PRC NPC OnUserDef script
    ExecuteScript("prc_npc_userdef", OBJECT_SELF);

}