Changes to nw_i0_invocatns

Eldritch Theurge
Update 10-16-2007: Not so many changes any more. Most has been moved to a seperate Eldritch Theurge file. This will make it easier to keep track of changes and merging it.

int DoEldritchBlast(object oCaster, object oTarget, int bCalledFromShape, int bDoTouchTest, int nDmgType, int nAllowReflexSave, int nIgnoreResists, int nHalfDmg, int nVFX)
{
// Default Blast w/no mods
int nMetaMagic = GetMetaMagicFeat();
int nHitVFX = VFX_INVOCATION_ELDRITCH_HIT; // default is Edlritch
//if ( nMetaMagic != METAMAGIC_NONE )
//if ( !(nMetaMagic & METAMAGIC_ELDRITCH_SHAPES) )

// adjust the VFX according to the essence
if ( nMetaMagic & METAMAGIC_INVOC_DRAINING_BLAST ) { nHitVFX = VFX_INVOCATION_DRAINING_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_FRIGHTFUL_BLAST ) { nHitVFX = VFX_INVOCATION_FRIGHTFUL_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_BESHADOWED_BLAST ) { nHitVFX = VFX_INVOCATION_BESHADOWED_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_BRIMSTONE_BLAST ) { nHitVFX = VFX_INVOCATION_BRIMSTONE_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_HELLRIME_BLAST ) { nHitVFX = VFX_INVOCATION_HELLRIME_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_BEWITCHING_BLAST ) { nHitVFX = VFX_INVOCATION_BEWITCHING_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_NOXIOUS_BLAST ) { nHitVFX = VFX_INVOCATION_NOXIOUS_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_VITRIOLIC_BLAST ) { nHitVFX = VFX_INVOCATION_VITRIOLIC_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_UTTERDARK_BLAST ) { nHitVFX = VFX_INVOCATION_UTTERDARK_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_HINDERING_BLAST ) { nHitVFX = VFX_INVOCATION_HINDERING_HIT; }
else if ( nMetaMagic & METAMAGIC_INVOC_BINDING_BLAST ) { nHitVFX = VFX_INVOCATION_BINDING_HIT; }

if(bDoTouchTest)
{
// AFW-OEI 02/20/2007: Eldritch Master adds +2 to the attack roll.
int nBonus = 0;
if (GetHasFeat(FEAT_EPIC_ELDRITCH_MASTER, oCaster))
{
nBonus = 2;
}

if ( TouchAttackRanged( oTarget, TRUE, nBonus ) == TOUCH_ATTACK_RESULT_MISS )
{
// Failed
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId(), TRUE));
return FALSE;
}
}

// Spell Effects not allowed to stack…
RemoveEffectsFromSpell(oTarget, GetSpellId());

effect eBeam = EffectBeam(nVFX, oCaster, BODY_NODE_HAND);
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster) == TRUE)
{
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId()));

int nDmg = GetEldritchBlastDmg(oCaster, oTarget, nAllowReflexSave, nIgnoreResists, nHalfDmg);

if ( nDmg > 0 ) // Make sure wasn't resisted
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId(), TRUE));

//Set damage effect
float fDelay = 0.0;
effect eDam = EffectDamage(nDmg, nDmgType);
effect eVis = EffectVisualEffect( nHitVFX );

//Apply the damage effect
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget);

if ((nDmgType==DAMAGE_TYPE_NEGATIVE)&&(GetRacialType(oTarget)==RACIAL_TYPE_UNDEAD))
{
DelayCommand( fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nDmg), oTarget) );

}
else
{
DelayCommand( fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget) );
}

// We only want to display the beam visual effect if the blast was NOT called from any of the Shape spells; otherwise, the shape will already have been displayed.
if ( !bCalledFromShape )
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.0);
}

return TRUE;
}
}
return FALSE;
}

