50 lines
1.6 KiB
Plaintext
50 lines
1.6 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Lesser Dispel
|
|
//:: NW_S0_LsDispel.nss
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Preston Watamaniuk
|
|
//:: Created On: Jan 7, 2002
|
|
//:://////////////////////////////////////////////
|
|
#include "x0_i0_spells"
|
|
#include "inc_dispel"
|
|
void main()
|
|
{
|
|
|
|
//Declare major variables
|
|
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_SONIC);
|
|
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
|
object oTarget = GetSpellTargetObject();
|
|
location lLocal = GetSpellTargetLocation();
|
|
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
|
|
|
|
if(nCasterLevel > 5)
|
|
{
|
|
nCasterLevel = 5;
|
|
}
|
|
effect eDispel;
|
|
if (GetIsObjectValid(oTarget))
|
|
{
|
|
AltspellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact);
|
|
}
|
|
else
|
|
{
|
|
eDispel = EffectDispelMagicBest(nCasterLevel);
|
|
//Apply the VFX impact and effects
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, GetSpellTargetLocation());
|
|
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT);
|
|
while (GetIsObjectValid(oTarget))
|
|
{
|
|
if(GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT)
|
|
{
|
|
DestroyObject(oTarget, 0.0);
|
|
}
|
|
AltspellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact);
|
|
|
|
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE,lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT);
|
|
}
|
|
}
|
|
|
|
}
|