Further file organization
Further file organization
This commit is contained in:
86
nwn/nwnprc/trunk/spells/nw_s0_haste.nss
Normal file
86
nwn/nwnprc/trunk/spells/nw_s0_haste.nss
Normal file
@@ -0,0 +1,86 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Haste
|
||||
//:: NW_S0_Haste.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Gives the targeted creature one extra partial
|
||||
action per round.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: May 29, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
// Modified March 2003: Remove Expeditious Retreat effects
|
||||
|
||||
//:: 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_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 = PRCGetSpellTargetObject();
|
||||
|
||||
if (GetHasSpellEffect(SPELL_EXPEDITIOUS_RETREAT, oTarget) == TRUE)
|
||||
{
|
||||
PRCRemoveSpellEffects(SPELL_EXPEDITIOUS_RETREAT, OBJECT_SELF, oTarget);
|
||||
}
|
||||
|
||||
if (GetHasSpellEffect(647, oTarget) == TRUE)
|
||||
{
|
||||
PRCRemoveSpellEffects(647, OBJECT_SELF, oTarget);
|
||||
}
|
||||
|
||||
if (GetHasSpellEffect(SPELL_MASS_HASTE, oTarget) == TRUE)
|
||||
{
|
||||
PRCRemoveSpellEffects(SPELL_MASS_HASTE, OBJECT_SELF, oTarget);
|
||||
}
|
||||
|
||||
|
||||
effect eHaste = EffectHaste();
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HASTE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eLink = EffectLinkEffects(eHaste, eDur);
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HASTE, FALSE));
|
||||
//Check for metamagic extension
|
||||
if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
|
||||
{
|
||||
nDuration = nDuration * 2; //Duration is +100%
|
||||
}
|
||||
// Apply effects to the currently selected target.
|
||||
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user