spellsGenericAreaOfEffect(object, location, int, float, int, effect, effect, effect, int, float, int, int, int, int, int, int, int, int, int, int, int, int)
Generic apply area of effect wrapper.
int nDurationType = DURATION_TYPE_INSTANT,
float fDuration = 0.0,
int nTargetType = SPELL_TARGET_ALLALLIES,
int bHarmful = FALSE,
int nRemoveEffectSpell = FALSE,
int nRemoveEffect1 = 0,
int nRemoveEffect2 = 0,
int nRemoveEffect3 = 0,
int bLineOfSight = FALSE,
int nObjectFilter = OBJECT_TYPE_CREATURE,
int bPersistentObject = FALSE,
int bResistCheck = FALSE,
int nSavingThrowType = SAVING_THROW_NONE,
int nSavingThrowSubType = SAVING_THROW_TYPE_ALL
The creature that cast the spell.
The location where you want to apply the effect.
Radius around the caster to apply the effect to. SHAPE_* See remarks.
The size of nShape. RADIUS_SIZE_*
The visual effect you want to apply to lTargetLoc.
Linked effects to apply to each individual target.
The visual effect you want to apply to each individual target.
The duration type for the eLink effect. DURATION_TYPE_* (Default: DURATION_TYPE_INSTANT)
The duration time for the eLink effect. (Default: 0.0)
Within the shape, what type of objects to apply the effects to. See remarks. (Default: SPELL_TARGET_ALLALLIES)
Determines if the spell is harmful to its target. (Default: FALSE)
Is this a remove effect spell? (Default: FALSE)
First effect, if any, to remove. (Default: 0)
Second effect, if any, to remove. (Default: 0)
Third effect, if any, to remove. (Default: 0)
This can be used to ensure that spell effects do not go through walls. (Default: FALSE)
Restrict results to this object type. OBJECT_TYPE_* (Default: OBJECT_TYPE_CREATURE)
Apply the effect to the calling object? See remarks. (Default: FALSE)
Attempt spell resistance or not? (Default: FALSE)
The type of saving throw to attempt to roll. SAVING_THROW_* (Default: SAVING_THROW_NONE)
A more specific saving throw to attempt to roll. SAVING_THROW_TYPE_* (Default: SAVING_THROW_TYPE_ALL)
Generic apply area of effect wrapper.
As you can see by the parameter list (22 of them!) this function is quite configurable. Be aware that sometimes choosing one option will exclude using another option.
If bPersistentObject is TRUE, then the target to apply the effect to is generated by GetFirstObjectInShape .
Valid values for nTargetType (used in selecting individual targets) are:
- SPELL_TARGET_ALLALLIES: All friendlies and anyone in the party.
- SPELL_TARGET_SELECTIVEHOSTILE: Only harms enemies, ever.
- SPELL_TARGET_STANDARDHOSTILE: This one is much more complex than the other two. Note the use of () and capital ORs and ANDs to denote nested conditions.
* Not friendly.
* oTarget hit themselves or their pet (familiar, summons, etc) with a spell.
* (if oTarget is a PC OR the module flag "X0_G_ALLOWSPELLSTOHURT" is 10) AND oTarget is not friendly with oSource.
* (not friendly AND the difficulty setting is greater than GAME_DIFFICULTY_NORMAL) AND the module switch "MODULE_SWITCH_ENABLE_NPC_AOE_HURT_ALLIES" is TRUE.
If nRemoveEffectSpell is FALSE, there is no need to set nRemoveEffect1, nRemoveEffect2, or nRemoveEffect3. If nRemoveEffectSpell is TRUE, the target must fail BOTH their spell resistance and saving throw tests in order for the specified effects to be removed. You can force these failures by setting bResistCheck to FALSE and nSavingThrowType to SAVING_THROW_NONE. If bResistCheck is TRUE, then each target will attempt to beat oCaster's spell resistance and thus avoid the spell.
If the target fails the spell resistance check, then they will attempt a saving throw roll (nSavingThrowType and nSavingThrowSubType). Should they fail, it is then time to zap them with the chosen effect.
If nSavingThrowType is set to SAVING_THROW_NONE, then there is no need to set nSavingThrowSubType.
eImpact and eVis are both optional. Set them to zero if you do not want a visual effect applied.
#include " x0_i0_spells "