Updated Release Archive. Fixed Mage-killer prereqs. Removed old LETO & ConvoCC related files. Added organized spell scroll store. Fixed Gloura spellbook. Various TLK fixes. Reorganized Repo. Removed invalid user folders. Added DocGen back in.
100 lines
3.3 KiB
Plaintext
100 lines
3.3 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Slow
|
|
//:: NW_S0_Slow.nss
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Character can take only one partial action
|
|
per round.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Preston Watamaniuk
|
|
//:: Created On: May 29, 2001
|
|
//:://////////////////////////////////////////////
|
|
//:: VFX Pass By: Preston W, On: June 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_TRANSMUTATION);
|
|
/*
|
|
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;
|
|
effect eSlow = EffectSlow();
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
|
effect eLink = EffectLinkEffects(eSlow, eDur);
|
|
|
|
effect eVis = EffectVisualEffect(VFX_IMP_SLOW);
|
|
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_30);
|
|
int nMetaMagic = PRCGetMetaMagicFeat();
|
|
//Determine spell duration as an integer for later conversion to Rounds, Turns or Hours.
|
|
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
|
int nDuration = CasterLvl;
|
|
|
|
|
|
|
|
int nLevel = nDuration;
|
|
int nCount = 0;
|
|
location lSpell = PRCGetSpellTargetLocation();
|
|
|
|
nLevel +=SPGetPenetr();
|
|
//Metamagic check for extend
|
|
if ((nMetaMagic & METAMAGIC_EXTEND))
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation());
|
|
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
|
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lSpell);
|
|
//Cycle through the targets within the spell shape until an invalid object is captured or the number of
|
|
//targets affected is equal to the caster level.
|
|
while(GetIsObjectValid(oTarget) && nCount < nLevel)
|
|
{
|
|
if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF))
|
|
{
|
|
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLOW));
|
|
if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nLevel) && !/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (nDC)))
|
|
{
|
|
//Apply the slow effect and VFX impact
|
|
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
//Count the number of creatures affected
|
|
nCount++;
|
|
}
|
|
}
|
|
//Select the next target within the spell shape.
|
|
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lSpell);
|
|
}
|
|
|
|
|
|
|
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
|
// Getting rid of the integer used to hold the spells spell school
|
|
}
|
|
|