Issue #2 and Issue #4 resolved.

#2. Coded hasEffectEquipped to loop through the entire inventory instead
of returning at the first effect found
#4. Check the return value of getTarget in bat_castOpt. Return 0 to have
the player select another option if 0.