Pretty simple concept. If you have a poison donated to you and you are leaving your base, you can predetermined a place on your base where the spell will be deployed if you are attacked. Of course it will be triggered by an attacker once they enter the area. The mode can be turned on or off so as to use it when you do or do Not want. Not sure if its feasible for any other dark spells to be used as defense, but the poison seems like a good candidate.
