Changes to nw_s0_ghoultch

:://///////
:: Ghoul Touch
:: NW_S0_GhoulTch.nss
:: Copyright (c) 2001 Bioware Corp.
:://////////
/*
The caster attempts a touch attack on a target
creature. If successful creature must save
or be paralyzed. Target exudes a stench that
causes all enemies to save or be stricken with
-2 Attack, Damage, Saves and Skill Checks for
1d6+2 rounds.
*/
:://////////
:: Created By: Preston Watamaniuk
:: Created On: Nov 7, 2001
:://////////

/* Georg 2003-09-11
- Put in melee touch attack check, as the fixed attack bonus is now calculated correctly
*/
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
#include "nw_i0_invocatns"

void main()
{

/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more

*/

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

// End of Spell Cast Hook

//Declare major variables including Area of Effect Object
effect eAOE = EffectAreaOfEffect(AOE_PER_FOGGHOUL);
int nSaveDC = GetSpellSaveDC();
effect eParal = EffectParalyze(nSaveDC, SAVING_THROW_FORT);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED);
effect eHit = EffectVisualEffect(VFX_HIT_SPELL_NECROMANCY);

effect eLink = EffectLinkEffects(eDur2, eDur);
eLink = EffectLinkEffects(eLink, eParal);

object oTarget = GetSpellTargetObject();
int nDuration = d6()+2;
int nMetaMagic = GetMetaMagicFeat();
Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDuration = 8;
Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDuration = nDuration + (nDuration/2); //Damage/Healing is +50%
}
else if(nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GHOUL_TOUCH));
//Make a touch attack to afflict target

// GZ: * GetSpellCastItem() == OBJECT_INVALID is used to prevent feedback from showing up when used as OnHitCastSpell property
if (TouchAttackMelee(oTarget,GetSpellCastItem() == OBJECT_INVALID)>0)
{
//SR and Saves
if(!MyResistSpell(OBJECT_SELF, oTarget) && !/*Fort Save*/ MySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_NEGATIVE))
{
//Create an instance of the AOE Object using the Apply Effect function
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHit, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, GetLocation(oTarget), RoundsToSeconds(nDuration));

/*////////////*/
// Draco Rayne: Added Eldritch Theurge Spellweave Ability
/*
//////////////*/

if (GetHasFeat(FEAT_ELDRITCH_SPELLWEAVE))
{
if ( nMetaMagic & METAMAGIC_INVOC_FRIGHTFUL_BLAST ) DoETMetaFrightfulBlast(OBJECT_SELF, oTarget);
if ( nMetaMagic & METAMAGIC_INVOC_DRAINING_BLAST ) DoETMetaDrainingBlast(OBJECT_SELF, oTarget);
}

}
}
}
}

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