#include "NW_I0_SPELLS" #include "x2_inc_spellhook" void main() { /* Spellcast Hook Code Added 2003-06-20 by Georg 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_DARKNESS); location lTarget = GetSpellTargetLocation(); object oObject=GetSpellTargetObject(); int nDuration = GetCasterLevel(OBJECT_SELF); int nMetaMagic = GetMetaMagicFeat(); //Make sure duration does no equal 0 if (nDuration < 1) { nDuration = 1; } //Check Extend metamagic feat. if (nMetaMagic == METAMAGIC_EXTEND) { nDuration = nDuration *2; //Duration is +100% } float fDuration=IntToFloat(nDuration); if (!GetIsObjectValid(oObject)) { return; } int nSave=WillSave(oObject,12,SAVING_THROW_TYPE_NEGATIVE,OBJECT_SELF); if (nSave==0) { ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBlindness(),oObject,fDuration); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE),oObject,fDuration); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_DARKNESS),oObject,fDuration); } //if (nSave==1) // { // SendMessageToPC(OBJECT_SELF,GetName(oObject)+" resisted the darkness spell (DC 14)"); // } //if (nSave==-1) // { // SendMessageToPC(OBJECT_SELF,GetName(oObject)+" is immune to that spell"); // } }