int DoEldritchCombinedEffects(object oTarget, int bDoTouchTest, int nAllowReflexSave, int nHalfDmg)
{
int nMetaMagic = GetMetaMagicFeat();
if ( nMetaMagic & METAMAGIC_INVOC_DRAINING_BLAST ) { return DoEssenceDrainingBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_FRIGHTFUL_BLAST ) { return DoEssenceFrightfulBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_BESHADOWED_BLAST ) { return DoEssenceBeshadowedBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_BRIMSTONE_BLAST ) { return DoEssenceBrimstoneBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_HELLRIME_BLAST ) { return DoEssenceHellrimeBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_BEWITCHING_BLAST ) { return DoEssenceBewitchingBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_NOXIOUS_BLAST ) { return DoEssenceNoxiousBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_VITRIOLIC_BLAST ) { return DoEssenceVitriolicBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_UTTERDARK_BLAST ) { return DoEssenceUtterdarkBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_GREATREACH ) { return DoEssenceGreatreachSpellblast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }
else if ( nMetaMagic & METAMAGIC_INVOC_SPELLBLAST ) { return DoEssenceSpellblast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, nAllowReflexSave, nHalfDmg); }

else
{
// No extra effects
//SpeakString("DoEldritchCombinedEffects(…): No blast invocation."); // DEBUG!
return DoEldritchBlast(OBJECT_SELF, oTarget, TRUE, bDoTouchTest, DAMAGE_TYPE_MAGICAL, nAllowReflexSave, FALSE, nHalfDmg);
}
}

int DoEssenceUtterdarkBlast(object oCaster, object oTarget, int bCalledFromShape, int bDoTouchTest, int nAllowReflexSave, int nHalfDmg)
{
// First, do Base Effects:
if ( DoEldritchBlast(oCaster, oTarget, bCalledFromShape, bDoTouchTest, DAMAGE_TYPE_NEGATIVE, nAllowReflexSave, FALSE, nHalfDmg, VFX_INVOCATION_UTTERDARK_RAY) )
{
if(!MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC()))
{
effect eVis = EffectVisualEffect( VFX_DUR_SPELL_ENERGY_DRAIN );
effect eDrain = EffectNegativeLevel(2);
eDrain = SupernaturalEffect(eDrain);
effect eLink = EffectLinkEffects( eDrain, eVis );
if (!GetRacialType(oTarget)==RACIAL_TYPE_UNDEAD) ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
//ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oTarget, HoursToSeconds(1));
//ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
return TRUE;
}
}
return FALSE;
}

int DoShapeEldritchSpear()
{

//Declare major variables
object oTarget = GetSpellTargetObject();

int nMetaMagic = GetMetaMagicFeat();
if ( nMetaMagic & METAMAGIC_INVOC_DRAINING_BLAST ) { return DoEssenceDrainingBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_FRIGHTFUL_BLAST ) { return DoEssenceFrightfulBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_BESHADOWED_BLAST ) { return DoEssenceBeshadowedBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_BRIMSTONE_BLAST ) { return DoEssenceBrimstoneBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_HELLRIME_BLAST ) { return DoEssenceHellrimeBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_BEWITCHING_BLAST ) { return DoEssenceBewitchingBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_NOXIOUS_BLAST ) { return DoEssenceNoxiousBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_VITRIOLIC_BLAST ) { return DoEssenceVitriolicBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_UTTERDARK_BLAST ) { return DoEssenceUtterdarkBlast( OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_GREATREACH ) { return DoEssenceGreatreachSpellblast(OBJECT_SELF, oTarget, FALSE, TRUE ); }
else if ( nMetaMagic & METAMAGIC_INVOC_SPELLBLAST ) { return DoEssenceSpellblast(OBJECT_SELF, oTarget, FALSE, TRUE ); }

else
{
// No extra effects
//SpeakString("DoEldritchCombinedEffects(…): No blast invocation."); // DEBUG!
return DoEldritchBlast( OBJECT_SELF, oTarget, FALSE, TRUE );
}

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License