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.
91 lines
2.9 KiB
Plaintext
91 lines
2.9 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Haste or Slow
|
|
//:: x2_s0_HasteSlow.nss
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
2/3rds of the time, Gives the targeted creature one extra partial
|
|
action per round.
|
|
1/3 of the time, Character can take only one partial action
|
|
per round.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Keith Warner
|
|
//:: Created On: Jan 3/03
|
|
//:://////////////////////////////////////////////
|
|
|
|
//:: altered 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);
|
|
/*
|
|
Spellcast Hook Code
|
|
Added 2003-07-07 by Georg Zoeller
|
|
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 (d100() > 33)
|
|
{// 2/3 of the time - do haste effect
|
|
//Declare major variables
|
|
object oTarget = PRCGetSpellTargetObject();
|
|
effect eHaste = EffectHaste();
|
|
effect eVis = EffectVisualEffect(VFX_IMP_HASTE);
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
|
effect eLink = EffectLinkEffects(eHaste, eDur);
|
|
|
|
int nDuration = PRCGetCasterLevel(OBJECT_SELF);
|
|
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HASTE, FALSE));
|
|
|
|
// Apply effects to the currently selected target.
|
|
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
}
|
|
else
|
|
{//1/3 of the time - do slow effect
|
|
|
|
//Declare major variables
|
|
object oTarget1 = PRCGetSpellTargetObject();
|
|
effect eSlow = EffectSlow();
|
|
effect eDur1 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
|
effect eLink1 = EffectLinkEffects(eSlow, eDur1);
|
|
|
|
effect eVis1 = EffectVisualEffect(VFX_IMP_SLOW);
|
|
effect eImpact1 = EffectVisualEffect(VFX_FNF_LOS_NORMAL_30);
|
|
|
|
//Determine spell duration as an integer for later conversion to Rounds, Turns or Hours.
|
|
int nDuration1 = PRCGetCasterLevel(OBJECT_SELF);
|
|
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget1, EventSpellCastAt(OBJECT_SELF, SPELL_SLOW, FALSE));
|
|
// Apply effects to the currently selected target.
|
|
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oTarget1, RoundsToSeconds(nDuration1));
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oTarget1);
|
|
|
|
|
|
}
|
|
|
|
|
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
|
// Erasing the variable used to store the spell's spell school
|
|
}
|
|
|
|
|