Further file organization
Further file organization
This commit is contained in:
147
nwn/nwnprc/trunk/spells/x0_s0_gustwind.nss
Normal file
147
nwn/nwnprc/trunk/spells/x0_s0_gustwind.nss
Normal file
@@ -0,0 +1,147 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Gust of Wind
|
||||
//:: [x0_s0_gustwind.nss]
|
||||
//:: Copyright (c) 2002 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This spell creates a gust of wind in all directions
|
||||
around the target. All targets in a medium area will be
|
||||
affected:
|
||||
- Target must make a For save vs. spell DC or be
|
||||
knocked down for 3 rounds
|
||||
- plays a wind sound
|
||||
- if an area of effect object is within the area
|
||||
it is dispelled
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent
|
||||
//:: Created On: September 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:: 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_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
|
||||
string sAOETag;
|
||||
object oCaster = OBJECT_SELF;
|
||||
|
||||
int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nCasterLvl = CasterLvl;
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
effect eExplode = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_WIND);
|
||||
|
||||
nCasterLvl += SPGetPenetr();
|
||||
|
||||
|
||||
// effect eDam;
|
||||
//Get the spell target location as opposed to the spell target.
|
||||
location lTarget = PRCGetSpellTargetLocation();
|
||||
|
||||
//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 | OBJECT_TYPE_AREA_OF_EFFECT);
|
||||
|
||||
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT)
|
||||
{
|
||||
// 1.69 change
|
||||
// Gust of wind should only destroy "cloud/fog like" area of effect spells.
|
||||
sAOETag = GetTag(oTarget);
|
||||
if ( sAOETag == "VFX_PER_FOGACID" ||
|
||||
sAOETag == "VFX_PER_FOGKILL" ||
|
||||
sAOETag == "VFX_PER_FOGBEWILDERMENT" ||
|
||||
sAOETag == "VFX_PER_FOGSTINK" ||
|
||||
sAOETag == "VFX_PER_FOGFIRE" ||
|
||||
sAOETag == "VFX_PER_FOGMIND" ||
|
||||
sAOETag == "VFX_PER_CREEPING_DOOM")
|
||||
{
|
||||
DestroyObject(oTarget);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId()));
|
||||
//Get the distance between the explosion and the target to calculate delay
|
||||
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
|
||||
|
||||
// * unlocked doors will reverse their open state
|
||||
if (GetObjectType(oTarget) == OBJECT_TYPE_DOOR)
|
||||
{
|
||||
if (GetLocked(oTarget) == FALSE)
|
||||
{
|
||||
if (GetIsOpen(oTarget) == FALSE)
|
||||
{
|
||||
AssignCommand(oTarget, ActionOpenDoor(oTarget));
|
||||
}
|
||||
else
|
||||
AssignCommand(oTarget, ActionCloseDoor(oTarget));
|
||||
}
|
||||
}
|
||||
int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF);
|
||||
if(!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLvl)
|
||||
&& !/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (nDC)))
|
||||
{
|
||||
|
||||
effect eKnockdown = EffectKnockdown();
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnockdown, oTarget, RoundsToSeconds(3),TRUE,-1,CasterLvl);
|
||||
// Apply effects to the currently selected target.
|
||||
// DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, 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 |OBJECT_TYPE_AREA_OF_EFFECT);
|
||||
}
|
||||
|
||||
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
||||
// Erasing the variable used to store the spell's spell school
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user