Bloody hell, but thats one inefficient scripting language. One thing that springs to mind should this project ever get going again, if you can nest if statements you can do something like
code:
if (nearest enemy is a valid target)
then
if (have spell) cast spell else
if (have scroll) cast spell
end
[/QUOTE]which cuts the melfs acid arrow script in half, give or take.
Shame there isnt a function to take the nth nearest enemy, that would really cut down on the lines needed.