This function removes zero or more magical affects from a player. (The correct usage would be 'effects', but it's a Sloth Mud tradition to get it wrong in this instance.) Since MUDL does not directly represent affects as their own type, you cannot remove a single specific affect - instead you can specify various criteria to describe the type of affect you want to remove, and all matching affects get removed. The number of affects that matched the criteria, and were thus removed, are returned.
The first argument is the character whose affects are getting removed.
If the second argument is the string 'all', then affects will be matched regardless of which spell generated them. If the second argument is anything else, then only affects generated by that spell will be matched.
The third argument is a flag list, much like the one described above in the affect documentation. The flags are
level=30 | only match affects at exactly caster level 30 |
max_level=30 | only match affects at or below caster level 30 |
positive | only match affects with positive modifiers |
negative | only match affects with negative modifiers |
location=strength | only match affects that modify strength |
bitvector=5 | only match affects with one or more of the bits in 5 (must have 1 or 4 or both) |
So, to remove all negative strength modifiers regardless of source,
remove_affect(%c,'all','location=strength negative')
To remove all chill touch spells and nothing else,
remove_affect(%c,'chill touch','')