diff --git a/Release/Neverwinter Nights Campaigns [PRC8].7z b/Release/Neverwinter Nights Campaigns [PRC8].7z new file mode 100644 index 00000000..db5916c1 Binary files /dev/null and b/Release/Neverwinter Nights Campaigns [PRC8].7z differ diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_kaboom.nss b/nwn/nwnprc/trunk/ocfixerf/q4_kaboom.nss new file mode 100644 index 00000000..577eb8bf --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_kaboom.nss @@ -0,0 +1,102 @@ +// explode golem power source + + +//#include "X0_I0_SPELLS" +//#include "x2_i0_spells" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + + +void Explode() +{ + SetPlotFlag(OBJECT_SELF, FALSE); + // End of Spell Cast Hook + //Declare major variables + int nDamage1, nDamage2, nDamage3, nDamage4; + float fDelay; + effect eExplode = EffectVisualEffect(464); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + int nKnockDur; + + int nSpellDC = 32; + + effect eDam1, eDam2, eDam3, eDam4, eDam5, eKnock; + eKnock = EffectKnockdown(); + //Get the spell target location as opposed to the spell target. + location lTarget = GetLocation(OBJECT_SELF); + //Apply the fireball explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0f, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + int nTotalDamage; + while (GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetFirstPC())) + { + //Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20 + 0.5f; + if (!PRCDoResistSpell(OBJECT_SELF, oTarget, FloatToInt(fDelay))) + { + //Roll damage for each target + nDamage1 = d6(40); + nDamage2 = d6(40); + + if (PRCMySavingThrow(SAVING_THROW_REFLEX,oTarget,nSpellDC,SAVING_THROW_TYPE_SPELL,OBJECT_SELF,fDelay) >0) + { + nDamage1 /=2; + nDamage2 /=2; + + } + nTotalDamage = nDamage1+nDamage2; + //Set the damage effect + eDam3 = EffectDamage(nDamage3, DAMAGE_TYPE_FIRE); + eDam4 = EffectDamage(nDamage4, DAMAGE_TYPE_SONIC); + //Link damage effects + + if(nTotalDamage > 0) + { + if (nTotalDamage > 50) + { + nKnockDur = Random(6) + 4; + DelayCommand(fDelay+0.3f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnock, oTarget, IntToFloat(nKnockDur))); + } + + // Apply effects to the currently selected target. + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam1, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam2, 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)); + + } + } + } + //Select the next target within the spell shape. + oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0f, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + // Destroy all golems in the island of the maker(and make the bodies stay) + object oArea = GetArea(OBJECT_SELF); + if(GetTag(oArea) != "IslandoftheMakerLowerRuins") + oArea = GetObjectByTag("IslandoftheMakerLowerRuins"); + + SignalEvent(oArea, EventUserDefined(103)); // kill of the golems at the lower level of the maker dungeon + + + DestroyObject(OBJECT_SELF, 2.0); +} + +void main() +{ + effect eVis = EffectVisualEffect(469); + int i; + float fDelay; + // count down - the more the time advances - the more pulses would appear. + for(i = 1; i <= 150; i++) + { + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF)); + fDelay += (1.0 - IntToFloat(i) / 30); + } + DelayCommand(14.0, Explode()); + +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_acidfoga.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_acidfoga.nss new file mode 100644 index 00000000..7c1acd76 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_acidfoga.nss @@ -0,0 +1,35 @@ +//:://///////////////////////////////////////////// +//:: Acid Fog: On Enter +//:: NW_S0_AcidFogA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 2d6 acid damage + per round and upon entering if they fail a Fort Save + their movement is halved. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + int nDamage; + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + effect eSlow = EffectMovementSpeedDecrease(50); + object oTarget = GetEnteringObject(); + float fDelay = PRCGetRandomDelay(1.0, 2.2); + nDamage = d6(3); + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 24, SAVING_THROW_TYPE_ACID, GetAreaOfEffectCreator(), fDelay)) + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSlow, oTarget); + eDam = EffectDamage(nDamage, DAMAGE_TYPE_ACID); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_acidfogc.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_acidfogc.nss new file mode 100644 index 00000000..9e3d350c --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_acidfogc.nss @@ -0,0 +1,42 @@ +//:://///////////////////////////////////////////// +//:: Acid Fog: Heartbeat +//:: NW_S0_AcidFogC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 2d6 acid damage + per round and upon entering if they fail a Fort Save + their movement is halved. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + int nDamage = d6(3); + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + object oTarget; + float fDelay; + + eDam = EffectDamage(nDamage, DAMAGE_TYPE_ACID); + //Start cycling through the AOE Object for viable targets including doors and placable objects. + oTarget = GetFirstInPersistentObject(OBJECT_SELF); + while(GetIsObjectValid(oTarget)) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, 24, SAVING_THROW_TYPE_ACID, GetAreaOfEffectCreator(), fDelay)) + nDamage = d6(3); + fDelay = PRCGetRandomDelay(0.4, 1.2); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + + //Get next target. + oTarget = GetNextInPersistentObject(OBJECT_SELF); + } +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_bladebara.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_bladebara.nss new file mode 100644 index 00000000..ad1c2322 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_bladebara.nss @@ -0,0 +1,33 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: On Enter +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + object oTarget = GetEnteringObject(); + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); + int nDamage = d6(14); + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 24)) + nDamage = d6(8); + eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_bladebarc.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_bladebarc.nss new file mode 100644 index 00000000..debbf445 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_bladebarc.nss @@ -0,0 +1,40 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: Heartbeat +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + object oTarget; + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); + + oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + int nDamage = d6(14); + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 24)) + nDamage = d6(7); + eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + oTarget = GetNextInPersistentObject(); + + } +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_firewalla.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_firewalla.nss new file mode 100644 index 00000000..177e71f5 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_firewalla.nss @@ -0,0 +1,33 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: On Enter +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + object oTarget = GetEnteringObject(); + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_HIT_FIRE); + int nDamage = d6(10); + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 24)) + nDamage = d6(5); + eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_firewallc.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_firewallc.nss new file mode 100644 index 00000000..0be3bd56 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_firewallc.nss @@ -0,0 +1,40 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: Heartbeat +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + object oTarget; + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_HIT_FIRE); + + oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + int nDamage = d6(14); + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 24)) + nDamage = d6(7); + eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + oTarget = GetNextInPersistentObject(); + + } +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfoga.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfoga.nss new file mode 100644 index 00000000..6223d5e5 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfoga.nss @@ -0,0 +1,29 @@ +//:://///////////////////////////////////////////// +//:: Acid Fog: On Enter +//:: NW_S0_AcidFogA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 2d6 acid damage + per round and upon entering if they fail a Fort Save + their movement is halved. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + effect eVis = EffectVisualEffect(VFX_IMP_POISON_S); + effect ePoison = EffectPoison(POISON_COLOSSAL_SPIDER_VENOM); + object oTarget = GetEnteringObject(); + float fDelay = PRCGetRandomDelay(1.0, 2.2); + //DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePoison, oTarget)); + +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfogb.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfogb.nss new file mode 100644 index 00000000..25662c35 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfogb.nss @@ -0,0 +1,46 @@ +//:://///////////////////////////////////////////// +//:: Acid Fog: On Exit +//:: NW_S0_AcidFogB.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 2d6 acid damage + per round and upon entering if they fail a Fort Save + their movement is halved. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// +//:: Update Pass By: Preston W, On: July 20, 2001 + +#include "x2_inc_spellhook" + +void main() +{ + + + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + int bValid = FALSE; + effect eAOE; + //Search through the valid effects on the target. + eAOE = GetFirstEffect(oTarget); + while (GetIsEffectValid(eAOE) && bValid == FALSE) + { + if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator()) + { + if(GetEffectType(eAOE) == EFFECT_TYPE_POISON) + { + RemoveEffect(oTarget, eAOE); + bValid = TRUE; + + } + } + //Get next effect on the target + eAOE = GetNextEffect(oTarget); + } + +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfogc.nss b/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfogc.nss new file mode 100644 index 00000000..6f6f1ff4 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q4_s0_poisfogc.nss @@ -0,0 +1,38 @@ +//:://///////////////////////////////////////////// +//:: Acid Fog: Heartbeat +//:: NW_S0_AcidFogC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 2d6 acid damage + per round and upon entering if they fail a Fort Save + their movement is halved. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + effect eVis = EffectVisualEffect(VFX_IMP_POISON_S); + object oTarget; + float fDelay; + + effect ePoison = EffectPoison(POISON_COLOSSAL_SPIDER_VENOM); + //Start cycling through the AOE Object for viable targets including doors and placable objects. + oTarget = GetFirstInPersistentObject(OBJECT_SELF); + while(GetIsObjectValid(oTarget)) + { + fDelay = PRCGetRandomDelay(0.4, 1.2); + //DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePoison, oTarget)); + + //Get next target. + oTarget = GetNextInPersistentObject(OBJECT_SELF); + } +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q5_s0_greasea.nss b/nwn/nwnprc/trunk/ocfixerf/q5_s0_greasea.nss new file mode 100644 index 00000000..2f1332b5 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q5_s0_greasea.nss @@ -0,0 +1,41 @@ +//:://///////////////////////////////////////////// +//:: Grease: On Enter +//:: NW_S0_GreaseA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creatures entering the zone of grease must make + a reflex save or fall down. Those that make + their save have their movement reduced by 1/2. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 1, 2001 +//::////////////////////////////////////////////// +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" +#include "prc_inc_skills" + +void main() +{ + + + + //Declare major variables + int nMetaMagic = GetMetaMagicFeat(); + effect eVis = EffectVisualEffect(VFX_IMP_SLOW); + effect eSlow = ExtraordinaryEffect(EffectMovementSpeedDecrease(50)); + effect eLink = EffectLinkEffects(eVis, eSlow); + object oTarget = GetEnteringObject(); + int nAppear = GetAppearanceType(oTarget); + if(PRCGetHasEffect(EFFECT_TYPE_MOVEMENT_SPEED_DECREASE, oTarget)) + return; // do not apply the effect twice + + if(!PRCIsFlying(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_INVALID, SPELL_GREASE)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSlow, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q5_s0_greasec.nss b/nwn/nwnprc/trunk/ocfixerf/q5_s0_greasec.nss new file mode 100644 index 00000000..5c79041a --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q5_s0_greasec.nss @@ -0,0 +1,46 @@ +//:://///////////////////////////////////////////// +//:: Grease: Heartbeat +//:: NW_S0_GreaseC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creatures entering the zone of grease must make + a reflex save or fall down. Those that make + their save have their movement reduced by 1/2. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 1, 2001 +//::////////////////////////////////////////////// +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" +#include "prc_inc_skills" + +void main() +{ + + + //Declare major variables + object oTarget; + effect eFall = ExtraordinaryEffect(EffectKnockdown()); + float fDelay; + //Get first target in spell area + oTarget = GetFirstInPersistentObject(); + int nAppear; + while(GetIsObjectValid(oTarget)) + { + if(!PRCIsFlying(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_INVALID, SPELL_GREASE)); + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 28, SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFall, oTarget, 4.0); + } + } + + //Get next target in spell area + oTarget = GetNextInPersistentObject(); + } +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q6_shard.nss b/nwn/nwnprc/trunk/ocfixerf/q6_shard.nss new file mode 100644 index 00000000..12a47e6e --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q6_shard.nss @@ -0,0 +1,340 @@ +// Shattered Mirror shard: +// When used on a pillar - activate the pillar's power, and disable the pillar for a few rounds. + +float PILLAR_CHARGE_TIME = 30.0; +int TRAP_DUR = 5; +//#include "X0_I0_SPELLS" +#include "nw_i0_generic" +#include "x2_inc_spellhook" +#include "prc_inc_spells" +#include "inc_dispel" + + +void StripEffects(int nNumber, object oTarget); +void AdjustCopy(object oCopy); +void DestroyCopy(object oCopy); +void CreateFence(location lLoc); +void SetBlocker(object oCreature); + +void main() +{ + object oPC = GetLocalObject(GetArea(OBJECT_SELF), "CURRENT_SHARD_USER"); + object oTarget; + if(oPC != OBJECT_INVALID && GetTag(oPC) == "q6_sabal") // if sabal is the one using the shard + { + // init the var + SetLocalObject(GetArea(OBJECT_SELF), "CURRENT_SHARD_USER", OBJECT_INVALID); + oTarget = GetLocalObject(GetArea(OBJECT_SELF), "CURRENT_SHARD_TARGET"); + SetLocalObject(GetArea(OBJECT_SELF), "CURRENT_SHARD_TARGET", OBJECT_INVALID); + } + else + { + oPC = GetItemActivator(); + oTarget = GetItemActivatedTarget(); + } + + + string sTag = GetTag(oTarget); + if(GetStringLeft(sTag, 11) != "q6f2_Pillar") + return; + + // pillar's type is in it's tag and determine's it's special power. + int nType = StringToInt(GetStringRight(sTag, 1)); + + + // making sure the pillar is active + int nActive = GetLocalInt(oTarget, "ACTIVE"); + if(nActive == 1) + return; + SetLocalInt(oTarget, "ACTIVE", 1); + DelayCommand(PILLAR_CHARGE_TIME, SetLocalInt(oTarget, "ACTIVE", 0)); + + // Apply a charged visual effect to pillar and start removing the effects + // until the pillar is discharged and ready for use again + effect eEff = GetFirstEffect(oTarget); + while(GetIsEffectValid(eEff)) + { + RemoveEffect(oTarget, eEff); + eEff = GetNextEffect(oTarget); + } + effect eBeam = EffectBeam(VFX_BEAM_ODD, oPC, BODY_NODE_HAND); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 1.5); + + effect eImp = EffectVisualEffect(VFX_FNF_STRIKE_HOLY); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget); + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + effect eVis2 = EffectVisualEffect(VFX_DUR_BLUR); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, PILLAR_CHARGE_TIME); + DelayCommand(PILLAR_CHARGE_TIME, + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis2, oTarget)); + + // Activate pillars power, depending on it's type + + if(nType == 1) // Revive + { + // Heal all allies + effect eVis = EffectVisualEffect(VFX_IMP_HEALING_X); + effect eHeal = EffectHeal(100); + effect eLink = EffectLinkEffects(eVis, eHeal); + int i = 1; + float fDelay = 1.0; + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oPC)); + object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, oPC, i); + while(oCreature != OBJECT_INVALID) + { + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oCreature)); + fDelay += 1.0; + i++; + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, oPC, i); + } + } + else if(nType == 2) // Dispel + { + // Mord' Disjunction on all enemies + int i = 1; + float fDelay = 1.0; + object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC, i); + while(oCreature != OBJECT_INVALID) + { + DelayCommand(fDelay, StripEffects(6, oCreature)); + fDelay += 1.0; + i++; + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC, i); + } + } + else if(nType == 3) // Entrapment + { + // jumping enemies into a trapped area. + + // First removing everyone from the trap areas: + + object oWP; + int i; + object oCreature = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oTarget, i); + while(oCreature != OBJECT_INVALID) + { + if(GetLocalInt(oCreature, "Q6F_INSIDE") == 1) + { + oWP = GetNearestObjectByTag("q6f_wp_trap_exit", oCreature); + DelayCommand(0.5, AssignCommand(oCreature, JumpToObject(oWP))); + DelayCommand(3.0, AssignCommand(oCreature, DetermineCombatRound(oPC))); + } + i++; + oCreature = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oTarget, i); + } + + // Create the fence + i = 1; + //object oFence; + oWP = GetNearestObjectByTag("q6f_wp_fence", oTarget, i); + while(oWP != OBJECT_INVALID) + { + CreateFence(GetLocation(oWP)); + i++; + oWP = GetNearestObjectByTag("q6f_wp_fence", oTarget, i); + } + + // bring in the blades... + i = 1; + oWP = GetNearestObjectByTag("q6f_wp_blades", oTarget, i); + effect eBlades = EffectAreaOfEffect(AOE_PER_WALLBLADE, "q6f_s0_bladebara", "q6f_s0_bladebarc"); + while(oWP != OBJECT_INVALID) + { + DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eBlades, GetLocation(oWP), RoundsToSeconds(TRAP_DUR))); + i++; + oWP = GetNearestObjectByTag("q6f_wp_blades", oTarget, i); + } + // bring in the victims + + i = 1; + object oBlock; // setting the nearest cage on the creature so he would attack it. + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC, i); + oWP = GetNearestObjectByTag("q6f_wp_trap_catch", oPC, i); + while(oCreature != OBJECT_INVALID && i <= 4) + { + if(GetMaster(oCreature) == OBJECT_INVALID) + { + DelayCommand(1.5, AssignCommand(oCreature, JumpToObject(oWP))); + DelayCommand(2.0, SetBlocker(oCreature)); + SetLocalString(oCreature,"X2_SPECIAL_COMBAT_AI_SCRIPT", "q6f_ai_blocked"); + i++; + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC, i); + oWP = GetNearestObjectByTag("q6f_wp_trap_catch", oPC, i); + } + } + + } + else if(nType == 4) // Guardian + { + // polymorph into a golem for a few rounds + effect ePoly = EffectPolymorph(93); + effect eAttackBonus = EffectAttackIncrease(10, ATTACK_BONUS_MISC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAttackBonus, oPC, RoundsToSeconds(3)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oPC, RoundsToSeconds(3)); + } + else if(nType == 5) // Time + { + // haste all allies and slow all enemies + effect eHaste = EffectHaste(); + effect eSlow = EffectSlow(); + effect eImpHaste = EffectVisualEffect(VFX_IMP_HASTE); + effect eImpSlow = EffectVisualEffect(VFX_IMP_SLOW); + int i = 1; + object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC, i); + while(oCreature != OBJECT_INVALID) + { + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpSlow, oCreature)); + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oCreature, RoundsToSeconds(5))); + i++; + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC, i); + } + + i = 1; + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, oPC, i); + while(oCreature != OBJECT_INVALID) + { + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpHaste, oCreature)); + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHaste, oCreature, RoundsToSeconds(5))); + i++; + oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, oPC, i); + } + + + + } + else if(nType == 6) // Mirroring + { + effect eVis = EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC)); + // creates 3 decoy copies of the player for a few rounds + object oCopy1 = CopyObject(oPC, GetLocation(oPC)); + object oCopy2 = CopyObject(oPC, GetLocation(oPC)); + object oCopy3 = CopyObject(oPC, GetLocation(oPC)); + + // Making sure the copies are not too powerful + AdjustCopy(oCopy1); + AdjustCopy(oCopy2); + AdjustCopy(oCopy3); + + DelayCommand(RoundsToSeconds(5), DestroyCopy(oCopy1)); + DelayCommand(RoundsToSeconds(5), DestroyCopy(oCopy2)); + DelayCommand(RoundsToSeconds(5), DestroyCopy(oCopy3)); + } + +} + +void AdjustCopy(object oCopy) +{ + // set hit points to a max of 50 + // set AC to 25 + // set base attack bonus to 20 + // set number of attack to 2 + // set all object's item as non-dropable + + ChangeFaction(oCopy, GetFirstPC()); + + int nHP = GetCurrentHitPoints(oCopy); + int nHPChange = nHP - 50; + if(nHPChange > 0) + { + effect eDamage = EffectDamage(nHPChange); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oCopy); + } + int nAC = GetAC(oCopy); + int nACChange = nAC - 25; + if(nACChange > 0) + { + effect eACDec = EffectACDecrease(nACChange); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eACDec, oCopy); + } + int nAttBon = GetBaseAttackBonus(oCopy); + int nAttBonChange = 20 - nAttBon; + if(nAttBonChange > 0) + { + effect eAttDec = EffectAttackDecrease(nAttBonChange); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eAttDec, oCopy); + } + SetBaseAttackBonus(2, oCopy); + object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, GetFirstPC()); + AssignCommand(oCopy, ActionMoveAwayFromObject(GetFirstPC(), TRUE, 10.0)); + AssignCommand(oCopy, ActionAttack(oEnemy)); + + object oItem = GetFirstItemInInventory(oCopy); + while(oItem != OBJECT_INVALID) + { + SetDroppableFlag(oItem, FALSE); + oItem = GetNextItemInInventory(oCopy); + } + oItem = GetItemInSlot(INVENTORY_SLOT_ARMS, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_ARROWS, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_BELT, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_BOLTS, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_BOOTS, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_BULLETS, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_CLOAK, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_HEAD, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_NECK, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oCopy); + SetDroppableFlag(oItem, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oCopy); + SetDroppableFlag(oItem, FALSE); + + TakeGoldFromCreature(GetGold(oCopy), oCopy, TRUE); +} + + +void StripEffects(int nNumber, object oTarget) +{ + //Declare major variables + effect eVis = EffectVisualEffect(VFX_IMP_BREACH); + int nCnt = 0; + int nIdx = 0; + int nTotal = nNumber; + if(GetIsEnemy(oTarget)) + { + //Search through and remove protections. + while(nCnt <= 17 && nIdx < nTotal) + { + nIdx = nIdx + PRCRemoveProtections(PRCGetSpellBreachProtection(nCnt), oTarget, nCnt); + nCnt++; + } + } + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); +} + +void DestroyCopy(object oCopy) +{ + effect eVis = EffectVisualEffect(VFX_IMP_DESTRUCTION); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oCopy)); + DestroyObject(oCopy); +} + +void CreateFence(location lLoc) +{ + object oFence = CreateObject(OBJECT_TYPE_PLACEABLE, "q6f_fence", lLoc); + DestroyObject(oFence, RoundsToSeconds(TRAP_DUR)); + +} + +void SetBlocker(object oCreature) +{ + AssignCommand(oCreature, ClearAllActions()); + object oBlocker = GetNearestObjectByTag("q6f_fence", oCreature); + SetLocalObject(oCreature, "Q6F_BLOCKER", oBlocker); + AssignCommand(oCreature, DetermineCombatRound()); +} diff --git a/nwn/nwnprc/trunk/ocfixerf/q6f_s0_bladebara.nss b/nwn/nwnprc/trunk/ocfixerf/q6f_s0_bladebara.nss new file mode 100644 index 00000000..b8b090ba --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q6f_s0_bladebara.nss @@ -0,0 +1,36 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: On Enter +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + object oTarget = GetEnteringObject(); + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); + int nDamage = d6(6); + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 26)) + { + nDamage = d6(3); + } + eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); +} + diff --git a/nwn/nwnprc/trunk/ocfixerf/q6f_s0_bladebarc.nss b/nwn/nwnprc/trunk/ocfixerf/q6f_s0_bladebarc.nss new file mode 100644 index 00000000..90815009 --- /dev/null +++ b/nwn/nwnprc/trunk/ocfixerf/q6f_s0_bladebarc.nss @@ -0,0 +1,40 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: Heartbeat +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// +//#include "X0_I0_SPELLS" +#include "x2_inc_spellhook" +#include "prc_inc_spells" + +void main() +{ + object oTarget; + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); + + oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + int nDamage = d6(6); + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, 18)) + { + nDamage = d6(3); + } + eDam = EffectDamage(nDamage, DAMAGE_TYPE_SLASHING); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + oTarget = GetNextInPersistentObject(); + } +} +