FANDOM


This is a script for making a spell cast at an object return to the spellcaster. The target still takes damage, however. Great for making sure spellcasters don't blast every chest in sight.

The ScriptEdit

This script is for chests; it checks to see if the chest is trapped or not, and only fires the spell back if the trap is activated. This script can be easily edited so that it does not check for any traps, and act more like spell turning.

void main()
{
int trapflag = GetIsTrapped(OBJECT_SELF);
int spell = GetLastSpell();
int spellflag = GetLastSpellHarmful();
object oCaster = GetLastSpellCaster();
if ((trapflag == TRUE) && (spellflag == TRUE))
{
 ActionCastSpellAtObject(spell, oCaster, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
}
}
Community content is available under CC-BY-SA unless otherwise noted.