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);
}
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.