Further file organization
Further file organization
This commit is contained in:
152
nwn/nwnprc/trunk/spells/PRC_vampdrain.nss
Normal file
152
nwn/nwnprc/trunk/spells/PRC_vampdrain.nss
Normal file
@@ -0,0 +1,152 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Vampiric Drain
|
||||
//:: PRC_vampdrain.nss
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Drain living, caster heals
|
||||
Drain dead, caster dies
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Zedium
|
||||
//:: Created On: April 5, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// GZ: gets rids of temporary hit points so that they will not stack
|
||||
//------------------------------------------------------------------------------
|
||||
void PRCRemoveTempHitPoints()
|
||||
{
|
||||
effect eProtection;
|
||||
int nCnt = 0;
|
||||
|
||||
eProtection = GetFirstEffect(OBJECT_SELF);
|
||||
while (GetIsEffectValid(eProtection))
|
||||
{
|
||||
if(GetEffectType(eProtection) == EFFECT_TYPE_TEMPORARY_HITPOINTS)
|
||||
RemoveEffect(OBJECT_SELF, eProtection);
|
||||
eProtection = GetNextEffect(OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
|
||||
int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDDice = nCasterLevel /4;
|
||||
if ((nDDice) == 0)
|
||||
{
|
||||
nDDice = 1;
|
||||
}
|
||||
//Damage Limit
|
||||
else if (nDDice>5)
|
||||
{
|
||||
nDDice = 5;
|
||||
}
|
||||
|
||||
int nDamage = d6(nDDice);
|
||||
//--------------------------------------------------------------------------
|
||||
//Enter Metamagic conditions
|
||||
//--------------------------------------------------------------------------
|
||||
nDamage = PRCMaximizeOrEmpower(6,nDDice,nMetaMagic);
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nDDice);
|
||||
int nDuration = nCasterLevel/3;
|
||||
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration *= 2;
|
||||
}
|
||||
//nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF);
|
||||
//--------------------------------------------------------------------------
|
||||
//Limit damage to max hp + 10
|
||||
//--------------------------------------------------------------------------
|
||||
int nMax = GetCurrentHitPoints(oTarget) + 10;
|
||||
if(nMax < nDamage)
|
||||
{
|
||||
nDamage = nMax;
|
||||
}
|
||||
|
||||
effect eHeal = EffectTemporaryHitpoints(nDamage/2);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eLink = EffectLinkEffects(eHeal, eDur);
|
||||
effect eHurt = PRCEffectDamage(oTarget, nDamage/2);
|
||||
effect eBad =EffectTemporaryHitpoints(nDamage);
|
||||
effect eNegLink = EffectLinkEffects(eBad, eDur);
|
||||
effect eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_NEGATIVE);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M);
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_EVIL_10);
|
||||
float fDelay;
|
||||
|
||||
nCasterLevel +=SPGetPenetr();
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation());
|
||||
//Get first target in shape
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, PRCGetSpellTargetLocation());
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
int iTombTainted = GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD;
|
||||
//Check if the target is undead
|
||||
if( MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || iTombTainted || GetLocalInt(oTarget, "AcererakHealing"))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHurt, OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, oTarget);
|
||||
PRCRemoveTempHitPoints();
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(1));
|
||||
}
|
||||
//Check if the target is hostile, and not an undead or construct
|
||||
//or protected by a spell
|
||||
if(!GetIsReactionTypeFriendly(oTarget) &&
|
||||
MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD &&
|
||||
!iTombTainted &&
|
||||
MyPRCGetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT &&
|
||||
!GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION, oTarget))
|
||||
{
|
||||
if(PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel) == 0)
|
||||
{
|
||||
if(/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_NEGATIVE, OBJECT_SELF, fDelay))
|
||||
{
|
||||
nDamage = nDamage/2;
|
||||
|
||||
if (GetHasMettle(oTarget, SAVING_THROW_WILL)) // Ignores partial effects
|
||||
{
|
||||
nDamage = 0;
|
||||
}
|
||||
}
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
|
||||
PRCBonusDamage(oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, OBJECT_SELF);
|
||||
PRCRemoveTempHitPoints();
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, HoursToSeconds(1));
|
||||
}
|
||||
}
|
||||
//Get next target in spell area
|
||||
oTarget = GetNextInPersistentObject();
|
||||
}
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the integer used to hold the spells spell school
|
||||
}
|
113
nwn/nwnprc/trunk/spells/nw_c2_default7.nss
Normal file
113
nwn/nwnprc/trunk/spells/nw_c2_default7.nss
Normal file
@@ -0,0 +1,113 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT7
|
||||
/*
|
||||
Default OnDeath event handler for NPCs.
|
||||
|
||||
Adjusts killer's alignment if appropriate and
|
||||
alerts allies to our death.
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Modified By: Deva Winblood
|
||||
//:: Modified On: April 1st, 2008
|
||||
//:: Added Support for Dying Wile Mounted
|
||||
//:://///////////////////////////////////////////////
|
||||
|
||||
const string sHenchSummonedFamiliar = "HenchSummonedFamiliar";
|
||||
const string sHenchSummonedAniComp = "HenchSummonedAniComp";
|
||||
const string sHenchLastHeardOrSeen = "LastSeenOrHeard";
|
||||
|
||||
#include "x2_inc_compon"
|
||||
#include "x0_i0_spawncond"
|
||||
|
||||
// Clears the last unheard, unseen enemy location
|
||||
void ClearEnemyLocation();
|
||||
|
||||
void main()
|
||||
{
|
||||
object oKiller = GetLastKiller();
|
||||
object oMaster = GetMaster();
|
||||
|
||||
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
|
||||
|
||||
if(GetLocalInt(GetModule(), "X3_ENABLE_MOUNT_DB") && GetIsObjectValid(oMaster))
|
||||
SetLocalInt(oMaster, "bX3_STORE_MOUNT_INFO", TRUE);
|
||||
|
||||
// If we're a good/neutral commoner,
|
||||
// adjust the killer's alignment evil
|
||||
if(GetLevelByClass(CLASS_TYPE_COMMONER)
|
||||
&& (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
|
||||
{
|
||||
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
|
||||
}
|
||||
|
||||
//Start Hench AI
|
||||
if(GetLocalInt(OBJECT_SELF, "GaveHealing"))
|
||||
{
|
||||
// Pausanias: destroy potions of healing
|
||||
object oItem = GetFirstItemInInventory();
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
if(GetTag(oItem) == "NW_IT_MPOTION003")
|
||||
DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory();
|
||||
}
|
||||
}
|
||||
|
||||
if(GetLocalInt(OBJECT_SELF, sHenchSummonedFamiliar))
|
||||
{
|
||||
object oFam = GetLocalObject(OBJECT_SELF, sHenchSummonedFamiliar);
|
||||
if(GetIsObjectValid(oFam))
|
||||
{
|
||||
//if(DEBUG) DoDebug(GetName(OBJECT_SELF) + " destroy familiar");
|
||||
DestroyObject(oFam, 0.1);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oFam));
|
||||
}
|
||||
}
|
||||
if(GetLocalInt(OBJECT_SELF, sHenchSummonedAniComp))
|
||||
{
|
||||
object oAni = GetLocalObject(OBJECT_SELF, sHenchSummonedAniComp);
|
||||
if(GetIsObjectValid(oAni))
|
||||
{
|
||||
//if(DEBUG) DoDebug(GetName(OBJECT_SELF) + " destroy ani comp");
|
||||
DestroyObject(oAni, 0.1);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oAni));
|
||||
}
|
||||
}
|
||||
|
||||
ClearEnemyLocation();
|
||||
//End Hench AI
|
||||
|
||||
// Call to allies to let them know we're dead
|
||||
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
// NOTE: the OnDeath user-defined event does not
|
||||
// trigger reliably and should probably be removed
|
||||
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
|
||||
craft_drop_items(oKiller);
|
||||
|
||||
ExecuteScript("prc_npc_death", OBJECT_SELF);
|
||||
ExecuteScript("prc_pwondeath", OBJECT_SELF);
|
||||
}
|
||||
|
||||
void ClearEnemyLocation()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
DeleteLocalLocation(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
|
||||
object oInvisTarget = GetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
if (GetIsObjectValid(oInvisTarget))
|
||||
{
|
||||
DestroyObject(oInvisTarget);
|
||||
DeleteLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
}
|
||||
}
|
24
nwn/nwnprc/trunk/spells/nw_s0_2pitfiend.nss
Normal file
24
nwn/nwnprc/trunk/spells/nw_s0_2pitfiend.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Pit Fiend Payload
|
||||
//:: NW_S0_2PitFiend
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
DEATH --- DEATH --- BO HA HA HA
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 11, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = OBJECT_SELF;
|
||||
effect eDrain = EffectDeath();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
|
||||
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDrain, oTarget);
|
||||
}
|
165
nwn/nwnprc/trunk/spells/nw_s0_abilbuff.nss
Normal file
165
nwn/nwnprc/trunk/spells/nw_s0_abilbuff.nss
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
nw_s0_abilbuff.nss
|
||||
|
||||
Ability buffs, ultravision and
|
||||
mass versions thereof
|
||||
|
||||
By: Flaming_Sword
|
||||
Created: Jul 1, 2006
|
||||
Modified: Jul 2, 2006
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
|
||||
void StripBuff(object oTarget, int nBuffSpellID, int nMassBuffSpellID)
|
||||
{
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
int nSpellID = GetEffectSpellId(eEffect);
|
||||
if (nBuffSpellID == nSpellID || nMassBuffSpellID == nSpellID)
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nSpellID, int nCasterLevel, int nEvent)
|
||||
{
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int bVision = (nSpellID == SPELL_DARKVISION) || (nSpellID == SPELL_MASS_ULTRAVISION);
|
||||
int bMass = (nSpellID >= SPELL_MASS_BULLS_STRENGTH) && (nSpellID <= SPELL_MASS_ULTRAVISION);
|
||||
effect eVis, eDur;
|
||||
int nAbility, nAltSpellID;
|
||||
if(bVision)
|
||||
{
|
||||
eDur = EffectVisualEffect(VFX_DUR_ULTRAVISION);
|
||||
eDur = EffectLinkEffects(eDur, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
|
||||
eDur = EffectLinkEffects(eDur, EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT));
|
||||
}
|
||||
else
|
||||
{
|
||||
eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
if((nSpellID == SPELL_BULLS_STRENGTH) || (nSpellID == SPELL_MASS_BULLS_STRENGTH))
|
||||
{
|
||||
nAbility = ABILITY_STRENGTH;
|
||||
eVis = EffectVisualEffect(VFX_IMP_BONUS_STRENGTH);
|
||||
if(nSpellID == SPELL_BULLS_STRENGTH)
|
||||
nAltSpellID = SPELL_MASS_BULLS_STRENGTH;
|
||||
else
|
||||
nAltSpellID = SPELL_BULLS_STRENGTH;
|
||||
}
|
||||
else if((nSpellID == SPELL_CATS_GRACE) || (nSpellID == SPELL_MASS_CATS_GRACE))
|
||||
{
|
||||
nAbility = ABILITY_DEXTERITY;
|
||||
eVis = EffectVisualEffect(VFX_IMP_BONUS_DEXTERITY);
|
||||
if(nSpellID == SPELL_CATS_GRACE)
|
||||
nAltSpellID = SPELL_MASS_CATS_GRACE;
|
||||
else
|
||||
nAltSpellID = SPELL_CATS_GRACE;
|
||||
}
|
||||
else if((nSpellID == SPELL_ENDURANCE) || (nSpellID == SPELL_MASS_ENDURANCE))
|
||||
{
|
||||
nAbility = ABILITY_CONSTITUTION;
|
||||
eVis = EffectVisualEffect(VFX_IMP_BONUS_CONSTITUTION);
|
||||
if(nSpellID == SPELL_ENDURANCE)
|
||||
nAltSpellID = SPELL_MASS_ENDURANCE;
|
||||
else
|
||||
nAltSpellID = SPELL_ENDURANCE;
|
||||
}
|
||||
else if((nSpellID == SPELL_EAGLE_SPLEDOR) || (nSpellID == SPELL_MASS_EAGLES_SPLENDOR))
|
||||
{
|
||||
nAbility = ABILITY_CHARISMA;
|
||||
eVis = EffectVisualEffect(VFX_IMP_BONUS_CHARISMA);
|
||||
if(nSpellID == SPELL_EAGLE_SPLEDOR)
|
||||
nAltSpellID = SPELL_MASS_EAGLES_SPLENDOR;
|
||||
else
|
||||
nAltSpellID = SPELL_EAGLE_SPLEDOR;
|
||||
}
|
||||
else if((nSpellID == SPELL_OWLS_WISDOM) || (nSpellID == SPELL_MASS_OWLS_WISDOM))
|
||||
{
|
||||
nAbility = ABILITY_WISDOM;
|
||||
eVis = EffectVisualEffect(VFX_IMP_BONUS_WISDOM);
|
||||
if(nSpellID == SPELL_OWLS_WISDOM)
|
||||
nAltSpellID = SPELL_MASS_OWLS_WISDOM;
|
||||
else
|
||||
nAltSpellID = SPELL_OWLS_WISDOM;
|
||||
}
|
||||
else if((nSpellID == SPELL_FOXS_CUNNING) || (nSpellID == SPELL_MASS_FOXS_CUNNING))
|
||||
{
|
||||
nAbility = ABILITY_INTELLIGENCE;
|
||||
eVis = EffectVisualEffect(VFX_IMP_BONUS_INTELLIGENCE);
|
||||
if(nSpellID == SPELL_FOXS_CUNNING)
|
||||
nAltSpellID = SPELL_MASS_FOXS_CUNNING;
|
||||
else
|
||||
nAltSpellID = SPELL_FOXS_CUNNING;
|
||||
}
|
||||
}
|
||||
float fDuration = HoursToSeconds(nCasterLevel);
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2;
|
||||
location lTarget;
|
||||
if(bMass)
|
||||
{
|
||||
lTarget = PRCGetSpellTargetLocation();
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if((!bMass) || (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster)))
|
||||
{
|
||||
PRCSignalSpellEvent(oTarget, FALSE);
|
||||
//if(bMass) fDelay = PRCGetSpellEffectDelay(lTarget, oTarget);
|
||||
int nStatMod = d4() + 1;
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE) nStatMod = 5;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER) nStatMod += (nStatMod / 2);
|
||||
effect eBuff;
|
||||
if(bVision)
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectLinkEffects(EffectUltravision(), eDur), oTarget, fDuration,TRUE,-1,nCasterLevel);
|
||||
else
|
||||
{
|
||||
StripBuff(oTarget, nSpellID, nAltSpellID);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectLinkEffects(EffectAbilityIncrease(nAbility, nStatMod), eDur), oTarget, fDuration,TRUE,-1,nCasterLevel);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
if(!bMass) break;
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget && IsTouchSpell(nSpellID))
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nSpellID, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nSpellID, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
149
nwn/nwnprc/trunk/spells/nw_s0_acidarrow.nss
Normal file
149
nwn/nwnprc/trunk/spells/nw_s0_acidarrow.nss
Normal file
@@ -0,0 +1,149 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Melf's Acid Arrow
|
||||
//:: Greater Shadow Conjuration: Melf's Acid Arrow
|
||||
//:: FileName nw_s0_acidarrow.nss
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
/*:://////////////////////////////////////////////
|
||||
Melf's Acid Arrow
|
||||
Conjuration (Creation) [Acid]
|
||||
Level: Sor/Wiz 2
|
||||
Components: V, S, M, F
|
||||
Casting Time: 1 standard action
|
||||
Range: Long (400 ft. + 40 ft./level)
|
||||
Effect: One arrow of acid
|
||||
Duration: 1 round + 1 round per three levels
|
||||
Saving Throw: None
|
||||
Spell Resistance: No
|
||||
|
||||
A magical arrow of acid springs from your hand and
|
||||
speeds to its target. You must succeed on a ranged
|
||||
touch attack to hit your target. The arrow deals
|
||||
2d4 points of acid damage with no splash damage.
|
||||
For every three caster levels (to a maximum of 18th),
|
||||
the acid, unless somehow neutralized, lasts for
|
||||
another round, dealing another 2d4 points of damage
|
||||
in that round.
|
||||
|
||||
Material Component
|
||||
Powdered rhubarb leaf and an adder<65>s stomach.
|
||||
|
||||
Focus
|
||||
A dart.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: xwarren
|
||||
//:: Created On: 2011-01-07
|
||||
//::*/////////////////////////////////////////////
|
||||
|
||||
#include "prc_inc_sp_tch"
|
||||
|
||||
void ArrowImpact(object oTarget, object oCaster, int nDuration, int nMetaMagic, int iAttackRoll, int nSpellID);
|
||||
void PerRoundDamage(object oTarget, object oCaster, int nDuration, int nMetamagic, int EleDmg, int nSpellID);
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int nSchool;
|
||||
|
||||
switch(nSpellID)
|
||||
{
|
||||
case SPELL_MELFS_ACID_ARROW: nSchool = SPELL_SCHOOL_CONJURATION; break;
|
||||
case SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW: nSchool = SPELL_SCHOOL_ILLUSION; break;
|
||||
}
|
||||
|
||||
PRCSetSchool(nSchool);
|
||||
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
effect eArrow = EffectVisualEffect(VFX_DUR_MIRV_ACID);
|
||||
|
||||
int nDuration = (CasterLvl / 3);
|
||||
if(nDuration > 6) nDuration = 6;
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
|
||||
CasterLvl += SPGetPenetr();
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget, oCaster))
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID));
|
||||
|
||||
int iAttackRoll = PRCDoRangedTouchAttack(oTarget);
|
||||
if(iAttackRoll > 0)
|
||||
{
|
||||
float fDelay = GetDistanceToObject(oTarget) / 25.0f;
|
||||
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, CasterLvl, fDelay))
|
||||
{
|
||||
DelayCommand(fDelay, ArrowImpact(oTarget, oCaster, nDuration, nMetaMagic, iAttackRoll, nSpellID));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Indicate Failure
|
||||
effect eSmoke = EffectVisualEffect(VFX_IMP_REFLEX_SAVE_THROW_USE);
|
||||
DelayCommand(fDelay+0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSmoke, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eArrow, oTarget);
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
||||
|
||||
void ArrowImpact(object oTarget, object oCaster, int nDuration, int nMetaMagic, int iAttackRoll, int nSpellID)
|
||||
{
|
||||
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ACID);
|
||||
|
||||
// Setup VFX
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ACID_L);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
// Set the VFX to be non dispelable, because the acid is not magic
|
||||
eDur = ExtraordinaryEffect(eDur);
|
||||
|
||||
// Calculate damage
|
||||
int nDamage = d4(2);
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 8;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage += nDamage / 2;
|
||||
// Acid Sheath adds +1 damage per die to acid descriptor spells
|
||||
if (GetHasDescriptor(nSpellID, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster))
|
||||
nDamage += 2;
|
||||
nDamage += SpellDamagePerDice(oCaster, 2);
|
||||
// Apply the VFX and initial damage
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, oTarget, RoundsToSeconds(nDuration), FALSE);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDamage, EleDmg);
|
||||
PRCBonusDamage(oTarget);
|
||||
|
||||
nDuration--;
|
||||
DelayCommand(6.0f, PerRoundDamage(oTarget, oCaster, nDuration, nMetaMagic, EleDmg, nSpellID));
|
||||
}
|
||||
|
||||
void PerRoundDamage(object oTarget, object oCaster, int nDuration, int nMetaMagic, int EleDmg, int nSpellID)
|
||||
{
|
||||
if(GetIsDead(oTarget))
|
||||
return;
|
||||
|
||||
// Calculate damage
|
||||
int nDamage = d4(2);
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 8;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage += nDamage / 2;
|
||||
// Acid Sheath adds +1 damage per die to acid descriptor spells
|
||||
if (GetHasDescriptor(nSpellID, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster))
|
||||
nDamage += 2;
|
||||
nDamage += SpellDamagePerDice(oCaster, 2);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
eDam = EffectLinkEffects(eVis, eDam);
|
||||
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
|
||||
if(nDuration--)
|
||||
DelayCommand(6.0f, PerRoundDamage(oTarget, oCaster, nDuration, nMetaMagic, EleDmg, nSpellID));
|
||||
}
|
66
nwn/nwnprc/trunk/spells/nw_s0_acidfog.nss
Normal file
66
nwn/nwnprc/trunk/spells/nw_s0_acidfog.nss
Normal file
@@ -0,0 +1,66 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Acid Fog
|
||||
//:: NW_S0_AcidFog.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Acid Fog
|
||||
Conjuration (Creation) [Acid]
|
||||
Level: Sor/Wiz 6, Water 7
|
||||
Components: V, S, M/DF
|
||||
Casting Time: 1 standard action
|
||||
Range: Medium (100 ft. + 10 ft./level)
|
||||
Effect: Fog spreads in 20-ft. radius, 20 ft. high
|
||||
Duration: 1 round/level
|
||||
Saving Throw: None
|
||||
Spell Resistance: No
|
||||
|
||||
Acid fog creates a billowing mass of misty vapors
|
||||
similar to that produced by a solid fog spell. In
|
||||
addition to slowing creatures down and obscuring
|
||||
sight, this spell<6C>s vapors are highly acidic. Each
|
||||
round on your turn, starting when you cast the
|
||||
spell, the fog deals 2d6 points of acid damage to
|
||||
each creature and object within it.
|
||||
|
||||
Arcane Material Component
|
||||
A pinch of dried, powdered peas combined with
|
||||
powdered animal hoof.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 17, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 20, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables including Area of Effect Object
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDuration = CasterLvl / 2;
|
||||
if(nDuration < 1) nDuration = 1;
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_FOGACID);
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_ACID);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget);
|
||||
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_FOGACID");
|
||||
SetAllAoEInts(SPELL_ACID_FOG, oAoE, PRCGetSpellSaveDC(SPELL_ACID_FOG, SPELL_SCHOOL_CONJURATION), 0, CasterLvl);
|
||||
SetLocalInt(oAoE, "Acid_Fog_Damage", ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ACID));
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
70
nwn/nwnprc/trunk/spells/nw_s0_acidfoga.nss
Normal file
70
nwn/nwnprc/trunk/spells/nw_s0_acidfoga.nss
Normal file
@@ -0,0 +1,70 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
//:://///////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
object oTarget = GetEnteringObject();
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
|
||||
effect eSlow = EffectMovementSpeedDecrease(50);
|
||||
float fDelay = PRCGetRandomDelay(1.0, 2.2);
|
||||
int nPenetr = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level") + SPGetPenetr(oCaster);
|
||||
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
//Fire cast spell at event for the target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ACID_FOG));
|
||||
//Spell resistance check
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
//Roll Damage
|
||||
//Enter Metamagic conditions
|
||||
int nDamage = d6(2);
|
||||
if (nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 12;//Damage is at max
|
||||
if (nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
|
||||
// Acid Sheath adds +1 damage per die to acid descriptor spells
|
||||
if (GetHasDescriptor(SPELL_ACID_FOG, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster))
|
||||
nDamage += 2;
|
||||
nDamage += SpellDamagePerDice(oCaster, 2);
|
||||
//Make a Fortitude Save to avoid the effects of the movement hit.
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,oCaster)), SAVING_THROW_TYPE_ACID, oCaster, fDelay))
|
||||
{
|
||||
//slowing effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eSlow, oTarget,0.0f,FALSE);
|
||||
// * BK: Removed this because it reduced damage, didn't make sense nDamage = d6();
|
||||
}
|
||||
|
||||
//Set Damage Effect with the modified damage
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, GetLocalInt(OBJECT_SELF, "Acid_Fog_Damage"));
|
||||
//Apply damage and visuals
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
57
nwn/nwnprc/trunk/spells/nw_s0_acidfogb.nss
Normal file
57
nwn/nwnprc/trunk/spells/nw_s0_acidfogb.nss
Normal file
@@ -0,0 +1,57 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
int bValid = FALSE;
|
||||
effect eAOE;
|
||||
if(GetHasSpellEffect(SPELL_ACID_FOG, oTarget))
|
||||
{
|
||||
//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_MOVEMENT_SPEED_DECREASE)
|
||||
{
|
||||
//If the effect was created by the Acid_Fog then remove it
|
||||
if(GetEffectSpellId(eAOE) == SPELL_ACID_FOG)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
||||
|
84
nwn/nwnprc/trunk/spells/nw_s0_acidfogc.nss
Normal file
84
nwn/nwnprc/trunk/spells/nw_s0_acidfogc.nss
Normal file
@@ -0,0 +1,84 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
// When the caster is no longer there, all functions calling
|
||||
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
if(!GetIsObjectValid(oCaster))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
//Declare major variables
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage = d6(2);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
nDamage = 12;//Damage is at max
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
nDamage = nDamage + (nDamage/2);
|
||||
// Acid Sheath adds +1 damage per die to acid descriptor spells
|
||||
if (GetHasDescriptor(SPELL_ACID_FOG, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster))
|
||||
nDamage += 2;
|
||||
nDamage += SpellDamagePerDice(oCaster, 2);
|
||||
int nPenetr = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level") + SPGetPenetr(oCaster);
|
||||
|
||||
//Start cycling through the AOE Object for viable targets including doors and placable objects.
|
||||
object oTarget = GetFirstInPersistentObject(OBJECT_SELF);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
int nDamageType = GetLocalInt(OBJECT_SELF, "Acid_Fog_Damage");
|
||||
int nSaveType = ChangedSaveType(nDamageType);
|
||||
float fDelay = PRCGetRandomDelay(0.4, 1.2);
|
||||
|
||||
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, nSaveType, oCaster, fDelay))
|
||||
{
|
||||
// This script does nothing if it has Mettle else deal only 1/2 damage
|
||||
nDamage = GetHasMettle(oTarget, SAVING_THROW_FORT) ? 0 : nDamage / 2;
|
||||
}
|
||||
//Fire cast spell at event for the affected target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ACID_FOG));
|
||||
//Spell resistance check
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
//Set the damage effect
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, nDamageType);
|
||||
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
}
|
||||
//Get next target.
|
||||
oTarget = GetNextInPersistentObject(OBJECT_SELF);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
131
nwn/nwnprc/trunk/spells/nw_s0_aid.nss
Normal file
131
nwn/nwnprc/trunk/spells/nw_s0_aid.nss
Normal file
@@ -0,0 +1,131 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Aid/Mass Aid
|
||||
//:: FileName nw_s0_aid.nss
|
||||
/*:://////////////////////////////////////////////
|
||||
Aid
|
||||
Enchantment (Compulsion) [Mind-Affecting]
|
||||
Level: Clr 2, Good 2, Luck 2
|
||||
Components: V, S, DF
|
||||
Casting Time: 1 standard action
|
||||
Range: Touch
|
||||
Target: Living creature touched
|
||||
Duration: 1 min./level
|
||||
Saving Throw: None
|
||||
Spell Resistance: Yes (harmless)
|
||||
|
||||
Aid grants the target a +1 morale bonus on attack
|
||||
rolls and saves against fear effects, plus
|
||||
temporary hit points equal to 1d8 + caster level
|
||||
(to a maximum of 1d8 + 10 temporary hit points at
|
||||
caster level 10th).
|
||||
|
||||
Mass Aid
|
||||
Enchantment (Compulsion) [Mind-Affecting]
|
||||
Level: Clr 3
|
||||
Range: Close (25 ft. + 5 ft./2 levels)
|
||||
Targets: One or more creatures within a 30 ft. range.
|
||||
Components: V, S, DF
|
||||
Casting Time: 1 standard action
|
||||
Duration: 1 min./level
|
||||
Saving Throw: None
|
||||
Spell Resistance: Yes (harmless)
|
||||
|
||||
Subjects gain +1 morale bonus on attack rolls and
|
||||
saves against fear effects, plus temporary hit
|
||||
points equal to 1d8 + caster level (to a maximum
|
||||
of 1d8 + 15 at caster level 15).
|
||||
//::*/////////////////////////////////////////////
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
void StripBuff(object oTarget, int nBuffSpellID, int nMassBuffSpellID)
|
||||
{
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
int nSpellID = GetEffectSpellId(eEffect);
|
||||
if (nBuffSpellID == nSpellID || nMassBuffSpellID == nSpellID)
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nSpellID)
|
||||
{
|
||||
//Declare major variables
|
||||
location lTarget;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int bMass = nSpellID == SPELL_MASS_AID;
|
||||
int nBonusLimit = bMass ? 15 : 10;
|
||||
float fDuration = TurnsToSeconds(nCasterLevel);
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID);
|
||||
effect eAttack = EffectAttackIncrease(1);
|
||||
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_ALL, 1, SAVING_THROW_TYPE_FEAR);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eLink = EffectLinkEffects(eAttack, eSave);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
if(bMass)
|
||||
{
|
||||
lTarget = PRCGetSpellTargetLocation();
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(((!bMass) || (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))) && PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE));
|
||||
|
||||
int nBonus = d8(1);
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE) nBonus = 8;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER) nBonus += (nBonus / 2);
|
||||
nBonus += nBonusLimit > nCasterLevel ? nCasterLevel : nBonusLimit;
|
||||
|
||||
effect eHP = EffectTemporaryHitpoints(nBonus);
|
||||
|
||||
// Remove pervious castings of it
|
||||
StripBuff(oTarget, SPELL_AID, SPELL_MASS_AID);
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, nSpellID, nCasterLevel, oCaster);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, fDuration);
|
||||
}
|
||||
if(!bMass) break;
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget && IsTouchSpell(nSpellID))
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nSpellID);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nSpellID))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
101
nwn/nwnprc/trunk/spells/nw_s0_animdead.nss
Normal file
101
nwn/nwnprc/trunk/spells/nw_s0_animdead.nss
Normal file
@@ -0,0 +1,101 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Animate Dead
|
||||
//:: NW_S0_AnimDead.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Summons a powerful skeleton or zombie depending
|
||||
on caster level.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 11, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_template"
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_NECROMANCY);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nLichHD = GetHitDice(oCaster);
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
float fDuration = HoursToSeconds(24);
|
||||
//Metamagic extension if needed
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2; //Duration is +100%
|
||||
|
||||
string sResRef;
|
||||
int nHD;
|
||||
|
||||
//Summon the appropriate creature based on the summoner level
|
||||
if (nCasterLevel <= 5)
|
||||
{
|
||||
//Tyrant Fog Zombie
|
||||
sResRef = "NW_S_ZOMBTYRANT";
|
||||
nHD = 4;
|
||||
}
|
||||
else if ((nCasterLevel >= 6) && (nCasterLevel <= 9))
|
||||
{
|
||||
//Skeleton Warrior
|
||||
sResRef = "NW_S_SKELWARR";
|
||||
nHD = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Skeleton Chieftain
|
||||
sResRef = "NW_S_SKELCHIEF";
|
||||
nHD = 7;
|
||||
}
|
||||
|
||||
effect eSummon = EffectSummonCreature(sResRef, VFX_FNF_SUMMON_UNDEAD);
|
||||
|
||||
MultisummonPreSummon();
|
||||
|
||||
if(GetPRCSwitch(PRC_PNP_ANIMATE_DEAD))
|
||||
{
|
||||
int nMaxHD = GetLevelByClass(CLASS_TYPE_DREAD_NECROMANCER, oCaster) >= 8 ?
|
||||
nCasterLevel * (4 + GetAbilityModifier(ABILITY_CHARISMA, oCaster)) : nCasterLevel * 4;
|
||||
|
||||
if(GetHasSpellEffect(SPELL_DES_20) || GetHasSpellEffect(SPELL_DES_100) || GetHasSpellEffect(SPELL_DESECRATE))
|
||||
nMaxHD *= 2;
|
||||
|
||||
if(GetHasTemplate(TEMPLATE_ARCHLICH, oCaster)) //: Archlich
|
||||
nMaxHD = nLichHD;
|
||||
|
||||
int nTotalHD = GetControlledUndeadTotalHD();
|
||||
|
||||
int nGold = GetGold(oCaster);
|
||||
int nCost = nHD * 25;
|
||||
if((nTotalHD+nHD) <= nMaxHD)
|
||||
{
|
||||
if(nCost > nGold)
|
||||
{
|
||||
FloatingTextStringOnCreature("You have insufficient gold to animate this creature", oCaster, FALSE);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
TakeGoldFromCreature(nCost, oCaster, TRUE);
|
||||
eSummon = SupernaturalEffect(eSummon);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eSummon, lTarget);
|
||||
FloatingTextStringOnCreature("Currently have "+IntToString(nTotalHD+nHD)+"HD out of "+IntToString(nMaxHD)+"HD.", oCaster);
|
||||
}
|
||||
}
|
||||
else
|
||||
FloatingTextStringOnCreature("You cannot create more undead at this time.", oCaster);
|
||||
}
|
||||
else
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lTarget, fDuration);
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
74
nwn/nwnprc/trunk/spells/nw_s0_auravital.nss
Normal file
74
nwn/nwnprc/trunk/spells/nw_s0_auravital.nss
Normal file
@@ -0,0 +1,74 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Aura of Vitality
|
||||
//:: NW_S0_AuraVital
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Transmutation
|
||||
Level: Druid 7
|
||||
Components: V, S
|
||||
Casting Time: 1 standard action
|
||||
Range: Close (25 ft. + 5 ft./2 levels)
|
||||
Target: One creature/3 levels, no two of
|
||||
which are more than 30 ft. apart
|
||||
Duration: 1 round/level
|
||||
Saving Throw: Will negates (harmless)
|
||||
Spell Resistance: Yes (harmless)
|
||||
|
||||
All subjects recive a +4 morale bonus to Strength,
|
||||
Dexterity and Constitution.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lCaster = GetLocation(oCaster);
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
float fDuration = RoundsToSeconds(CasterLvl);
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2; //Duration is +100%
|
||||
|
||||
effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH,4);
|
||||
effect eDex = EffectAbilityIncrease(ABILITY_DEXTERITY,4);
|
||||
effect eCon = EffectAbilityIncrease(ABILITY_CONSTITUTION,4);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
effect eLink = EffectLinkEffects(eStr, eDex);
|
||||
eLink = EffectLinkEffects(eLink, eCon);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE);
|
||||
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lCaster);
|
||||
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lCaster);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(GetFactionEqual(oTarget) || GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
float fDelay = PRCGetRandomDelay(0.4, 1.1);
|
||||
//Signal the spell cast at event
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_AURA_OF_VITALITY, FALSE));
|
||||
//Apply effects and VFX to target
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, SPELL_AURA_OF_VITALITY, CasterLvl));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lCaster);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
92
nwn/nwnprc/trunk/spells/nw_s0_awaken.nss
Normal file
92
nwn/nwnprc/trunk/spells/nw_s0_awaken.nss
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
nw_s0_awaken
|
||||
|
||||
This spell makes an animal ally more
|
||||
powerful, intelligent and robust for the
|
||||
duration of the spell. Requires the caster to
|
||||
make a Will save to succeed.
|
||||
|
||||
By: Preston Watamaniuk
|
||||
Created: Aug 10, 2001
|
||||
Modified: Jun 12, 2006
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "inc_npc"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH, 4);
|
||||
effect eCon = EffectAbilityIncrease(ABILITY_CONSTITUTION, 4);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eInt;
|
||||
effect eAttack = EffectAttackIncrease(2);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID);
|
||||
int nInt = d10();
|
||||
//int nDuration = 24;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
|
||||
if(GetAssociateTypeNPC(oTarget) == ASSOCIATE_TYPE_ANIMALCOMPANION && GetMasterNPC(oTarget) == oCaster)
|
||||
{
|
||||
if(!GetHasSpellEffect(SPELL_AWAKEN))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_AWAKEN, FALSE));
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nInt = 10;//Damage is at max
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nInt += (nInt/2); //Damage/Healing is +50%
|
||||
//if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
// nDuration *= 2; //Duration is +100%
|
||||
|
||||
eInt = EffectAbilityIncrease(ABILITY_WISDOM, nInt);
|
||||
|
||||
effect eLink = EffectLinkEffects(eStr, eCon);
|
||||
eLink = EffectLinkEffects(eLink, eAttack);
|
||||
eLink = EffectLinkEffects(eLink, eInt);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = SupernaturalEffect(eLink);
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f, TRUE, SPELL_AWAKEN, nCasterLevel);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
95
nwn/nwnprc/trunk/spells/nw_s0_barkskin.nss
Normal file
95
nwn/nwnprc/trunk/spells/nw_s0_barkskin.nss
Normal file
@@ -0,0 +1,95 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Barkskin
|
||||
//:: nw_s0_barkskin.nss
|
||||
//::///////////////////////////////////////////////
|
||||
/*
|
||||
Transmutation
|
||||
Level: Drd 2, Rgr 2, Plant 2
|
||||
Components: V, S, DF
|
||||
Casting Time: 1 standard action
|
||||
Range: Touch
|
||||
Target: Living creature touched
|
||||
Duration: 10 min./level
|
||||
Saving Throw: None
|
||||
Spell Resistance: Yes (harmless)
|
||||
|
||||
Barkskin toughens a creature<72>s skin. The effect
|
||||
grants a +2 enhancement bonus to the creature<72>s
|
||||
existing natural armor bonus. This enhancement
|
||||
bonus increases by 1 for every three caster levels
|
||||
above 3rd, to a maximum of +5 at caster level 12th.
|
||||
|
||||
The enhancement bonus provided by barkskin stacks
|
||||
with the target<65>s natural armor bonus, but not with
|
||||
other enhancement bonuses to natural armor. A
|
||||
creature without natural armor has an effective
|
||||
natural armor bonus of +0.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: By: Preston Watamaniuk
|
||||
//:: Created: Feb 21, 2001
|
||||
//:: Modified: Jun 12, 2006
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel)
|
||||
{
|
||||
if(!PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
FloatingTextStringOnCreature("Selected target is not a living creature.", oCaster, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
float fDuration = TurnsToSeconds(nCasterLevel) * 10;
|
||||
//Enter Metamagic conditions
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) //Duration is +100%
|
||||
fDuration *= 2;
|
||||
|
||||
//Determine AC Bonus based Level.
|
||||
int nBonus = (nCasterLevel / 3) + 1;
|
||||
if(nBonus > 5)
|
||||
nBonus = 5;
|
||||
|
||||
//Make sure the Armor Bonus is of type Natural
|
||||
effect eLink = EffectACIncrease(nBonus, AC_NATURAL_BONUS);
|
||||
eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN));
|
||||
eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
|
||||
effect eHead = EffectVisualEffect(VFX_IMP_HEAD_NATURE);
|
||||
|
||||
//Signal spell cast at event
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_BARKSKIN, FALSE));
|
||||
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, SPELL_BARKSKIN, nCasterLevel);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHead, oTarget);
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLevel = PRCGetCasterLevel();
|
||||
int nEvent = GetLocalInt(OBJECT_SELF, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(OBJECT_SELF, PRC_SPELL_HOLD) && OBJECT_SELF == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(OBJECT_SELF, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(OBJECT_SELF, oTarget, nCasterLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(OBJECT_SELF, oTarget, nCasterLevel))
|
||||
DecrementSpellCharges(OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
119
nwn/nwnprc/trunk/spells/nw_s0_bescurse.nss
Normal file
119
nwn/nwnprc/trunk/spells/nw_s0_bescurse.nss
Normal file
@@ -0,0 +1,119 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Bestow Curse
|
||||
//:: Greater Bestow Curse
|
||||
//:: nw_s0_bescurse.nss
|
||||
//::///////////////////////////////////////////////
|
||||
/*
|
||||
Bestow Curse
|
||||
Necromancy
|
||||
Level: Clr 3, Sor/Wiz 4
|
||||
Components: V, S
|
||||
Casting Time: 1 standard action
|
||||
Range: Touch
|
||||
Target: Creature touched
|
||||
Duration: Permanent
|
||||
Saving Throw: Will negates
|
||||
Spell Resistance: Yes
|
||||
|
||||
You place a curse on the subject. Choose one of the
|
||||
following three effects:
|
||||
-6 decrease to an ability score (minimum 1).
|
||||
-4 penalty on attack rolls, saves, ability checks,
|
||||
and skill checks.
|
||||
Each turn, the target has a 50% chance to act
|
||||
normally; otherwise, it takes no action.
|
||||
|
||||
You may also invent your own curse, but it should
|
||||
be no more powerful than those described above.
|
||||
|
||||
The curse bestowed by this spell cannot be dispelled,
|
||||
but it can be removed with a break enchantment,
|
||||
limited wish, miracle, remove curse, or wish spell.
|
||||
|
||||
Bestow curse counters remove curse.
|
||||
|
||||
Greater Bestow Curse
|
||||
???
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: NWN version:
|
||||
//:: Afflicted creature must save or suffer a -2 penalty
|
||||
//:: to all ability scores. This is a supernatural effect.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: By: Bob McCabe
|
||||
//:: Created: March 6, 2001
|
||||
//:: Modified: Jun 12, 2006
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Flaming_Sword: Added touch attack roll
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_sp_func"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel)
|
||||
{
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int iAttackRoll = PRCDoMeleeTouchAttack(oTarget);
|
||||
if (iAttackRoll > 0)
|
||||
{
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
int nPenalty = nSpellID == SPELL_GREATER_BESTOW_CURSE ? 4 : 2;
|
||||
nPenalty *= iAttackRoll;//can score a *Critical Hit*
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
|
||||
effect eCurse = EffectCurse(nPenalty, //str
|
||||
nPenalty, //dex
|
||||
nPenalty, //con
|
||||
nPenalty, //int
|
||||
nPenalty, //wis
|
||||
nPenalty);//cha
|
||||
//Make sure that curse is of type supernatural not magical
|
||||
eCurse = SupernaturalEffect(eCurse);
|
||||
|
||||
//Signal spell cast at event
|
||||
SignalEvent(oTarget, EventSpellCastAt(oTarget, nSpellID));
|
||||
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
|
||||
{
|
||||
//Make Will Save
|
||||
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster)))
|
||||
{
|
||||
//Apply Effect and VFX
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eCurse, oTarget, 0.0f, TRUE, nSpellID, nCasterLevel);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return iAttackRoll; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_NECROMANCY);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
66
nwn/nwnprc/trunk/spells/nw_s0_bladebar.nss
Normal file
66
nwn/nwnprc/trunk/spells/nw_s0_bladebar.nss
Normal file
@@ -0,0 +1,66 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Blade Barrier
|
||||
//:: NW_S0_BladeBar.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
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables including Area of Effect Object
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_WALLBLADE);
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
|
||||
//Check Extend metamagic feat.
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_WALLBLADE");
|
||||
SetAllAoEInts(SPELL_BLADE_BARRIER, oAoE, PRCGetSpellSaveDC(SPELL_BLADE_BARRIER, SPELL_SCHOOL_EVOCATION), 0, CasterLvl);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
||||
|
81
nwn/nwnprc/trunk/spells/nw_s0_bladebara.nss
Normal file
81
nwn/nwnprc/trunk/spells/nw_s0_bladebara.nss
Normal file
@@ -0,0 +1,81 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetEnteringObject();
|
||||
effect eDam;
|
||||
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
|
||||
object aoeCreator = GetAreaOfEffectCreator();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nLevel = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
int CasterLvl = nLevel;
|
||||
|
||||
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
|
||||
|
||||
//Make level check
|
||||
if (nLevel > 20)
|
||||
{
|
||||
nLevel = 20;
|
||||
}
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
|
||||
{
|
||||
//Fire spell cast at event
|
||||
SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_BLADE_BARRIER));
|
||||
//Roll Damage
|
||||
int nDamage = d6(nLevel);
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = nLevel * 6;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2);
|
||||
}
|
||||
nDamage += SpellDamagePerDice(aoeCreator, nLevel);
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(aoeCreator, oTarget,nPenetr) )
|
||||
{
|
||||
// 1.69 change
|
||||
//Adjust damage according to Reflex Save, Evasion or Improved Evasion
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget,aoeCreator),SAVING_THROW_TYPE_SPELL);
|
||||
|
||||
//Set damage effect
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SLASHING);
|
||||
//Apply damage and VFX
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
102
nwn/nwnprc/trunk/spells/nw_s0_bladebarc.nss
Normal file
102
nwn/nwnprc/trunk/spells/nw_s0_bladebarc.nss
Normal file
@@ -0,0 +1,102 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oTarget;
|
||||
effect eDam;
|
||||
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED);
|
||||
object aoeCreator = GetAreaOfEffectCreator();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
int nLevel = CasterLvl;
|
||||
//Make level check
|
||||
if (nLevel > 20)
|
||||
{
|
||||
nLevel = 20;
|
||||
}
|
||||
|
||||
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ 2003-Oct-15
|
||||
// Add damage to placeables/doors now that the command support bit fields
|
||||
//--------------------------------------------------------------------------
|
||||
oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR);
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ 2003-Oct-15
|
||||
// When the caster is no longer there, all functions calling
|
||||
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
|
||||
//--------------------------------------------------------------------------
|
||||
if (!GetIsObjectValid(aoeCreator))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
|
||||
{
|
||||
//Fire spell cast at event
|
||||
SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_BLADE_BARRIER));
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(aoeCreator, oTarget,CasterLvl) )
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget,aoeCreator);
|
||||
//Roll Damage
|
||||
int nDamage = d6(nLevel);
|
||||
//Enter Metamagic conditions
|
||||
if((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = nLevel * 6;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2);
|
||||
}
|
||||
nDamage += SpellDamagePerDice(aoeCreator, nLevel);
|
||||
// 1.69 change
|
||||
//Adjust damage according to Reflex Save, Evasion or Improved Evasion
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget,aoeCreator),SAVING_THROW_TYPE_SPELL);
|
||||
//Set damage effect
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SLASHING);
|
||||
//Apply damage and VFX
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR);
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
||||
|
111
nwn/nwnprc/trunk/spells/nw_s0_bless.nss
Normal file
111
nwn/nwnprc/trunk/spells/nw_s0_bless.nss
Normal file
@@ -0,0 +1,111 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Bless
|
||||
//:: NW_S0_Bless.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Bless
|
||||
Enchantment (Compulsion) [Mind-Affecting]
|
||||
Level: Clr 1, Pal 1
|
||||
Components: V, S, DF
|
||||
Casting Time: 1 standard action
|
||||
Range: 50 ft.
|
||||
Area: The caster and all allies within
|
||||
a 50-ft. burst, centered on the caster
|
||||
Duration: 1 min./level
|
||||
Saving Throw: None
|
||||
Spell Resistance: Yes (harmless)
|
||||
|
||||
|
||||
Bless fills your allies with courage. Each ally
|
||||
gains a +1 morale bonus on attack rolls and on
|
||||
saving throws against fear effects.
|
||||
|
||||
Bless counters and dispels bane.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 24, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Added Bless item ability: Georg Z, On: June 20, 2001
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
float fDuration = TurnsToSeconds(nCasterLvl);
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2; //Duration is +100%
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
// ---------------- TARGETED ON BOLT -------------------
|
||||
if(GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_ITEM)
|
||||
{
|
||||
// special handling for blessing crossbow bolts that can slay rakshasa's
|
||||
if (GetBaseItemType(oTarget) == BASE_ITEM_BOLT)
|
||||
{
|
||||
object oPossessor = GetItemPossessor(oTarget);
|
||||
SignalEvent(oPossessor, EventSpellCastAt(oCaster, SPELL_BLESS, FALSE));
|
||||
IPSafeAddItemProperty(oTarget, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_SLAYRAKSHASA, 1), fDuration, X2_IP_ADDPROP_POLICY_KEEP_EXISTING);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPossessor);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, oPossessor, fDuration, FALSE);
|
||||
PRCSetSchool();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
location lCaster = GetLocation(oCaster);
|
||||
float fRange = FeetToMeters(50.0);
|
||||
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
|
||||
|
||||
//Apply Impact
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lCaster);
|
||||
|
||||
//Get the first target in the radius around the caster
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRange, lCaster);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(GetIsReactionTypeFriendly(oTarget) || GetFactionEqual(oTarget))
|
||||
{
|
||||
//Fire spell cast at event for target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_BLESS, FALSE));
|
||||
|
||||
float fDelay = PRCGetRandomDelay(0.4, 1.1);
|
||||
|
||||
if(GetHasSpellEffect(SPELL_BANE, oTarget))
|
||||
//Remove Bane spell
|
||||
DelayCommand(fDelay, PRCRemoveEffectsFromSpell(oTarget, SPELL_BANE));
|
||||
else
|
||||
{
|
||||
effect eAttack = EffectAttackIncrease(1);
|
||||
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_ALL, 1, SAVING_THROW_TYPE_FEAR);
|
||||
effect eLink = EffectLinkEffects(eAttack, eSave);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
//Apply bonus effects
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, SPELL_BLESS, nCasterLvl));
|
||||
}
|
||||
//Apply VFX impact
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
//Get the next target in the specified area around the caster
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, fRange, lCaster);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
76
nwn/nwnprc/trunk/spells/nw_s0_blinddeaf.nss
Normal file
76
nwn/nwnprc/trunk/spells/nw_s0_blinddeaf.nss
Normal file
@@ -0,0 +1,76 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Blindness/Deafness
|
||||
//:: [NW_S0_BlindDead.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Necromancy
|
||||
Level: Brd 2, Clr 3, Sor/Wiz 2
|
||||
Components: V
|
||||
Casting Time: 1 standard action
|
||||
Range: Medium (100 ft. + 10 ft./level)
|
||||
Target: One living creature
|
||||
Duration: Permanent (D)
|
||||
Saving Throw: Fortitude negates
|
||||
Spell Resistance: Yes
|
||||
|
||||
You call upon the powers of unlife to render the
|
||||
subject blinded or deafened, as you choose.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
//TODO: convert to subradials
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_NECROMANCY);
|
||||
|
||||
//Declare major varibles
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
|
||||
float fDuration = RoundsToSeconds(CasterLvl);
|
||||
//Metamagic check for duration
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
|
||||
|
||||
effect eBlind = EffectBlindness();
|
||||
effect eDeaf = EffectDeaf();
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eLink = EffectLinkEffects(eBlind, eDeaf);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_BLINDNESS_AND_DEAFNESS));
|
||||
//Do SR check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr) && PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
// Make Fortitude save to negate
|
||||
if (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, oCaster)))
|
||||
{
|
||||
|
||||
//Apply visual and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, SPELL_BLINDNESS_AND_DEAFNESS, CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
99
nwn/nwnprc/trunk/spells/nw_s0_burnhand.nss
Normal file
99
nwn/nwnprc/trunk/spells/nw_s0_burnhand.nss
Normal file
@@ -0,0 +1,99 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Burning Hands
|
||||
//:: NW_S0_BurnHand
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Evocation [Fire]
|
||||
Level: Fire 1, Sor/Wiz 1
|
||||
Components: V, S
|
||||
Casting Time: 1 standard action
|
||||
Range: 15 ft.
|
||||
Area: Cone-shaped burst
|
||||
Duration: Instantaneous
|
||||
Saving Throw: Reflex half
|
||||
Spell Resistance: Yes
|
||||
|
||||
A cone of searing flame shoots from your fingertips.
|
||||
Any creature in the area of the flames takes 1d4
|
||||
points of fire damage per caster level (maximum 5d4).
|
||||
Flammable materials burn if the flames touch them.
|
||||
A character can extinguish burning items as a
|
||||
full-round action.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 5, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated On: April 5th, 2001
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: July 23, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE);
|
||||
int nSaveType = ChangedSaveType(EleDmg);
|
||||
int nDice = min(5, nCasterLevel);
|
||||
int nDamage;
|
||||
float fDist;
|
||||
|
||||
//Declare and assign personal impact visual effect.
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 10.0, 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.
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
//Signal spell cast at event to fire.
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_BURNING_HANDS));
|
||||
//Calculate the delay time on the application of effects based on the distance
|
||||
//between the caster and the target
|
||||
fDist = GetDistanceBetween(oCaster, oTarget)/20;
|
||||
//Make SR check, and appropriate saving throw.
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDist) && oTarget != oCaster)
|
||||
{
|
||||
nDamage = d4(nDice);
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 4 * nDice;//Damage is at max
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage += nDamage / 2; //Damage/Healing is +50%
|
||||
|
||||
nDamage += SpellDamagePerDice(oCaster, nDice);
|
||||
//Run the damage through the various reflex save and evasion feats
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget, oCaster), nSaveType);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
effect eFire = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDist, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDist, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
113
nwn/nwnprc/trunk/spells/nw_s0_calllghtn.nss
Normal file
113
nwn/nwnprc/trunk/spells/nw_s0_calllghtn.nss
Normal file
@@ -0,0 +1,113 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Call Lightning
|
||||
//:: NW_S0_CallLghtn.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//::///////////////////////////////////////////////
|
||||
/*
|
||||
Evocation [Electricity]
|
||||
Level: Drd 3
|
||||
Components: V, S
|
||||
Casting Time: 1 round
|
||||
Range: Medium (100 ft. + 10 ft./level)
|
||||
Effect: One or more 30-ft.-long vertical lines of lightning
|
||||
Duration: 1 min./level
|
||||
Saving Throw: Reflex half
|
||||
Spell Resistance: Yes
|
||||
|
||||
Immediately upon completion of the spell, and once
|
||||
per round thereafter, you may call down a 5-foot-wide,
|
||||
30-foot-long, vertical bolt of lightning that deals
|
||||
3d6 points of electricity damage. The bolt of lightning
|
||||
flashes down in a vertical stroke at whatever target
|
||||
point you choose within the spell<6C>s range (measured
|
||||
from your position at the time). Any creature in the
|
||||
target square or in the path of the bolt is affected.
|
||||
|
||||
You need not call a bolt of lightning immediately;
|
||||
other actions, even spellcasting, can be performed.
|
||||
However, each round after the first you may use a
|
||||
standard action (concentrating on the spell) to call
|
||||
a bolt. You may call a total number of bolts equal to
|
||||
your caster level (maximum 10 bolts).
|
||||
|
||||
If you are outdoors and in a stormy area<65>a rain shower,
|
||||
clouds and wind, hot and cloudy conditions, or even a
|
||||
tornado (including a whirlwind formed by a djinni or an
|
||||
air elemental of at least Large size)<29>each bolt deals
|
||||
3d10 points of electricity damage instead of 3d6.
|
||||
|
||||
This spell functions indoors or underground but not
|
||||
underwater.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Notes: totally not like PnP version,
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 22, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = nCasterLvl + SPGetPenetr();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDice = min(10, nCasterLvl);
|
||||
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ELECTRICAL);
|
||||
int nSaveType = ChangedSaveType(EleDmg);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
|
||||
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, 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.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CALL_LIGHTNING));
|
||||
//Get the distance between the explosion and the target to calculate delay
|
||||
float fDelay = PRCGetRandomDelay(0.4, 1.75);
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
//Roll damage for each target
|
||||
int nDamage = d6(nDice);
|
||||
//Resolve metamagic
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 6 * nDice;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage += nDamage / 2;
|
||||
|
||||
nDamage += SpellDamagePerDice(oCaster, nDice);
|
||||
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget, oCaster), nSaveType);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
//Set the damage effect
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
102
nwn/nwnprc/trunk/spells/nw_s0_charmani.nss
Normal file
102
nwn/nwnprc/trunk/spells/nw_s0_charmani.nss
Normal file
@@ -0,0 +1,102 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Charm Person or Animal]
|
||||
//:: [nw_s0_charmani.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Charm Person
|
||||
Enchantment (Charm) [Mind-Affecting]
|
||||
Level: Brd 1, Sor/Wiz 1
|
||||
Components: V, S
|
||||
Casting Time: 1 standard action
|
||||
Range: Close (25 ft. + 5 ft./2 levels)
|
||||
Target: One humanoid creature
|
||||
Duration: 1 hour/level
|
||||
Saving Throw: Will negates
|
||||
Spell Resistance: Yes
|
||||
|
||||
This charm makes a humanoid creature regard you as
|
||||
its trusted friend and ally (treat the target<65>s
|
||||
attitude as friendly). If the creature is currently
|
||||
being threatened or attacked by you or your allies,
|
||||
however, it receives a +5 bonus on its saving throw.
|
||||
|
||||
The spell does not enable you to control the
|
||||
charmed person as if it were an automaton, but it
|
||||
perceives your words and actions in the most
|
||||
favorable way. You can try to give the subject
|
||||
orders, but you must win an opposed Charisma check
|
||||
to convince it to do anything it wouldn<64>t
|
||||
ordinarily do. (Retries are not allowed.) An
|
||||
affected creature never obeys suicidal or obviously
|
||||
harmful orders, but it might be convinced that
|
||||
something very dangerous is worth doing. Any act by
|
||||
you or your apparent allies that threatens the
|
||||
charmed person breaks the spell. You must speak the
|
||||
person<EFBFBD>s language to communicate your commands, or
|
||||
else be good at pantomiming.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is dominated for 1 round
|
||||
//:: per caster level.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDuration = 2 + CasterLvl/3;
|
||||
nDuration = PRCGetScaledDuration(nDuration, oTarget);
|
||||
//Meta magic duration check
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
|
||||
effect eCharm = EffectCharmed();
|
||||
eCharm = PRCGetScaledEffect(eCharm, oTarget);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
//Link the charm and duration visual effects
|
||||
effect eLink = EffectLinkEffects(eMind, eCharm);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire spell cast at event to fire on the target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CHARM_PERSON_OR_ANIMAL, FALSE));
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
|
||||
{
|
||||
//Make sure the racial type of the target is applicable
|
||||
if(PRCAmIAHumanoid(oTarget) ||
|
||||
nRacial == RACIAL_TYPE_ANIMAL)
|
||||
{
|
||||
//Make Will Save
|
||||
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply impact effects and linked duration and charm effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_PERSON_OR_ANIMAL, CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
62
nwn/nwnprc/trunk/spells/nw_s0_charmmon.nss
Normal file
62
nwn/nwnprc/trunk/spells/nw_s0_charmmon.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Charm Monster]
|
||||
//:: [NW_S0_CharmMon.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is charmed for 1 round
|
||||
//:: per 2 caster levels.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 25, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDuration = 3 + CasterLvl/2;
|
||||
nDuration = PRCGetScaledDuration(nDuration, oTarget);
|
||||
//Metamagic extend check
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
|
||||
effect eCharm = EffectCharmed();
|
||||
eCharm = PRCGetScaledEffect(eCharm, oTarget);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
//Link effects
|
||||
effect eLink = EffectLinkEffects(eMind, eCharm);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CHARM_MONSTER, FALSE));
|
||||
// Make SR Check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
|
||||
{
|
||||
// Make Will save vs Mind-Affecting
|
||||
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply impact and linked effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_MONSTER, CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
71
nwn/nwnprc/trunk/spells/nw_s0_charmper.nss
Normal file
71
nwn/nwnprc/trunk/spells/nw_s0_charmper.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Charm Person]
|
||||
//:: [NW_S0_CharmPer.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is charmed for 1 round
|
||||
//:: per caster level.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 5, 2001
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 10, 2001
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = nCasterLvl + SPGetPenetr();
|
||||
int nDuration = 2 + nCasterLvl/3;
|
||||
nDuration = PRCGetScaledDuration(nDuration, oTarget);
|
||||
|
||||
//Make Metamagic check for extend
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration = nDuration * 2;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
|
||||
effect eCharm = EffectCharmed();
|
||||
eCharm = PRCGetScaledEffect(eCharm, oTarget);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link persistant effects
|
||||
effect eLink = EffectLinkEffects(eMind, eCharm);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CHARM_PERSON, FALSE));
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nPenetr))
|
||||
{
|
||||
//Verify that the Racial Type is humanoid
|
||||
if(PRCAmIAHumanoid(oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply impact and linked effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration), TRUE, SPELL_CHARM_PERSON, nCasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
205
nwn/nwnprc/trunk/spells/nw_s0_chlightn.nss
Normal file
205
nwn/nwnprc/trunk/spells/nw_s0_chlightn.nss
Normal file
@@ -0,0 +1,205 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Chain Lightning
|
||||
//:: NW_S0_ChLightn
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The primary target is struck with 1d6 per caster,
|
||||
1/2 with a reflex save. 1 secondary target per
|
||||
level is struck for 1d6 / 2 caster levels. No
|
||||
repeat targets can be chosen.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brennon Holmes
|
||||
//:: Created On: March 8, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 26, 2001
|
||||
//:: Update Pass By: Preston W, On: July 26, 2001
|
||||
|
||||
/*
|
||||
bugfix by Kovi 2002.07.28
|
||||
- successful saving throw and (improved) evasion was ignored for
|
||||
secondary targets,
|
||||
- all secondary targets suffered exactly the same damage
|
||||
2002.08.25
|
||||
- primary target was not effected
|
||||
*/
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nCasterLevel = CasterLvl;
|
||||
//Limit caster level
|
||||
// June 2/04 - Bugfix: Cap the level BEFORE the damage calculation, not after. Doh.
|
||||
if (nCasterLevel > 20)
|
||||
{
|
||||
nCasterLevel = 20;
|
||||
}
|
||||
|
||||
int nDamage = d6(nCasterLevel);
|
||||
int nDamStrike;
|
||||
int nNumAffected = 0;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Declare lightning effect connected the casters hands
|
||||
effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF, BODY_NODE_HAND);;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
|
||||
effect eDamage;
|
||||
object oFirstTarget = PRCGetSpellTargetObject();
|
||||
object oHolder;
|
||||
object oTarget;
|
||||
location lSpellLocation;
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = 6 * nCasterLevel;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2); //Damage/is +50%
|
||||
}
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nCasterLevel);
|
||||
|
||||
CasterLvl +=SPGetPenetr();
|
||||
|
||||
int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ELECTRICAL);
|
||||
|
||||
//Damage the initial target
|
||||
if (spellsIsTarget(oFirstTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oFirstTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHAIN_LIGHTNING));
|
||||
//Make an SR Check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oFirstTarget,CasterLvl))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
//Adjust damage via Reflex Save or Evasion or Improved Evasion
|
||||
nDamStrike = PRCGetReflexAdjustedDamage(nDamage, oFirstTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
|
||||
//Set the damage effect for the first target
|
||||
eDamage = PRCEffectDamage(oTarget, nDamStrike, EleDmg);
|
||||
//Apply damage to the first target and the VFX impact.
|
||||
if(nDamStrike > 0)
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oFirstTarget);
|
||||
PRCBonusDamage(oFirstTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oFirstTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Apply the lightning stream effect to the first target, connecting it with the caster
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oFirstTarget,0.5,FALSE);
|
||||
|
||||
|
||||
//Reinitialize the lightning effect so that it travels from the first target to the next target
|
||||
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oFirstTarget, BODY_NODE_CHEST);
|
||||
|
||||
|
||||
float fDelay = 0.2;
|
||||
int nCnt = 0;
|
||||
|
||||
|
||||
// *
|
||||
// * Secondary Targets
|
||||
// *
|
||||
|
||||
|
||||
//Get the first target in the spell shape
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oFirstTarget), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
while (GetIsObjectValid(oTarget) && nCnt < nCasterLevel)
|
||||
{
|
||||
//Make sure the caster's faction is not hit and the first target is not hit
|
||||
if (oTarget != oFirstTarget && spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
|
||||
{
|
||||
//Connect the new lightning stream to the older target and the new target
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,0.5,FALSE));
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHAIN_LIGHTNING));
|
||||
//Do an SR check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
nDamage = d6(nCasterLevel) ;
|
||||
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = 6 * nCasterLevel;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2); //Damage/is +50%
|
||||
}
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nCasterLevel);
|
||||
//Adjust damage via Reflex Save or Evasion or Improved Evasion
|
||||
nDamStrike = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY);
|
||||
//Apply the damage and VFX impact to the current target
|
||||
eDamage = PRCEffectDamage(oTarget, nDamStrike /2, EleDmg);
|
||||
if(nDamStrike > 0) //age > 0)
|
||||
{
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget));
|
||||
}
|
||||
}
|
||||
oHolder = oTarget;
|
||||
|
||||
//change the currect holder of the lightning stream to the current target
|
||||
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oHolder, BODY_NODE_CHEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
// * April 2003 trying to make sure beams originate correctly
|
||||
effect eNewLightning = EffectBeam(VFX_BEAM_LIGHTNING, oHolder, BODY_NODE_CHEST);
|
||||
if(GetIsEffectValid(eNewLightning))
|
||||
{
|
||||
eLightning = eNewLightning;
|
||||
}
|
||||
}
|
||||
|
||||
fDelay = fDelay + 0.1f;
|
||||
}
|
||||
//Count the number of targets that have been hit.
|
||||
if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
nCnt++;
|
||||
}
|
||||
|
||||
// April 2003: Setting the new origin for the beam
|
||||
// oFirstTarget = oTarget;
|
||||
|
||||
//Get the next target in the shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oFirstTarget), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
|
||||
|
||||
}
|
36
nwn/nwnprc/trunk/spells/nw_s0_circchaosa.nss
Normal file
36
nwn/nwnprc/trunk/spells/nw_s0_circchaosa.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Good
|
||||
//:: NW_S0_CircGoodA
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from good effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
object oTarget = GetEnteringObject();
|
||||
|
||||
if(GetIsFriend(oTarget, oCaster))
|
||||
{
|
||||
//Declare major variables
|
||||
effect eLink = PRCCreateProtectionFromAlignmentLink(ALIGNMENT_CHAOTIC);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_MAGIC_CIRCLE_AGAINST_CHAOS, FALSE));
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f, FALSE);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
42
nwn/nwnprc/trunk/spells/nw_s0_circchaosb.nss
Normal file
42
nwn/nwnprc/trunk/spells/nw_s0_circchaosb.nss
Normal file
@@ -0,0 +1,42 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Good
|
||||
//:: NW_S0_CircGoodB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from good effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
|
||||
if(GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_CHAOS, oTarget))
|
||||
{
|
||||
int bValid = FALSE;
|
||||
//Search through the valid effects on the target.
|
||||
effect eAOE = GetFirstEffect(oTarget);
|
||||
while(GetIsEffectValid(eAOE) && !bValid)
|
||||
{
|
||||
if(GetEffectCreator(eAOE) == GetAreaOfEffectCreator()
|
||||
&& GetEffectSpellId(eAOE) == SPELL_MAGIC_CIRCLE_AGAINST_CHAOS
|
||||
&& GetEffectType(eAOE) != EFFECT_TYPE_AREA_OF_EFFECT)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
152
nwn/nwnprc/trunk/spells/nw_s0_circdeath.nss
Normal file
152
nwn/nwnprc/trunk/spells/nw_s0_circdeath.nss
Normal file
@@ -0,0 +1,152 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Circle of Death
|
||||
//:: NW_S0_CircDeath
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The caster slays a number of HD worth of creatures
|
||||
equal to 1d4 times level. The creature gets a
|
||||
Fort Save or dies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: June 1, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Aidan Scanlan
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: July 25, 2001
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget;
|
||||
object oLowest;
|
||||
effect eDeath = EffectDeath();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
|
||||
effect eFNF = EffectVisualEffect(VFX_FNF_LOS_EVIL_20);
|
||||
int bContinueLoop = FALSE; //Used to determine if we have a next valid target
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
int nHD = d4(CasterLvl); //Roll to see how many HD worth of creature will be killed
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCurrentHD;
|
||||
int bAlreadyAffected;
|
||||
int nMax = 10;// maximun hd creature affected, set this to 9 so that a lower HD creature is chosen automatically
|
||||
//Also 9 is the maximum HD a creature can have and still be affected by the spell
|
||||
float fDelay;
|
||||
string sIdentifier = GetTag(OBJECT_SELF);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nHD = 4 * CasterLvl;
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nHD = nHD + (nHD/2); //Damage/Healing is +50%
|
||||
}
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, PRCGetSpellTargetLocation());
|
||||
//Check for at least one valid object to start the main loop
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
|
||||
if (GetIsObjectValid(oTarget))
|
||||
{
|
||||
bContinueLoop = TRUE;
|
||||
}
|
||||
// The above checks to see if there is at least one valid target. If no value target exists we do not enter
|
||||
// the loop.
|
||||
|
||||
|
||||
CasterLvl +=SPGetPenetr();
|
||||
|
||||
|
||||
while ((nHD > 0) && (bContinueLoop))
|
||||
{
|
||||
int nLow = nMax; //Set nLow to the lowest HD creature in the last pass through the loop
|
||||
bContinueLoop = FALSE; //Set this to false so that the loop only continues in the case of new low HD creature
|
||||
//Get first target creature in loop
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
//Make sure the currect target is not an enemy
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
|
||||
{
|
||||
//Get a local set on the creature that checks if the spell has already allowed them to save
|
||||
bAlreadyAffected = GetLocalInt(oTarget, "bDEATH" + sIdentifier);
|
||||
if (!bAlreadyAffected)
|
||||
{
|
||||
nCurrentHD = GetHitDice(oTarget);
|
||||
//If the selected creature is of lower HD then the current nLow value and
|
||||
//the HD of the creature is of less HD than the number of HD available for
|
||||
//the spell to affect then set the creature as the currect primary target
|
||||
if(nCurrentHD < nLow && nCurrentHD <= nHD)
|
||||
{
|
||||
nLow = nCurrentHD;
|
||||
oLowest = oTarget;
|
||||
bContinueLoop = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in shape to test for a new
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation());
|
||||
}
|
||||
//Check to make sure that oLowest has changed
|
||||
if(bContinueLoop == TRUE)
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oLowest, EventSpellCastAt(OBJECT_SELF, SPELL_CIRCLE_OF_DEATH));
|
||||
fDelay = PRCGetRandomDelay();
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oLowest,CasterLvl, fDelay))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
//Make a Fort Save versus death effects
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oLowest, nDC, SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay))
|
||||
{
|
||||
DeathlessFrenzyCheck(oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oLowest);
|
||||
//DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oLowest));
|
||||
}
|
||||
}
|
||||
//Even if the target made their save mark them as having been affected by the spell
|
||||
SetLocalInt(oLowest, "bDEATH" + sIdentifier, TRUE);
|
||||
//Destroy the local after 1/4 of a second in case other Circles of Death are cast on
|
||||
//the creature laster
|
||||
DelayCommand(fDelay + 0.25, DeleteLocalInt(oLowest, "bDEATH" + sIdentifier));
|
||||
//Adjust the number of HD that have been affected by the spell
|
||||
nHD = nHD - GetHitDice(oLowest);
|
||||
oLowest = OBJECT_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
130
nwn/nwnprc/trunk/spells/nw_s0_circdoom.nss
Normal file
130
nwn/nwnprc/trunk/spells/nw_s0_circdoom.nss
Normal file
@@ -0,0 +1,130 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Circle of Doom
|
||||
//:: nw_s0_circdoom.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Spell level: cleric 5
|
||||
Innate level: 5
|
||||
School: necromancy
|
||||
Descriptor: negative
|
||||
Components: verbal, somatic
|
||||
Range: medium (20 meters)
|
||||
Area of effect: huge (6.67 meter radius)
|
||||
Duration: instant
|
||||
Save: fortitude 1/2
|
||||
Spell resistance: yes
|
||||
Additional counterspells: healing circle
|
||||
|
||||
All enemies within the area of effect
|
||||
are struck with negative energy that causes 1d8
|
||||
points of negative energy damage, +1 point per
|
||||
caster level. Negative energy spells have a
|
||||
reverse effect on undead, healing them instead of
|
||||
harming them.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk and Keith Soleski
|
||||
//:: Created On: Jan 31, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: July 25, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: Added code to maximize for Faith Healing and Blast Infidel
|
||||
//:: Aaon Graywolf - Jan 7, 2003
|
||||
|
||||
#include "prc_inc_function"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_NECROMANCY);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
|
||||
//Limit Caster Level
|
||||
if(nCasterLevel > 20)
|
||||
nCasterLevel = 20;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_M);
|
||||
effect eFNF = EffectVisualEffect(VFX_FNF_LOS_EVIL_10);
|
||||
effect eDam;
|
||||
effect eHeal;
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, lTarget);
|
||||
|
||||
//Get first target in the specified area
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
//Roll damage
|
||||
nDamage = d8();
|
||||
//Enter Metamagic conditions
|
||||
int iBlastFaith = BlastInfidelOrFaithHeal(oCaster, oTarget, DAMAGE_TYPE_NEGATIVE, FALSE);
|
||||
if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
|
||||
nDamage = 8;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage = nDamage + (nDamage/2);
|
||||
nDamage = nDamage + nCasterLevel;
|
||||
|
||||
fDelay = PRCGetRandomDelay();
|
||||
|
||||
//If the target is an allied undead it is healed
|
||||
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD
|
||||
|| (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD)
|
||||
|| GetLocalInt(oTarget, "AcererakHealing"))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CIRCLE_OF_DOOM, FALSE));
|
||||
//Set the heal effect
|
||||
eHeal = PRCEffectHeal(nDamage, oTarget);
|
||||
//Apply the impact VFX and healing effect
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
nDamage += SpellDamagePerDice(oCaster, 1);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CIRCLE_OF_DOOM));
|
||||
//Make an SR Check
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oCaster, fDelay))
|
||||
{
|
||||
if(GetHasMettle(oTarget, SAVING_THROW_FORT))
|
||||
// This script does nothing if it has Mettle, bail
|
||||
nDamage = 0;
|
||||
else
|
||||
nDamage = nDamage/2;
|
||||
}
|
||||
if(nDamage)
|
||||
{
|
||||
//Set Damage
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_NEGATIVE);
|
||||
//Apply impact VFX and damage
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in the specified area
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
50
nwn/nwnprc/trunk/spells/nw_s0_circevila.nss
Normal file
50
nwn/nwnprc/trunk/spells/nw_s0_circevila.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Evil
|
||||
//:: NW_S0_CircEvilA
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from evil effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_template"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
object oTarget = GetEnteringObject();
|
||||
object oAOE = OBJECT_SELF;
|
||||
int nSpellID = GetLocalInt(oAOE, "X2_AoE_SpellID");
|
||||
effect eLink;
|
||||
|
||||
if(GetIsFriend(oTarget, oCaster))
|
||||
{
|
||||
//Declare major variables
|
||||
if (GetHasTemplate(TEMPLATE_SAINT, oCaster))
|
||||
{
|
||||
eLink = PRCCreateProtectionFromAlignmentLink(ALIGNMENT_EVIL, 2);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
eLink = PRCCreateProtectionFromAlignmentLink(ALIGNMENT_EVIL);
|
||||
}
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_MAGIC_CIRCLE_AGAINST_EVIL, FALSE));
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f, FALSE);
|
||||
}
|
||||
if (nSpellID == SPELL_HALLOW)
|
||||
SetLocalInt(oTarget, "HallowTurn", TRUE);
|
||||
PRCSetSchool();
|
||||
}
|
46
nwn/nwnprc/trunk/spells/nw_s0_circevilb.nss
Normal file
46
nwn/nwnprc/trunk/spells/nw_s0_circevilb.nss
Normal file
@@ -0,0 +1,46 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Evil
|
||||
//:: NW_S0_CircEvilB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from evil effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
object oAOE = OBJECT_SELF;
|
||||
int nSpellID = GetLocalInt(oAOE, "X2_AoE_SpellID");
|
||||
|
||||
if(GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_EVIL, oTarget))
|
||||
{
|
||||
int bValid = FALSE;
|
||||
//Search through the valid effects on the target.
|
||||
effect eAOE = GetFirstEffect(oTarget);
|
||||
while(GetIsEffectValid(eAOE) && !bValid)
|
||||
{
|
||||
if(GetEffectCreator(eAOE) == GetAreaOfEffectCreator()
|
||||
&& (GetEffectSpellId(eAOE) == SPELL_MAGIC_CIRCLE_AGAINST_EVIL || GetEffectSpellId(eAOE) == SPELL_HALLOW)
|
||||
&& GetEffectType(eAOE) != EFFECT_TYPE_AREA_OF_EFFECT)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
if (nSpellID == SPELL_HALLOW)
|
||||
DeleteLocalInt(oTarget, "HallowTurn");
|
||||
PRCSetSchool();
|
||||
}
|
36
nwn/nwnprc/trunk/spells/nw_s0_circgooda.nss
Normal file
36
nwn/nwnprc/trunk/spells/nw_s0_circgooda.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Good
|
||||
//:: NW_S0_CircGoodA
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from good effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
object oTarget = GetEnteringObject();
|
||||
|
||||
if(GetIsFriend(oTarget, oCaster))
|
||||
{
|
||||
//Declare major variables
|
||||
effect eLink = PRCCreateProtectionFromAlignmentLink(ALIGNMENT_GOOD);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_MAGIC_CIRCLE_AGAINST_GOOD, FALSE));
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f, FALSE);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
42
nwn/nwnprc/trunk/spells/nw_s0_circgoodb.nss
Normal file
42
nwn/nwnprc/trunk/spells/nw_s0_circgoodb.nss
Normal file
@@ -0,0 +1,42 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Good
|
||||
//:: NW_S0_CircGoodB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from good effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
|
||||
if(GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_GOOD, oTarget))
|
||||
{
|
||||
int bValid = FALSE;
|
||||
//Search through the valid effects on the target.
|
||||
effect eAOE = GetFirstEffect(oTarget);
|
||||
while(GetIsEffectValid(eAOE) && !bValid)
|
||||
{
|
||||
if(GetEffectCreator(eAOE) == GetAreaOfEffectCreator()
|
||||
&& GetEffectSpellId(eAOE) == SPELL_MAGIC_CIRCLE_AGAINST_GOOD
|
||||
&& GetEffectType(eAOE) != EFFECT_TYPE_AREA_OF_EFFECT)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
36
nwn/nwnprc/trunk/spells/nw_s0_circlawa.nss
Normal file
36
nwn/nwnprc/trunk/spells/nw_s0_circlawa.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Evil
|
||||
//:: NW_S0_CircEvilA
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from evil effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
object oTarget = GetEnteringObject();
|
||||
|
||||
if(GetIsFriend(oTarget, oCaster))
|
||||
{
|
||||
//Declare major variables
|
||||
effect eLink = PRCCreateProtectionFromAlignmentLink(ALIGNMENT_LAWFUL);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_MAGIC_CIRCLE_AGAINST_LAW, FALSE));
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f, FALSE);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
42
nwn/nwnprc/trunk/spells/nw_s0_circlawb.nss
Normal file
42
nwn/nwnprc/trunk/spells/nw_s0_circlawb.nss
Normal file
@@ -0,0 +1,42 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Cirle Against Evil
|
||||
//:: NW_S0_CircEvilB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Add basic protection from evil effects to
|
||||
entering allies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 20, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
|
||||
if(GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_LAW, oTarget))
|
||||
{
|
||||
int bValid = FALSE;
|
||||
//Search through the valid effects on the target.
|
||||
effect eAOE = GetFirstEffect(oTarget);
|
||||
while(GetIsEffectValid(eAOE) && !bValid)
|
||||
{
|
||||
if(GetEffectCreator(eAOE) == GetAreaOfEffectCreator()
|
||||
&& GetEffectSpellId(eAOE) == SPELL_MAGIC_CIRCLE_AGAINST_LAW
|
||||
&& GetEffectType(eAOE) != EFFECT_TYPE_AREA_OF_EFFECT)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
121
nwn/nwnprc/trunk/spells/nw_s0_circle.nss
Normal file
121
nwn/nwnprc/trunk/spells/nw_s0_circle.nss
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
nw_s0_circle
|
||||
|
||||
Magic Circle Against Good, Evil, Law, Chaos
|
||||
|
||||
By: Flaming_Sword
|
||||
Created: Jun 13, 2006
|
||||
Modified: Jun 13, 2006
|
||||
|
||||
Consolidation of 4 scripts, cleaned up
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel)
|
||||
{
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int nAOE;
|
||||
string temp;
|
||||
|
||||
switch(nSpellID)
|
||||
{
|
||||
case SPELL_MAGIC_CIRCLE_AGAINST_CHAOS:
|
||||
{
|
||||
nAOE = AOE_MOB_CIRCCHAOS;
|
||||
temp = "TEMPO_CIRCCHAOS";
|
||||
break;
|
||||
}
|
||||
case SPELL_MAGIC_CIRCLE_AGAINST_EVIL:
|
||||
case SPELL_HALLOW:
|
||||
{
|
||||
nAOE = AOE_MOB_CIRCGOOD;
|
||||
temp = "TEMPO_CIRCEVIL";
|
||||
break;
|
||||
}
|
||||
case SPELL_MAGIC_CIRCLE_AGAINST_GOOD:
|
||||
{
|
||||
nAOE = AOE_MOB_CIRCEVIL;
|
||||
temp = "TEMPO_CIRCGOOD";
|
||||
break;
|
||||
}
|
||||
case SPELL_MAGIC_CIRCLE_AGAINST_LAW:
|
||||
{
|
||||
nAOE = AOE_MOB_CIRCLAW;
|
||||
temp = "TEMPO_CIRCLAW";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
effect eAOE = EffectAreaOfEffect(nAOE);
|
||||
effect eVis;
|
||||
|
||||
if(nSpellID == SPELL_MAGIC_CIRCLE_AGAINST_CHAOS
|
||||
|| nSpellID == SPELL_MAGIC_CIRCLE_AGAINST_GOOD)
|
||||
eVis = EffectVisualEffect(VFX_IMP_EVIL_HELP);
|
||||
else
|
||||
eVis = EffectVisualEffect(VFX_IMP_GOOD_HELP);
|
||||
|
||||
int nTemp = GetLocalInt(oCaster, temp);
|
||||
DeleteLocalInt(oCaster, temp);
|
||||
|
||||
float fDuration = nTemp ? RoundsToSeconds(nTemp) : HoursToSeconds(nCasterLevel);
|
||||
//Make sure duration does not equal 0
|
||||
//if nTemp == 0 we use caster level for duration, so check if it's not 0
|
||||
if(nCasterLevel < 1)
|
||||
fDuration = HoursToSeconds(1);
|
||||
|
||||
if (nSpellID == SPELL_HALLOW) fDuration = HoursToSeconds(24);
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Check Extend metamagic feat.
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2; //Duration is +100%
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE));
|
||||
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
//Setup Area Of Effect object
|
||||
object oAoE = GetAreaOfEffectObject(GetLocation(oTarget), GetAreaOfEffectTag(nAOE), oCaster);
|
||||
SetAllAoEInts(nSpellID, oAoE, 0, 0, nCasterLevel);
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
151
nwn/nwnprc/trunk/spells/nw_s0_clairadvo.nss
Normal file
151
nwn/nwnprc/trunk/spells/nw_s0_clairadvo.nss
Normal file
@@ -0,0 +1,151 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Scrying
|
||||
//:: sp_scrying.nss
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
A spell that allows the caster to scry either
|
||||
on any creature in the area they're in, or to
|
||||
scry on any PC.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Stratovarius
|
||||
//:: Created On: April 30, 2007
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_dynconv"
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
void ApplyScryEffects(object oPC)
|
||||
{
|
||||
if(DEBUG) DoDebug("prc_inc_scry: ApplyScryEffects():\n"
|
||||
+ "oPC = '" + GetName(oPC) + "'"
|
||||
);
|
||||
// The Scryer is not supposed to be visible, nor can he move or cast
|
||||
// He also can't take damage from scrying
|
||||
effect eLink = EffectSpellImmunity(SPELL_ALL_SPELLS);
|
||||
// Damage immunities
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_BLUDGEONING, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_DIVINE, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_MAGICAL, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_PIERCING, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_POSITIVE, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 100));
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC, 100));
|
||||
// Specific immunities
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_ABILITY_DECREASE));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_BLINDNESS));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_DEAFNESS));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_CRITICAL_HIT));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_DEATH));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_DISEASE));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_ENTANGLE));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_SLOW));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_KNOCKDOWN));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_NEGATIVE_LEVEL));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_PARALYSIS));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_SILENCE));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_SNEAK_ATTACK));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_TRAP));
|
||||
eLink = EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS));
|
||||
// Random stuff
|
||||
eLink = EffectLinkEffects(eLink, EffectCutsceneGhost());
|
||||
eLink = EffectLinkEffects(eLink, EffectCutsceneImmobilize());
|
||||
eLink = EffectLinkEffects(eLink, EffectEthereal());
|
||||
eLink = EffectLinkEffects(eLink, EffectAttackDecrease(50));
|
||||
eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY));
|
||||
// Permanent until Scry ends
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eLink), oPC, GetLocalFloat(oPC, "ScryDuration") + 6.0);
|
||||
|
||||
// Create array for storing a list of the nerfed weapons in
|
||||
array_create(oPC, "Scry_Nerfed");
|
||||
|
||||
object oWeapon;
|
||||
itemproperty ipNoDam = ItemPropertyNoDamage();
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
|
||||
if(IPGetIsMeleeWeapon(oWeapon)){
|
||||
if(!GetItemHasItemProperty(oWeapon, ITEM_PROPERTY_NO_DAMAGE)){
|
||||
//SetLocalInt(oWeapon, "BaelnornProjection_NoDamage", TRUE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipNoDam, oWeapon);
|
||||
array_set_object(oPC, "Scry_Nerfed", array_get_size(oPC, "Scry_Nerfed"), oWeapon);
|
||||
}
|
||||
// Check left hand only if right hand had a weapon
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
|
||||
if(IPGetIsMeleeWeapon(oWeapon)){
|
||||
if(!GetItemHasItemProperty(oWeapon, ITEM_PROPERTY_NO_DAMAGE)){
|
||||
//SetLocalInt(oWeapon, "BaelnornProjection_NoDamage", TRUE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipNoDam, oWeapon);
|
||||
array_set_object(oPC, "Scry_Nerfed", array_get_size(oPC, "Scry_Nerfed"), oWeapon);
|
||||
}}
|
||||
}else if(IPGetIsRangedWeapon(oWeapon)){
|
||||
if(!GetItemHasItemProperty(oWeapon, ITEM_PROPERTY_NO_DAMAGE)){
|
||||
//SetLocalInt(oWeapon, "BaelnornProjection_NoDamage", TRUE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipNoDam, oWeapon);
|
||||
array_set_object(oPC, "Scry_Nerfed", array_get_size(oPC, "Scry_Nerfed"), oWeapon);
|
||||
}}
|
||||
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oPC);
|
||||
if(GetIsObjectValid(oWeapon)){
|
||||
if(!GetItemHasItemProperty(oWeapon, ITEM_PROPERTY_NO_DAMAGE)){
|
||||
//SetLocalInt(oWeapon, "BaelnornProjection_NoDamage", TRUE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipNoDam, oWeapon);
|
||||
array_set_object(oPC, "Scry_Nerfed", array_get_size(oPC, "Scry_Nerfed"), oWeapon);
|
||||
}}
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oPC);
|
||||
if(GetIsObjectValid(oWeapon)){
|
||||
if(!GetItemHasItemProperty(oWeapon, ITEM_PROPERTY_NO_DAMAGE)){
|
||||
//SetLocalInt(oWeapon, "BaelnornProjection_NoDamage", TRUE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipNoDam, oWeapon);
|
||||
array_set_object(oPC, "Scry_Nerfed", array_get_size(oPC, "Scry_Nerfed"), oWeapon);
|
||||
}}
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oPC);
|
||||
if(GetIsObjectValid(oWeapon)){
|
||||
if(!GetItemHasItemProperty(oWeapon, ITEM_PROPERTY_NO_DAMAGE)){
|
||||
//SetLocalInt(oWeapon, "BaelnornProjection_NoDamage", TRUE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ipNoDam, oWeapon);
|
||||
array_set_object(oPC, "Scry_Nerfed", array_get_size(oPC, "Scry_Nerfed"), oWeapon);
|
||||
}}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = OBJECT_SELF;
|
||||
|
||||
DeleteLocalInt(oPC, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(oPC, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_DIVINATION);
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
//Declare major variables
|
||||
object oTarget;
|
||||
int nCasterLvl = PRCGetCasterLevel(oPC);
|
||||
int nSpell = PRCGetSpellId();
|
||||
float fDur = 60.0 * nCasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Make Metamagic check for extend
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
fDur = fDur * 2;
|
||||
}
|
||||
|
||||
SetLocalInt(oPC, "ScryCasterLevel", nCasterLvl);
|
||||
SetLocalInt(oPC, "ScrySpellId", nSpell);
|
||||
SetLocalFloat(oPC, "ScryDuration", fDur);
|
||||
|
||||
StartDynamicConversation("prc_scry_conv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC);
|
||||
|
||||
// Apply the immunity effects
|
||||
ApplyScryEffects(oPC);
|
||||
|
||||
DeleteLocalInt(oPC, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the integer used to hold the spells spell school
|
||||
}
|
109
nwn/nwnprc/trunk/spells/nw_s0_clarity.nss
Normal file
109
nwn/nwnprc/trunk/spells/nw_s0_clarity.nss
Normal file
@@ -0,0 +1,109 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Clarity
|
||||
//:: NW_S0_Clarity.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell removes Charm, Daze, Confusion, Stunned
|
||||
and Sleep. It also protects the user from these
|
||||
effects for 1 turn / level. Does 1 point of
|
||||
damage for each effect removed.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 25, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
effect eImm1 = EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS);
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_POSITIVE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
effect eLink = EffectLinkEffects(eImm1, eVis);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eDam = PRCEffectDamage(oTarget, 1, DAMAGE_TYPE_NEGATIVE);
|
||||
effect eSearch = GetFirstEffect(oTarget);
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
int bValid;
|
||||
int bVisual;
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLARITY, FALSE));
|
||||
//Search through effects
|
||||
while(GetIsEffectValid(eSearch))
|
||||
{
|
||||
bValid = FALSE;
|
||||
//Check to see if the effect matches a particular type defined below
|
||||
if (GetEffectType(eSearch) == EFFECT_TYPE_DAZED)
|
||||
{
|
||||
bValid = TRUE;
|
||||
}
|
||||
else if(GetEffectType(eSearch) == EFFECT_TYPE_CHARMED)
|
||||
{
|
||||
bValid = TRUE;
|
||||
}
|
||||
else if(GetEffectType(eSearch) == EFFECT_TYPE_SLEEP)
|
||||
{
|
||||
bValid = TRUE;
|
||||
}
|
||||
else if(GetEffectType(eSearch) == EFFECT_TYPE_CONFUSED)
|
||||
{
|
||||
bValid = TRUE;
|
||||
}
|
||||
else if(GetEffectType(eSearch) == EFFECT_TYPE_STUNNED)
|
||||
{
|
||||
bValid = TRUE;
|
||||
}
|
||||
//Apply damage and remove effect if the effect is a match
|
||||
if (bValid == TRUE)
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
RemoveEffect(oTarget, eSearch);
|
||||
bVisual = TRUE;
|
||||
}
|
||||
eSearch = GetNextEffect(oTarget);
|
||||
}
|
||||
float fTime = 30.0 + RoundsToSeconds(nDuration);
|
||||
//After effects are removed we apply the immunity to mind spells to the target
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fTime,TRUE,-1,CasterLvl);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
74
nwn/nwnprc/trunk/spells/nw_s0_cloudkill.nss
Normal file
74
nwn/nwnprc/trunk/spells/nw_s0_cloudkill.nss
Normal file
@@ -0,0 +1,74 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Cloudkill
|
||||
//:: NW_S0_CloudKill.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
All creatures with 3 or less HD die, those with
|
||||
4 to 6 HD must make a save Fortitude Save or die.
|
||||
Those with more than 6 HD take 1d10 Poison damage
|
||||
every round.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 17, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: modified by Ornedan Dec 22, 2004 to PnP rules
|
||||
|
||||
|
||||
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_FOGKILL);
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel();
|
||||
int nDuration = CasterLvl;
|
||||
effect eImpact = EffectVisualEffect(258);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget);
|
||||
if(nDuration < 1)
|
||||
{
|
||||
nDuration = 1;
|
||||
}
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Metamagic checks for entend
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Apply the AOE object to the specified location
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, MinutesToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_FOGKILL");
|
||||
SetAllAoEInts(SPELL_CLOUDKILL, oAoE, PRCGetSpellSaveDC(SPELL_CLOUDKILL, SPELL_SCHOOL_CONJURATION), 0, CasterLvl);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
115
nwn/nwnprc/trunk/spells/nw_s0_cloudkilla.nss
Normal file
115
nwn/nwnprc/trunk/spells/nw_s0_cloudkilla.nss
Normal file
@@ -0,0 +1,115 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Cloudkill: On Enter
|
||||
//:: NW_S0_CloudKillA.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
All creatures with 3 or less HD die, those with
|
||||
4 to 6 HD must make a save Fortitude Save or die.
|
||||
Those with more than 6 HD take 1d10 Poison damage
|
||||
every round.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 17, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: modified by Ornedan Dec 22, 2004 to PnP rules
|
||||
#include "prc_inc_spells"
|
||||
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetEnteringObject();
|
||||
int nHD = GetHitDice(oTarget);
|
||||
effect eDeath = EffectDeath();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
|
||||
effect eNeg = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
effect eConceal = EffectConcealment(20);
|
||||
effect eVis2 = EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT);
|
||||
effect eLink = EffectLinkEffects(eConceal, eVis2);
|
||||
|
||||
//effect eDam;
|
||||
int nDam = d4();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
|
||||
object aoeCreator = GetAreaOfEffectCreator();
|
||||
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
|
||||
//int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
{
|
||||
nDam = 4;//Damage is at max
|
||||
}
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDam = nDam + (nDam/2); //Damage/Healing is +50%
|
||||
}
|
||||
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL));
|
||||
|
||||
//Concealement by fog happens no matter what
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, oTarget, 0.0f, FALSE);
|
||||
|
||||
//Determine spell effect based on the targets HD
|
||||
if (nHD <= 3)
|
||||
{
|
||||
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DEATH))
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
|
||||
}
|
||||
}
|
||||
else if (nHD >= 4 && nHD <= 6)
|
||||
{
|
||||
//Make a save or die
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, aoeCreator), SAVING_THROW_TYPE_DEATH, OBJECT_SELF))
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetHasMettle(oTarget, SAVING_THROW_FORT))
|
||||
// This script does nothing if it has Mettle, bail
|
||||
return;
|
||||
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDam, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, aoeCreator), SAVING_THROW_TYPE_SPELL, OBJECT_SELF))
|
||||
{
|
||||
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDam, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetHasMettle(oTarget, SAVING_THROW_FORT))
|
||||
// This script does nothing if it has Mettle, bail
|
||||
return;
|
||||
// Halve the damage on succesfull save.
|
||||
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDam / 2, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
60
nwn/nwnprc/trunk/spells/nw_s0_cloudkillb.nss
Normal file
60
nwn/nwnprc/trunk/spells/nw_s0_cloudkillb.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Cloudkill: On Exit
|
||||
//:: NW_S0_CloudKillB.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
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: modified by Ornedan Dec 22, 2004
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
int bValid = FALSE;
|
||||
effect eAOE;
|
||||
if(GetHasSpellEffect(SPELL_CLOUDKILL, oTarget))
|
||||
{
|
||||
//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_CONCEALMENT)
|
||||
{
|
||||
//If the effect was created by the spell then remove it
|
||||
if(GetEffectSpellId(eAOE) == SPELL_CLOUDKILL)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
109
nwn/nwnprc/trunk/spells/nw_s0_cloudkillc.nss
Normal file
109
nwn/nwnprc/trunk/spells/nw_s0_cloudkillc.nss
Normal file
@@ -0,0 +1,109 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Cloudkill: Heartbeat
|
||||
//:: NW_S0_CloudKillC.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
All creatures with 3 or less HD die, those with
|
||||
4 to 6 HD must make a save Fortitude Save or die.
|
||||
Those with more than 6 HD take 1d10 Poison damage
|
||||
every round.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 17, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: modified by Ornedan Dec 22, 2004 to PnP rules
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage = d4();
|
||||
//effect eDam;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
object oTarget;
|
||||
int nHD;
|
||||
float fDelay;
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
{
|
||||
nDamage = 4;//Damage is at max
|
||||
}
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ 2003-Oct-15
|
||||
// When the caster is no longer there, all functions calling
|
||||
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
|
||||
//--------------------------------------------------------------------------
|
||||
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
object aoeCreator = GetAreaOfEffectCreator();
|
||||
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
|
||||
|
||||
|
||||
//Set damage effect
|
||||
//Get the first object in the persistant AOE
|
||||
oTarget = GetFirstInPersistentObject();
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
fDelay = PRCGetRandomDelay();
|
||||
if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE , aoeCreator) )
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL));
|
||||
|
||||
nHD = GetHitDice(oTarget);
|
||||
|
||||
//Apply VFX impact and damage
|
||||
//Creatures with less than 6 HD take full damage automatically
|
||||
//Any with more than 6 get to save (Fortitued) for half
|
||||
if (nHD < 6)
|
||||
{
|
||||
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,aoeCreator)), SAVING_THROW_TYPE_SPELL, OBJECT_SELF))
|
||||
{
|
||||
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetHasMettle(oTarget, SAVING_THROW_FORT))
|
||||
// This script does nothing if it has Mettle, bail
|
||||
nDamage = 0;
|
||||
// Halve the damage on succesfull save.
|
||||
AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage / 2, DURATION_TYPE_TEMPORARY, TRUE, -1.0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get the next target in the AOE
|
||||
oTarget = GetNextInPersistentObject();
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
137
nwn/nwnprc/trunk/spells/nw_s0_colspray.nss
Normal file
137
nwn/nwnprc/trunk/spells/nw_s0_colspray.nss
Normal file
@@ -0,0 +1,137 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Color Spray
|
||||
//:: NW_S0_ColSpray.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
A cone of sparkling lights flashes out in a cone
|
||||
from the casters hands affecting all those within
|
||||
the Area of Effect.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 25, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nHD;
|
||||
int nDuration;
|
||||
float fDelay;
|
||||
object oTarget;
|
||||
effect eSleep = EffectSleep();
|
||||
effect eStun = EffectStunned();
|
||||
effect eBlind = EffectBlindness();
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
effect eLink1 = EffectLinkEffects(eSleep, eMind);
|
||||
|
||||
effect eLink2 = EffectLinkEffects(eStun, eMind);
|
||||
eLink2 = EffectLinkEffects(eLink2, eDur);
|
||||
|
||||
effect eLink3 = EffectLinkEffects(eBlind, eMind);
|
||||
|
||||
effect eVis1 = EffectVisualEffect(VFX_IMP_SLEEP);
|
||||
effect eVis2 = EffectVisualEffect(VFX_IMP_STUN);
|
||||
effect eVis3 = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M);
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
|
||||
|
||||
//Get first object in the spell cone
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 10.0, PRCGetSpellTargetLocation(), TRUE);
|
||||
//Cycle through the target until the current object is invalid
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)
|
||||
&& !PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, oTarget)
|
||||
&& oTarget != OBJECT_SELF)
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_COLOR_SPRAY));
|
||||
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/30;
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay))
|
||||
{
|
||||
nDuration = 3 + d4();
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDuration = 7;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDuration = nDuration + (nDuration/2); //Damage/Healing is +50%
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
|
||||
nHD = GetHitDice(oTarget);
|
||||
if(nHD <= 2)
|
||||
{
|
||||
//Apply the VFX impact and effects
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl));
|
||||
}
|
||||
else if(nHD > 2 && nHD < 5)
|
||||
{
|
||||
nDuration = nDuration - 1;
|
||||
//Apply the VFX impact and effects
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis3, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink3, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); }
|
||||
else
|
||||
{
|
||||
nDuration = nDuration - 2;
|
||||
//Apply the VFX impact and effects
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in spell area
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 10.0, PRCGetSpellTargetLocation(), TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
125
nwn/nwnprc/trunk/spells/nw_s0_conecold.nss
Normal file
125
nwn/nwnprc/trunk/spells/nw_s0_conecold.nss
Normal file
@@ -0,0 +1,125 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Cone of Cold
|
||||
//:: NW_S0_ConeCold
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
// Cone of cold creates an area of extreme cold,
|
||||
// originating at your hand and extending outward
|
||||
// in a cone. It drains heat, causing 1d6 points of
|
||||
// cold damage per caster level (maximum 15d6).
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Noel Borstad
|
||||
//:: Created On: 10/18/02000
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Aidan Scanlan On: April 11, 2001
|
||||
//:: Update Pass By: Preston W, On: July 25, 2001
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
float SpellDelay (object oTarget, int nShape);
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
int nCasterLevel = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
location lTargetLocation = PRCGetSpellTargetLocation();
|
||||
object oTarget;
|
||||
//Limit Caster level for the purposes of damage.
|
||||
if (nCasterLevel > 15)
|
||||
{
|
||||
nCasterLevel = 15;
|
||||
}
|
||||
|
||||
CasterLvl +=SPGetPenetr();
|
||||
|
||||
int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_COLD);
|
||||
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
// March 2003. Removed this as part of the reputation pass
|
||||
// if((PRCGetSpellId() == 340 && !GetIsFriend(oTarget)) || PRCGetSpellId() == 25)
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CONE_OF_COLD));
|
||||
//Get the distance between the target and caster to delay the application of effects
|
||||
fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20.0;
|
||||
//Make SR check, and appropriate saving throw(s).
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay) && (oTarget != OBJECT_SELF))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
//Detemine damage
|
||||
nDamage = d6(nCasterLevel);
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = 6 * nCasterLevel;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
|
||||
}
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nCasterLevel);
|
||||
//Adjust damage according to Reflex Save, Evasion or Improved Evasion
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD);
|
||||
|
||||
// Apply effects to the currently selected target.
|
||||
effect eCold = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FROST_L);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
//Apply delayed effects
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCold, oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
118
nwn/nwnprc/trunk/spells/nw_s0_confusion.nss
Normal file
118
nwn/nwnprc/trunk/spells/nw_s0_confusion.nss
Normal file
@@ -0,0 +1,118 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Confusion
|
||||
//:: nw_s0_confusion.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Enchantment (Compulsion) [Mind-Affecting]
|
||||
Level: Brd 3, Sor/Wiz 4, Trickery 4
|
||||
Components: V, S, M/DF
|
||||
Casting Time: 1 standard action
|
||||
Range: Medium (100 ft. + 10 ft./level)
|
||||
Targets: All creatures in a 15-ft. radius burst
|
||||
Duration: 1 round/level
|
||||
Saving Throw: Will negates
|
||||
Spell Resistance: Yes
|
||||
|
||||
|
||||
This spell causes the targets to become confused,
|
||||
making them unable to independently determine
|
||||
what they will do.
|
||||
|
||||
Roll on the following table at the beginning of
|
||||
each subject<63>s turn each round to see what the
|
||||
subject does in that round.
|
||||
d% Behavior
|
||||
01-10 Attack caster with melee or ranged weapons
|
||||
(or close with caster if attack is not possible).
|
||||
11-20 Act normally.
|
||||
21-50 Do nothing but babble incoherently.
|
||||
51-70 Flee away from caster at top possible speed.
|
||||
71-100 Attack nearest creature (for this purpose,
|
||||
a familiar counts as part of the subject<63>s self).
|
||||
|
||||
A confused character who can<61>t carry out the
|
||||
indicated action does nothing but babble
|
||||
incoherently. Attackers are not at any special
|
||||
advantage when attacking a confused character.
|
||||
Any confused character who is attacked
|
||||
automatically attacks its attackers on its next
|
||||
turn, as long as it is still confused when its
|
||||
turn comes. Note that a confused character will
|
||||
not make attacks of opportunity against any
|
||||
creature that it is not already devoted to
|
||||
attacking (either because of its most recent
|
||||
action or because it has just been attacked).
|
||||
|
||||
Arcane Material Component
|
||||
A set of three nut shells.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 30 , 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 25, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDuration = CasterLvl;
|
||||
int nDur;
|
||||
float fDelay;
|
||||
|
||||
//Perform metamagic checks
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
|
||||
effect eConfuse = PRCEffectConfused();
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link duration VFX and confusion effects
|
||||
effect eLink = EffectLinkEffects(eMind, eConfuse);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget);
|
||||
|
||||
//Search through target area
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CONFUSION));
|
||||
fDelay = PRCGetRandomDelay();
|
||||
//Make SR Check and faction check
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
//Make Will Save
|
||||
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oCaster, fDelay))
|
||||
{
|
||||
//Apply linked effect and VFX Impact
|
||||
nDur = PRCGetScaledDuration(nDuration, oTarget);
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDur), TRUE, SPELL_CONFUSION, CasterLvl));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in the shape
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
111
nwn/nwnprc/trunk/spells/nw_s0_contagion.nss
Normal file
111
nwn/nwnprc/trunk/spells/nw_s0_contagion.nss
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
nw_s0_contagion
|
||||
|
||||
The target must save or be struck down with
|
||||
Blidning Sickness, Cackle Fever, Filth Fever
|
||||
Mind Fire, Red Ache, the Shakes or Slimy Doom.
|
||||
|
||||
By: Preston Watamaniuk
|
||||
Created: June 6, 2001
|
||||
Modified: Jun 12, 2006
|
||||
|
||||
Flaming_Sword: Added touch attack roll
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
int CasterLvl = nCasterLevel;
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
|
||||
//INSERT SPELL CODE HERE
|
||||
int iAttackRoll = PRCDoMeleeTouchAttack(oTarget);
|
||||
if (iAttackRoll > 0)
|
||||
{
|
||||
int nRand = Random(7)+1;
|
||||
int nDisease;
|
||||
//Use a random seed to determine the disease that will be delivered.
|
||||
switch (nRand)
|
||||
{
|
||||
case 1:
|
||||
nDisease = DISEASE_CONTAGION_BLINDING_SICKNESS;
|
||||
break;
|
||||
case 2:
|
||||
nDisease = DISEASE_CONTAGION_CACKLE_FEVER;
|
||||
break;
|
||||
case 3:
|
||||
nDisease = DISEASE_CONTAGION_FILTH_FEVER;
|
||||
break;
|
||||
case 4:
|
||||
nDisease = DISEASE_CONTAGION_MINDFIRE;
|
||||
break;
|
||||
case 5:
|
||||
nDisease = DISEASE_CONTAGION_RED_ACHE;
|
||||
break;
|
||||
case 6:
|
||||
nDisease = DISEASE_CONTAGION_SHAKES;
|
||||
break;
|
||||
case 7:
|
||||
nDisease = DISEASE_CONTAGION_SLIMY_DOOM;
|
||||
break;
|
||||
}
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CONTAGION));
|
||||
effect eDisease = EffectDisease(nDisease);
|
||||
//Make SR check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget, CasterLvl + SPGetPenetr()))
|
||||
{
|
||||
// Make the real first save against the spell's DC
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SPELL))
|
||||
{
|
||||
//The effect is permament because the disease subsystem has its own internal resolution
|
||||
//system in place.
|
||||
// The first disease save is against an impossible fake DC, since at this point the
|
||||
// target has already failed their real first save.
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisease, oTarget, 0.0f, TRUE, -1, CasterLvl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return iAttackRoll; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
93
nwn/nwnprc/trunk/spells/nw_s0_conund.nss
Normal file
93
nwn/nwnprc/trunk/spells/nw_s0_conund.nss
Normal file
@@ -0,0 +1,93 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Control Undead]
|
||||
//:: [NW_S0_ConUnd.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
A single undead with up to 3 HD per caster level
|
||||
can be dominated.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Feb 2, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk
|
||||
//:: Last Updated On: April 6, 2001
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eControl = EffectDominated();
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
|
||||
effect eLink = EffectLinkEffects(eMind, eControl);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
int nHD = CasterLvl * 2;
|
||||
if (GetLevelByClass(CLASS_TYPE_DREAD_NECROMANCER, OBJECT_SELF) >= 8)
|
||||
{
|
||||
nHD = CasterLvl * (2 + GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF));
|
||||
}
|
||||
//Make meta magic
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = CasterLvl * 2;
|
||||
}
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
|
||||
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD && GetHitDice(oTarget) <= nHD)
|
||||
{
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CONTROL_UNDEAD));
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr))
|
||||
{
|
||||
//Make a Will save
|
||||
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_NONE, OBJECT_SELF, 1.0))
|
||||
{
|
||||
//Apply VFX impact and Link effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration),TRUE,-1,CasterLvl));
|
||||
//Increment HD affected count
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
93
nwn/nwnprc/trunk/spells/nw_s0_crgrund.nss
Normal file
93
nwn/nwnprc/trunk/spells/nw_s0_crgrund.nss
Normal file
@@ -0,0 +1,93 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Create Greater Undead
|
||||
//:: NW_S0_CrGrUnd.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Summons an undead type pegged to the character's
|
||||
level.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = nCasterLevel;
|
||||
nDuration = 24;
|
||||
string sResRef;
|
||||
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
|
||||
//Make metamagic extend check
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Determine undead to summon based on level
|
||||
if (nCasterLevel <= 15)
|
||||
sResRef = "NW_S_VAMPIRE";
|
||||
else if ((nCasterLevel >= 16) && (nCasterLevel <= 17))
|
||||
sResRef = "NW_S_DOOMKGHT";
|
||||
else if ((nCasterLevel >= 18) && (nCasterLevel <= 19))
|
||||
sResRef = "NW_S_LICH";
|
||||
else
|
||||
sResRef = "NW_S_MUMCLERIC";
|
||||
effect eSummon = EffectSummonCreature(sResRef,VFX_FNF_SUMMON_UNDEAD);
|
||||
//Apply summon effect and VFX impact.
|
||||
MultisummonPreSummon();
|
||||
if(GetPRCSwitch(PRC_CREATE_UNDEAD_UNCONTROLLED))
|
||||
{
|
||||
object oSummon = CreateObject(OBJECT_TYPE_CREATURE, sResRef, PRCGetSpellTargetLocation());
|
||||
//make it hostile
|
||||
ChangeToStandardFaction(oSummon, STANDARD_FACTION_HOSTILE);
|
||||
//this is to
|
||||
//A) allow time to dominate properly
|
||||
//B) allow time for corpsecrafter to run
|
||||
effect eDom = EffectCutsceneDominated();
|
||||
eDom = SupernaturalEffect(EffectLinkEffects(eDom, EffectCutsceneImmobilize()));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDom, oSummon, 3.0);
|
||||
//visual
|
||||
effect eVFX = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVFX, PRCGetSpellTargetLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetPRCSwitch(PRC_CREATE_UNDEAD_PERMANENT))
|
||||
{
|
||||
eSummon = SupernaturalEffect(eSummon);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eSummon, PRCGetSpellTargetLocation());
|
||||
}
|
||||
else
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, PRCGetSpellTargetLocation(), HoursToSeconds(nDuration));
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
70
nwn/nwnprc/trunk/spells/nw_s0_crpdoom.nss
Normal file
70
nwn/nwnprc/trunk/spells/nw_s0_crpdoom.nss
Normal file
@@ -0,0 +1,70 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Creeping Doom
|
||||
//:: NW_S0_CrpDoom
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The druid calls forth a mass of churning insects
|
||||
and scorpians that bite and sting all those within
|
||||
a 20ft square. The total spell effects does
|
||||
1000 damage to all withiin the area of effect
|
||||
until all damage is dealt.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: , 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//Needed would require an entry into the vfx_persistent.2DA and a new AOE constant
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables including Area of Effect Object
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_CREEPING_DOOM);
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel();
|
||||
int nDuration = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Make sure duration does no equal 0
|
||||
if (nDuration < 1)
|
||||
{
|
||||
nDuration = 1;
|
||||
}
|
||||
//Check Extend metamagic feat.
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_CREEPING_DOOM");
|
||||
SetAllAoEInts(SPELL_CREEPING_DOOM, oAoE, PRCGetSpellSaveDC(SPELL_CREEPING_DOOM, SPELL_SCHOOL_CONJURATION), 0, CasterLvl);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
61
nwn/nwnprc/trunk/spells/nw_s0_crpdooma.nss
Normal file
61
nwn/nwnprc/trunk/spells/nw_s0_crpdooma.nss
Normal file
@@ -0,0 +1,61 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Creeping Doom: On Enter
|
||||
//:: NW_S0_AcidFogA.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creature caught in the swarm take an initial
|
||||
damage of 1d20, but there after they take
|
||||
1d4 per swarm counter on the AOE.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 17, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
int nDamage;
|
||||
effect eDam;
|
||||
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
|
||||
object oTarget = GetEnteringObject();
|
||||
effect eSpeed = EffectMovementSpeedDecrease(50);
|
||||
effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eLink = EffectLinkEffects(eSpeed, eVis2);
|
||||
float fDelay;
|
||||
|
||||
object aoeCreator = GetAreaOfEffectCreator();
|
||||
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
|
||||
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
|
||||
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
|
||||
{
|
||||
//Fire cast spell at event for the target
|
||||
SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_CREEPING_DOOM));
|
||||
fDelay = PRCGetRandomDelay(1.0, 1.8);
|
||||
//Roll Damage
|
||||
nDamage = d20();
|
||||
nDamage += SpellDamagePerDice(aoeCreator, 1);
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_PIERCING);
|
||||
//Apply damage and visuals
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget,0.0f,FALSE);
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
60
nwn/nwnprc/trunk/spells/nw_s0_crpdoomb.nss
Normal file
60
nwn/nwnprc/trunk/spells/nw_s0_crpdoomb.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Creeping Doom: On Exit
|
||||
//:: NW_S0_CrpDoomB.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
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
int bValid = FALSE;
|
||||
effect eAOE;
|
||||
if(GetHasSpellEffect(SPELL_CREEPING_DOOM, oTarget))
|
||||
{
|
||||
//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_MOVEMENT_SPEED_DECREASE)
|
||||
{
|
||||
//If the effect was created by the Acid_Fog then remove it
|
||||
if(GetEffectSpellId(eAOE) == SPELL_CREEPING_DOOM)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
96
nwn/nwnprc/trunk/spells/nw_s0_crpdoomc.nss
Normal file
96
nwn/nwnprc/trunk/spells/nw_s0_crpdoomc.nss
Normal file
@@ -0,0 +1,96 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Creeping Doom: Heartbeat
|
||||
//:: NW_S0_CrpDoomC.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creature caught in the swarm take an initial
|
||||
damage of 1d20, but there after they take
|
||||
1d6 per swarm counter on the AOE.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 17, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
int nDamage;
|
||||
effect eDam;
|
||||
effect eVis = EffectVisualEffect(VFX_COM_BLOOD_REG_RED);
|
||||
object oTarget = GetEnteringObject();
|
||||
string sConstant1 = "NW_SPELL_CONSTANT_CREEPING_DOOM1" + ObjectToString(GetAreaOfEffectCreator());
|
||||
string sConstant2 = "NW_SPELL_CONSTANT_CREEPING_DOOM2" + ObjectToString(GetAreaOfEffectCreator());
|
||||
int nSwarm = GetLocalInt(OBJECT_SELF, sConstant1);
|
||||
int nDamCount = GetLocalInt(OBJECT_SELF, sConstant2);
|
||||
float fDelay;
|
||||
if(nSwarm < 1)
|
||||
{
|
||||
nSwarm = 1;
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// GZ 2003-Oct-15
|
||||
// When the caster is no longer there, all functions calling
|
||||
// GetAreaOfEffectCreator will fail. Its better to remove the barrier then
|
||||
//--------------------------------------------------------------------------
|
||||
if (!GetIsObjectValid(GetAreaOfEffectCreator()))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Get first target in spell area
|
||||
oTarget = GetFirstInPersistentObject();
|
||||
while(GetIsObjectValid(oTarget) && nDamCount < 1000)
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
|
||||
{
|
||||
fDelay = PRCGetRandomDelay(1.0, 2.2);
|
||||
//------------------------------------------------------------------
|
||||
// According to the book, SR Does not count against creeping doom
|
||||
//------------------------------------------------------------------
|
||||
//Spell resistance check
|
||||
// if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget, fDelay))
|
||||
// {
|
||||
SignalEvent(oTarget,EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_CREEPING_DOOM, FALSE));
|
||||
//Roll Damage
|
||||
nDamage = d6(nSwarm);
|
||||
nDamage += SpellDamagePerDice(GetAreaOfEffectCreator(), nSwarm);
|
||||
//Set Damage Effect with the modified damage
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_PIERCING);
|
||||
//Apply damage and visuals
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
nDamCount = nDamCount + nDamage;
|
||||
// }
|
||||
}
|
||||
//Get next target in spell area
|
||||
oTarget = GetNextInPersistentObject();
|
||||
}
|
||||
if(nDamCount >= 1000)
|
||||
{
|
||||
DestroyObject(OBJECT_SELF, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
nSwarm++;
|
||||
SetLocalInt(OBJECT_SELF, sConstant1, nSwarm);
|
||||
SetLocalInt(OBJECT_SELF, sConstant2, nDamCount);
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
97
nwn/nwnprc/trunk/spells/nw_s0_crundead.nss
Normal file
97
nwn/nwnprc/trunk/spells/nw_s0_crundead.nss
Normal file
@@ -0,0 +1,97 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Create Undead
|
||||
//:: NW_S0_CrUndead.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Spell summons a Ghoul, Shadow, Ghast, Wight or
|
||||
Wraith
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = nCasterLevel;
|
||||
nDuration = 24;
|
||||
string sResRef;
|
||||
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
|
||||
//Check for metamagic extend
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Set the summoned undead to the appropriate template based on the caster level
|
||||
if (nCasterLevel <= 11)
|
||||
sResRef = "NW_S_GHOUL";
|
||||
else if ((nCasterLevel >= 12) && (nCasterLevel <= 13))
|
||||
sResRef = "NW_S_GHAST";
|
||||
else if ((nCasterLevel >= 14) && (nCasterLevel <= 15))
|
||||
sResRef = "NW_S_WIGHT";
|
||||
else if ((nCasterLevel >= 16))
|
||||
sResRef = "NW_S_SPECTRE";
|
||||
effect eSummon = EffectSummonCreature(sResRef,VFX_FNF_SUMMON_UNDEAD);
|
||||
|
||||
//Apply VFX impact and summon effect
|
||||
MultisummonPreSummon();
|
||||
if(GetPRCSwitch(PRC_CREATE_UNDEAD_UNCONTROLLED))
|
||||
{
|
||||
object oSummon = CreateObject(OBJECT_TYPE_CREATURE, sResRef, PRCGetSpellTargetLocation());
|
||||
//this is to
|
||||
//make it hostile
|
||||
ChangeToStandardFaction(oSummon, STANDARD_FACTION_HOSTILE);
|
||||
//A) allow time to dominate properly
|
||||
//B) allow time for corpsecrafter to run
|
||||
effect eDom = EffectCutsceneDominated();
|
||||
eDom = SupernaturalEffect(EffectLinkEffects(eDom, EffectCutsceneImmobilize()));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDom, oSummon, 3.0);
|
||||
//visual
|
||||
effect eVFX = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVFX, PRCGetSpellTargetLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetPRCSwitch(PRC_CREATE_UNDEAD_PERMANENT))
|
||||
{
|
||||
eSummon = SupernaturalEffect(eSummon);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eSummon, PRCGetSpellTargetLocation());
|
||||
}
|
||||
else
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, PRCGetSpellTargetLocation(), HoursToSeconds(nDuration));
|
||||
}
|
||||
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, PRCGetSpellTargetLocation());
|
||||
// object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED);
|
||||
// DelayCommand(0.5, CorpseCrafter(OBJECT_SELF, oSummon));
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
211
nwn/nwnprc/trunk/spells/nw_s0_curinflict.nss
Normal file
211
nwn/nwnprc/trunk/spells/nw_s0_curinflict.nss
Normal file
@@ -0,0 +1,211 @@
|
||||
/** @file
|
||||
nw_s0_cureinflict
|
||||
|
||||
Handles all the cure/inflict spells
|
||||
|
||||
By: Flaming_Sword
|
||||
Created: Jun 13, 2006
|
||||
Modified: Jun 30, 2006
|
||||
|
||||
Consolidation of multiple scripts
|
||||
modified healing vfx for inflict spells
|
||||
changed cure minor wounds to heal 1 hp
|
||||
in line with SRD
|
||||
added will save 1/2 damage for cure spells
|
||||
added mass cure spells
|
||||
added mass heal-like random delay for mass
|
||||
cure spells (to look cool, delay can be
|
||||
set to zero if desired)
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "prc_inc_function"
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nSpellID, int bIsCure)
|
||||
{
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int bMass = IsMassCure(nSpellID) || IsMassInflict(nSpellID);
|
||||
int nHealVFX;
|
||||
int nEnergyType = bIsCure ? DAMAGE_TYPE_POSITIVE : DAMAGE_TYPE_NEGATIVE;
|
||||
int nSpellLevel = StringToInt(lookup_spell_cleric_level(PRCGetSpellId()));
|
||||
int nDice = bMass ? nSpellLevel - 4 : nSpellLevel; // The spells use a number of dice equivalent to spell level, mass versions 4 fewer
|
||||
int bHeal;
|
||||
|
||||
switch(nDice) //nDice == 0 for cure/inflict minor wounds
|
||||
{
|
||||
case 0: nHealVFX = VFX_IMP_HEAD_HEAL; break;
|
||||
case 1: nHealVFX = VFX_IMP_HEALING_S; break;
|
||||
case 2: nHealVFX = VFX_IMP_HEALING_M; break;
|
||||
case 3: nHealVFX = VFX_IMP_HEALING_L; break;
|
||||
case 4: default: nHealVFX = VFX_IMP_HEALING_G; break;
|
||||
}
|
||||
|
||||
// Extra points based on spell level, capped to caster level
|
||||
int nExtraDamage = min(nSpellLevel * 5, nCasterLevel);
|
||||
|
||||
// Healing is more effective for players on low or normal difficulty
|
||||
int nDifficultyCondition = (GetIsPC(oTarget) && (GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES)) && bIsCure;
|
||||
|
||||
// Mass spell AoE targeting
|
||||
location lLoc;
|
||||
if(bMass)
|
||||
{
|
||||
lLoc = PRCGetSpellTargetLocation();
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsCure ? VFX_FNF_LOS_HOLY_20 : VFX_FNF_LOS_EVIL_20), lLoc);
|
||||
}
|
||||
|
||||
// Targeting loop
|
||||
float fDelay = 0.0;
|
||||
int nHealed = 0;
|
||||
int nMaxHealed = bMass ? nCasterLevel : 1;
|
||||
int iAttackRoll = 1;
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
// Skip non-creatures. AoE targeting shouldn't get them anyway, but single target spells shouldn't affect non-creatures either
|
||||
// Also skip constructs, since they are neither living nor undead. Technically, they would qualify for being healed by mass cures, but we assume that's just bad editing.
|
||||
//Improved Fortification overrides Warforged's ability to be healed.
|
||||
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT && !GetIsWarforged(oTarget) || GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget))
|
||||
{
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE);
|
||||
continue;
|
||||
}
|
||||
|
||||
//random delay like mass heal so it looks cool :P (can be set to zero if behavior is not desired)
|
||||
if(bMass) fDelay = PRCGetRandomDelay();
|
||||
|
||||
// Roll damage / heal points
|
||||
int iBlastFaith = BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE);
|
||||
int iTombTainted = GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD;
|
||||
int nHeal = 0;
|
||||
if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith || nDifficultyCondition)
|
||||
{
|
||||
nHeal = nDice * 8 + nExtraDamage;
|
||||
if(nDifficultyCondition && ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith))
|
||||
nHeal += nExtraDamage; //extra damage on lower difficulties
|
||||
}
|
||||
else
|
||||
nHeal = d8(nDice) + nExtraDamage;
|
||||
// More feat effects
|
||||
if((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
nHeal += (nHeal / 2);
|
||||
if(GetHasFeat(FEAT_AUGMENT_HEALING, oCaster) && bIsCure)
|
||||
nHeal += (nSpellLevel * 2);
|
||||
// Cure Minor only does 1 - Fox
|
||||
if(nDice == 0)
|
||||
nHeal = 1;
|
||||
//Healing Hands bonus even applies to Cure Minor - Fox
|
||||
if(PRCGetLastSpellCastClass() == CLASS_TYPE_HEALER)
|
||||
nHeal += GetAbilityModifier(ABILITY_CHARISMA, oCaster);
|
||||
|
||||
// Whether we are supposed to heal or hurt the target
|
||||
bHeal = (!bIsCure && (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || iTombTainted)) || // Undead handling, non-cures heal them
|
||||
(bIsCure && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && !iTombTainted); // Undead handling, cures hurt them
|
||||
|
||||
if (GetLocalInt(oTarget, "AcererakHealing")) bHeal = TRUE;
|
||||
|
||||
// Healing, assume the caster never wants to heal hostiles and any targeting of such was a misclick
|
||||
if(bHeal && !spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster))
|
||||
{
|
||||
//Warforged are only healed for half, none if they have Improved Fortification
|
||||
if(GetIsWarforged(oTarget)) nHeal /= 2;
|
||||
if(GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget)) nHeal = 0;
|
||||
|
||||
// Apply healing to the target
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(nHeal, oTarget), oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHealVFX), oTarget));
|
||||
|
||||
// Let the AI know
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE));
|
||||
|
||||
// Increment the # of affected targets counter
|
||||
nHealed++;
|
||||
}
|
||||
// Harming, assume the caster never wants to hurt non-hostiles and any targeting of such was a misclick
|
||||
else if(!bHeal && spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster))
|
||||
{
|
||||
nHeal += SpellDamagePerDice(OBJECT_SELF, nDice);
|
||||
// Roll touch attack if non-mass spell
|
||||
iAttackRoll = bMass ? TRUE : PRCDoMeleeTouchAttack(oTarget);
|
||||
if(iAttackRoll > 0)
|
||||
{
|
||||
// Let the AI know about hostile spell use
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID));
|
||||
|
||||
// Roll SR
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nCasterLevel + SPGetPenetr()))
|
||||
{
|
||||
// Save for half
|
||||
if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget,
|
||||
PRCGetSaveDC(oTarget, oCaster, nSpellID),
|
||||
bIsCure ? SAVING_THROW_TYPE_POSITIVE : SAVING_THROW_TYPE_NEGATIVE
|
||||
)
|
||||
)
|
||||
{
|
||||
nHeal /= 2;
|
||||
// Mettle for total avoidance instead
|
||||
if(GetHasMettle(oTarget, SAVING_THROW_WILL))
|
||||
nHeal = 0;
|
||||
}
|
||||
|
||||
// Apply effects
|
||||
effect eDam = PRCEffectDamage(oTarget, nHeal, nEnergyType);
|
||||
DelayCommand(fDelay + 1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsCure ? VFX_IMP_SUNSTRIKE : VFX_IMP_HARM), oTarget));
|
||||
}
|
||||
}
|
||||
|
||||
// Increment the # of affected targets counter
|
||||
nHealed++;
|
||||
}
|
||||
|
||||
// Terminate loop if target limit reached
|
||||
if(nHealed >= nMaxHealed)
|
||||
break;
|
||||
|
||||
// Otherwise get next target
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE);
|
||||
}
|
||||
|
||||
return bMass ? TRUE : iAttackRoll; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int bIsCure = IsMassCure(nSpellID) || IsCure(nSpellID); //whether it is a cure or inflict spell
|
||||
int nSchool = bIsCure ? SPELL_SCHOOL_CONJURATION : SPELL_SCHOOL_NECROMANCY;
|
||||
PRCSetSchool(nSchool);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
// Check for holding charge
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{ //can't hold the charge with mass cure/inflict spells
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget && IsTouchSpell(nSpellID))
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nSpellID, bIsCure);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nSpellID, bIsCure))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
135
nwn/nwnprc/trunk/spells/nw_s0_darkness.nss
Normal file
135
nwn/nwnprc/trunk/spells/nw_s0_darkness.nss
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
nw_s0_darkness
|
||||
|
||||
Creates a globe of darkness around those in the area
|
||||
of effect.
|
||||
|
||||
By: Preston Watamaniuk
|
||||
Created: Jan 7, 2002
|
||||
Modified: June 12, 2006
|
||||
|
||||
Flaming_Sword: Added touch attack roll
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_inc_itmrstr"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel)
|
||||
{
|
||||
//Declare major variables including Area of Effect Object
|
||||
int iAttackRoll = 1;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nPnP = GetPRCSwitch(PRC_PNP_DARKNESS);
|
||||
float fDuration = nPnP ? TurnsToSeconds(nCasterLevel * 10) : RoundsToSeconds(nCasterLevel);//10min/level for PnP
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_DARKNESS);
|
||||
|
||||
//Make sure duration does no equal 0
|
||||
if(fDuration < 6.0f)
|
||||
fDuration = 6.0f;
|
||||
|
||||
//Check Extend metamagic feat.
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2;
|
||||
|
||||
int nShadow = max(GetLocalInt(oCaster, "ShadowMantle_Shoulder"), GetLocalInt(oTarget, "ShadowMantle_Shoulder"));
|
||||
if (nShadow) nPnP = FALSE;
|
||||
if (DEBUG) DoDebug("nw_s0_darkness: oCaster "+GetName(oCaster)+" oTarget "+GetName(oTarget)+" nSwitch "+IntToString(nPnP));
|
||||
|
||||
if(!nPnP)
|
||||
{
|
||||
if (nShadow)
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, oCaster, fDuration);
|
||||
else
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, PRCGetSpellTargetLocation(), fDuration);
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(GetSpellTargetLocation(), "VFX_PER_DARKNESS");
|
||||
SetAllAoEInts(SPELL_DARKNESS, oAoE, PRCGetSpellSaveDC(SPELL_DARKNESS, SPELL_SCHOOL_EVOCATION), 0, nCasterLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oItemTarget = oTarget;
|
||||
if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
|
||||
{ //touch attack roll if target creature is not an ally
|
||||
// ally = friendly or party member
|
||||
if(!spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))
|
||||
iAttackRoll = PRCDoMeleeTouchAttack(oTarget);
|
||||
|
||||
if(iAttackRoll > 0)
|
||||
{
|
||||
oItemTarget = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget);
|
||||
if(!GetIsObjectValid(oTarget))
|
||||
{
|
||||
//no armor, check other slots
|
||||
int i;
|
||||
for(i=0;i<14;i++)
|
||||
{
|
||||
oItemTarget = GetItemInSlot(i, oTarget);
|
||||
if(GetIsObjectValid(oTarget))
|
||||
break;//end for loop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, oTarget, fDuration, TRUE, -1, nCasterLevel);
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(GetSpellTargetLocation(), "VFX_PER_DARKNESS");
|
||||
SetAllAoEInts(SPELL_DARKNESS, oAoE, PRCGetSpellSaveDC(SPELL_DARKNESS, SPELL_SCHOOL_EVOCATION), 0, nCasterLevel);
|
||||
}
|
||||
// If nothing is valid
|
||||
else if (!GetIsObjectValid(oItemTarget) && !GetIsObjectValid(oItemTarget))
|
||||
{
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, PRCGetSpellTargetLocation(), fDuration);
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(GetSpellTargetLocation(), "VFX_PER_DARKNESS");
|
||||
SetAllAoEInts(SPELL_DARKNESS, oAoE, PRCGetSpellSaveDC(SPELL_DARKNESS, SPELL_SCHOOL_EVOCATION), 0, nCasterLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
//otherwise items get an IP
|
||||
itemproperty ipDarkness = ItemPropertyAreaOfEffect(IP_CONST_AOE_DARKNESS, nCasterLevel);
|
||||
IPSafeAddItemProperty(oItemTarget, ipDarkness, fDuration);
|
||||
//this applies the effects relating to it
|
||||
DelayCommand(0.1, VoidCheckPRCLimitations(oItemTarget, OBJECT_INVALID));
|
||||
}
|
||||
}
|
||||
|
||||
return iAttackRoll; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
103
nwn/nwnprc/trunk/spells/nw_s0_darknessa.nss
Normal file
103
nwn/nwnprc/trunk/spells/nw_s0_darknessa.nss
Normal file
@@ -0,0 +1,103 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Darkness: On Enter
|
||||
//:: NW_S0_DarknessA.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates a globe of darkness around those in the area
|
||||
of effect.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Feb 28, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_DARKNESS);
|
||||
effect eDark = EffectDarkness();
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eLink = EffectLinkEffects(eDark, eDur);
|
||||
|
||||
effect eLink2 = EffectLinkEffects(eInvis, eDur);
|
||||
|
||||
effect ePnP = EffectLinkEffects(eDur, EffectDarkness());
|
||||
if(GetPRCSwitch(PRC_PNP_DARKNESS_35ED))
|
||||
ePnP = EffectLinkEffects(eDur, EffectConcealment(20));
|
||||
|
||||
object oTarget = GetEnteringObject();
|
||||
int iShadow = GetLevelByClass(CLASS_TYPE_SHADOWLORD,oTarget);
|
||||
|
||||
if (iShadow)
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectUltravision(), oTarget,0.0f,FALSE);
|
||||
if (iShadow>1)
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(20), oTarget,0.0f,FALSE);
|
||||
|
||||
|
||||
int nDuration = PRCGetCasterLevel(OBJECT_SELF);
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
|
||||
|
||||
// * July 2003: If has darkness then do not put it on it again
|
||||
// Primogenitor: Yes, what about overlapping darkness effects by different casters?
|
||||
//if (PRCGetHasEffect(EFFECT_TYPE_DARKNESS, oTarget) == TRUE)
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
if(GetIsObjectValid(oTarget) && oTarget != GetAreaOfEffectCreator())
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
|
||||
}
|
||||
|
||||
if (iShadow)
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink2, oTarget,0.0f,FALSE);
|
||||
else
|
||||
{
|
||||
if(GetPRCSwitch(PRC_PNP_DARKNESS))
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, ePnP, oTarget,0.0f,FALSE);
|
||||
else
|
||||
//Fire cast spell at event for the specified target
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget,0.0f,FALSE);
|
||||
}
|
||||
}
|
||||
else if (oTarget == GetAreaOfEffectCreator())
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
|
||||
//Fire cast spell at event for the specified target
|
||||
if(GetPRCSwitch(PRC_PNP_DARKNESS))
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, ePnP, oTarget,0.0f,FALSE);
|
||||
else
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink2, oTarget,0.0f,FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
61
nwn/nwnprc/trunk/spells/nw_s0_darknessb.nss
Normal file
61
nwn/nwnprc/trunk/spells/nw_s0_darknessb.nss
Normal file
@@ -0,0 +1,61 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Darkness: On Exit
|
||||
//:: NW_S0_DarknessB.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates a globe of darkness around those in the area
|
||||
of effect.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Feb 28, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
object oTarget = GetExitingObject();
|
||||
object oCreator = GetAreaOfEffectCreator();
|
||||
if(DEBUG) DoDebug(GetName(oTarget) + " is leaving " + GetName(oCreator) + "'s darkness effect");
|
||||
|
||||
int bValid = FALSE;
|
||||
effect eAOE;
|
||||
|
||||
//Search through the valid effects on the target.
|
||||
eAOE = GetFirstEffect(oTarget);
|
||||
while(GetIsEffectValid(eAOE))
|
||||
{
|
||||
int nType = GetEffectType(eAOE);
|
||||
int nID = GetEffectSpellId(eAOE);
|
||||
object oEffectCreator = GetEffectCreator(eAOE);
|
||||
|
||||
if((nID == SPELL_DARKNESS ||
|
||||
nID == SPELLABILITY_AS_DARKNESS ||
|
||||
nID == SPELL_SHADOW_CONJURATION_DARKNESS ||
|
||||
nID == 688 || //bioware SLA darkness
|
||||
nID == SHADOWLORD_DARKNESS ||
|
||||
nID == SPELL_RACE_DARKNESS ||
|
||||
nID == SPELL_DEEPER_DARKNESS ||
|
||||
nID == INVOKE_DARKNESS ||
|
||||
(nID == -1 && (GetObjectType(GetEffectCreator(eAOE)) == OBJECT_TYPE_ITEM) && GetLocalInt(OBJECT_SELF, "PRC_AoE_IPRP_Init")) // Item-based AoE
|
||||
) &&
|
||||
GetEffectCreator(eAOE) == oCreator &&
|
||||
nType != EFFECT_TYPE_AREA_OF_EFFECT
|
||||
)
|
||||
{
|
||||
if(DEBUG) DoDebug(GetName(oTarget) + " has an effect from " + GetName(oCreator) + "'s darkness effect");
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
}
|
||||
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
140
nwn/nwnprc/trunk/spells/nw_s0_daze.nss
Normal file
140
nwn/nwnprc/trunk/spells/nw_s0_daze.nss
Normal file
@@ -0,0 +1,140 @@
|
||||
/*::///////////////////////////////////////////////
|
||||
//:: [Daze]
|
||||
//:: [NW_S0_Daze.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 15, 2001
|
||||
//:: Update Pass By: Preston W, On: July 27, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: modified by xwarren Jul 22, 2010
|
||||
//:://////////////////////////////////////////////
|
||||
//::
|
||||
//:: Daze
|
||||
//::
|
||||
//:: Enchantment (Compulsion) [Mind-Affecting]
|
||||
//:: Level: Brd 0, Sor/Wiz 0
|
||||
//:: Components: V, S, M
|
||||
//:: Casting Time: 1 standard action
|
||||
//:: Range: Close (25 ft. + 5 ft./2 levels)
|
||||
//:: Target: One humanoid creature of 4 HD or less
|
||||
//:: Duration: 1 round
|
||||
//:: Saving Throw: Will negates
|
||||
//:: Spell Resistance: Yes
|
||||
//::
|
||||
//:: This enchantment clouds the mind of a humanoid
|
||||
//:: creature with 4 or fewer Hit Dice so that it
|
||||
//:: takes no actions. Humanoids of 5 or more HD are
|
||||
//:: not affected. A dazed subject is not stunned,
|
||||
//:: so attackers get no special advantage against it.
|
||||
//::
|
||||
//:: Material Component
|
||||
//:: A pinch of wool or similar substance.
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
//::
|
||||
//:: Daze Monster
|
||||
//::
|
||||
//:: Enchantment (Compulsion) [Mind-Affecting]
|
||||
//:: Level: Beguiler 2, Brd 2, Sor/Wiz 2
|
||||
//:: Components: V, S, M
|
||||
//:: Casting Time: 1 standard action
|
||||
//:: Range: Medium (100 ft. + 10 ft./level)
|
||||
//:: Target: One living creature of 6 HD or less
|
||||
//:: Duration: 1 round
|
||||
//:: Saving Throw: Will negates
|
||||
//:: Spell Resistance: Yes
|
||||
//::
|
||||
//:: This enchantment clouds the mind of
|
||||
//:: a living creature with 6 or fewer Hit
|
||||
//:: Dice so that it takes no actions. Creatures
|
||||
//:: of 7 or more HD are not affected. A dazed
|
||||
//:: subject is not stunned, so attackers get no
|
||||
//:: special advantage against it.
|
||||
//::
|
||||
//:: Material Component
|
||||
//:: A pinch of wool or similar substance.
|
||||
//::
|
||||
//::////////////////////////////////////////////*/
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
#include "prc_sp_func"
|
||||
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE);
|
||||
effect eDaze = EffectDazed();
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
effect eLink = EffectLinkEffects(eMind, eDaze);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDuration = 2;
|
||||
//check meta magic for extend
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = 4;
|
||||
}
|
||||
int nSpellID = GetSpellId();
|
||||
int nMaxHD = nSpellID == SPELL_DAZE ? 4 : 6;
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
|
||||
//Make sure the target of Daze spell is a humaniod
|
||||
if(nSpellID == SPELL_DAZE && PRCAmIAHumanoid(oTarget) != TRUE)
|
||||
return TRUE;
|
||||
//Make sure the target of Daze Monster spell is a living creature
|
||||
if(nSpellID == SPELL_DAZE_MONSTER && PRCGetIsAliveCreature(oTarget) != TRUE)
|
||||
return TRUE;
|
||||
if(GetHitDice(oTarget) <= nMaxHD)
|
||||
{
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID));
|
||||
//Make SR check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget,nPenetr))
|
||||
{
|
||||
//Make Will Save to negate effect
|
||||
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply VFX Impact and daze effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,nCasterLevel);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT);
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
71
nwn/nwnprc/trunk/spells/nw_s0_deaward.nss
Normal file
71
nwn/nwnprc/trunk/spells/nw_s0_deaward.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
nw_s0_deaward
|
||||
|
||||
The target creature is protected from the instant
|
||||
death effects for the duration of the spell
|
||||
|
||||
By: Preston Watamaniuk
|
||||
Created: July 27, 2001
|
||||
Modified: June 12, 2006
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
effect eDeath = EffectImmunity(IMMUNITY_TYPE_DEATH);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DEATH_WARD);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eLink = EffectLinkEffects(eDeath, eDur);
|
||||
|
||||
int CasterLvl = nCasterLevel;
|
||||
int nDuration = CasterLvl;
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DEATH_WARD, FALSE));
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Apply VFX impact and death immunity effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
97
nwn/nwnprc/trunk/spells/nw_s0_delfirea.nss
Normal file
97
nwn/nwnprc/trunk/spells/nw_s0_delfirea.nss
Normal file
@@ -0,0 +1,97 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Delayed Blast Fireball: On Enter
|
||||
//:: NW_S0_DelFireA.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The caster creates a trapped area which detects
|
||||
the entrance of enemy creatures into 3 m area
|
||||
around the spell location. When tripped it
|
||||
causes a fiery explosion that does 1d6 per
|
||||
caster level up to a max of 20d6 damage.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 27, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetEnteringObject();
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
location lTarget = GetLocation(OBJECT_SELF);
|
||||
int nDamage;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
|
||||
int nCasterLevel = CasterLvl;
|
||||
//Limit caster level
|
||||
if (nCasterLevel > 20)
|
||||
nCasterLevel = 20;
|
||||
|
||||
CasterLvl += SPGetPenetr();
|
||||
|
||||
int EleDmg = GetLocalInt(OBJECT_SELF, "DelayedBlastFireballDamage");
|
||||
int nSaveType = ChangedSaveType(EleDmg);
|
||||
|
||||
effect eDam;
|
||||
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
//Check the faction of the entering object to make sure the entering object is not in the casters faction
|
||||
if(!GetLocalInt(OBJECT_SELF, "NW_SPELL_DELAY_BLAST_FIREBALL") && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "NW_SPELL_DELAY_BLAST_FIREBALL",TRUE);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
|
||||
//Cycle through the targets in the explosion area
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_DELAYED_BLAST_FIREBALL));
|
||||
//Make SR check
|
||||
if (!PRCDoResistSpell(oCaster, oTarget,CasterLvl))
|
||||
{
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 6 * nCasterLevel;//Damage is at max
|
||||
else
|
||||
nDamage = d6(nCasterLevel);
|
||||
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage += nDamage/2;//Damage/Healing is +50%
|
||||
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nCasterLevel);
|
||||
//Change damage according to Reflex, Evasion and Improved Evasion
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster, -1);
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, nSaveType, GetAreaOfEffectCreator());
|
||||
if(nDamage > 0)
|
||||
{
|
||||
//Set up the damage effect
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
|
||||
//Apply VFX impact and damage effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
DelayCommand(0.01, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in the sequence
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
DestroyObject(OBJECT_SELF, 1.0);
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
52
nwn/nwnprc/trunk/spells/nw_s0_delfirebal.nss
Normal file
52
nwn/nwnprc/trunk/spells/nw_s0_delfirebal.nss
Normal file
@@ -0,0 +1,52 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Delayed Blast Fireball
|
||||
//:: NW_S0_DelFirebal.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The caster creates a trapped area which detects
|
||||
the entrance of enemy creatures into 3 m area
|
||||
around the spell location. When tripped it
|
||||
causes a fiery explosion that does 1d6 per
|
||||
caster level up to a max of 20d6 damage.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 27, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables including Area of Effect Object
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_DELAY_BLAST_FIREBALL);
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel();
|
||||
int nDuration = CasterLvl / 2;
|
||||
//Make sure the duration is at least one round
|
||||
if(nDuration == 0)
|
||||
nDuration = 1;
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Check Extend metamagic feat.
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2;//Duration is +100%
|
||||
}
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_DELAY_BLAST_FIREBALL");
|
||||
SetAllAoEInts(SPELL_DELAYED_BLAST_FIREBALL, oAoE, PRCGetSpellSaveDC(SPELL_DELAYED_BLAST_FIREBALL, SPELL_SCHOOL_EVOCATION), 0, CasterLvl);
|
||||
SetLocalInt(oAoE, "DelayedBlastFireballDamage", ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE));
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
||||
|
||||
|
101
nwn/nwnprc/trunk/spells/nw_s0_destruc.nss
Normal file
101
nwn/nwnprc/trunk/spells/nw_s0_destruc.nss
Normal file
@@ -0,0 +1,101 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Destruction
|
||||
//:: NW_S0_Destruc
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The target creature is destroyed if it fails a
|
||||
Fort save, otherwise it takes 10d6 damage.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Aug 13, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
effect eDeath = EffectDeath();
|
||||
effect eDam;
|
||||
effect eVis = EffectVisualEffect(234);
|
||||
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
CasterLvl +=SPGetPenetr();
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget) && PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DESTRUCTION));
|
||||
//Make SR check
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl))
|
||||
{
|
||||
//Make a saving throw check
|
||||
if(!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF)))
|
||||
{
|
||||
DeathlessFrenzyCheck(oTarget);
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
|
||||
}
|
||||
else if (GetHasMettle(oTarget, SAVING_THROW_FORT))
|
||||
{
|
||||
// This script does nothing if it has Mettle, bail
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
nDamage = d6(10);
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = 60;//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
|
||||
}
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, 10);
|
||||
//Set damage effect
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
}
|
||||
//Apply VFX impact
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
111
nwn/nwnprc/trunk/spells/nw_s0_dismagic.nss
Normal file
111
nwn/nwnprc/trunk/spells/nw_s0_dismagic.nss
Normal file
@@ -0,0 +1,111 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Dispel Magic
|
||||
//:: NW_S0_DisMagic.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Attempts to dispel all magic on a targeted
|
||||
//:: object, or simply the most powerful that it
|
||||
//:: can on every object in an area if no target
|
||||
//:: specified.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:: Updated On: Oct 20, 2003, Georg Zoeller
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "inc_dispel"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
*/
|
||||
//--------------------------------------------------------------------------
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
return;
|
||||
}
|
||||
// End of Spell Cast Hook
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_BREACH);
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_DISPEL);
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
location lLocal = PRCGetSpellTargetLocation();
|
||||
int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int iTypeDispel = GetLocalInt(GetModule(),"BIODispel");
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Dispel Magic is capped at caster level 10
|
||||
//--------------------------------------------------------------------------
|
||||
if(nCasterLevel > 10)
|
||||
{
|
||||
nCasterLevel = 10;
|
||||
}
|
||||
|
||||
if (GetIsObjectValid(oTarget))
|
||||
{
|
||||
//----------------------------------------------------------------------
|
||||
// Targeted Dispel - Dispel all
|
||||
//----------------------------------------------------------------------
|
||||
if (iTypeDispel)
|
||||
spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact);
|
||||
else
|
||||
spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------------------------------------------
|
||||
// Area of Effect - Only dispel best effect
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation());
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE );
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT)
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
// Handle Area of Effects
|
||||
//--------------------------------------------------------------
|
||||
if (iTypeDispel)
|
||||
spellsDispelAoE(oTarget, OBJECT_SELF,nCasterLevel);
|
||||
else
|
||||
spellsDispelAoEMod(oTarget, OBJECT_SELF,nCasterLevel);
|
||||
|
||||
}
|
||||
else if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (iTypeDispel)
|
||||
spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact, FALSE);
|
||||
else
|
||||
spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact, FALSE);
|
||||
}
|
||||
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE,lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
||||
|
||||
|
80
nwn/nwnprc/trunk/spells/nw_s0_dismissal.nss
Normal file
80
nwn/nwnprc/trunk/spells/nw_s0_dismissal.nss
Normal file
@@ -0,0 +1,80 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Dismissal
|
||||
//:: NW_S0_Dismissal.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
All summoned creatures within 30ft of caster
|
||||
make a save and SR check or be banished
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 22, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
#include "inc_npc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oMaster;
|
||||
location lTarget = GetLocation(oCaster);
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
CasterLvl += SPGetPenetr();
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON);
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_EVIL_30);
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget);
|
||||
|
||||
//Get the first object in the are of effect
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
//does the creature have a master.
|
||||
oMaster = GetMasterNPC(oTarget);
|
||||
//Is that master valid and is he an enemy
|
||||
if(GetIsObjectValid(oMaster) && spellsIsTarget(oMaster, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
//Is the creature a summoned associate
|
||||
int nAssociateType = GetAssociateTypeNPC(oTarget);
|
||||
if((nAssociateType == ASSOCIATE_TYPE_SUMMONED &&
|
||||
GetStringLeft(GetTag(oTarget), 14) != "psi_astral_con") ||
|
||||
nAssociateType == ASSOCIATE_TYPE_FAMILIAR ||
|
||||
nAssociateType == ASSOCIATE_TYPE_ANIMALCOMPANION ||
|
||||
GetLocalInt(oTarget, "HenchPseudoSummon"))
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_DISMISSAL));
|
||||
//Make SR and will save checks
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, CasterLvl)
|
||||
&& !PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster) + 6))
|
||||
{
|
||||
//Apply the VFX and delay the destruction of the summoned monster so
|
||||
//that the script and VFX can play.
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
AssignCommand(oTarget, SetIsDestroyable(TRUE));
|
||||
//OnDeath script... so lets kill it.
|
||||
effect eKill = EffectDamage(GetCurrentHitPoints(oTarget));
|
||||
//just to be extra-sure... :)
|
||||
effect eDeath = EffectDeath(FALSE, FALSE);
|
||||
DelayCommand(0.25, ApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget));
|
||||
DelayCommand(0.25, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));
|
||||
DestroyObject(oTarget, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next creature in the shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
128
nwn/nwnprc/trunk/spells/nw_s0_divpower.nss
Normal file
128
nwn/nwnprc/trunk/spells/nw_s0_divpower.nss
Normal file
@@ -0,0 +1,128 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Divine Power
|
||||
//:: NW_S0_DivPower.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Improves the Clerics base attack by 33%, +1 HP
|
||||
per level and raises their strength to 18 if
|
||||
is not already there.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 21, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
bugfix by Kovi 2002.07.22
|
||||
- temporary hp was stacked
|
||||
- loosing temporary hp resulted in loosing the other bonuses
|
||||
- number of attacks was not increased (should have been a BAB increase)
|
||||
still problem:
|
||||
~ attacks are better still approximation (the additional attack is at full BAB)
|
||||
~ attack/ability bonuses count against the limits
|
||||
*/
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
//:: modified by motu99 April 7, 2007
|
||||
|
||||
#include "prc_inc_combat"
|
||||
|
||||
/*
|
||||
#include "prc_inc_combat"
|
||||
#include "x2_inc_shifter"
|
||||
#include "pnp_shft_poly"
|
||||
*/
|
||||
|
||||
void PnPDivinePowerPseudoHB()
|
||||
{
|
||||
if(DEBUG) DoDebug("entered PnPDivinePowerPseudoHB");
|
||||
|
||||
object oPC = OBJECT_SELF;
|
||||
// if we don't have the spell effect any more, do clean up
|
||||
if(!GetHasSpellEffect(SPELL_DIVINE_POWER, oPC))
|
||||
{
|
||||
DeleteLocalInt(oPC, "AttackCount_DivinePower");
|
||||
|
||||
// now execute prc_bab_caller to set the base attack count to normal again
|
||||
ExecuteScript("prc_bab_caller", oPC);
|
||||
|
||||
//end the pseudoHB
|
||||
return;
|
||||
}
|
||||
// otherwise rerun the Pseudo HB until spell expires
|
||||
DelayCommand(6.0, PnPDivinePowerPseudoHB());
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int iCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int iBAB = GetBaseAttackBonus(oTarget);
|
||||
int iHD = GetHitDice(oTarget);
|
||||
int nHP = iCasterLvl;
|
||||
float fDuration = RoundsToSeconds(iCasterLvl);
|
||||
int bBiowareDP = GetPRCSwitch(PRC_BIOWARE_DIVINE_POWER);
|
||||
|
||||
//DoDebug("nw_s0_divpower: " +GetName(OBJECT_SELF)+" is casting DivinePower with caster level " + IntToString(iCasterLvl)+" on "+GetName(oTarget));
|
||||
|
||||
int iFighterBAB = GetFighterBAB(iHD);
|
||||
int iAttackBonus = iFighterBAB - iBAB;
|
||||
if(iAttackBonus < 0) iAttackBonus = 0;
|
||||
|
||||
int iTotalAttackCount = GetAttacks(iFighterBAB, iHD);
|
||||
int iBonusAttacks = iTotalAttackCount - GetAttacks(iBAB, iHD);
|
||||
|
||||
int nStr = GetAbilityScore(oTarget, ABILITY_STRENGTH);
|
||||
int iStrengthBonus = 18 - nStr;
|
||||
|
||||
//Meta-Magic
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration += fDuration;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_SUPER_HEROISM);
|
||||
effect eHP = EffectTemporaryHitpoints(nHP);
|
||||
|
||||
// begin effect link with visual duration effect
|
||||
effect eLink = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
// make sure the attack bonus is a bonus, link it the the duration visual
|
||||
if(iAttackBonus > 0)
|
||||
eLink = EffectLinkEffects(eLink, EffectAttackIncrease(iAttackBonus));
|
||||
|
||||
// if there are any bonus attacks, link them in, but only if we have biowares Divine Power version
|
||||
if(iBonusAttacks > 0 && bBiowareDP)
|
||||
eLink = EffectLinkEffects(eLink, EffectModifyAttacks(iBonusAttacks));
|
||||
|
||||
//Make sure that the strength modifier is a bonus, and link it in
|
||||
if(iStrengthBonus > 0)
|
||||
eLink = EffectLinkEffects(eLink, EffectAbilityIncrease(ABILITY_STRENGTH, iStrengthBonus));
|
||||
|
||||
// remove any effects from any previous Divine Power Spell
|
||||
PRCRemoveEffectsFromSpell(oTarget, SPELL_DIVINE_POWER);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_DIVINE_POWER, FALSE));
|
||||
|
||||
//Apply Link and VFX effects to the target
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, fDuration, TRUE, SPELL_DIVINE_POWER, iCasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, SPELL_DIVINE_POWER, iCasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
// motu99: this must be executed *after* the spell effects are applied, otherwise prc_bab_caller will not change the base attack count!
|
||||
if(!bBiowareDP)
|
||||
{ // if we don't use Bioware's version of DP, set the additional # of attacks via prc_bab_caller
|
||||
SetLocalInt(oTarget, "AttackCount_DivinePower", iTotalAttackCount);
|
||||
ExecuteScript("prc_bab_caller", oTarget);
|
||||
|
||||
// put the pseudo heart beat on the target of the spell, to check whether spell expired
|
||||
DelayCommand(6.0, AssignCommand(oTarget, PnPDivinePowerPseudoHB()));
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
90
nwn/nwnprc/trunk/spells/nw_s0_dmgred.nss
Normal file
90
nwn/nwnprc/trunk/spells/nw_s0_dmgred.nss
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
nw_s0_dmgred
|
||||
|
||||
Consolidation of Stoneskin,
|
||||
Greater Stoneskin, Premonition
|
||||
|
||||
By: Flaming_Sword
|
||||
Created: Jun 28, 2006
|
||||
Modified: Jun 28, 2006
|
||||
|
||||
Merged, cleaned up
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int nSoak = 0;
|
||||
int nCap = -1;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
effect eLink;
|
||||
int nDuration = nCasterLevel;
|
||||
int nLimit = 10 * nCasterLevel;
|
||||
if(nSpellID == SPELL_PREMONITION)
|
||||
{
|
||||
nSoak = 30;
|
||||
eLink = EffectVisualEffect(VFX_DUR_PROT_PREMONITION);
|
||||
}
|
||||
else if(nSpellID == SPELL_GREATER_STONESKIN)
|
||||
{
|
||||
nSoak = 20;
|
||||
eLink = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
|
||||
if(nLimit > 150) nLimit = 150;
|
||||
}
|
||||
else if(nSpellID == SPELL_STONESKIN)
|
||||
{
|
||||
nSoak = 10;
|
||||
eLink = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
|
||||
if(nLimit > 100) nLimit = 100;
|
||||
}
|
||||
eLink = EffectLinkEffects(eLink, EffectDamageReduction(nSoak, DAMAGE_POWER_PLUS_FIVE, nLimit));
|
||||
if(nSpellID != SPELL_PREMONITION)
|
||||
{
|
||||
eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
|
||||
int nImp = (nSpellID == SPELL_GREATER_STONESKIN) ? VFX_IMP_POLYMORPH : VFX_IMP_SUPER_HEROISM;
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nImp), oTarget);
|
||||
}
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
PRCRemoveEffectsFromSpell(oTarget, nSpellID);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration),TRUE,-1,nCasterLevel);
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
92
nwn/nwnprc/trunk/spells/nw_s0_doman.nss
Normal file
92
nwn/nwnprc/trunk/spells/nw_s0_doman.nss
Normal file
@@ -0,0 +1,92 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Dominate Animal]
|
||||
//:: [NW_S0_DomAn.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is dominated for 1 round
|
||||
//:: per caster level.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 30, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: July 30, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eDom = EffectCutsceneDominated(); // Allows multiple dominated creatures
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link domination and persistant VFX
|
||||
effect eLink = EffectLinkEffects(eMind, eDom);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nCasterLevel = CasterLvl;
|
||||
int nDuration = 3 + nCasterLevel;
|
||||
nCasterLevel +=SPGetPenetr();
|
||||
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_ANIMAL, FALSE));
|
||||
//Make sure the target is an animal
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
if ((nRacial == RACIAL_TYPE_ANIMAL))
|
||||
{
|
||||
//Make SR check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel))
|
||||
{
|
||||
//Will Save for spell negation
|
||||
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Check for Metamagic extension
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration * 2;
|
||||
}
|
||||
// Extra domination immunity check - using EffectCutsceneDominated(), which normally bypasses
|
||||
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DOMINATE) && !GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply linked effect and VFX impact
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
95
nwn/nwnprc/trunk/spells/nw_s0_dommon.nss
Normal file
95
nwn/nwnprc/trunk/spells/nw_s0_dommon.nss
Normal file
@@ -0,0 +1,95 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Dominate Monster]
|
||||
//:: [NW_S0_DomMon.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Will save or the target monster is Dominated for
|
||||
3 turns +1 per caster level.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: July 30, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eDom = EffectCutsceneDominated(); // Allows multiple dominated creatures
|
||||
eDom = PRCGetScaledEffect(eDom, oTarget);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link domination and persistant VFX
|
||||
effect eLink = EffectLinkEffects(eMind, eDom);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nCasterLevel = CasterLvl;
|
||||
int nDuration = 3 + nCasterLevel/2;
|
||||
nCasterLevel +=SPGetPenetr();
|
||||
|
||||
nDuration = PRCGetScaledDuration(nDuration, oTarget);
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_MONSTER, FALSE));
|
||||
//Make sure the target is a monster
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel))
|
||||
{
|
||||
//Make a Will Save
|
||||
if (!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Check for Metamagic extension
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration * 2;
|
||||
}
|
||||
// Extra domination immunity check - using EffectCutsceneDominated(), which normally bypasses
|
||||
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DOMINATE) && !GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply linked effects and VFX Impact
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
102
nwn/nwnprc/trunk/spells/nw_s0_dompers.nss
Normal file
102
nwn/nwnprc/trunk/spells/nw_s0_dompers.nss
Normal file
@@ -0,0 +1,102 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Dominate Person]
|
||||
//:: [NW_S0_DomPers.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Will save or the target is dominated for 1 round
|
||||
//:: per caster level.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 10, 2001
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eDom = EffectCutsceneDominated(); // Allows multiple dominated creatures
|
||||
eDom = PRCGetScaledEffect(eDom, oTarget);
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link duration effects
|
||||
effect eLink = EffectLinkEffects(eMind, eDom);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOMINATE_S);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nCasterLevel = CasterLvl;
|
||||
int nDuration = 2 + nCasterLevel/3;
|
||||
nDuration = PRCGetScaledDuration(nDuration, oTarget);
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOMINATE_PERSON, FALSE));
|
||||
nCasterLevel +=SPGetPenetr();
|
||||
//Make sure the target is a humanoid
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
if ((nRacial == RACIAL_TYPE_DWARF) ||
|
||||
(nRacial == RACIAL_TYPE_ELF) ||
|
||||
(nRacial == RACIAL_TYPE_GNOME) ||
|
||||
(nRacial == RACIAL_TYPE_HALFLING) ||
|
||||
(nRacial == RACIAL_TYPE_HUMAN) ||
|
||||
(nRacial == RACIAL_TYPE_HALFELF) ||
|
||||
(nRacial == RACIAL_TYPE_HALFORC))
|
||||
{
|
||||
//Make SR Check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel))
|
||||
{
|
||||
//Make Will Save
|
||||
if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, 1.0))
|
||||
{
|
||||
//Check for metamagic extension
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration * 2;
|
||||
}
|
||||
// Extra domination immunity check - using EffectCutsceneDominated(), which normally bypasses
|
||||
if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DOMINATE) && !GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS))
|
||||
{
|
||||
//Apply linked effects and VFX impact
|
||||
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl));
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
96
nwn/nwnprc/trunk/spells/nw_s0_doom.nss
Normal file
96
nwn/nwnprc/trunk/spells/nw_s0_doom.nss
Normal file
@@ -0,0 +1,96 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Doom
|
||||
//:: NW_S0_Doom.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
If the target fails a save they recieve a -2
|
||||
penalty to all saves, attack rolls, damage and
|
||||
skill checks for the duration of the spell.
|
||||
|
||||
July 22 2002 (BK): Made it mind affecting.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 22, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
|
||||
effect eLink = EffectShaken();
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
int nLevel = CasterLvl;
|
||||
int nPenetr= CasterLvl + SPGetPenetr();
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Meta-Magic checks
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nLevel *= 2;
|
||||
}
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DOOM));
|
||||
//Spell Resistance and Saving throw
|
||||
|
||||
//* GZ Engine fix for mind affecting spell
|
||||
|
||||
int nResult = WillSave(oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_MIND_SPELLS);
|
||||
if (nResult == 2)
|
||||
{
|
||||
if (GetIsPC(OBJECT_SELF)) // only display immune feedback for PCs
|
||||
{
|
||||
FloatingTextStrRefOnCreature(84525, oTarget,FALSE); // * Target Immune
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (nResult == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
nResult = (nResult || PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr));
|
||||
if (!nResult)
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink , oTarget, TurnsToSeconds(nLevel),TRUE,-1,CasterLvl);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
91
nwn/nwnprc/trunk/spells/nw_s0_elements.nss
Normal file
91
nwn/nwnprc/trunk/spells/nw_s0_elements.nss
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
nw_s0_elements
|
||||
|
||||
Endure, Resist, Protection from Elements
|
||||
|
||||
By: Flaming_Sword
|
||||
Created: Jun 16, 2006
|
||||
Modified: Jun 16, 2006
|
||||
|
||||
Consolidation of 3 scripts, cleaned up
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
int nSpellID = PRCGetSpellId();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
float fDuration = (nSpellID == SPELL_RESIST_ELEMENTS) ? TurnsToSeconds(nCasterLevel) : HoursToSeconds(24);
|
||||
int nResistance = 0;
|
||||
switch(nSpellID)
|
||||
{
|
||||
case SPELL_PROTECTION_FROM_ELEMENTS: nResistance += 10;
|
||||
case SPELL_RESIST_ELEMENTS: nResistance += 10;
|
||||
case SPELL_ENDURE_ELEMENTS: nResistance += 10; break;
|
||||
}
|
||||
int nAmount = nResistance + 10;
|
||||
|
||||
effect eCold = EffectDamageResistance(DAMAGE_TYPE_COLD, nResistance, nAmount);
|
||||
effect eFire = EffectDamageResistance(DAMAGE_TYPE_FIRE, nResistance, nAmount);
|
||||
effect eAcid = EffectDamageResistance(DAMAGE_TYPE_ACID, nResistance, nAmount);
|
||||
effect eSonic = EffectDamageResistance(DAMAGE_TYPE_SONIC, nResistance, nAmount);
|
||||
effect eElec = EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, nResistance, nAmount);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_PROTECTION_ELEMENTS);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ELEMENTAL_PROTECTION);
|
||||
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
|
||||
|
||||
//Link Effects
|
||||
effect eLink = EffectLinkEffects(eCold, eFire);
|
||||
eLink = EffectLinkEffects(eLink, eAcid);
|
||||
eLink = EffectLinkEffects(eLink, eSonic);
|
||||
eLink = EffectLinkEffects(eLink, eElec);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eDur2);
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
fDuration *= 2; //Duration is +100%
|
||||
PRCRemoveEffectsFromSpell(oTarget, nSpellID);
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration,TRUE,-1,nCasterLevel);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
135
nwn/nwnprc/trunk/spells/nw_s0_eleswarm.nss
Normal file
135
nwn/nwnprc/trunk/spells/nw_s0_eleswarm.nss
Normal file
@@ -0,0 +1,135 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Elemental Swarm
|
||||
//:: NW_S0_EleSwarm.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell creates a conduit from the caster
|
||||
to the elemental planes. The first elemental
|
||||
summoned is a 24 HD Air elemental. Whenever an
|
||||
elemental dies it is replaced by the next
|
||||
elemental in the chain Air, Earth, Water, Fire
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 30, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003
|
||||
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
|
||||
if(GetPRCSwitch(PRC_PNP_ELEMENTAL_SWARM)
|
||||
&& GetPRCSwitch(PRC_MULTISUMMON))
|
||||
{
|
||||
float fDuration = IntToFloat(60*10*CasterLvl);
|
||||
float fDelay = 600.0;
|
||||
if(GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL))
|
||||
{
|
||||
fDuration = RoundsToSeconds(CasterLvl);
|
||||
fDelay = RoundsToSeconds(1);
|
||||
}
|
||||
//Check for metamagic duration
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
fDuration = fDuration * 2.0; //Duration is +100%
|
||||
MultisummonPreSummon();
|
||||
int i;
|
||||
int nVFX = VFX_FNF_SUMMON_MONSTER_3;
|
||||
string sResRef;
|
||||
int nElement = Random(4);
|
||||
switch(nElement)
|
||||
{
|
||||
case 0:
|
||||
sResRef = "NW_S_AIRHUGE";
|
||||
break;
|
||||
case 1:
|
||||
sResRef = "NW_S_WATERHUGE";
|
||||
break;
|
||||
case 2:
|
||||
sResRef = "NW_S_FIREHUGE";
|
||||
break;
|
||||
case 3:
|
||||
sResRef = "NW_S_EARTHHUGE";
|
||||
break;
|
||||
}
|
||||
effect eSummon = EffectSummonCreature(sResRef, nVFX);
|
||||
int nHugeElementals = d4(2);
|
||||
for(i=0; i<nHugeElementals; i++)
|
||||
{
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, PRCGetSpellTargetLocation(), fDuration);
|
||||
}
|
||||
|
||||
switch(nElement)
|
||||
{
|
||||
case 0:
|
||||
sResRef = "NW_S_AIRGREAT";
|
||||
break;
|
||||
case 1:
|
||||
sResRef = "NW_S_WATERGREAT";
|
||||
break;
|
||||
case 2:
|
||||
sResRef = "NW_S_FIREGREAT";
|
||||
break;
|
||||
case 3:
|
||||
sResRef = "NW_S_EARTHGREAT";
|
||||
break;
|
||||
}
|
||||
eSummon = EffectSummonCreature(sResRef, nVFX);
|
||||
int nGreaterElementals = d4(1);
|
||||
for(i=0; i<nGreaterElementals; i++)
|
||||
{
|
||||
DelayCommand(fDelay, MultisummonPreSummon());
|
||||
DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetLocation(OBJECT_SELF), fDuration-fDelay));
|
||||
}
|
||||
switch(nElement)
|
||||
{
|
||||
case 0:
|
||||
sResRef = "NW_S_AIRELDER";
|
||||
break;
|
||||
case 1:
|
||||
sResRef = "NW_S_WATERELDER";
|
||||
break;
|
||||
case 2:
|
||||
sResRef = "NW_S_FIREELDER";
|
||||
break;
|
||||
case 3:
|
||||
sResRef = "NW_S_EARTHELDER";
|
||||
break;
|
||||
}
|
||||
eSummon = EffectSummonCreature(sResRef, nVFX);
|
||||
DelayCommand(fDelay*2.0, MultisummonPreSummon());
|
||||
DelayCommand(fDelay*2.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetLocation(OBJECT_SELF), fDuration-(fDelay*2.0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
int nDuration = 24;
|
||||
effect eSummon;
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
|
||||
float fDuration = HoursToSeconds(nDuration);
|
||||
if(GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL))
|
||||
fDuration = RoundsToSeconds(CasterLvl);
|
||||
//Check for metamagic duration
|
||||
if((nMetaMagic & METAMAGIC_EXTEND))
|
||||
fDuration = fDuration * 2.0; //Duration is +100%
|
||||
//Set the summoning effect
|
||||
eSummon = EffectSwarm(FALSE, "NW_SW_AIRGREAT", "NW_SW_WATERGREAT","NW_SW_EARTHGREAT","NW_SW_FIREGREAT");
|
||||
//Apply the summon effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSummon, OBJECT_SELF, fDuration, TRUE,-1,CasterLvl);
|
||||
|
||||
DelayCommand(0.5, AugmentSummonedCreature("NW_SW_AIRGREAT"));
|
||||
}
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
85
nwn/nwnprc/trunk/spells/nw_s0_enebuffer.nss
Normal file
85
nwn/nwnprc/trunk/spells/nw_s0_enebuffer.nss
Normal file
@@ -0,0 +1,85 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Energy Buffer
|
||||
//:: NW_S0_EneBuffer
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The caster is protected from all five energy
|
||||
types for up to 3 per caster level. When
|
||||
one element type is spent all five are
|
||||
removed.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Sept 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
//Declare major variables
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
int nAmount = 60;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
effect eCold = EffectDamageResistance(DAMAGE_TYPE_COLD, 40, nAmount);
|
||||
effect eFire = EffectDamageResistance(DAMAGE_TYPE_FIRE, 40, nAmount);
|
||||
effect eAcid = EffectDamageResistance(DAMAGE_TYPE_ACID, 40, nAmount);
|
||||
effect eSonic = EffectDamageResistance(DAMAGE_TYPE_SONIC, 40, nAmount);
|
||||
effect eElec = EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 40, nAmount);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_PROTECTION_ELEMENTS);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ELEMENTAL_PROTECTION);
|
||||
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERGY_BUFFER, FALSE));
|
||||
|
||||
//Link Effects
|
||||
effect eLink = EffectLinkEffects(eCold, eFire);
|
||||
eLink = EffectLinkEffects(eLink, eAcid);
|
||||
eLink = EffectLinkEffects(eLink, eSonic);
|
||||
eLink = EffectLinkEffects(eLink, eElec);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eDur2);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
|
||||
PRCRemoveEffectsFromSpell(oTarget, GetSpellId());
|
||||
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
||||
|
107
nwn/nwnprc/trunk/spells/nw_s0_enedrain.nss
Normal file
107
nwn/nwnprc/trunk/spells/nw_s0_enedrain.nss
Normal file
@@ -0,0 +1,107 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Energy Drain
|
||||
//:: NW_S0_EneDrain.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Target loses 2d4 levels.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
|
||||
//::Added code to maximize for Faith Healing and Blast Infidel
|
||||
//::Aaon Graywolf - Jan 7, 2003
|
||||
|
||||
//::Added hold ray functionality - HackyKid
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "prc_inc_function"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nSaveDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
int nDrain = d4(2);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
|
||||
|
||||
//Undead Gain HP from Energy Drain
|
||||
int nHP = d4(2);
|
||||
nHP = nHP + nHP + nHP + nHP +nHP;
|
||||
effect eHP = EffectTemporaryHitpoints(nHP);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_NEGATIVE, TRUE);
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
|
||||
{
|
||||
nDrain = 8;//Damage is at max
|
||||
}
|
||||
if (nMetaMagic & METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDrain = nDrain + (nDrain/2); //Damage/Healing is +50%
|
||||
}
|
||||
effect eDrain = EffectNegativeLevel(nDrain);
|
||||
eDrain = SupernaturalEffect(eDrain);
|
||||
|
||||
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, HoursToSeconds(1),TRUE,-1,nCasterLevel);
|
||||
}
|
||||
else if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERGY_DRAIN));
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr))
|
||||
{
|
||||
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget,OBJECT_SELF), SAVING_THROW_TYPE_NEGATIVE))
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget,0.0f,TRUE,-1,nCasterLevel);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
if (oCaster != oTarget) //cant target self with this spell, only when holding charge
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
125
nwn/nwnprc/trunk/spells/nw_s0_enervat.nss
Normal file
125
nwn/nwnprc/trunk/spells/nw_s0_enervat.nss
Normal file
@@ -0,0 +1,125 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Enervation
|
||||
//:: NW_S0_Enervat.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Target Loses 1d4 levels for 1 hour per caster
|
||||
level
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
|
||||
//::Added code to maximize for Faith Healing and Blast Infidel
|
||||
//::Aaon Graywolf - Jan 7, 2003
|
||||
|
||||
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_inc_function"
|
||||
#include "prc_sp_func"
|
||||
#include "prc_add_spell_dc"
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nSaveDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
int nDrain = d4();
|
||||
int nDuration = nCasterLevel;
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
|
||||
|
||||
//Undead Gain HP from Enervation
|
||||
int nHP = ((nCasterLevel/2) * 5);
|
||||
if (nHP > 25)
|
||||
{
|
||||
nHP = 25;
|
||||
}
|
||||
|
||||
effect eHP = EffectTemporaryHitpoints(nHP);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_NEGATIVE, TRUE);
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith)
|
||||
{
|
||||
nDrain = 4;//Damage is at max
|
||||
}
|
||||
if (nMetaMagic & METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDrain = nDrain + (nDrain/2); //Damage/Healing is +50%
|
||||
}
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
|
||||
effect eDrain = EffectNegativeLevel(nDrain);
|
||||
effect eLink = EffectLinkEffects(eDrain, eDur);
|
||||
|
||||
int iAttackRoll = PRCDoRangedTouchAttack(oTarget);;
|
||||
if(iAttackRoll > 0)
|
||||
{
|
||||
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD)
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, HoursToSeconds(1),TRUE,-1,nCasterLevel);
|
||||
}
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERVATION));
|
||||
//Resist magic check
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr))
|
||||
{
|
||||
if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_NEGATIVE))
|
||||
{
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration),TRUE,-1,nCasterLevel);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
|
||||
ApplyTouchAttackDamage(OBJECT_SELF, oTarget, iAttackRoll, 0, DAMAGE_TYPE_NEGATIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return iAttackRoll; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
if (oCaster != oTarget) //cant target self with this spell, only when holding charge
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
48
nwn/nwnprc/trunk/spells/nw_s0_entangle.nss
Normal file
48
nwn/nwnprc/trunk/spells/nw_s0_entangle.nss
Normal file
@@ -0,0 +1,48 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Entangle
|
||||
//:: NW_S0_Enangle
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Area of effect spell that places the entangled
|
||||
effect on enemies if they fail a saving throw
|
||||
each round.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Dec 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update Pass By: Preston W, On: July 31, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
|
||||
|
||||
//Declare major variables including Area of Effect Object
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_ENTANGLE);
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel();
|
||||
int nDuration = 3 + CasterLvl / 2;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Make sure duration does no equal 0
|
||||
if(nDuration < 1)
|
||||
nDuration = 1;
|
||||
|
||||
//Check Extend metamagic feat.
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2; //Duration is +100%
|
||||
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_ENTANGLE");
|
||||
SetAllAoEInts(SPELL_ENTANGLE, oAoE, PRCGetSpellSaveDC(SPELL_ENTANGLE, SPELL_SCHOOL_TRANSMUTATION), 0, CasterLvl);
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
||||
|
53
nwn/nwnprc/trunk/spells/nw_s0_entangleb.nss
Normal file
53
nwn/nwnprc/trunk/spells/nw_s0_entangleb.nss
Normal file
@@ -0,0 +1,53 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Entangle B: On Exit
|
||||
//:: NW_S0_EntangleB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Removes the entangle effect after the AOE dies.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 25, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION);
|
||||
|
||||
//Declare major variables
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
effect eAOE;
|
||||
if(GetHasSpellEffect(SPELL_ENTANGLE, oTarget))
|
||||
{
|
||||
//Search through the valid effects on the target.
|
||||
eAOE = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eAOE))
|
||||
{
|
||||
if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator())
|
||||
{
|
||||
if(GetEffectType(eAOE) == EFFECT_TYPE_ENTANGLE)
|
||||
{
|
||||
//If the effect was created by the Entagle then remove it
|
||||
if(GetEffectSpellId(eAOE) == SPELL_ENTANGLE)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
71
nwn/nwnprc/trunk/spells/nw_s0_entanglec.nss
Normal file
71
nwn/nwnprc/trunk/spells/nw_s0_entanglec.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Entangle
|
||||
//:: NW_S0_EntangleC.NSS
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Upon entering the AOE the target must make
|
||||
a reflex save or be entangled by vegitation
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: July 30, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//::Updated Aug 14, 2003 Georg: removed some artifacts
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION);
|
||||
|
||||
//Declare major variables
|
||||
effect eHold = EffectEntangle();
|
||||
effect eEntangle = EffectVisualEffect(VFX_DUR_ENTANGLE);
|
||||
//Link Entangle and Hold effects
|
||||
effect eLink = EffectLinkEffects(eHold, eEntangle);
|
||||
|
||||
object aoeCreator = GetAreaOfEffectCreator();
|
||||
int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
|
||||
int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl);
|
||||
|
||||
|
||||
object oTarget = GetFirstInPersistentObject();
|
||||
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{ // SpawnScriptDebugger();
|
||||
if(!GetHasFeat(FEAT_WOODLAND_STRIDE, oTarget) && !GetCreatureFlag(oTarget, CREATURE_VAR_IS_INCORPOREAL))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENTANGLE));
|
||||
//Make SR check
|
||||
if(!GetHasSpellEffect(SPELL_ENTANGLE, oTarget))
|
||||
{
|
||||
//if(!PRCDoResistSpell(aoeCreator, oTarget,nPenetr))
|
||||
//{
|
||||
//Make reflex save
|
||||
if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, (PRCGetSaveDC(oTarget,aoeCreator))))
|
||||
{
|
||||
//Apply linked effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2),FALSE);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in the AOE
|
||||
oTarget = GetNextInPersistentObject();
|
||||
}
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
71
nwn/nwnprc/trunk/spells/nw_s0_ethervis.nss
Normal file
71
nwn/nwnprc/trunk/spells/nw_s0_ethervis.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Ethereal Visage
|
||||
//:: NW_S0_EtherVis.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Caster gains 20/+3 Damage reduction and is immune
|
||||
to 2 level spells and lower.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_ETHEREAL_VISAGE);
|
||||
effect eDam = EffectDamageReduction(20, DAMAGE_POWER_PLUS_THREE);
|
||||
effect eSpell = EffectSpellLevelAbsorption(2);
|
||||
effect eConceal = EffectConcealment(25);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
effect eLink = EffectLinkEffects(eDam, eVis);
|
||||
eLink = EffectLinkEffects(eLink, eSpell);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eConceal);
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
//Enter Metamagic conditions
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ETHEREAL_VISAGE, FALSE));
|
||||
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
59
nwn/nwnprc/trunk/spells/nw_s0_evards.nss
Normal file
59
nwn/nwnprc/trunk/spells/nw_s0_evards.nss
Normal file
@@ -0,0 +1,59 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Evards Black Tentacles
|
||||
//:: NW_S0_Evards.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell conjures a field of rubbery black tentacles, each 10 feet long.
|
||||
These waving members seem to spring forth from the earth, floor, or whatever
|
||||
surface is underfoot<6F>including water. They grasp and entwine around creatures
|
||||
that enter the area, holding them fast and crushing them with great strength.
|
||||
Every creature within the area of the spell must make a grapple check, opposed
|
||||
by the grapple check of the tentacles. Treat the tentacles attacking a particular
|
||||
target as a Large creature with a base attack bonus equal to your caster level
|
||||
and a Strength score of 19. Thus, its grapple check modifier is equal to your
|
||||
caster level +8. The tentacles are immune to all types of damage.
|
||||
Once the tentacles grapple an opponent, they may make a grapple check each round
|
||||
on your turn to deal 1d6+4 points of bludgeoning damage. The tentacles continue
|
||||
to crush the opponent until the spell ends or the opponent escapes.
|
||||
Any creature that enters the area of the spell is immediately attacked by the
|
||||
tentacles. Even creatures who aren<65>t grappling with the tentacles may move
|
||||
through the area at only half normal speed.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 23, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: GZ: Removed SR, its not there by the book
|
||||
//:: Primogenitor: Implemented 3.5ed rules
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables including Area of Effect Object
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_EVARDS_BLACK_TENTACLES,
|
||||
"nw_s0_evardsa", "nw_s0_evardsc", "nw_s0_evardsb");
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int CasterLvl = PRCGetCasterLevel();
|
||||
int nDuration = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Make sure duration does no equal 0
|
||||
if (nDuration < 1)
|
||||
nDuration = 1;
|
||||
//Check Extend metamagic feat.
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2; //Duration is +100%
|
||||
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(lTarget, "VFX_PER_EVARDS_BLACK_TENTACLES");
|
||||
SetAllAoEInts(SPELL_EVARDS_BLACK_TENTACLES, oAoE, PRCGetSpellSaveDC(SPELL_EVARDS_BLACK_TENTACLES, SPELL_SCHOOL_CONJURATION), 0, CasterLvl);
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
79
nwn/nwnprc/trunk/spells/nw_s0_evardsa.nss
Normal file
79
nwn/nwnprc/trunk/spells/nw_s0_evardsa.nss
Normal file
@@ -0,0 +1,79 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Evards Black Tentacles: On Enter
|
||||
//:: NW_S0_EvardsA
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell conjures a field of rubbery black tentacles, each 10 feet long.
|
||||
These waving members seem to spring forth from the earth, floor, or whatever
|
||||
surface is underfoot including water. They grasp and entwine around creatures
|
||||
that enter the area, holding them fast and crushing them with great strength.
|
||||
Every creature within the area of the spell must make a grapple check, opposed
|
||||
by the grapple check of the tentacles. Treat the tentacles attacking a particular
|
||||
target as a Large creature with a base attack bonus equal to your caster level
|
||||
and a Strength score of 19. Thus, its grapple check modifier is equal to your
|
||||
caster level +8. The tentacles are immune to all types of damage.
|
||||
Once the tentacles grapple an opponent, they may make a grapple check each round
|
||||
on your turn to deal 1d6+4 points of bludgeoning damage. The tentacles continue
|
||||
to crush the opponent until the spell ends or the opponent escapes.
|
||||
Any creature that enters the area of the spell is immediately attacked by the
|
||||
tentacles. Even creatures who aren<65>t grappling with the tentacles may move
|
||||
through the area at only half normal speed.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 23, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: GZ: Removed SR, its not there by the book
|
||||
//:: Primogenitor: Implemented 3.5ed rules
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_combmove"
|
||||
|
||||
void DecrementTentacleCount(object oTarget, string sVar)
|
||||
{
|
||||
SetLocalInt(oTarget, sVar, GetLocalInt(oTarget, sVar) - 1);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
object oTarget = GetEnteringObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCasterLevel = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE , GetAreaOfEffectCreator())
|
||||
&& GetCreatureFlag(oTarget, CREATURE_VAR_IS_INCORPOREAL) != TRUE)
|
||||
{
|
||||
//Fire cast spell at event for the target
|
||||
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(),
|
||||
SPELL_EVARDS_BLACK_TENTACLES));
|
||||
//Apply reduced movement effect and VFX_Impact
|
||||
//firstly, make them half-speed
|
||||
SPApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectMovementSpeedDecrease(50), oTarget);
|
||||
//now do grappling and stuff
|
||||
//cant already be grappled so no need to check that
|
||||
int nGrappleSucessful = FALSE;
|
||||
//this spell doesnt need to make a touch attack
|
||||
//as defined in the spell
|
||||
int nAttackerGrappleMod = nCasterLevel+4+4;
|
||||
nGrappleSucessful = _DoGrappleCheck(OBJECT_INVALID, oTarget, nAttackerGrappleMod);
|
||||
if(nGrappleSucessful)
|
||||
{
|
||||
//now being grappled
|
||||
AssignCommand(oTarget, ClearAllActions());
|
||||
effect eHold = EffectCutsceneImmobilize();
|
||||
effect eEntangle = EffectVisualEffect(VFX_DUR_SPELLTURNING_R);
|
||||
effect eLink = EffectLinkEffects(eHold, eEntangle);
|
||||
//eLink = EffectKnockdown();
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 6.0);
|
||||
SetLocalInt(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF),
|
||||
GetLocalInt(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF))+1);
|
||||
DelayCommand(6.1, DecrementTentacleCount(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF)));
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
60
nwn/nwnprc/trunk/spells/nw_s0_evardsb.nss
Normal file
60
nwn/nwnprc/trunk/spells/nw_s0_evardsb.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Evards Black Tentacles: On Exit
|
||||
//:: NW_S0_EvardsB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell conjures a field of rubbery black tentacles, each 10 feet long.
|
||||
These waving members seem to spring forth from the earth, floor, or whatever
|
||||
surface is underfoot<6F>including water. They grasp and entwine around creatures
|
||||
that enter the area, holding them fast and crushing them with great strength.
|
||||
Every creature within the area of the spell must make a grapple check, opposed
|
||||
by the grapple check of the tentacles. Treat the tentacles attacking a particular
|
||||
target as a Large creature with a base attack bonus equal to your caster level
|
||||
and a Strength score of 19. Thus, its grapple check modifier is equal to your
|
||||
caster level +8. The tentacles are immune to all types of damage.
|
||||
Once the tentacles grapple an opponent, they may make a grapple check each round
|
||||
on your turn to deal 1d6+4 points of bludgeoning damage. The tentacles continue
|
||||
to crush the opponent until the spell ends or the opponent escapes.
|
||||
Any creature that enters the area of the spell is immediately attacked by the
|
||||
tentacles. Even creatures who aren<65>t grappling with the tentacles may move
|
||||
through the area at only half normal speed.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 23, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: GZ: Removed SR, its not there by the book
|
||||
//:: Primogenitor: Implemented 3.5ed rules
|
||||
#include "prc_alterations"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
//Get the object that is exiting the AOE
|
||||
object oTarget = GetExitingObject();
|
||||
int bValid = FALSE;
|
||||
effect eAOE;
|
||||
if(GetHasSpellEffect(SPELL_EVARDS_BLACK_TENTACLES, oTarget))
|
||||
{
|
||||
//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_MOVEMENT_SPEED_DECREASE)
|
||||
{
|
||||
//If the effect was created by the Acid_Fog then remove it
|
||||
if(GetEffectSpellId(eAOE) == SPELL_EVARDS_BLACK_TENTACLES)
|
||||
{
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next effect on the target
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
}
|
92
nwn/nwnprc/trunk/spells/nw_s0_evardsc.nss
Normal file
92
nwn/nwnprc/trunk/spells/nw_s0_evardsc.nss
Normal file
@@ -0,0 +1,92 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Evards Black Tentacles: Heartbeat
|
||||
//:: NW_S0_EvardsC
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell conjures a field of rubbery black tentacles, each 10 feet long.
|
||||
These waving members seem to spring forth from the earth, floor, or whatever
|
||||
surface is underfoot<6F>including water. They grasp and entwine around creatures
|
||||
that enter the area, holding them fast and crushing them with great strength.
|
||||
Every creature within the area of the spell must make a grapple check, opposed
|
||||
by the grapple check of the tentacles. Treat the tentacles attacking a particular
|
||||
target as a Large creature with a base attack bonus equal to your caster level
|
||||
and a Strength score of 19. Thus, its grapple check modifier is equal to your
|
||||
caster level +8. The tentacles are immune to all types of damage.
|
||||
Once the tentacles grapple an opponent, they may make a grapple check each round
|
||||
on your turn to deal 1d6+4 points of bludgeoning damage. The tentacles continue
|
||||
to crush the opponent until the spell ends or the opponent escapes.
|
||||
Any creature that enters the area of the spell is immediately attacked by the
|
||||
tentacles. Even creatures who aren<65>t grappling with the tentacles may move
|
||||
through the area at only half normal speed.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 23, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: GZ: Removed SR, its not there by the book
|
||||
//:: Primogenitor: Implemented 3.5ed rules
|
||||
#include "prc_inc_combmove"
|
||||
|
||||
void DecrementTentacleCount(object oTarget, string sVar)
|
||||
{
|
||||
SetLocalInt(oTarget, sVar, GetLocalInt(oTarget, sVar) - 1);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCasterLevel = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level");
|
||||
object oTarget = GetFirstInPersistentObject();
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE , GetAreaOfEffectCreator())
|
||||
&& GetCreatureFlag(oTarget, CREATURE_VAR_IS_INCORPOREAL) != TRUE)
|
||||
{
|
||||
//Fire cast spell at event for the target
|
||||
SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(),
|
||||
SPELL_EVARDS_BLACK_TENTACLES));
|
||||
//now do grappling and stuff
|
||||
int nGrappleSucessful = FALSE;
|
||||
//this spell doesnt need to make a touch attack
|
||||
//as defined in the spell
|
||||
int nAttackerGrappleMod = nCasterLevel+4+4;
|
||||
nGrappleSucessful = _DoGrappleCheck(OBJECT_INVALID, oTarget, nAttackerGrappleMod);
|
||||
if(nGrappleSucessful)
|
||||
{
|
||||
//if already being grappled, apply damage
|
||||
if(GetLocalInt(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF)))
|
||||
{
|
||||
//apply the damage
|
||||
int nDamage = d6();
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 6;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage += nDamage/2;
|
||||
nDamage += 4;
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, 1);
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_PLUS_TWO);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
}
|
||||
//now being grappled
|
||||
AssignCommand(oTarget, ClearAllActions());
|
||||
effect eHold = EffectCutsceneImmobilize();
|
||||
effect eEntangle = EffectVisualEffect(VFX_DUR_SPELLTURNING_R);
|
||||
effect eLink = EffectLinkEffects(eHold, eEntangle);
|
||||
//eLink = EffectKnockdown();
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 6.0);
|
||||
SetLocalInt(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF),
|
||||
GetLocalInt(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF))+1);
|
||||
DelayCommand(6.1, DecrementTentacleCount(oTarget, "GrappledBy_"+ObjectToString(OBJECT_SELF)));
|
||||
}
|
||||
}
|
||||
oTarget = GetNextInPersistentObject();
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
|
||||
}
|
73
nwn/nwnprc/trunk/spells/nw_s0_extrathf.nss
Normal file
73
nwn/nwnprc/trunk/spells/nw_s0_extrathf.nss
Normal file
@@ -0,0 +1,73 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Rogues Cunning AKA Potion of Extra Theiving
|
||||
//:: NW_S0_ExtraThf.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Grants the user +10 Search, Disable Traps and
|
||||
Move Silently, Open Lock (+5), Pick Pockets
|
||||
Set Trap for 5 Turns
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: November 9, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
//Declare major variables
|
||||
effect eSearch = EffectSkillIncrease(SKILL_SEARCH, 10);
|
||||
effect eDisable = EffectSkillIncrease(SKILL_DISABLE_TRAP, 10);
|
||||
effect eMove = EffectSkillIncrease(SKILL_MOVE_SILENTLY, 10);
|
||||
effect eOpen = EffectSkillIncrease(SKILL_OPEN_LOCK, 5);
|
||||
effect ePick = EffectSkillIncrease(SKILL_PICK_POCKET, 10);
|
||||
effect eTrap = EffectSkillIncrease(SKILL_SET_TRAP, 10);
|
||||
effect eHide = EffectSkillIncrease(SKILL_HIDE, 10);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
//Link Effects
|
||||
effect eLink = EffectLinkEffects(eSearch, eDisable);
|
||||
eLink = EffectLinkEffects(eLink, eMove);
|
||||
eLink = EffectLinkEffects(eLink, eOpen);
|
||||
eLink = EffectLinkEffects(eLink, ePick);
|
||||
eLink = EffectLinkEffects(eLink, eTrap);
|
||||
eLink = EffectLinkEffects(eLink, eHide);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_MAGICAL_VISION);
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(5),TRUE,-1,CasterLvl);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
97
nwn/nwnprc/trunk/spells/nw_s0_fear.nss
Normal file
97
nwn/nwnprc/trunk/spells/nw_s0_fear.nss
Normal file
@@ -0,0 +1,97 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Fear]
|
||||
//:: [NW_S0_Fear.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Causes an area of fear that reduces Will Saves
|
||||
//:: and applies the frightened effect.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 23, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: July 30, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
float fDuration = RoundsToSeconds(CasterLvl);
|
||||
int nDamage;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FEAR_S);
|
||||
effect eFear = EffectFrightened();
|
||||
effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
float fDelay;
|
||||
//Link the fear and mind effects
|
||||
effect eLink = EffectLinkEffects(eFear, eMind);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
|
||||
object oTarget;
|
||||
//Check for metamagic extend
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
fDuration = fDuration * 2.0; //Duration is +100%
|
||||
}
|
||||
//Apply Impact
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation());
|
||||
//Get first target in the spell cone
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation(), TRUE);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
fDelay = PRCGetRandomDelay();
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FEAR));
|
||||
//Make SR Check
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr, fDelay))
|
||||
{
|
||||
//Make a will save
|
||||
if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_FEAR, OBJECT_SELF, fDelay))
|
||||
{
|
||||
//Apply the linked effects and the VFX impact
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration,TRUE,-1,CasterLvl);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Get next target in the spell cone
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation(), TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
68
nwn/nwnprc/trunk/spells/nw_s0_feebmind.nss
Normal file
68
nwn/nwnprc/trunk/spells/nw_s0_feebmind.nss
Normal file
@@ -0,0 +1,68 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Feeblemind
|
||||
//:: [NW_S0_FeebMind.nss]
|
||||
//:: Copyright (c) 2000 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Target must make a Will save or take ability
|
||||
//:: damage to Intelligence equaling 1d4 per 4 levels.
|
||||
//:: Duration of 1 rounds per 2 levels.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Feb 2, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_DIVINATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int CasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = CasterLvl + SPGetPenetr();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDuration = CasterLvl/2;
|
||||
int nDice = CasterLvl/4;
|
||||
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
nDuration *= 2;
|
||||
|
||||
//effect eFeeb;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
|
||||
effect eRay = EffectBeam(VFX_BEAM_MIND, oCaster, BODY_NODE_HAND);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FEEBLEMIND));
|
||||
//bug fix - apply the ray effect first, than check SR
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.0, FALSE);
|
||||
//Make SR check
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr))
|
||||
{
|
||||
//Make an will save
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
if (GetLevelByTypeArcane(oTarget) > 0) nDC += 4;
|
||||
int nWillResult = WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS);
|
||||
if(nWillResult == 0)
|
||||
{
|
||||
int nLoss = GetAbilityScore(oTarget, ABILITY_INTELLIGENCE) - 1;
|
||||
ApplyAbilityDamage(oTarget, ABILITY_INTELLIGENCE, nLoss, DURATION_TYPE_PERMANENT, FALSE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
else
|
||||
// * target was immune
|
||||
if(nWillResult == 2)
|
||||
{
|
||||
SendMessageToPCByStrRef(oCaster, 40105);
|
||||
}
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
56
nwn/nwnprc/trunk/spells/nw_s0_findtrap.nss
Normal file
56
nwn/nwnprc/trunk/spells/nw_s0_findtrap.nss
Normal file
@@ -0,0 +1,56 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Find Traps
|
||||
//:: NW_S0_FindTrap
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Divination
|
||||
Level: Clr 2
|
||||
Components: V, S
|
||||
Casting Time: 1 standard action
|
||||
Range: Personal
|
||||
Target You
|
||||
Duration: 1 min./level
|
||||
|
||||
You gain intuitive insight into the workings of
|
||||
traps. You can use the Search skill to detect
|
||||
traps just as a rogue can. In addition, you gain
|
||||
an insight bonus equal to one-half your caster
|
||||
level (maximum +10) on Search checks made to find
|
||||
traps while the spell is in effect.
|
||||
|
||||
Note that find traps grants no ability to disable
|
||||
the traps that you may find.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "prc_inc_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_DIVINATION);
|
||||
|
||||
object oCaster = OBJECT_SELF;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_KNOCK);
|
||||
int nCnt = 1;
|
||||
object oTrap = GetNearestObject(OBJECT_TYPE_TRIGGER | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, oCaster, nCnt);
|
||||
while(GetIsObjectValid(oTrap) && GetDistanceToObject(oTrap) <= 30.0)
|
||||
{
|
||||
if(GetIsTrapped(oTrap))
|
||||
{
|
||||
SetTrapDetectedBy(oTrap, oCaster);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTrap));
|
||||
if(!GetPRCSwitch(PRC_PNP_FIND_TRAPS))
|
||||
DelayCommand(2.0, SetTrapDisabled(oTrap));
|
||||
}
|
||||
nCnt++;
|
||||
oTrap = GetNearestObject(OBJECT_TYPE_TRIGGER | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, oCaster, nCnt);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
107
nwn/nwnprc/trunk/spells/nw_s0_fingdeath.nss
Normal file
107
nwn/nwnprc/trunk/spells/nw_s0_fingdeath.nss
Normal file
@@ -0,0 +1,107 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Finger of Death
|
||||
//:: NW_S0_FingDeath
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
// You can slay any one living creature within range.
|
||||
// The victim is entitled to a Fortitude saving throw to
|
||||
// survive the attack. If he succeeds, he instead
|
||||
// sustains 3d6 points of damage +1 point per caster
|
||||
// level.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Noel Borstad
|
||||
//:: Created On: Oct 17, 2000
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Updated By: Georg Z, On: Aug 21, 2003 - no longer affects placeables
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
effect eDam;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DEATH_L);
|
||||
effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
nCasterLvl +=SPGetPenetr();
|
||||
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE,OBJECT_SELF))
|
||||
{
|
||||
//GZ: I still signal this event for scripting purposes, even if a placeable
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FINGER_OF_DEATH));
|
||||
if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
|
||||
//Make SR check
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLvl))
|
||||
{
|
||||
//Make Forttude save
|
||||
if (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_DEATH))
|
||||
{
|
||||
DeathlessFrenzyCheck(oTarget);
|
||||
|
||||
//Apply the death effect and VFX impact
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget);
|
||||
//SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Target shouldn't take damage if they are immune to death magic.
|
||||
if (!GetIsImmune( oTarget, IMMUNITY_TYPE_DEATH) && !(GetHasMettle(oTarget, SAVING_THROW_FORT)))
|
||||
{
|
||||
//Roll damage
|
||||
nDamage = d6(3) + nCasterLvl;
|
||||
//Make metamagic checks
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = 18 + nCasterLvl;
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2);
|
||||
}
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, 3);
|
||||
//Set damage effect
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_NEGATIVE);
|
||||
//Apply damage effect and VFX impact
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
96
nwn/nwnprc/trunk/spells/nw_s0_fireball.nss
Normal file
96
nwn/nwnprc/trunk/spells/nw_s0_fireball.nss
Normal file
@@ -0,0 +1,96 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Fireball
|
||||
//:: NW_S0_Fireball
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
// A fireball is a burst of flame that detonates with
|
||||
// a low roar and inflicts 1d6 points of damage per
|
||||
// caster level (maximum of 10d6) to all creatures
|
||||
// within the area. Unattended objects also take
|
||||
// damage. The explosion creates almost no pressure.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Noel Borstad
|
||||
//:: Created On: Oct 18 , 2000
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
|
||||
//:: Last Updated By: AidanScanlan, On: April 11, 2001
|
||||
//:: Last Updated By: Preston Watamaniuk, On: May 25, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam;
|
||||
//Limit Caster level for the purposes of damage
|
||||
int nDice = min(10, nCasterLvl);
|
||||
|
||||
nCasterLvl += SPGetPenetr();
|
||||
|
||||
//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 = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, 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.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FIREBALL));
|
||||
//Get the distance between the explosion and the target to calculate delay
|
||||
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
|
||||
if (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl, fDelay))
|
||||
{
|
||||
//Resolve metamagic
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
nDamage = 6 * nDice;
|
||||
else
|
||||
//Roll damage for each target
|
||||
nDamage = d6(nDice);
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
nDamage += nDamage / 2;
|
||||
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nDice);
|
||||
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget, oCaster)), SAVING_THROW_TYPE_FIRE);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
//Set the damage effect
|
||||
eDam = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
PRCBonusDamage(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, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
||||
|
81
nwn/nwnprc/trunk/spells/nw_s0_fireshld.nss
Normal file
81
nwn/nwnprc/trunk/spells/nw_s0_fireshld.nss
Normal file
@@ -0,0 +1,81 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Elemental Shield
|
||||
//:: NW_S0_FireShld.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Caster gains 50% cold and fire immunity. Also anyone
|
||||
who strikes the caster with melee attacks takes
|
||||
1d6 + 1 per caster level in damage.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created On: Aug 28, 2003, GZ: Fixed stacking issue
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
//:: left the immunities as 50% cold and fire, not variable.
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_ELEMENTAL_SHIELD);
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
object oTarget = OBJECT_SELF;
|
||||
effect eShield = EffectDamageShield(nDuration, DAMAGE_BONUS_1d6, ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE));
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eCold = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 50);
|
||||
effect eFire = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 50);
|
||||
|
||||
//Link effects
|
||||
effect eLink = EffectLinkEffects(eShield, eCold);
|
||||
eLink = EffectLinkEffects(eLink, eFire);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eVis);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ELEMENTAL_SHIELD, FALSE));
|
||||
|
||||
// *GZ: No longer stack this spell
|
||||
if (GetHasSpellEffect(GetSpellId(),oTarget))
|
||||
{
|
||||
PRCRemoveSpellEffects(GetSpellId(), OBJECT_SELF, oTarget);
|
||||
}
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
98
nwn/nwnprc/trunk/spells/nw_s0_firestrm.nss
Normal file
98
nwn/nwnprc/trunk/spells/nw_s0_firestrm.nss
Normal file
@@ -0,0 +1,98 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Fire Storm
|
||||
//:: NW_S0_FireStm
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates a zone of destruction around the caster
|
||||
within which all living creatures are pummeled
|
||||
with fire.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 11, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 21, 2001
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = GetLocation(oCaster);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
int nDamage2;
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
|
||||
int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE);
|
||||
|
||||
|
||||
int nCasterLevel = CasterLvl;
|
||||
if(nCasterLevel > 20)
|
||||
{
|
||||
nCasterLevel = 20; //bugfix, was == 20
|
||||
}
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eFireStorm = EffectVisualEffect(VFX_FNF_FIRESTORM);
|
||||
float fDelay;
|
||||
CasterLvl +=SPGetPenetr();
|
||||
|
||||
//Apply Fire and Forget Visual in the area;
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFireStorm, lTarget);
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
//This spell smites everyone who is more than 2 meters away from the caster.
|
||||
//if (GetDistanceBetween(oTarget, OBJECT_SELF) > 2.0)
|
||||
//{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF)
|
||||
{
|
||||
fDelay = PRCGetRandomDelay(1.5, 2.5);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIRE_STORM));
|
||||
//Make SR check, and appropriate saving throw(s).
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay))
|
||||
{
|
||||
//Roll Damage
|
||||
nDamage = d6(nCasterLevel);
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 6 * nCasterLevel;//Damage is at max
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage = nDamage + (nDamage/2);//Damage/Healing is +50%
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
//Save versus both holy and fire damage
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, nCasterLevel);
|
||||
nDamage2 = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, (nDC), SAVING_THROW_TYPE_DIVINE);
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, (nDC), SAVING_THROW_TYPE_FIRE);
|
||||
if(nDamage)
|
||||
{
|
||||
// Apply effects to the currently selected target. For this spell we have used
|
||||
//both Divine and Fire damage.
|
||||
effect eDivine = PRCEffectDamage(oTarget, nDamage2, DAMAGE_TYPE_DIVINE);
|
||||
effect eFire = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDivine, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
99
nwn/nwnprc/trunk/spells/nw_s0_flmarrow.nss
Normal file
99
nwn/nwnprc/trunk/spells/nw_s0_flmarrow.nss
Normal file
@@ -0,0 +1,99 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Flame Arrow
|
||||
//:: NW_S0_FlmArrow
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Fires a stream of fiery arrows at the selected
|
||||
target that do 4d6 damage per arrow. 1 Arrow
|
||||
per 4 levels is created.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Sept 20, 2001
|
||||
//:: Updated By: Georg Zoeller, Aug 18 2003: Uncapped
|
||||
//:://////////////////////////////////////////////
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_CONJURATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
int nPenetr = nCasterLvl + SPGetPenetr();
|
||||
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE);
|
||||
int nSaveType = ChangedSaveType(EleDmg);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
float fDist = GetDistanceBetween(oCaster, oTarget);
|
||||
float fDelay = fDist/(3.0 * log(fDist) + 2.0);
|
||||
|
||||
int nDamage;
|
||||
int nCnt;
|
||||
effect eMissile = EffectVisualEffect(VFX_IMP_MIRV_FLAME);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
|
||||
//Limit missiles to five
|
||||
int nMissiles = nCasterLvl / 4;
|
||||
if(nMissiles == 0)
|
||||
nMissiles = 1;
|
||||
/* Uncapped because PHB doesn't list any cap and we now got epic levels
|
||||
else if (nMissiles > 5)
|
||||
nMissiles = 5;*/
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FLAME_ARROW));
|
||||
//Apply a single damage hit for each missile instead of as a single mass
|
||||
//Make SR Check
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay))
|
||||
{
|
||||
int iAttackRoll = 0;
|
||||
for(nCnt = 1; nCnt <= nMissiles; nCnt++)
|
||||
{
|
||||
// causes them each to make a ranged touch attack
|
||||
iAttackRoll = PRCDoRangedTouchAttack(oTarget);
|
||||
if(iAttackRoll > 0)
|
||||
{
|
||||
//Roll damage
|
||||
nDamage = d6(4);
|
||||
//Enter Metamagic conditions
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 24;//Damage is at max
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
|
||||
nDamage += SpellDamagePerDice(oCaster, 4);
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, nSaveType);
|
||||
|
||||
// only add sneak attack damage and bonus damage to first projectile
|
||||
if(nCnt == 1)
|
||||
{
|
||||
nDamage += SpellSneakAttackDamage(oCaster, oTarget);
|
||||
PRCBonusDamage(oTarget);
|
||||
}
|
||||
|
||||
//Set damage effect
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
//Apply the MIRV and damage effect
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// * May 2003: Make it so the arrow always appears, even if resisted
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget);
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
102
nwn/nwnprc/trunk/spells/nw_s0_flmlash.nss
Normal file
102
nwn/nwnprc/trunk/spells/nw_s0_flmlash.nss
Normal file
@@ -0,0 +1,102 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Flame Lash
|
||||
//:: NW_S0_FlmLash.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates a whip of fire that targets a single
|
||||
individual
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 21, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
|
||||
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE);
|
||||
|
||||
int nCasterLevel = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
if(nCasterLevel > 3)
|
||||
{
|
||||
nCasterLevel = (nCasterLevel-3)/3;
|
||||
}
|
||||
else
|
||||
{
|
||||
nCasterLevel = 0;
|
||||
}
|
||||
int nDamage = d6(2 + nCasterLevel);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if ((nMetaMagic & METAMAGIC_MAXIMIZE))
|
||||
{
|
||||
nDamage = 6 * (2 + nCasterLevel);//Damage is at max
|
||||
}
|
||||
if ((nMetaMagic & METAMAGIC_EMPOWER))
|
||||
{
|
||||
nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
|
||||
}
|
||||
nDamage += SpellDamagePerDice(OBJECT_SELF, 2 + nCasterLevel);
|
||||
CasterLvl +=SPGetPenetr();
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
effect eRay = EffectBeam(VFX_BEAM_FIRE_LASH, OBJECT_SELF, BODY_NODE_HAND);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7,FALSE);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FLAME_LASH));
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, 1.0))
|
||||
{
|
||||
//nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF);
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (nDC), SAVING_THROW_TYPE_FIRE);
|
||||
effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
//Apply the VFX impact and effects
|
||||
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
96
nwn/nwnprc/trunk/spells/nw_s0_flmstrike.nss
Normal file
96
nwn/nwnprc/trunk/spells/nw_s0_flmstrike.nss
Normal file
@@ -0,0 +1,96 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Flame Strike
|
||||
//:: NW_S0_FlmStrike
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
// A flame strike is a vertical column of divine fire
|
||||
// roaring downward. The spell deals 1d6 points of
|
||||
// damage per level, to a maximum of 15d6. Half the
|
||||
// damage is fire damage, but the rest of the damage
|
||||
// results directly from divine power and is therefore
|
||||
// not subject to protection from elements (fire),
|
||||
// fire shield (chill shield), etc.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Noel Borstad
|
||||
//:: Created On: Oct 19, 2000
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 20, 2001
|
||||
//:: Update Pass By: Preston W, On: Aug 1, 2001
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if(!X2PreSpellCastCode()) return;
|
||||
|
||||
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
||||
int nPenetr = nCasterLvl + SPGetPenetr();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE);
|
||||
int nSaveType = ChangedSaveType(EleDmg);
|
||||
int nDice = min(15, nCasterLvl);
|
||||
|
||||
int nDamage, nDamage2;
|
||||
effect eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
effect eHoly, eFire;
|
||||
|
||||
//Apply the location impact visual to the caster location instead of caster target creature.
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, lTarget);
|
||||
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget, FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FLAME_STRIKE));
|
||||
|
||||
//Make SR check, and appropriate saving throw(s).
|
||||
if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, 0.6))
|
||||
{
|
||||
nDamage = d6(nDice);
|
||||
if(nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
nDamage = 6 * nDice;
|
||||
if(nMetaMagic & METAMAGIC_EMPOWER)
|
||||
nDamage = nDamage + (nDamage/2);
|
||||
nDamage += SpellDamagePerDice(oCaster, nDice);
|
||||
//Adjust the damage based on Reflex Save, Evasion and Improved Evasion
|
||||
int nDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
nDamage2 = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, nDC, nSaveType);
|
||||
|
||||
//Make a faction check so that only enemies receieve the full brunt of the damage.
|
||||
if(!GetIsFriend(oTarget))
|
||||
{
|
||||
nDamage = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, nDC, SAVING_THROW_TYPE_DIVINE);
|
||||
if(nDamage)
|
||||
{
|
||||
eHoly = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE);
|
||||
DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHoly, oTarget));
|
||||
}
|
||||
}
|
||||
// Apply effects to the currently selected target.
|
||||
if(nDamage2)
|
||||
{
|
||||
eFire = PRCEffectDamage(oTarget, nDamage2, EleDmg);
|
||||
DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget));
|
||||
DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget, FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
90
nwn/nwnprc/trunk/spells/nw_s0_freemove.nss
Normal file
90
nwn/nwnprc/trunk/spells/nw_s0_freemove.nss
Normal file
@@ -0,0 +1,90 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Freedom of Movement
|
||||
//:: NW_S0_FreeMove.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The target creature gains immunity to the
|
||||
Entangle, Slow and Paralysis effects
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By: Preston W, On: June 21, 2001
|
||||
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION);
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
effect eParal = EffectImmunity(IMMUNITY_TYPE_PARALYSIS);
|
||||
effect eEntangle = EffectImmunity(IMMUNITY_TYPE_ENTANGLE);
|
||||
effect eSlow = EffectImmunity(IMMUNITY_TYPE_SLOW);
|
||||
effect eMove = EffectImmunity(IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE);
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_FREEDOM_OF_MOVEMENT);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
//Link effects
|
||||
effect eLink = EffectLinkEffects(eParal, eEntangle);
|
||||
eLink = EffectLinkEffects(eLink, eSlow);
|
||||
eLink = EffectLinkEffects(eLink, eVis);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eMove);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FREEDOM_OF_MOVEMENT, FALSE));
|
||||
|
||||
//Search for and remove the above negative effects
|
||||
effect eLook = GetFirstEffect(oTarget);
|
||||
while(GetIsEffectValid(eLook))
|
||||
{
|
||||
if(GetEffectType(eLook) == EFFECT_TYPE_PARALYZE ||
|
||||
GetEffectType(eLook) == EFFECT_TYPE_ENTANGLE ||
|
||||
GetEffectType(eLook) == EFFECT_TYPE_SLOW ||
|
||||
GetEffectType(eLook) == EFFECT_TYPE_MOVEMENT_SPEED_DECREASE)
|
||||
{
|
||||
RemoveEffect(oTarget, eLook);
|
||||
}
|
||||
eLook = GetNextEffect(oTarget);
|
||||
}
|
||||
//Meta-Magic Checks
|
||||
if(nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration *= 2;
|
||||
}
|
||||
//Apply Linked Effect
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
105
nwn/nwnprc/trunk/spells/nw_s0_gate.nss
Normal file
105
nwn/nwnprc/trunk/spells/nw_s0_gate.nss
Normal file
@@ -0,0 +1,105 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Gate
|
||||
//:: NW_S0_Gate.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Summons a Balor to fight for the caster.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: April 12, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "inc_dynconv"
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void CreateBalor()
|
||||
{
|
||||
CreateObject(OBJECT_TYPE_CREATURE, "NW_S_BALOR_EVIL", PRCGetSpellTargetLocation());
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
if (!GetLocalInt(OBJECT_SELF, "DimAnchor"))
|
||||
{
|
||||
// Do the gating
|
||||
int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF);
|
||||
float fDur = RoundsToSeconds(nCasterLevel);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
|
||||
if(GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL))
|
||||
fDur = RoundsToSeconds(nCasterLevel*GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL));
|
||||
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDur *= 2;
|
||||
SetLocalFloat(OBJECT_SELF, "TrueGateDuration", fDur);
|
||||
|
||||
StartDynamicConversation("true_gate_conv", OBJECT_SELF, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatingTextStringOnCreature("You are under a Dimensional Anchor. Gate fails.", OBJECT_SELF, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
if (!GetLocalInt(OBJECT_SELF, "DimAnchor"))
|
||||
{
|
||||
|
||||
//Declare major variables
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = nCasterLevel;
|
||||
effect eSummon;
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
|
||||
//Make metamagic extend check
|
||||
if ((nMetaMagic & METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Summon the Balor and apply the VFX impact
|
||||
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, PRCGetSpellTargetLocation());
|
||||
location lSpellTargetLOC = PRCGetSpellTargetLocation();
|
||||
|
||||
if(GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL) ||
|
||||
GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_EVIL) ||
|
||||
GetHasSpellEffect(SPELL_HOLY_AURA))
|
||||
{
|
||||
eSummon = EffectSummonCreature("NW_S_BALOR",VFX_FNF_SUMMON_GATE,3.0);
|
||||
float fSeconds = RoundsToSeconds(nDuration);
|
||||
if(GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL))
|
||||
fSeconds = RoundsToSeconds(nDuration*GetPRCSwitch(PRC_SUMMON_ROUND_PER_LEVEL));
|
||||
DelayCommand(6.0, MultisummonPreSummon());
|
||||
DelayCommand(3.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lSpellTargetLOC);
|
||||
DelayCommand(3.0, CreateBalor());
|
||||
}
|
||||
}*/
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
70
nwn/nwnprc/trunk/spells/nw_s0_ghostvis.nss
Normal file
70
nwn/nwnprc/trunk/spells/nw_s0_ghostvis.nss
Normal file
@@ -0,0 +1,70 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Ghostly Visage
|
||||
//:: NW_S0_MirrImage.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Caster gains 5/+1 Damage reduction and immunity
|
||||
to 1st level spells.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION);
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE);
|
||||
effect eDam = EffectDamageReduction(5, DAMAGE_POWER_PLUS_ONE);
|
||||
effect eSpell = EffectSpellLevelAbsorption(1);
|
||||
effect eConceal = EffectConcealment(10);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eLink = EffectLinkEffects(eDam, eVis);
|
||||
eLink = EffectLinkEffects(eLink, eSpell);
|
||||
eLink = EffectLinkEffects(eLink, eConceal);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GHOSTLY_VISAGE, FALSE));
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Apply the VFX impact and effects
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
||||
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
105
nwn/nwnprc/trunk/spells/nw_s0_ghoultch.nss
Normal file
105
nwn/nwnprc/trunk/spells/nw_s0_ghoultch.nss
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
nw_s0_ghoultch.nss
|
||||
|
||||
The caster attempts a touch attack on a target
|
||||
creature. If successful creature must save
|
||||
or be paralyzed. Target exudes a stench that
|
||||
causes all enemies to save or be stricken with
|
||||
-2 Attack, Damage, Saves and Skill Checks for
|
||||
1d6+2 rounds.
|
||||
|
||||
By: Preston Watamaniuk
|
||||
Created: Nov 7, 2001
|
||||
Modified: Jun 12, 2006
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "prc_inc_sp_tch"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
//Implements the spell impact, put code here
|
||||
// if called in many places, return TRUE if
|
||||
// stored charges should be decreased
|
||||
// eg. touch attack hits
|
||||
//
|
||||
// Variables passed may be changed if necessary
|
||||
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
||||
{
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_FOGGHOUL);
|
||||
effect eParal = EffectParalyze();
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED);
|
||||
|
||||
effect eLink = EffectLinkEffects(eDur2, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eParal);
|
||||
|
||||
int iAttackRoll = 0;
|
||||
|
||||
int nDuration = d6()+2;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic & METAMAGIC_MAXIMIZE)
|
||||
{
|
||||
nDuration = 8;//Damage is at max
|
||||
}
|
||||
if (nMetaMagic & METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDuration = nDuration + (nDuration/2); //Damage/Healing is +50%
|
||||
}
|
||||
if (nMetaMagic & METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
if(!GetIsReactionTypeFriendly(oTarget) && PRCAmIAHumanoid(oTarget) && PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GHOUL_TOUCH));
|
||||
//Make a touch attack to afflict target
|
||||
|
||||
// GZ: * GetSpellCastItem() == OBJECT_INVALID is used to prevent feedback from showing up when used as OnHitCastSpell property
|
||||
iAttackRoll = PRCDoMeleeTouchAttack(oTarget);
|
||||
if (iAttackRoll)
|
||||
{
|
||||
//SR and Saves
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget) && !/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_NEGATIVE))
|
||||
{
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, GetLocation(oTarget), RoundsToSeconds(nDuration));
|
||||
|
||||
object oAoE = GetAreaOfEffectObject(GetLocation(oTarget), "VFX_PER_FOGGHOUL");
|
||||
SetAllAoEInts(SPELL_GHOUL_TOUCH, oAoE, PRCGetSpellSaveDC(SPELL_GHOUL_TOUCH, SPELL_SCHOOL_NECROMANCY), 0, nCasterLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return iAttackRoll; //return TRUE if spell charges should be decremented
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
PRCSetSchool(SPELL_SCHOOL_NECROMANCY);
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
||||
if(!nEvent) //normal cast
|
||||
{
|
||||
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
||||
{ //holding the charge, casting spell on self
|
||||
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
||||
return;
|
||||
}
|
||||
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
||||
{
|
||||
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
||||
DecrementSpellCharges(oCaster);
|
||||
}
|
||||
}
|
||||
PRCSetSchool();
|
||||
}
|
56
nwn/nwnprc/trunk/spells/nw_s0_ghoultcha.nss
Normal file
56
nwn/nwnprc/trunk/spells/nw_s0_ghoultcha.nss
Normal file
@@ -0,0 +1,56 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Ghoul Touch: On Enter
|
||||
//:: NW_S0_GhoulTchA.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The caster attempts a touch attack on a target
|
||||
creature. If successful creature must save
|
||||
or be paralyzed. Target exudes a stench that
|
||||
causes all enemies to save or be stricken with
|
||||
-2 Attack, Damage, Saves and Skill Checks for
|
||||
1d6+2 rounds.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 7, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void main()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY);
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetEnteringObject();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DOOM);
|
||||
effect eAttack = EffectAttackDecrease(2);
|
||||
effect eDamage = EffectDamageDecrease(2, DAMAGE_TYPE_BLUDGEONING|DAMAGE_TYPE_PIERCING|DAMAGE_TYPE_SLASHING);
|
||||
effect eSave = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2);
|
||||
effect eSkill = EffectSkillDecrease(SKILL_ALL_SKILLS, 2);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
||||
|
||||
//Link Effects
|
||||
effect eLink = EffectLinkEffects(eDamage, eSave);
|
||||
eLink = EffectLinkEffects(eLink, eSave);
|
||||
eLink = EffectLinkEffects(eLink, eSkill);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget) || GetAreaOfEffectCreator() != oTarget)
|
||||
{
|
||||
if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget) && !PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget,GetAreaOfEffectCreator())) && PRCGetIsAliveCreature(oTarget))
|
||||
{
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2+d6()));
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Getting rid of the local integer storing the spellschool name
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user