/*   Script generated by
Lilac Soul's NWN Script Generator, v. 1.6

For download info, please visit:
http://www.lilacsoul.revility.com    */

//Put this OnEnter
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

AssignCommand(oPC, ClearAllActions());

AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT));

AssignCommand(oPC, ActionMoveToObject(GetObjectByTag("LOC_c42mirror")));

object oTarget;
oTarget = oPC;

if (!WillSave(oPC, 14))
    {

    effect eEffect;
    eEffect = EffectParalyze();

    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 180.0f);

    object oTarget;
    oTarget = GetObjectByTag("MirrorGlassc42");

    DelayCommand(2.0,AssignCommand(oPC, SetFacingPoint(GetPosition(oTarget))));
    oTarget = oPC;

    eEffect = EffectParalyze();

    DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 20.0f));

    DelayCommand(6.0, FloatingTextStringOnCreature("You stare into the mirror and watch as a duplicate of yourself steps out to do battle with you.", oPC));

    eEffect = EffectDamage(4, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL);

    DelayCommand(12.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC));

    DelayCommand(12.0, FloatingTextStringOnCreature("The battle is purely in your mind, but some of the damage you sustain is real.", oPC));
    return;
    }
    FloatingTextStringOnCreature("You stare into the mirror and watch as a duplicate of yourself steps out to do battle with you.  You shake your head and be sheer force of will dispell the illusion.", oPC);
}

