RemoveEffect(object, effect)
Removes an effect from a creature or object.
void RemoveEffect( object oCreature, effect eEffect );
Parameters
oCreature
The object to remove an effect from.
eEffect
The effect to remove.
Description
Removes eEffect from oCreature.
Version
1.22
Example
// Bioware's utility function to remove the sleep effect
// on a successful DC 15 listen check.
void RemoveAmbientSleep()
{
if(GetHasEffect(EFFECT_TYPE_SLEEP))
{
effect eSleep = GetFirstEffect(OBJECT_SELF);
while(GetIsEffectValid(eSleep))
{
if(GetEffectCreator(eSleep) == OBJECT_SELF)
{
int nRoll = d20();
nRoll += GetSkillRank(SKILL_LISTEN);
nRoll += GetAbilityModifier(ABILITY_WISDOM);
if(nRoll > 15)
{
RemoveEffect(OBJECT_SELF, eSleep);
}
}
eSleep = GetNextEffect(OBJECT_SELF);
}
}
}
See Also
| functions: | EffectSpellLevelAbsorption | GetEffectDurationType | GetEffectSpellId | GetEffectSubType | GetEffectType |
| categories: | Effects Functions |
author: Tom Cassiotis
Send comments on this topic.