What this does is, it targets the npc in the next line, and casts Ice Lance until they die(assuming the macro is being spammed). Then move onto the next target.

What I want to do is to cast different spells on different targets. For example, I want to cast Ice Lance on the targets "shakes" and "captain", while casting Arcane Barrage if the targets are "first" and "Doctor".

I've been trying to accomplish this with my rookie coding skills, but I couldn't succeed. I'd REALLY appreciate if someone can help.