//::///////////////////////////////////////////////
//:: Cure Critical Wounds
//:: NW_S0_CurCrWn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// As cure light wounds, except cure critical wounds
// cures 4d8 points of damage plus 1 point per
// caster level (up to +20).
*/
//:://////////////////////////////////////////////
//:: Created By: Noel Borstad
//:: Created On: Oct 18, 2000
//:://////////////////////////////////////////////
//:: VFX Pass By: Preston W, On: June 20, 2001
//:: Update Pass By: Preston W, On: July 26, 2001

#include "NW_I0_SPELLS"
#include "hos_alignment"
void main()
{
    object oMe=OBJECT_SELF;
    object oTarg=GetSpellTargetObject();
    effect eDmg=EffectDamage(d8(4));
    if (GetLocalString(oMe,"sTeamID")!=GetLocalString(oTarg,"sTeamID")&&GetRacialType(oTarg)!=RACIAL_TYPE_UNDEAD&&GetMaster(oTarg)!=oMe)
        AdjustAlignmentPartyProtected(oMe,ALIGNMENT_GOOD,1);
    if (GetLocalInt(oTarg,"nIsVampire")!=TRUE&&GetRacialType(oTarg)!=RACIAL_TYPE_UNDEAD&&!GetLocalInt(oTarg,"bUndead"))
       spellsCure(d8(4), 20, 32, VFX_IMP_SUNSTRIKE, VFX_IMP_HEALING_G, GetSpellId());
    else
       ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oTarg,1.0);

}