//::///////////////////////////////////////////////
//:: Aura of Protection
//:: NW_S1_AuraProt.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Acts as a double strength Magic Circle against
    evil and a Minor Globe for those friends in
    the area.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: March 18, 2001
//:://////////////////////////////////////////////
#include "NW_I0_SPELLS"

#include "jx_inc_magic"
#include "x2_inc_spellhook"

void main()
{
	if (!X2PreSpellCastCode()) { JXPostSpellCastCode(); return; }


    //Declare major variables including Area of Effect Object
    object oTarget = JXGetSpellTargetObject();
    int nDuration = JXGetCasterLevel(OBJECT_SELF) / 2;
    int nMetaMagic = JXGetMetaMagicFeat();
    //Make sure duration does no equal 0
    if (nDuration < 1)
    {
        nDuration = 1;
    }
    //Create an instance of the AOE Object using the Apply Effect function
    JXApplyAreaEffectToObject(AOE_MOB_PROTECTION, oTarget, TurnsToSeconds(nDuration));

	JXPostSpellCastCode();
}
