and scanner (built in or attach) shoulb be able to understand if a monster is immune or absorbe an element and avoid to cast the spell.