//:://///////////////////////////////////////////// //:: Bolt: Level Drain //:: NW_S1_BltLvlDr //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Creature must make a ranged touch attack to hit the intended target. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: May 11 , 2001 //:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws //::////////////////////////////////////////////// #include "NW_I0_SPELLS" #include "prc_inc_spells" //#include "wm_include" void main() { //if (WildMagicOverride()) { return; } //:: Declare major variables object oNPC = OBJECT_SELF; object oTarget = PRCGetSpellTargetObject(); int nHD = GetHitDice(oNPC); int nCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oNPC); effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); effect eBolt = EffectNegativeLevel(1); int bSpecial = GetLocalInt(OBJECT_SELF,"SPECIAL_DRAIN_BOLT"); if ( bSpecial ) eBolt = EffectNegativeLevel(4); int nDC = 10 +nCHAMod+ (nHD/2); int nCount = nHD/5; if (nCount == 0) { nCount = 1; } int nDamage = d6(nCount); //Fire cast spell at event for the specified target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_LEVEL_DRAIN)); //Make a saving throw check int nResult = TouchAttackRanged(oTarget); if (nResult) { if ( bSpecial ) { int nHeal = 40; if ( nResult == 2 && !GetIsImmune(oTarget,IMMUNITY_TYPE_CRITICAL_HIT) && bSpecial ) { eBolt = EffectNegativeLevel(8); nHeal *= 2; } effect eHeal = EffectHeal(nHeal); effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_L); if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_NEGATIVE_LEVEL) ) { ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,OBJECT_SELF); ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,OBJECT_SELF); } } //Make a saving throw check if (!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) && TouchAttackRanged(oTarget)) { //eBolt = LEVEL DRAIN EFFECT eBolt = SupernaturalEffect(eBolt); //Apply the VFX impact and effects ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); } } }