//::///////////////////////////////////////////////
//:: Furious Assault
//:: NW_S2_FurAslt.nss
//:: Copyright (c) 2006 Obsidian Entertainment, Inc.
//:://////////////////////////////////////////////
/*
   * Attacks do max damage for the next 3 rounds.
   * User takes 10 points of damage at the end of
	 each round.
*/
//:://////////////////////////////////////////////
//:: Created By: Andrew Woo (AFW-OEI)
//:: Created On: 05/18/2006
//:://////////////////////////////////////////////
#include "jx_inc_magic"
#include "x2_inc_spellhook"

void mainSpell();
void main()
{
	AssignCommand(JXGetCaster(), mainSpell());
}

void mainSpell()
{
    if (!X2PreSpellCastCode())
    {
		// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        { JXPostSpellCastCode(); return; }
    }

	object oTarget	  = OBJECT_SELF;

	effect eMaxDamage = EffectMaxDamage();
	effect eDur		  = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
	effect eDoT		  = EffectDamage(10);

	effect eLink = EffectLinkEffects(eMaxDamage, eDur);
	eLink = SupernaturalEffect(eLink);

	SignalEvent(oTarget, EventSpellCastAt(oTarget, SPELLABILITY_FURIOUS_ASSAULT, FALSE));
    JXApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3));
	DelayCommand(RoundsToSeconds(1), JXApplyEffectToObject(DURATION_TYPE_INSTANT, eDoT, oTarget));
	DelayCommand(RoundsToSeconds(2), JXApplyEffectToObject(DURATION_TYPE_INSTANT, eDoT, oTarget));
	DelayCommand(RoundsToSeconds(3), JXApplyEffectToObject(DURATION_TYPE_INSTANT, eDoT, oTarget));

	JXPostSpellCastCode();
}
