2025/09/06 Update
Fixed VFX for Prismatic Sphere. Fixed Bonded Summoner's familiar past 10th class lvl. Removed old goad item. Capped Inscribe Rune CL at 20th. Updated Psychic Rogue's power list. Fixed goad's icon size in baseitems.2da Added WotC Mind's Eye Web Enhancement PDFs to notes. Added PnP Animal Companion notes.
This commit is contained in:
51
nwn/nwnprc/trunk/scripts/prc_end_spell_fx.nss
Normal file
51
nwn/nwnprc/trunk/scripts/prc_end_spell_fx.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
#include "prc_inc_spells"
|
||||
|
||||
//:: End Spell Effects
|
||||
//:: Removes spell effects created by the caster on the chosen target or ground.
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oTarget = OBJECT_SELF;
|
||||
location lTarget = GetSpellTargetLocation();
|
||||
|
||||
// If the target is valid, handle creature/placeable effects
|
||||
if (GetIsObjectValid(oTarget))
|
||||
{
|
||||
effect eEff = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEff))
|
||||
{
|
||||
if (GetEffectCreator(eEff) == oCaster)
|
||||
{
|
||||
RemoveEffect(oTarget, eEff);
|
||||
}
|
||||
eEff = GetNextEffect(oTarget);
|
||||
}
|
||||
|
||||
// Play cessate VFX on the object target
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REMOVE_CONDITION), oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, look for persistent AoEs at the location
|
||||
float fRadius = 10.0; // cover typical AoE spell size
|
||||
object oAOE = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget, TRUE, OBJECT_TYPE_AREA_OF_EFFECT);
|
||||
int bFound = FALSE;
|
||||
|
||||
while (GetIsObjectValid(oAOE))
|
||||
{
|
||||
if (GetAreaOfEffectCreator(oAOE) == oCaster)
|
||||
{
|
||||
DestroyObject(oAOE);
|
||||
bFound = TRUE;
|
||||
}
|
||||
oAOE = MyNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget, TRUE, OBJECT_TYPE_AREA_OF_EFFECT);
|
||||
}
|
||||
|
||||
// If we destroyed at least one AoE, show cessate VFX at ground target
|
||||
if (bFound)
|
||||
{
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REMOVE_CONDITION), lTarget);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user