From 68ca3a56ca647690ac9ec5e850cf1d3d616e91ee Mon Sep 17 00:00:00 2001 From: Jaysyn904 <68194417+Jaysyn904@users.noreply.github.com> Date: Fri, 23 Jan 2026 00:03:47 -0500 Subject: [PATCH] 2026/01/22 Update 2 Mechanatrixes always fail saves vs elecricity. Incorporated most creature ability scripts into the PRC8 & updated them to use PRCEffect(), SPApplyEffectToObject(), etc. Updated prc_inc_breath to use PRCEffectDamage() Updated several spell scripts to use PRCEffectDamage(). --- nwn/nwnprc/trunk/include/prc_inc_breath.nss | 84 ++++++------ nwn/nwnprc/trunk/include/prc_inc_spells.nss | 4 + nwn/nwnprc/trunk/scripts/prc_reservaoe.nss | 2 +- nwn/nwnprc/trunk/scripts/prc_reservtch.nss | 2 +- nwn/nwnprc/trunk/spells/nw_s1_bltacid.nss | 55 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_bltcharm.nss | 44 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltchrdr.nss | 45 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltcold.nss | 54 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_bltcondr.nss | 45 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltconf.nss | 42 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltdaze.nss | 42 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltdeath.nss | 37 +++++ nwn/nwnprc/trunk/spells/nw_s1_bltdexdr.nss | 44 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltdisese.nss | 68 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_bltdomn.nss | 45 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltfire.nss | 56 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_bltintdr.nss | 44 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltknckd.nss | 39 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltlightn.nss | 56 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_bltlvldr.nss | 45 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltparal.nss | 41 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltpoison.nss | 118 ++++++++++++++++ nwn/nwnprc/trunk/spells/nw_s1_bltshards.nss | 53 +++++++ nwn/nwnprc/trunk/spells/nw_s1_bltslow.nss | 40 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltstrdr.nss | 44 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltstun.nss | 41 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltweb.nss | 42 ++++++ nwn/nwnprc/trunk/spells/nw_s1_bltwisdr.nss | 44 ++++++ nwn/nwnprc/trunk/spells/nw_s1_coneacid.nss | 66 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_conecold.nss | 66 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_conedisea.nss | 89 ++++++++++++ nwn/nwnprc/trunk/spells/nw_s1_coneelec.nss | 69 ++++++++++ nwn/nwnprc/trunk/spells/nw_s1_conefire.nss | 69 ++++++++++ nwn/nwnprc/trunk/spells/nw_s1_conepois.nss | 128 +++++++++++++++++ nwn/nwnprc/trunk/spells/nw_s1_conesonic.nss | 66 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulschrdr.nss | 62 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulscold.nss | 58 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulscondr.nss | 61 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsdeath.nss | 53 +++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsdexdr.nss | 62 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsdis.nss | 73 ++++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsdrwn.nss | 6 +- nwn/nwnprc/trunk/spells/nw_s1_pulselec.nss | 58 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsfire.nss | 58 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsholy.nss | 78 +++++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsintdr.nss | 62 +++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulslvldr.nss | 51 +++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsneg.nss | 76 +++++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulspois.nss | 129 ++++++++++++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsspore.nss | 43 ++++++ nwn/nwnprc/trunk/spells/nw_s1_pulsstrdr.nss | 60 ++++++++ nwn/nwnprc/trunk/spells/nw_s1_pulswind.nss | 47 +++++++ nwn/nwnprc/trunk/spells/nw_s1_pulswisdr.nss | 57 ++++++++ nwn/nwnprc/trunk/spells/nw_s2_turndead.nss | 6 +- nwn/nwnprc/trunk/spells/sp_acidicfire.nss | 24 ++-- nwn/nwnprc/trunk/spells/sp_alcfrost.nss | 10 +- nwn/nwnprc/trunk/spells/sp_alcspark.nss | 12 +- nwn/nwnprc/trunk/spells/sp_biledrop.nss | 8 +- nwn/nwnprc/trunk/spells/sp_curse_watera.nss | 15 +- nwn/nwnprc/trunk/spells/sp_forcemissiles.nss | 8 +- nwn/nwnprc/trunk/spells/sp_leonals_roar.nss | 2 +- nwn/nwnprc/trunk/spells/sp_rain_ffishC.nss | 2 +- nwn/nwnprc/trunk/spells/sp_scrmngfl.nss | 4 +- nwn/nwnprc/trunk/spells/sp_throw_ep.nss | 4 +- nwn/nwnprc/trunk/spells/x0_s0_spikegroen.nss | 8 +- nwn/nwnprc/trunk/spells/x0_s0_spikegrohb.nss | 8 +- nwn/nwnprc/trunk/spells/x0_s3_holy.nss | 16 +-- nwn/nwnprc/trunk/spells/x2_s1_beholdray.nss | 4 +- nwn/nwnprc/trunk/spells/x2_s3_flamingd.nss | 2 +- .../users/Tenjac/spells/prc_axiowater.nss | 13 +- 70 files changed, 2951 insertions(+), 118 deletions(-) create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltacid.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltcharm.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltchrdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltcold.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltcondr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltconf.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltdaze.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltdeath.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltdexdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltdisese.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltdomn.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltfire.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltintdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltknckd.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltlightn.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltlvldr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltparal.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltpoison.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltshards.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltslow.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltstrdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltstun.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltweb.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_bltwisdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_coneacid.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_conecold.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_conedisea.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_coneelec.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_conefire.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_conepois.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_conesonic.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulschrdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulscold.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulscondr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsdeath.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsdexdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsdis.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulselec.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsfire.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsholy.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsintdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulslvldr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsneg.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulspois.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsspore.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulsstrdr.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulswind.nss create mode 100644 nwn/nwnprc/trunk/spells/nw_s1_pulswisdr.nss diff --git a/nwn/nwnprc/trunk/include/prc_inc_breath.nss b/nwn/nwnprc/trunk/include/prc_inc_breath.nss index 094029c5..70e1b34c 100644 --- a/nwn/nwnprc/trunk/include/prc_inc_breath.nss +++ b/nwn/nwnprc/trunk/include/prc_inc_breath.nss @@ -168,8 +168,8 @@ void ExhaleImmunity(object oDragon, int nDamageType, location lTargetArea) effect eLink = EffectLinkEffects(eImmune, eVis2); //apply effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eImmune, oTarget, fDuration)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eImmune, oTarget, fDuration)); } } @@ -603,15 +603,15 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_NONE)) { //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POISON_L), oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSickened(), oTarget, 12.0)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POISON_L), oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSickened(), oTarget, 12.0)); } //1 round otherwise else { //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POISON_L), oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSickened(), oTarget, 6.0)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POISON_L), oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSickened(), oTarget, 6.0)); } } @@ -659,16 +659,16 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_NONE)) { //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nSlowDuration))); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nSlowDuration))); SetLocalInt(oTarget, "AffectedByBreath", TRUE); } //Adept breath effect still lasts for one round if save is made else if(IsAdeptBreath()) { //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(1))); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(1))); SetLocalInt(oTarget, "AffectedByBreath", TRUE); } } @@ -685,10 +685,10 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F //Set Damage and VFX - Bioware Gold used VFX_IMP_REDUCE_ABILITY_SCORE originally eVis = EffectVisualEffect(VFX_IMP_POISON_L); //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); //adept breath penalty only last 4 rounds on failure, gold breath has no duration if(IsAdeptBreath()) - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAbilityDecrease(ABILITY_STRENGTH, BreathUsed.nDiceNumber), oTarget, 24.0)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAbilityDecrease(ABILITY_STRENGTH, BreathUsed.nDiceNumber), oTarget, 24.0)); else DelayCommand(fDelay, ApplyAbilityDamage(oTarget, ABILITY_STRENGTH, BreathUsed.nDiceNumber, DURATION_TYPE_PERMANENT, TRUE)); SetLocalInt(oTarget, "AffectedByBreath", TRUE); @@ -699,8 +699,8 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F //Set Damage and VFX - Bioware Gold used VFX_IMP_REDUCE_ABILITY_SCORE originally eVis = EffectVisualEffect(VFX_IMP_POISON_L); //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAbilityDecrease(ABILITY_STRENGTH, BreathUsed.nDiceNumber), oTarget, 12.0)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAbilityDecrease(ABILITY_STRENGTH, BreathUsed.nDiceNumber), oTarget, 12.0)); SetLocalInt(oTarget, "AffectedByBreath", TRUE); } bCanCling = TRUE; @@ -729,7 +729,7 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_NONE)) { //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nParalDuration))); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nParalDuration))); SetLocalInt(oTarget, "AffectedByBreath", TRUE); } } @@ -749,8 +749,8 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F eBreath = EffectNegativeLevel(nLevelDrain); eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); SetLocalInt(oTarget, "AffectedByBreath", TRUE); } } @@ -769,11 +769,11 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F if (nAdjustedDamage > 0) { //Set Damage and VFX - eBreath = EffectDamage(nAdjustedDamage, BreathUsed.nDamageType); + eBreath = PRCEffectDamage(oTarget, nAdjustedDamage, BreathUsed.nDamageType); eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE); //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); SetLocalInt(oTarget, "AffectedByBreath", TRUE); bCanCling = TRUE; } @@ -830,8 +830,8 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F if(GetLocalInt(oTarget, "DragonWard")) nAdjustedDamage -= 40; - effect eBreath1 = EffectDamage(nAdjustedDamage/2, DAMAGE_TYPE_FIRE); - effect eBreath2 = EffectDamage(nAdjustedDamage/2, DAMAGE_TYPE_SONIC); + effect eBreath1 = PRCEffectDamage(oTarget, nAdjustedDamage/2, DAMAGE_TYPE_FIRE); + effect eBreath2 = PRCEffectDamage(oTarget, nAdjustedDamage/2, DAMAGE_TYPE_SONIC); eBreath = EffectLinkEffects(eBreath1, eBreath2); eVis = EffectVisualEffect(chVisual); } @@ -839,12 +839,12 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F { if(GetLocalInt(oTarget, "DragonWard")) nAdjustedDamage -= 20; - eBreath = EffectDamage(nAdjustedDamage, BreathUsed.nDamageType); + eBreath = PRCEffectDamage(oTarget, nAdjustedDamage, BreathUsed.nDamageType); eVis = EffectVisualEffect(nVisualType); } //Apply the VFX impact and effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); SetLocalInt(oTarget, "AffectedByBreath", TRUE); bCanCling = TRUE; } @@ -859,7 +859,7 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nKnockdownDC, SAVING_THROW_TYPE_NONE)) { effect eWindblown = EffectKnockdown(); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eWindblown, oTarget, 6.0)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eWindblown, oTarget, 6.0)); } } } @@ -879,10 +879,10 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F //Warforged are only healed for half if(GetIsWarforged(oTarget)) nHeal /= 2; - eBreath = EffectHeal(nHeal); + eBreath = PRCEffectHeal(nHeal, oTarget); effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_S); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHealVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHealVis, oTarget)); } //Entangling Exhalation @@ -896,22 +896,22 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F //only does damage if the original breath did damage if(BreathUsed.nDamageType > 0) { - effect eDamage = EffectDamage(d6(), BreathUsed.nDamageType); + effect eDamage = PRCEffectDamage(oTarget, d6(), BreathUsed.nDamageType); switch(nEntangleRounds) { case 4: - DelayCommand(fDelay + RoundsToSeconds(4), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(fDelay + RoundsToSeconds(4), SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); case 3: - DelayCommand(fDelay + RoundsToSeconds(3), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(fDelay + RoundsToSeconds(3), SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); case 2: - DelayCommand(fDelay + RoundsToSeconds(2), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(fDelay + RoundsToSeconds(2), SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); case 1: - DelayCommand(fDelay + RoundsToSeconds(1), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); break; + DelayCommand(fDelay + RoundsToSeconds(1), SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); break; } } //but always entangles if the breath affects the target - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEntangled, oTarget, RoundsToSeconds(nEntangleRounds))); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEntangled, oTarget, RoundsToSeconds(nEntangleRounds))); } DeleteLocalInt(oTarget, "AffectedByBreath"); @@ -937,18 +937,18 @@ void ApplyBreath(struct breath BreathUsed, location lTargetArea, int bLinger = F { if(nAdjustedDamage < 3) nCount = BreathUsed.nClinging; - effect eBreath1 = EffectDamage(nAdjustedDamage/2, DAMAGE_TYPE_FIRE); - effect eBreath2 = EffectDamage(nAdjustedDamage/2, DAMAGE_TYPE_SONIC); + effect eBreath1 = PRCEffectDamage(oTarget, nAdjustedDamage/2, DAMAGE_TYPE_FIRE); + effect eBreath2 = PRCEffectDamage(oTarget, nAdjustedDamage/2, DAMAGE_TYPE_SONIC); effect eAfterBreath = EffectLinkEffects(eBreath1, eBreath2); - DelayCommand(fNewDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eAfterBreath, oTarget)); + DelayCommand(fNewDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAfterBreath, oTarget)); } else { if(nAdjustedDamage < 2) nCount = BreathUsed.nClinging; - effect eAfterBreath = EffectDamage(nAdjustedDamage, BreathUsed.nDamageType); - DelayCommand(fNewDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eAfterBreath, oTarget)); + effect eAfterBreath = PRCEffectDamage(oTarget, nAdjustedDamage, BreathUsed.nDamageType); + DelayCommand(fNewDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAfterBreath, oTarget)); } - DelayCommand(fNewDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fNewDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } } @@ -988,3 +988,5 @@ void PRCPlayDragonBattleCry() PlayVoiceChat(VOICE_CHAT_BATTLECRY2); } } + +//:: void main() {} \ No newline at end of file diff --git a/nwn/nwnprc/trunk/include/prc_inc_spells.nss b/nwn/nwnprc/trunk/include/prc_inc_spells.nss index f32e1d4c..768f9a27 100644 --- a/nwn/nwnprc/trunk/include/prc_inc_spells.nss +++ b/nwn/nwnprc/trunk/include/prc_inc_spells.nss @@ -1072,6 +1072,10 @@ int PRCMySavingThrow(int nSavingThrow, object oTarget, int nDC, int nSaveType = nDC -= 1 + (GetHitDice(oTarget) / 5); else if(GetHasFeat(FEAT_HARD_ELEC, oTarget)) nDC -= 2; + + //:: Mechanatrix always fail saves vs electricity. + if(GetRacialType(oTarget) == RACIAL_TYPE_MECHANATRIX) + return 0; } else if(nSaveType == SAVING_THROW_TYPE_SONIC) { diff --git a/nwn/nwnprc/trunk/scripts/prc_reservaoe.nss b/nwn/nwnprc/trunk/scripts/prc_reservaoe.nss index 8ccfe5f3..56eaf9d0 100644 --- a/nwn/nwnprc/trunk/scripts/prc_reservaoe.nss +++ b/nwn/nwnprc/trunk/scripts/prc_reservaoe.nss @@ -54,7 +54,7 @@ void DoAOE(effect eVis, effect eExplode, int nSaveType, int nDamage, int nDamage //Apply explosion visual if needed if (nShape == SHAPE_SPHERE) ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eExplode, lTarget, 1.0); - else if (nShape == SHAPE_SPELLCYLINDER) ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eExplode, oBeamTarget, 1.0); + else if (nShape == SHAPE_SPELLCYLINDER) SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eExplode, oBeamTarget, 1.0); //Remove the created beam target object if it exists if (GetResRef(oBeamTarget) == "prc_invisobj") DestroyObject(oBeamTarget, 3.0); diff --git a/nwn/nwnprc/trunk/scripts/prc_reservtch.nss b/nwn/nwnprc/trunk/scripts/prc_reservtch.nss index 8ece1d70..f6cf9b67 100644 --- a/nwn/nwnprc/trunk/scripts/prc_reservtch.nss +++ b/nwn/nwnprc/trunk/scripts/prc_reservtch.nss @@ -32,7 +32,7 @@ void main() eEffect = EffectDeaf(); eEffect = SupernaturalEffect(eEffect); - eVis = EffectVisualEffect(VFX_IMP_ACID_S); + eVis = EffectVisualEffect(VFX_IMP_SONIC); eVisFail = EffectVisualEffect(VFX_IMP_STUN); if (!GetLocalInt(oPC, "ClapOfThunderBonus")) diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltacid.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltacid.nss new file mode 100644 index 00000000..27d40b61 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltacid.nss @@ -0,0 +1,55 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Acid +//:: NW_S1_BltAcid +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Reflex or Will save is + needed to halve damage or avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = nHD /2; + 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_ACID)); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + //nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ACID); + //Make a ranged touch attack + int nTouch = PRCDoRangedTouchAttack(oTarget); + if(nTouch > 0) + { + if(nTouch == 2) + { + nDamage *= 2; + } + //Set damage effect + eBolt = EffectDamage(nDamage, DAMAGE_TYPE_ACID); + if(nDamage > 0) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltcharm.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltcharm.nss new file mode 100644 index 00000000..ad2dacdd --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltcharm.nss @@ -0,0 +1,44 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Charm +//:: NW_S1_BltCharm +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Reflex or Will save is + needed to halve damage or avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_CHARM); + effect eBolt = EffectCharmed(); + eBolt = GetScaledEffect(eBolt, oTarget); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + nCount = PRCGetScaledDuration(nCount, oTarget); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_CHARM)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltchrdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltchrdr.nss new file mode 100644 index 00000000..d9263b79 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltchrdr.nss @@ -0,0 +1,45 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Charisma Drain +//:: NW_S1_BltChrDr +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Fortitude save is + needed to avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = (nHD /3); + 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_ABILITY_DRAIN_CHARISMA)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + eBolt = EffectAbilityDecrease(ABILITY_CHARISMA, nCount); + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltcold.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltcold.nss new file mode 100644 index 00000000..f8e92e77 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltcold.nss @@ -0,0 +1,54 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Cold +//:: NW_S1_BltCold +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Reflex or Will save is + needed to halve damage or avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = nHD /2; + 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_COLD)); + //Make a ranged touch attack + int nTouch = PRCDoRangedTouchAttack(oTarget); + if(nTouch > 0) + { + if(nTouch == 2) + { + nDamage *= 2; + } + //Set damage effect + eBolt = EffectDamage(nDamage, DAMAGE_TYPE_COLD); + if(nDamage > 0) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltcondr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltcondr.nss new file mode 100644 index 00000000..7d6c7f46 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltcondr.nss @@ -0,0 +1,45 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Constitution Drain +//:: NW_S1_BltConDr +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Fort save is + needed to avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = (nHD /3); + 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_ABILITY_DRAIN_CONSTITUTION)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + eBolt = EffectAbilityDecrease(ABILITY_CONSTITUTION, nCount); + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltconf.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltconf.nss new file mode 100644 index 00000000..a24b89ce --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltconf.nss @@ -0,0 +1,42 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Confuse +//:: NW_S1_BltConf +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis2 = EffectVisualEffect(VFX_IMP_CONFUSION_S); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eBolt = EffectConfused(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + eLink = EffectLinkEffects(eLink, eVis); + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_CONFUSE)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltdaze.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltdaze.nss new file mode 100644 index 00000000..5ec74a1a --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltdaze.nss @@ -0,0 +1,42 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Daze +//:: NW_S1_BltDaze +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eBolt = EffectDazed(); + eBolt = GetScaledEffect(eBolt, oTarget); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + eLink = EffectLinkEffects(eLink, eVis); + + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + nCount = PRCGetScaledDuration(nCount, oTarget); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_DAZE)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltdeath.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltdeath.nss new file mode 100644 index 00000000..6f07e861 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltdeath.nss @@ -0,0 +1,37 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Death +//:: NW_S1_BltDeath +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eBolt = EffectDeath(); + int nDC = 10 + (nHD/2); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_DEATH)); + //Make a saving throw check + if(PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget); + //ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltdexdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltdexdr.nss new file mode 100644 index 00000000..81a66cd2 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltdexdr.nss @@ -0,0 +1,44 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Dexterity Drain +//:: NW_S1_BltDexDr +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = (nHD /3); + 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_ABILITY_DRAIN_DEXTERITY)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + eBolt = EffectAbilityDecrease(ABILITY_DEXTERITY, nCount); + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltdisese.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltdisese.nss new file mode 100644 index 00000000..d69a69e6 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltdisese.nss @@ -0,0 +1,68 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Disease +//:: NW_S1_BltDisease +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to infect + the target with a disease. The disease used + is chosen based upon the racial type of the + caster. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nRacial = GetRacialType(OBJECT_SELF); + int nDisease; + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_DISEASE)); + + //Here we use the racial type of the attacker to select an + //appropriate disease. + switch (nRacial) + { + case RACIAL_TYPE_VERMIN: + nDisease = DISEASE_VERMIN_MADNESS; + break; + case RACIAL_TYPE_UNDEAD: + nDisease = DISEASE_FILTH_FEVER; + break; + case RACIAL_TYPE_OUTSIDER: + if(GetTag(OBJECT_SELF) == "NW_SLAADRED") + { + nDisease = DISEASE_RED_SLAAD_EGGS; + } + else + { + nDisease = DISEASE_DEMON_FEVER; + } + break; + case RACIAL_TYPE_MAGICAL_BEAST: + nDisease = DISEASE_SOLDIER_SHAKES; + break; + case RACIAL_TYPE_ABERRATION: + nDisease = DISEASE_BLINDING_SICKNESS; + break; + default: + nDisease = DISEASE_SOLDIER_SHAKES; + break; + } + //Assign effect and chosen disease + effect eBolt = EffectDisease(nDisease); + //Make the ranged touch attack. + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltdomn.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltdomn.nss new file mode 100644 index 00000000..f36e8045 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltdomn.nss @@ -0,0 +1,45 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Dominated +//:: NW_S1_BltDomn +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S); + effect eBolt = EffectDominated(); + eBolt = GetScaledEffect(eBolt, oTarget); + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED); + eBolt = GetScaledEffect(eBolt, oTarget); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + eLink = EffectLinkEffects(eLink, eVis2); + + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + nCount = PRCGetScaledDuration(nCount, oTarget); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_DOMINATE)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltfire.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltfire.nss new file mode 100644 index 00000000..e14d4efc --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltfire.nss @@ -0,0 +1,56 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Fire +//:: NW_S1_BoltFire +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Reflex or Will save is + needed to halve damage or avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = nHD /2; + 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_FIRE)); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + //nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_FIRE); + //Make a ranged touch attack + int nTouch = PRCDoRangedTouchAttack(oTarget); + if(nTouch > 0) + { + if(nTouch == 2) + { + nDamage *= 2; + } + //Set damage effect + eBolt = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_FIRE); + if(nDamage > 0) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltintdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltintdr.nss new file mode 100644 index 00000000..34aa7e0f --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltintdr.nss @@ -0,0 +1,44 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Intelligence Drain +//:: NW_S1_BltIntDr +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = (nHD /3); + 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_ABILITY_DRAIN_INTELLIGENCE)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + eBolt = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nCount); + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget, RoundsToSeconds(nHD)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltknckd.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltknckd.nss new file mode 100644 index 00000000..63ade5d4 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltknckd.nss @@ -0,0 +1,39 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Knockdown +//:: NW_S1_BltKnckD +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. Reflex or Will save is + needed to halve damage or avoid effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_SONIC); + effect eBolt = EffectKnockdown(); + int nDC = 10 + (nHD/2); + effect eDam = PRCEffectDamage(oTarget, d6(), DAMAGE_TYPE_BLUDGEONING); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_KNOCKDOWN)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, RoundsToSeconds(3)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltlightn.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltlightn.nss new file mode 100644 index 00000000..6a7f99ba --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltlightn.nss @@ -0,0 +1,56 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Lightning +//:: NW_S1_BltLightn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Does 1d6 per level to a single target. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 10, 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF,BODY_NODE_HAND); + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = nHD /2; + 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_LIGHTNING)); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + //nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ELECTRICITY); + //Make a ranged touch attack + int nTouch = PRCDoRangedTouchAttack(oTarget); + if(nTouch > 0) + { + if(nTouch == 2) + { + nDamage *= 2; + } + //Set damage effect + eBolt = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_ELECTRICAL); + if(nDamage > 0) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget); + } + } + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, oTarget, 1.8); +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltlvldr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltlvldr.nss new file mode 100644 index 00000000..33542603 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltlvldr.nss @@ -0,0 +1,45 @@ +//:://///////////////////////////////////////////// +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt = EffectNegativeLevel(1); + int nDC = 10 + (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 + if (PRCDoRangedTouchAttack(oTarget)) + { + //eBolt = LEVEL DRAIN EFFECT + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltparal.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltparal.nss new file mode 100644 index 00000000..6da9877f --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltparal.nss @@ -0,0 +1,41 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Paralyze +//:: NW_S1_BltParal +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eBolt = EffectParalyze(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + eLink = EffectLinkEffects(eLink, eVis); + + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + nCount = PRCGetScaledDuration(nCount, oTarget); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_PARALYZE)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltpoison.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltpoison.nss new file mode 100644 index 00000000..aba7fd59 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltpoison.nss @@ -0,0 +1,118 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Poison +//:: NW_S1_BltPoison.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Must make a ranged touch attack. If successful + the target is struck down with poison that + scales with level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 22, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + effect ePoison; + int nPoison; + int nRacial = MyPRCGetRacialType(OBJECT_SELF); + int nHD = GetHitDice(OBJECT_SELF); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_POISON)); + + //Determine the poison type based on the Racial Type and HD + // June 3/04: Bugfix for some screwy if statements. + switch (nRacial) + { + case RACIAL_TYPE_OUTSIDER: + if (nHD <= 9) + { + nPoison = POISON_QUASIT_VENOM; + } + else if (nHD < 13) + { + nPoison = POISON_BEBILITH_VENOM; + } + else //if (nHD >= 13) //if statement not actually needed... + { + nPoison = POISON_PIT_FIEND_ICHOR; + } + break; + case RACIAL_TYPE_VERMIN: + if (nHD < 3) + { + nPoison = POISON_TINY_SPIDER_VENOM; + } + else if (nHD < 6) + { + nPoison = POISON_SMALL_SPIDER_VENOM; + } + else if (nHD < 9) + { + nPoison = POISON_MEDIUM_SPIDER_VENOM; + } + else if (nHD < 12) + { + nPoison = POISON_LARGE_SPIDER_VENOM; + } + else if (nHD < 15) + { + nPoison = POISON_HUGE_SPIDER_VENOM; + } + else if (nHD < 18) + { + nPoison = POISON_GARGANTUAN_SPIDER_VENOM; + } + else //if (nHD >= 18) + { + nPoison = POISON_COLOSSAL_SPIDER_VENOM; + } + break; + default: + if (nHD < 3) + { + nPoison = POISON_NIGHTSHADE; + } + else if (nHD < 6) + { + nPoison = POISON_BLADE_BANE; + } + else if (nHD < 9) + { + nPoison = POISON_BLOODROOT; + } + else if (nHD < 12) + { + nPoison = POISON_LARGE_SPIDER_VENOM; + } + else if (nHD < 15) + { + nPoison = POISON_LICH_DUST; + } + else if (nHD < 18) + { + nPoison = POISON_DARK_REAVER_POWDER; + } + else //if (nHD >= 18 ) + { + nPoison = POISON_BLACK_LOTUS_EXTRACT; + } + + break; + } + //Make a ranged touch attack + if (PRCDoRangedTouchAttack (oTarget)) + { + ePoison = EffectPoison(nPoison); + //Apply effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltshards.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltshards.nss new file mode 100644 index 00000000..04d659f5 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltshards.nss @@ -0,0 +1,53 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Shards +//:: NW_S1_BltShard +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = nHD /2; + 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_SHARDS)); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + //nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC); + //Make a ranged touch attack + int nTouch = PRCDoRangedTouchAttack(oTarget); + if(nTouch > 0) + { + if(nTouch == 2) + { + nDamage *= 2; + } + //Set damage effect + eBolt = EffectDamage(nDamage, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_PLUS_ONE); + if(nDamage > 0) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget); + } + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltslow.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltslow.nss new file mode 100644 index 00000000..72161726 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltslow.nss @@ -0,0 +1,40 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Slow +//:: NW_S1_BltSlow +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature must make a ranged touch attack to hit + the intended target. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: June 18 , 2001 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_SLOW); + effect eBolt = EffectSlow(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_SLOW)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltstrdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltstrdr.nss new file mode 100644 index 00000000..50f19734 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltstrdr.nss @@ -0,0 +1,44 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Strength Drain +//:: NW_S1_BltStrDr +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = (nHD /3); + 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_ABILITY_DRAIN_STRENGTH)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + eBolt = EffectAbilityDecrease(ABILITY_STRENGTH, nCount); + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltstun.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltstun.nss new file mode 100644 index 00000000..17a54ec3 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltstun.nss @@ -0,0 +1,41 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Stun +//:: NW_S1_BltStun +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_STUN); + effect eBolt = EffectStunned(); + eBolt = GetScaledEffect(eBolt, oTarget); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBolt, eDur); + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + nCount = PRCGetScaledDuration(nCount, oTarget); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_STUN)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltweb.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltweb.nss new file mode 100644 index 00000000..b33554a6 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltweb.nss @@ -0,0 +1,42 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Web +//:: NW_S1_BltWeb +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Glues a single target to the ground with + sticky strands of webbing. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 28, 2002 +//:: Updated On: July 15, 2003 Georg Zoeller - Removed saving throws +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" +#include "x2_inc_switches" + +void main() +{ + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_DUR_WEB); + effect eStick = EffectEntangle(); + effect eLink = EffectLinkEffects(eVis, eStick); + + int nDC = 10 + (nHD/2); + int nCount = (nHD + 1) / 2; + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_BOLT_WEB)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + if( !GetHasFeat(FEAT_WOODLAND_STRIDE, oTarget) && GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) != TRUE ) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nCount)); + } + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_bltwisdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_bltwisdr.nss new file mode 100644 index 00000000..1462861d --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_bltwisdr.nss @@ -0,0 +1,44 @@ +//:://///////////////////////////////////////////// +//:: Bolt: Wisdom Drain +//:: NW_S1_BltWisDr +//:: 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 "prc_inc_spells" +#include "prc_inc_sp_tch" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oTarget = PRCGetSpellTargetObject(); + int nHD = GetHitDice(OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBolt; + int nDC = 10 + (nHD/2); + int nCount = (nHD /3); + 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_ABILITY_DRAIN_WISDOM)); + //Make a saving throw check + if (PRCDoRangedTouchAttack(oTarget)) + { + eBolt = EffectAbilityDecrease(ABILITY_WISDOM, nCount); + eBolt = SupernaturalEffect(eBolt); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBolt, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_coneacid.nss b/nwn/nwnprc/trunk/spells/nw_s1_coneacid.nss new file mode 100644 index 00000000..7d7d1eb5 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_coneacid.nss @@ -0,0 +1,66 @@ +//:://///////////////////////////////////////////// +//:: Cone: Acid +//:: NW_S1_ConeAcid +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A cone of damage eminated from the monster. Does + a set amount of damage based upon the creatures HD + and can be halved with a Reflex Save. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + int nHD = GetHitDice(OBJECT_SELF); + int nDamage; + int nLoop = nHD / 3; + int nDC = 10 + (nHD/2); + float fDelay; + if(nLoop == 0) + { + nLoop = 1; + } + //Calculate the damage + for (nLoop; nLoop > 0; nLoop--) + { + nDamage = nDamage + d6(2); + } + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + effect eCone; + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_ACID)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, GetSpellSaveDC(),SAVING_THROW_TYPE_ACID); + //Set damage effect + eCone = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_ACID); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget)); + } + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_conecold.nss b/nwn/nwnprc/trunk/spells/nw_s1_conecold.nss new file mode 100644 index 00000000..24707051 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_conecold.nss @@ -0,0 +1,66 @@ +//:://///////////////////////////////////////////// +//:: Cone: Cold +//:: NW_S1_ConeCold +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A cone of damage eminated from the monster. Does + a set amount of damage based upon the creatures HD + and can be halved with a Reflex Save. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + int nHD = GetHitDice(OBJECT_SELF); + int nDamage; + int nDice = nHD / 3; + int nDC = 10 + (nHD/2); + float fDelay; + + if(nDice == 0) + { + nDice = 1; + } + nDice *= 2; + + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + effect eCone; + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_COLD)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = d6(nDice); + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD); + //Set damage effect + eCone = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_COLD); + + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_conedisea.nss b/nwn/nwnprc/trunk/spells/nw_s1_conedisea.nss new file mode 100644 index 00000000..110d4f10 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_conedisea.nss @@ -0,0 +1,89 @@ +//:://///////////////////////////////////////////// +//:: Cone: Disease +//:: NW_S1_ConeDisea +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature spits out a cone of disease that cannot + be avoided unless a Reflex save is made. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 22, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nRacial = MyPRCGetRacialType(OBJECT_SELF); + int nDisease; + //Determine the disease type based on the Racial Type and HD + switch (nRacial) + { + case RACIAL_TYPE_OUTSIDER: + nDisease = DISEASE_DEMON_FEVER; + break; + case RACIAL_TYPE_VERMIN: + nDisease = DISEASE_VERMIN_MADNESS; + break; + case RACIAL_TYPE_UNDEAD: + if(nHD <= 3) + { + nDisease = DISEASE_ZOMBIE_CREEP; + } + else if (nHD > 3 && nHD <= 10) + { + nDisease = DISEASE_GHOUL_ROT; + } + else if(nHD > 10) + { + nDisease = DISEASE_MUMMY_ROT; + } + default: + if(nHD <= 3) + { + nDisease = DISEASE_MINDFIRE; + } + else if (nHD > 3 && nHD <= 10) + { + nDisease = DISEASE_RED_ACHE; + } + else if(nHD > 10) + { + nDisease = DISEASE_SHAKES; + } + + + break; + } + //Set disease effect + effect eCone = EffectDisease(nDisease); + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_DISEASE)); + //Get the delay time + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget)); + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE); + + } +} + + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_coneelec.nss b/nwn/nwnprc/trunk/spells/nw_s1_coneelec.nss new file mode 100644 index 00000000..a9e90feb --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_coneelec.nss @@ -0,0 +1,69 @@ +//:://///////////////////////////////////////////// +//:: Cone: Lightning +//:: NW_S1_ConeElec +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A cone of damage eminates from the monster. Does + a set amount of damage based upon the creatures HD + and can be halved with a Reflex Save. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11, 2001 +//::////////////////////////////////////////////// +//:: Updated Georg Z, 2003-09-02: fixed cone not visible if no damage is done +#include "NW_I0_SPELLS" +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + //Declare major variables + int nHD = GetHitDice(OBJECT_SELF); + int nDamage; + int nLoop = nHD / 3; + int nDC = 10 + (nHD/2); + float fDelay; + if(nLoop == 0) + { + nLoop = 1; + } + //Calculate the damage + for (nLoop; nLoop > 0; nLoop--) + { + nDamage = nDamage + d6(2); + } + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF,BODY_NODE_HAND); + effect eCone; + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_LIGHTNING)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSpellSaveDC(), SAVING_THROW_TYPE_ELECTRICITY); + //Set damage effect + eCone = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_ELECTRICAL); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,0.5); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_conefire.nss b/nwn/nwnprc/trunk/spells/nw_s1_conefire.nss new file mode 100644 index 00000000..d3d7be1f --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_conefire.nss @@ -0,0 +1,69 @@ +//:://///////////////////////////////////////////// +//:: Cone: Fire +//:: NW_S1_ConeFire +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A cone of damage eminated from the monster. Does + a set amount of damage based upon the creatures HD + and can be halved with a Reflex Save. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11, 2001 +//::////////////////////////////////////////////// +//:: Updated By: Andrew Nobbs +//:: Updated On: FEb 26, 2003 +//:: Note: Changed the faction check to GetIsEnemy +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + int nHD = GetHitDice(OBJECT_SELF); + int nDamage; + int nLoop = nHD / 3; + int nDC = 10 + (nHD/2); + float fDelay; + if(nLoop == 0) + { + nLoop = 1; + } + //Calculate the damage + for (nLoop; nLoop > 0; nLoop--) + { + nDamage = nDamage + d6(2); + } + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + effect eCone; + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_FIRE)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE); + //Set damage effect + eCone = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_FIRE); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_conepois.nss b/nwn/nwnprc/trunk/spells/nw_s1_conepois.nss new file mode 100644 index 00000000..82127e83 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_conepois.nss @@ -0,0 +1,128 @@ +//:://///////////////////////////////////////////// +//:: Cone: Poison +//:: NW_S1_ConePois +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature spits out a cone of poison that cannot + be avoided unless a Reflex save is made. Creatures + who fail there save are struck with Wyvern Poison +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 22, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + (nHD/2); + int nRacial = MyPRCGetRacialType(OBJECT_SELF); + int nPoison; + //Determine the poison type based on the Racial Type and HD + switch (nRacial) + { + case RACIAL_TYPE_OUTSIDER: + if (nHD <= 9) + { + nPoison = POISON_QUASIT_VENOM; + } + else if (nHD < 13) + { + nPoison = POISON_BEBILITH_VENOM; + } + else //if (nHD >= 13) + { + nPoison = POISON_PIT_FIEND_ICHOR; + } + break; + case RACIAL_TYPE_VERMIN: + if (nHD < 3) + { + nPoison = POISON_TINY_SPIDER_VENOM; + } + else if (nHD < 6) + { + nPoison = POISON_SMALL_SPIDER_VENOM; + } + else if (nHD < 9) + { + nPoison = POISON_MEDIUM_SPIDER_VENOM; + } + else if (nHD < 12) + { + nPoison = POISON_LARGE_SPIDER_VENOM; + } + else if (nHD < 15) + { + nPoison = POISON_HUGE_SPIDER_VENOM; + } + else if (nHD < 18) + { + nPoison = POISON_GARGANTUAN_SPIDER_VENOM; + } + else //if (nHD >= 18) + { + nPoison = POISON_COLOSSAL_SPIDER_VENOM; + } + break; + default: + if (nHD < 3) + { + nPoison = POISON_NIGHTSHADE; + } + else if (nHD < 6) + { + nPoison = POISON_BLADE_BANE; + } + else if (nHD < 9) + { + nPoison = POISON_BLOODROOT; + } + else if (nHD < 12) + { + nPoison = POISON_LARGE_SPIDER_VENOM; + } + else if (nHD < 15) + { + nPoison = POISON_LICH_DUST; + } + else if (nHD < 18) + { + nPoison = POISON_DARK_REAVER_POWDER; + } + else //if (nHD >= 18 ) + { + nPoison = POISON_BLACK_LOTUS_EXTRACT; + } + + break; + } + effect eCone = EffectPoison(nPoison); + effect eVis = EffectVisualEffect(VFX_IMP_POISON_S); + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget) ; + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_POISON)); + //Get the delay time + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eCone, oTarget)); + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE); + } +} + + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_conesonic.nss b/nwn/nwnprc/trunk/spells/nw_s1_conesonic.nss new file mode 100644 index 00000000..0e2c22b5 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_conesonic.nss @@ -0,0 +1,66 @@ +//:://///////////////////////////////////////////// +//:: Cone: Sonic +//:: NW_S1_ConeSonic +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A cone of damage eminated from the monster. Does + a set amount of damage based upon the creatures HD + and can be halved with a Reflex Save. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 11, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" +#include "prc_add_spell_dc" + +void main() +{ + //Declare major variables + int nHD = GetHitDice(OBJECT_SELF); + int nDamage; + int nLoop = nHD / 3; + int nDC = 10 + (nHD/2); + float fDelay; + if(nLoop == 0) + { + nLoop = 1; + } + //Calculate the damage + for (nLoop; nLoop > 0; nLoop--) + { + nDamage = nDamage + d6(2); + } + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + effect eCone; + effect eVis = EffectVisualEffect(VFX_IMP_SONIC); + + oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_CONE_SONIC)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSpellSaveDC(), DAMAGE_TYPE_SONIC); + //Set damage effect + eCone = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SONIC); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCone, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulschrdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulschrdr.nss new file mode 100644 index 00000000..05378f69 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulschrdr.nss @@ -0,0 +1,62 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Charisma Drain +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = GetHitDice(OBJECT_SELF)/5; + if (nDamage == 0) + { + nDamage = 1; + } + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_CHARISMA)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Make a saving throw check + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Set the Ability mod and change to supernatural effect + eHowl = EffectAbilityDecrease(ABILITY_CHARISMA, nDamage); + eHowl = SupernaturalEffect(eHowl); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get first target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulscold.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulscold.nss new file mode 100644 index 00000000..1f06ad17 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulscold.nss @@ -0,0 +1,58 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Cold +//:: NW_S1_PulsCold +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage; + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eHowl; + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_COLD); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_COLD)); + //Roll the damage + nDamage = d6(GetHitDice(OBJECT_SELF)); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + eHowl = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_COLD); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulscondr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulscondr.nss new file mode 100644 index 00000000..05b833a8 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulscondr.nss @@ -0,0 +1,61 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Constitution Drain +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "NW_I0_SPELLS" +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = GetHitDice(OBJECT_SELF)/5; + if (nDamage == 0) + { + nDamage = 1; + } + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_CONSTITUTION)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Make a saving throw check + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Set the Ability mod and change to supernatural effect + eHowl = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDamage); + eHowl = SupernaturalEffect(eHowl); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get first target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsdeath.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsdeath.nss new file mode 100644 index 00000000..8df6a2aa --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsdeath.nss @@ -0,0 +1,53 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Death +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "NW_I0_SPELLS" +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eHowl = EffectDeath(); + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DEATH)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay)) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + //DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsdexdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsdexdr.nss new file mode 100644 index 00000000..9009f359 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsdexdr.nss @@ -0,0 +1,62 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Dexterity Drain +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "NW_I0_SPELLS" +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = GetHitDice(OBJECT_SELF)/5; + if (nDamage == 0) + { + nDamage = 1; + } + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_DEXTERITY)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Make a saving throw check + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Set the Ability mod and change to supernatural effect + eHowl = EffectAbilityDecrease(ABILITY_DEXTERITY, nDamage); + eHowl = SupernaturalEffect(eHowl); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get first target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsdis.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsdis.nss new file mode 100644 index 00000000..905d1a1d --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsdis.nss @@ -0,0 +1,73 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Disease +//:: NW_S1_PulsDis +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of disease spreads out from the creature + and infects all those within 10ft +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = d6(GetHitDice(OBJECT_SELF)); + int nRacial = MyPRCGetRacialType(OBJECT_SELF); + int nDisease; + float fDelay; + effect eDisease; + effect ePulse = EffectVisualEffect(266); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePulse, GetLocation(OBJECT_SELF)); + + //Determine the disease type based on the Racial Type + switch (nRacial) + { + case RACIAL_TYPE_VERMIN: + nDisease = DISEASE_VERMIN_MADNESS; + break; + case RACIAL_TYPE_UNDEAD: + nDisease = DISEASE_FILTH_FEVER; + break; + case RACIAL_TYPE_OUTSIDER: + nDisease = DISEASE_DEMON_FEVER; + break; + case RACIAL_TYPE_MAGICAL_BEAST: + nDisease = DISEASE_SOLDIER_SHAKES; + break; + case RACIAL_TYPE_ABERRATION: + nDisease = DISEASE_BLINDING_SICKNESS; + break; + default: + nDisease = DISEASE_MINDFIRE; + break; + } + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DISEASE)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + eDisease = EffectDisease(nDisease); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsdrwn.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsdrwn.nss index 3b770542..840ad6ba 100644 --- a/nwn/nwnprc/trunk/spells/nw_s1_pulsdrwn.nss +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsdrwn.nss @@ -32,9 +32,9 @@ void Drown(object oTarget) if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 20) == FALSE) { //Apply the VFX impact and damage effect - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); //Set damage effect to kill the target - ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget); } } @@ -42,7 +42,7 @@ void Drown(object oTarget) void main () { int nDamage = GetCurrentHitPoints() / 2; - ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDamage(nDamage), OBJECT_SELF); + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, PRCEffectDamage(OBJECT_SELF, nDamage), OBJECT_SELF); //Declare major variables object oTarget; int bSave = FALSE; diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulselec.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulselec.nss new file mode 100644 index 00000000..c6a2c543 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulselec.nss @@ -0,0 +1,58 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Lightning +//:: NW_S0_CallLghtn.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within 10ft of the creature take + 1d6 per HD up to 10d6 +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 22, 2001 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage; + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + effect eHowl = EffectVisualEffect(VFX_IMP_PULSE_COLD); + DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eHowl, GetLocation(OBJECT_SELF))); + + effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF,BODY_NODE_CHEST); + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_LIGHTNING)); + //Roll the damage + nDamage = d6(nHD); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + eHowl = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_ELECTRICAL); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget, 0.5)); + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsfire.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsfire.nss new file mode 100644 index 00000000..c9efde62 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsfire.nss @@ -0,0 +1,58 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Fire +//:: NW_S1_PulsFire +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage; + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + effect eHowl; + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_FIRE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_FIRE)); + //Roll the damage + nDamage = d6(nHD); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_FIRE); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + eHowl = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_FIRE); + if(nDamage > 0) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsholy.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsholy.nss new file mode 100644 index 00000000..eabb511a --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsholy.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Holy +//:: NW_S1_PulsHoly +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. Undead are damaged, allies are healed. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage; + float fDelay; + effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M); + effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + effect eHowl; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_HOLY); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Roll the amount to heal or damage + nDamage = d4(nHD); + //If the target is not undead + if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + //Make a faction check + if(oTarget != OBJECT_SELF) + { + if(GetIsFriend(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY, FALSE)); + //Set heal effect + eHowl = EffectHeal(nDamage); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + else + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_DIVINE); + //Set damage effect + eHowl = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE) ; + if(nDamage > 0) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY)); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsintdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsintdr.nss new file mode 100644 index 00000000..9bb158cd --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsintdr.nss @@ -0,0 +1,62 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Intelligence Drain +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "NW_I0_SPELLS" +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = GetHitDice(OBJECT_SELF)/5; + if (nDamage == 0) + { + nDamage = 1; + } + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_INTELLIGENCE)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Make a saving throw check + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Set the Ability mod and change to supernatural effect + eHowl = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nDamage); + eHowl = SupernaturalEffect(eHowl); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get first target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulslvldr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulslvldr.nss new file mode 100644 index 00000000..807831a9 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulslvldr.nss @@ -0,0 +1,51 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Level Drain +//:: NW_S1_PulsLvlDr +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetLocation(OBJECT_SELF)); + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + fDelay = GetSpellEffectDelay(GetLocation(OBJECT_SELF), oTarget)/20; + //Make a saving throw check + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Apply the VFX impact and effects + eHowl = EffectNegativeLevel(1); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsneg.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsneg.nss new file mode 100644 index 00000000..13f98463 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsneg.nss @@ -0,0 +1,76 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Negative +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. Undead are healed. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage; + float fDelay; + effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M); + effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Roll the amount to heal or damage + nDamage = d4(nHD); + //If the target is undead + if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + //Make a faction check + if(GetIsFriend(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY, FALSE)); + //Set heal effect + eHowl = EffectHeal(nDamage); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + else + { + if(!GetIsReactionTypeFriendly(oTarget) && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE); + //Set damage effect + eHowl = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_NEGATIVE); + if(nDamage > 0) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_HOLY)); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + } + } + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulspois.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulspois.nss new file mode 100644 index 00000000..59a94a7f --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulspois.nss @@ -0,0 +1,129 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Poison +//:: NW_S1_PulsPois +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. All who make a reflex save are not + poisoned. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 23, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = d6(GetHitDice(OBJECT_SELF)); + int nRacial = GetRacialType(OBJECT_SELF); + int nHD = GetHitDice(OBJECT_SELF); + int nPoison; + float fDelay; + effect ePoison; + + //Determine the poison type based on the Racial Type and HD + switch (nRacial) + { + case RACIAL_TYPE_OUTSIDER: + if (nHD <= 9) + { + nPoison = POISON_QUASIT_VENOM; + } + else if (nHD < 13) + { + nPoison = POISON_BEBILITH_VENOM; + } + else //if (nHD >= 13) + { + nPoison = POISON_PIT_FIEND_ICHOR; + } + break; + case RACIAL_TYPE_VERMIN: + if (nHD < 3) + { + nPoison = POISON_TINY_SPIDER_VENOM; + } + else if (nHD < 6) + { + nPoison = POISON_SMALL_SPIDER_VENOM; + } + else if (nHD < 9) + { + nPoison = POISON_MEDIUM_SPIDER_VENOM; + } + else if (nHD < 12) + { + nPoison = POISON_LARGE_SPIDER_VENOM; + } + else if (nHD < 15) + { + nPoison = POISON_HUGE_SPIDER_VENOM; + } + else if (nHD < 18) + { + nPoison = POISON_GARGANTUAN_SPIDER_VENOM; + } + else// if (nHD >= 18) + { + nPoison = POISON_COLOSSAL_SPIDER_VENOM; + } + break; + default: + if (nHD < 3) + { + nPoison = POISON_NIGHTSHADE; + } + else if (nHD < 6) + { + nPoison = POISON_BLADE_BANE; + } + else if (nHD < 9) + { + nPoison = POISON_BLOODROOT; + } + else if (nHD < 12) + { + nPoison = POISON_LARGE_SPIDER_VENOM; + } + else if (nHD < 15) + { + nPoison = POISON_LICH_DUST; + } + else if (nHD < 18) + { + nPoison = POISON_DARK_REAVER_POWDER; + } + else //if (nHD >= 18 ) + { + nPoison = POISON_BLACK_LOTUS_EXTRACT; + } + break; + } + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_POISON)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + ePoison = EffectPoison(nPoison); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsspore.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsspore.nss new file mode 100644 index 00000000..bec813b6 --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsspore.nss @@ -0,0 +1,43 @@ +//:://///////////////////////////////////////////// +//:: Vrock Spores +//:: NW_S1_PulsSpore +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of disease spreads out from the creature + and infects all those within 10ft +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 8, 2002 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + float fDelay; + effect eDisease; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NATURE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_DISEASE)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + eDisease = EffectDisease(DISEASE_SOLDIER_SHAKES); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDisease, oTarget)); + } + } + //Get next target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulsstrdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulsstrdr.nss new file mode 100644 index 00000000..d5053adf --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulsstrdr.nss @@ -0,0 +1,60 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Strength Drain +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = GetHitDice(OBJECT_SELF)/5; + if (nDamage == 0) + { + nDamage = 1; + } + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != OBJECT_SELF) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_STRENGTH)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Make a saving throw check + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Set the Ability mod and change to supernatural effect + eHowl = EffectAbilityDecrease(ABILITY_STRENGTH, nDamage); + eHowl = SupernaturalEffect(eHowl); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Get first target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulswind.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulswind.nss new file mode 100644 index 00000000..6d5b69de --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulswind.nss @@ -0,0 +1,47 @@ +//:://///////////////////////////////////////////// +//:: Pulse Whirlwind +//:: NW_S1_PulsWind +//:: Copyright (c) 2001 Bioware Corp. +//:://///////////////////////////////////////////// +/* + All those that fail a save of DC 14 are knocked + down by the elemental whirlwind. + + * made this make the knockdown last 2 rounds instead of 1 + * it will now also do d3(hitdice/2) damage +*/ +//:://///////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 8, 2002 +//:://///////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + effect eDown = EffectKnockdown(); + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_WIND); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + int nDamage = GetHitDice(OBJECT_SELF) /2; + effect eDam; + //Get first target in spell area + while(GetIsObjectValid(oTarget)) + { + eDam = PRCEffectDamage(oTarget, d3(nDamage), DAMAGE_TYPE_SLASHING); + + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Make a saving throw check + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 14)) + { + //Apply the VFX impact and effects + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDown, oTarget, RoundsToSeconds(2)); + DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam,oTarget)); + } + //Get next target in spell area + } + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF)); + } +} diff --git a/nwn/nwnprc/trunk/spells/nw_s1_pulswisdr.nss b/nwn/nwnprc/trunk/spells/nw_s1_pulswisdr.nss new file mode 100644 index 00000000..6b1cb60b --- /dev/null +++ b/nwn/nwnprc/trunk/spells/nw_s1_pulswisdr.nss @@ -0,0 +1,57 @@ +//:://///////////////////////////////////////////// +//:: Pulse: Wisdom Drain +//:: NW_S1_PulsDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A wave of energy emanates from the creature which affects + all within 10ft. Damage can be reduced by half for all + damaging variants. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 14, 2000 +//::////////////////////////////////////////////// +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + int nDamage = GetHitDice(OBJECT_SELF)/5; + if (nDamage == 0) + { + nDamage = 1; + } + float fDelay; + int nHD = GetHitDice(OBJECT_SELF); + int nDC = 10 + nHD; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eHowl; + effect eImpact = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, OBJECT_SELF); + //Get first target in spell area + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_PULSE_ABILITY_DRAIN_WISDOM)); + //Determine effect delay + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20; + //Make a saving throw check + if(!/*FortSave*/PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay)) + { + //Set the Ability mod and change to supernatural effect + eHowl = EffectAbilityDecrease(ABILITY_WISDOM, nDamage); + eHowl = SupernaturalEffect(eHowl); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eHowl, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + //Get first target in spell area + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(OBJECT_SELF)); + } +} + diff --git a/nwn/nwnprc/trunk/spells/nw_s2_turndead.nss b/nwn/nwnprc/trunk/spells/nw_s2_turndead.nss index 5cf905bc..fd78e46f 100644 --- a/nwn/nwnprc/trunk/spells/nw_s2_turndead.nss +++ b/nwn/nwnprc/trunk/spells/nw_s2_turndead.nss @@ -177,7 +177,7 @@ void main() nTargetRace = MyPRCGetRacialType(oTest); if(nTargetRace == RACIAL_TYPE_UNDEAD && nTurningMaxHD >= GetHitDiceForTurning(oTest, nTurnType, nTargetRace)) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d8(GetEssentiaInvestedFeat(OBJECT_SELF, FEAT_AZURE_TURNING)), DAMAGE_TYPE_DIVINE), oTest); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTest, d8(GetEssentiaInvestedFeat(OBJECT_SELF, FEAT_AZURE_TURNING)), DAMAGE_TYPE_DIVINE), oTest); } //move to next test @@ -287,7 +287,7 @@ void main() && nTargetRace == RACIAL_TYPE_UNDEAD && (GetHasFeat(FEAT_EXALTED_TURNING)) || GetPersistantLocalInt(OBJECT_SELF, "VoPFeat"+IntToString(FEAT_EXALTED_TURNING))) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d6(3), DAMAGE_TYPE_DIVINE), oTest); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTest, d6(3), DAMAGE_TYPE_DIVINE), oTest); } //Check for Holy Fire @@ -295,7 +295,7 @@ void main() { int nFire = nTurningMaxHD / 2; int nHoly = nTurningMaxHD - nFire; - effect eDam = EffectLinkEffects(EffectDamage(DAMAGE_TYPE_DIVINE, nHoly), EffectDamage(DAMAGE_TYPE_FIRE, nFire)); + effect eDam = EffectLinkEffects(PRCEffectDamage(oTest, DAMAGE_TYPE_DIVINE, nHoly), PRCEffectDamage(oTest, DAMAGE_TYPE_FIRE, nFire)); SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTest); } } diff --git a/nwn/nwnprc/trunk/spells/sp_acidicfire.nss b/nwn/nwnprc/trunk/spells/sp_acidicfire.nss index 4a06553c..4946772f 100644 --- a/nwn/nwnprc/trunk/spells/sp_acidicfire.nss +++ b/nwn/nwnprc/trunk/spells/sp_acidicfire.nss @@ -81,23 +81,23 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing } //Set damage effect - effect eDam = EffectDamage(nDam, nDamageType); + effect eDam = PRCEffectDamage(oTarget, nDam, nDamageType); //Apply the MIRV and damage effect // * only damage enemies - if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE,OBJECT_SELF) ) + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) ) { // * must be the correct racial type (only used with Holy Water) if ((nRacialType != RACIAL_TYPE_ALL) && (nRacialType == MyPRCGetRacialType(oTarget))) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget); VISUALS outrace the grenade, looks bad } else if ((nRacialType == RACIAL_TYPE_ALL) ) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget); VISUALS outrace the grenade, looks bad } @@ -122,7 +122,7 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing lTarget = Location(oArea, vPos, fFace); missing code looks bad because it does not jive with visual */ - ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fExplosionRadius, lTarget, TRUE, nObjectFilter); //Cycle through the targets within the spell shape until an invalid object is captured. while (GetIsObjectValid(oTarget)) @@ -134,7 +134,7 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing nDamage = nSplashDamage; //Set the damage effect - effect eDam = EffectDamage(nDamage, nDamageType); + effect eDam = PRCEffectDamage(oTarget, nDamage, nDamageType); if(nDamage > 0) { // * must be the correct racial type (only used with Holy Water) @@ -142,17 +142,17 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing { // Apply effects to the currently selected target. SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); //This visual effect is applied to the target object not the location as above. This visual effect //represents the flame that erupts on the target not on the ground. - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } else if ((nRacialType == RACIAL_TYPE_ALL) ) { SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } @@ -196,8 +196,8 @@ void main() { // haaaack: store caster level on item for the on hit spell to work properly SetLocalInt(oMyWeapon,"X2_SPELL_CLEVEL_FLAMING_WEAPON",nCasterLvl); - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), RoundsToSeconds(nDuration)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), RoundsToSeconds(nDuration)); AddFlamingEffectToWeapon(oMyWeapon, RoundsToSeconds(nDuration)); } return; diff --git a/nwn/nwnprc/trunk/spells/sp_alcfrost.nss b/nwn/nwnprc/trunk/spells/sp_alcfrost.nss index 60731a17..f0afb8fb 100644 --- a/nwn/nwnprc/trunk/spells/sp_alcfrost.nss +++ b/nwn/nwnprc/trunk/spells/sp_alcfrost.nss @@ -76,7 +76,7 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing } //Set damage effect - effect eDam = EffectDamage(nDam, nDamageType); + effect eDam = PRCEffectDamage(oTarget, nDam, nDamageType); //Apply the MIRV and damage effect // * only damage enemies @@ -85,14 +85,14 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing // * must be the correct racial type (only used with Holy Water) if ((nRacialType != RACIAL_TYPE_ALL) && (nRacialType == MyPRCGetRacialType(oTarget))) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget); VISUALS outrace the grenade, looks bad } else if ((nRacialType == RACIAL_TYPE_ALL) ) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget); VISUALS outrace the grenade, looks bad } @@ -193,8 +193,8 @@ void main() // haaaack: store caster level on item for the on hit spell to work properly SetLocalInt(oMyWeapon,"X2_SPELL_CLEVEL_FLAMING_WEAPON",nCasterLvl); - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), RoundsToSeconds(nDuration)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), RoundsToSeconds(nDuration)); AddFrostEffectToWeapon(oMyWeapon, RoundsToSeconds(nDuration)); } return; diff --git a/nwn/nwnprc/trunk/spells/sp_alcspark.nss b/nwn/nwnprc/trunk/spells/sp_alcspark.nss index e62a7210..4c482387 100644 --- a/nwn/nwnprc/trunk/spells/sp_alcspark.nss +++ b/nwn/nwnprc/trunk/spells/sp_alcspark.nss @@ -78,7 +78,7 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing } //Set damage effect - effect eDam = EffectDamage(nDam, nDamageType); + effect eDam = PRCEffectDamage(oTarget, nDam, nDamageType); //Apply the MIRV and damage effect // * only damage enemies @@ -87,14 +87,14 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing // * must be the correct racial type (only used with Holy Water) if ((nRacialType != RACIAL_TYPE_ALL) && (nRacialType == MyPRCGetRacialType(oTarget))) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget); VISUALS outrace the grenade, looks bad } else if ((nRacialType == RACIAL_TYPE_ALL) ) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget); VISUALS outrace the grenade, looks bad } @@ -131,7 +131,7 @@ void PRCDoGrenade(int nDirectDamage, int nSplashDamage, int vSmallHit, int vRing nDamage = nSplashDamage; //Set the damage effect - effect eDam = EffectDamage(nDamage, nDamageType); + effect eDam = PRCEffectDamage(oTarget, nDamage, nDamageType); if(nDamage > 0) { // * must be the correct racial type (only used with Holy Water) @@ -193,8 +193,8 @@ void main() {// haaaack: store caster level on item for the on hit spell to work properly SetLocalInt(oMyWeapon,"X2_SPELL_CLEVEL_FLAMING_WEAPON",nCasterLvl); - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), RoundsToSeconds(nDuration)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyWeapon)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyWeapon), RoundsToSeconds(nDuration)); AddSparkEffectToWeapon(oMyWeapon, RoundsToSeconds(nDuration)); } return; diff --git a/nwn/nwnprc/trunk/spells/sp_biledrop.nss b/nwn/nwnprc/trunk/spells/sp_biledrop.nss index d0b492d3..73f93565 100644 --- a/nwn/nwnprc/trunk/spells/sp_biledrop.nss +++ b/nwn/nwnprc/trunk/spells/sp_biledrop.nss @@ -54,9 +54,9 @@ void main() nDam += 1; //Set damage effect - effect eDam = EffectDamage(nDam, DAMAGE_TYPE_ACID); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ACID); - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); //Apply second round @@ -64,7 +64,7 @@ void main() if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 17, SAVING_THROW_TYPE_ACID)) { - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSick, oTarget, RoundsToSeconds(1)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSick, oTarget, RoundsToSeconds(1)); } } @@ -80,7 +80,7 @@ void main() { if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 13, SAVING_THROW_TYPE_ACID)) { - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSick, oSplashTarget, RoundsToSeconds(1)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSick, oSplashTarget, RoundsToSeconds(1)); } } oSplashTarget = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE); diff --git a/nwn/nwnprc/trunk/spells/sp_curse_watera.nss b/nwn/nwnprc/trunk/spells/sp_curse_watera.nss index 7da62ec3..1feff7a7 100644 --- a/nwn/nwnprc/trunk/spells/sp_curse_watera.nss +++ b/nwn/nwnprc/trunk/spells/sp_curse_watera.nss @@ -52,7 +52,7 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int nDam *= 2; } // Set damage effect - eDam = EffectDamage(nDam, nDamageType); + eDam = PRCEffectDamage(oTarget, nDam, nDamageType); // Check reaction type if(!GetIsReactionTypeFriendly(oTarget)) @@ -67,8 +67,8 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int GetAlignmentGoodEvil(oTarget) == nAlignment)) { // Apply damage and VFX - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); // Signal event spell cast at SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellId)); } @@ -87,13 +87,14 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int // Apply AOE VFX ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eAOE, lTarget); - //Set the damage effect - eDam = EffectDamage(nSplashDam, nDamageType); + // Cycle through the targets within the spell shape until an invalid object is captured. oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fExplosionRadius, lTarget, TRUE, nObjectFilter); while(GetIsObjectValid(oTarget)) { + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nSplashDam, nDamageType); // Check PvP and make sure it isn't the target if(!GetIsReactionTypeFriendly(oTarget) && oDoNotDam != oTarget) @@ -112,8 +113,8 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellId)); // Delay the damage and visual effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } // Get the next target within the spell shape. diff --git a/nwn/nwnprc/trunk/spells/sp_forcemissiles.nss b/nwn/nwnprc/trunk/spells/sp_forcemissiles.nss index 9d713020..2fadcd9e 100644 --- a/nwn/nwnprc/trunk/spells/sp_forcemissiles.nss +++ b/nwn/nwnprc/trunk/spells/sp_forcemissiles.nss @@ -62,8 +62,8 @@ void SendMissileBomb(object oCaster, object oTarget, float fDelay=0.0, float fTi if (nMetaMagic == METAMAGIC_EMPOWER) nDam += nDam/2; - DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDam, DAMAGE_TYPE_MAGICAL), oLoop)); - DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_MAGBLUE, FALSE, 4.0f), oLoop)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oLoop, nDam, DAMAGE_TYPE_MAGICAL), oLoop)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_MAGBLUE, FALSE, 4.0f), oLoop)); } else if (!PRCDoResistSpell(oCaster, oLoop, nPenetr, fDelay)) { @@ -73,8 +73,8 @@ void SendMissileBomb(object oCaster, object oTarget, float fDelay=0.0, float fTi if (nMetaMagic == METAMAGIC_EMPOWER) nDam += nDam/2; - DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDam, DAMAGE_TYPE_MAGICAL), oLoop)); - DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_MAGBLUE), oLoop)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oLoop, nDam, DAMAGE_TYPE_MAGICAL), oLoop)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_MAGBLUE), oLoop)); } oLoop = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(5.0), lLoc, TRUE); diff --git a/nwn/nwnprc/trunk/spells/sp_leonals_roar.nss b/nwn/nwnprc/trunk/spells/sp_leonals_roar.nss index 7bb102d8..b224f9f9 100644 --- a/nwn/nwnprc/trunk/spells/sp_leonals_roar.nss +++ b/nwn/nwnprc/trunk/spells/sp_leonals_roar.nss @@ -87,7 +87,7 @@ void main() if (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_SONIC, oCaster, fDelay)) { int nDmg = d6(2); - effect eSonicDmg = EffectDamage(nDmg, DAMAGE_TYPE_SONIC); + effect eSonicDmg = PRCEffectDamage(oTarget, nDmg, DAMAGE_TYPE_SONIC); effect eSonicLink = EffectLinkEffects(eSonicVFX, eSonicDmg); DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eSonicLink, oTarget)); } diff --git a/nwn/nwnprc/trunk/spells/sp_rain_ffishC.nss b/nwn/nwnprc/trunk/spells/sp_rain_ffishC.nss index f80026d4..ac3001e2 100644 --- a/nwn/nwnprc/trunk/spells/sp_rain_ffishC.nss +++ b/nwn/nwnprc/trunk/spells/sp_rain_ffishC.nss @@ -15,7 +15,7 @@ void main() while(GetIsObjectValid(oTarget)) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d3(1), DAMAGE_TYPE_BLUDGEONING), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, d3(1), DAMAGE_TYPE_BLUDGEONING), oTarget); oTarget = MyNextObjectInShape(SHAPE_SPHERE, 500.0f, lLoc, FALSE, OBJECT_TYPE_CREATURE); } diff --git a/nwn/nwnprc/trunk/spells/sp_scrmngfl.nss b/nwn/nwnprc/trunk/spells/sp_scrmngfl.nss index 473fe8ba..d9daf94e 100644 --- a/nwn/nwnprc/trunk/spells/sp_scrmngfl.nss +++ b/nwn/nwnprc/trunk/spells/sp_scrmngfl.nss @@ -25,11 +25,11 @@ void main() while(GetIsObjectValid(oTarget)) { nDam = d8(1); - ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDam, DAMAGE_TYPE_SONIC), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_SONIC), oTarget); if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 15, SAVING_THROW_TYPE_SONIC)) { - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDeaf, oTarget, TurnsToSeconds(1)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDeaf, oTarget, TurnsToSeconds(1)); } oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 11.0, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); diff --git a/nwn/nwnprc/trunk/spells/sp_throw_ep.nss b/nwn/nwnprc/trunk/spells/sp_throw_ep.nss index c28f3ba3..eee95d04 100644 --- a/nwn/nwnprc/trunk/spells/sp_throw_ep.nss +++ b/nwn/nwnprc/trunk/spells/sp_throw_ep.nss @@ -47,9 +47,9 @@ void main() nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, nDC, nSaveType); if(nDam > 0) { - ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDam, nDamType), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, nDamType), oTarget); // vfx on object - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); } } oTarget = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); diff --git a/nwn/nwnprc/trunk/spells/x0_s0_spikegroen.nss b/nwn/nwnprc/trunk/spells/x0_s0_spikegroen.nss index 6d7ce5af..ccbdcd64 100644 --- a/nwn/nwnprc/trunk/spells/x0_s0_spikegroen.nss +++ b/nwn/nwnprc/trunk/spells/x0_s0_spikegroen.nss @@ -43,12 +43,12 @@ void PRCDoSpikeGrowthEffect(object oTarget,int nPenetr) int nDam = PRCMaximizeOrEmpower(4, 1, nMetaMagic); //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); - effect eDam = EffectDamage(nDam, DAMAGE_TYPE_PIERCING); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_PIERCING); effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); //effect eLink = eDam; //Apply damage and visuals - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam/*eLink*/, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam/*eLink*/, oTarget)); // * only apply a slow effect from this spell once if (GetHasSpellEffect(453, oTarget) == FALSE) @@ -57,7 +57,7 @@ void PRCDoSpikeGrowthEffect(object oTarget,int nPenetr) if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()), SAVING_THROW_ALL, GetAreaOfEffectCreator(), fDelay)) { effect eSpeed = EffectMovementSpeedDecrease(30); - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, oTarget, HoursToSeconds(24)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, oTarget, HoursToSeconds(24)); } } } diff --git a/nwn/nwnprc/trunk/spells/x0_s0_spikegrohb.nss b/nwn/nwnprc/trunk/spells/x0_s0_spikegrohb.nss index c9ea2a16..fb5cc15d 100644 --- a/nwn/nwnprc/trunk/spells/x0_s0_spikegrohb.nss +++ b/nwn/nwnprc/trunk/spells/x0_s0_spikegrohb.nss @@ -43,12 +43,12 @@ void PRCDoSpikeGrowthEffect(object oTarget,int nPenetr) int nDam = PRCMaximizeOrEmpower(4, 1, nMetaMagic); //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); - effect eDam = EffectDamage(nDam, DAMAGE_TYPE_PIERCING); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_PIERCING); effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); //effect eLink = eDam; //Apply damage and visuals - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam/*eLink*/, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam/*eLink*/, oTarget)); // * only apply a slow effect from this spell once if (GetHasSpellEffect(453, oTarget) == FALSE) @@ -57,7 +57,7 @@ void PRCDoSpikeGrowthEffect(object oTarget,int nPenetr) if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()), SAVING_THROW_ALL, GetAreaOfEffectCreator(), fDelay)) { effect eSpeed = EffectMovementSpeedDecrease(30); - ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, oTarget, HoursToSeconds(24)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, oTarget, HoursToSeconds(24)); } } } diff --git a/nwn/nwnprc/trunk/spells/x0_s3_holy.nss b/nwn/nwnprc/trunk/spells/x0_s3_holy.nss index 576ed9c9..cb313dab 100644 --- a/nwn/nwnprc/trunk/spells/x0_s3_holy.nss +++ b/nwn/nwnprc/trunk/spells/x0_s3_holy.nss @@ -52,7 +52,7 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int nDam *= 2; } // Set damage effect - eDam = EffectDamage(nDam, nDamageType); + eDam = PRCEffectDamage(oTarget, nDam, nDamageType); // Check reaction type if(!GetIsReactionTypeFriendly(oTarget)) @@ -67,8 +67,8 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int GetAlignmentGoodEvil(oTarget) == nAlignment)) { // Apply damage and VFX - ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); - ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); // Signal event spell cast at SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellId)); } @@ -87,13 +87,13 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int // Apply AOE VFX ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eAOE, lTarget); - //Set the damage effect - eDam = EffectDamage(nSplashDam, nDamageType); - // Cycle through the targets within the spell shape until an invalid object is captured. oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fExplosionRadius, lTarget, TRUE, nObjectFilter); while(GetIsObjectValid(oTarget)) { + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nSplashDam, nDamageType); + // Check PvP and make sure it isn't the target if(!GetIsReactionTypeFriendly(oTarget) && oDoNotDam != oTarget) @@ -112,8 +112,8 @@ void PRCDoGrenade(int nDirectDam, int nSplashDam, int nVisVFX, int nAOEVFX, int SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellId)); // Delay the damage and visual effects - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); - DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); } } // Get the next target within the spell shape. diff --git a/nwn/nwnprc/trunk/spells/x2_s1_beholdray.nss b/nwn/nwnprc/trunk/spells/x2_s1_beholdray.nss index 54396540..1af4e4df 100644 --- a/nwn/nwnprc/trunk/spells/x2_s1_beholdray.nss +++ b/nwn/nwnprc/trunk/spells/x2_s1_beholdray.nss @@ -130,7 +130,7 @@ void main() SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,e1,oTarget,RoundsToSeconds(6)); break; - case 783: e1 = EffectDamage(d8(2)+10); + case 783: e1 = PRCEffectDamage(oTarget, d8(2)+10); eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED); SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); SPApplyEffectToObject(DURATION_TYPE_INSTANT,e1,oTarget); @@ -154,7 +154,7 @@ void main() { switch (nSpell) { - case 776: e1 = EffectDamage(d6(3)+13); + case 776: e1 = PRCEffectDamage(oTarget, d6(3)+13); eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); eLink = EffectLinkEffects(e1,eVis); SPApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oTarget); diff --git a/nwn/nwnprc/trunk/spells/x2_s3_flamingd.nss b/nwn/nwnprc/trunk/spells/x2_s3_flamingd.nss index 4213369f..ae6618cb 100644 --- a/nwn/nwnprc/trunk/spells/x2_s3_flamingd.nss +++ b/nwn/nwnprc/trunk/spells/x2_s3_flamingd.nss @@ -82,7 +82,7 @@ void main() int nDmg = d4() + nLevel; - effect eDmg = PRCEffectDamage(oTarget, nDmg,nDamageType); + effect eDmg = PRCEffectDamage(oTarget, nDmg, nDamageType); effect eVis; if (nDmg<10) // if we are doing below 10 point of damage, use small flame { diff --git a/nwn/nwnprc/trunk/users/Tenjac/spells/prc_axiowater.nss b/nwn/nwnprc/trunk/users/Tenjac/spells/prc_axiowater.nss index c29f3218..ffd34be8 100644 --- a/nwn/nwnprc/trunk/users/Tenjac/spells/prc_axiowater.nss +++ b/nwn/nwnprc/trunk/users/Tenjac/spells/prc_axiowater.nss @@ -33,15 +33,16 @@ Material Component: 5 pounds of powdered iron and silver (worth 25 gp). //:: Created On: 6/10/2022 //::////////////////////////////////////////////// -#include "prc_sp_func" +#include "prc_inc_spells" #include "prc_add_spell_dc" #include "prc_inc_sp_tch" void main() { - location lTarget = GetSpellTargetLocation(); - float fRadius = FeetToMeters(5); + location lTarget = PRCGetSpellTargetLocation(); + float fRadius = FeetToMeters(5.0); int nTouch; + int nDam; effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY); object oTarget = PRCGetSpellTargetObject(); @@ -63,7 +64,7 @@ void main() nDam += nDam; } - effect eDam = EffectDamage(nDam, DAMAGE_TYPE_DIVINE); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_DIVINE); object oDoNotDam = oTarget; //Outsider @@ -77,7 +78,7 @@ void main() } } - oTarget = MyGetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget); while(GetIsObjectValid(oTarget)) { if(oTarget != oDoNotDam) @@ -93,7 +94,7 @@ void main() } } } - MyGetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget); + GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget); } } \ No newline at end of file