ITT: I don't know anything about programming. Kay.

Alright. I won't talk about any of my programming skills. But, let's have you stop talking about throwing conditions into a system that you don't understand. I'll give you a pseudo-code model that I believe is accurate, or extremely close to the one FFXI uses to process spell casting. You tell me where you'll "throw a condition", and what that condition is, and we'll see how this goes.

Kay? Kay.

Step 1: Client sends packet to server saying "Hey bitches, I'm firin' mah lazer"

>Server processes spell start request, confirms IsValidTarget, and checks player stats and spell stats to determine Casting Time, and records StartTime and StartPosition

>Spell Animation is told to start on the Client

>Server starts the conditional statement: (When CurrentTime = StartTime + CastingTime) and does nothing in the interim. No packets are sent to or from the Client in this time.

>Conditional statement is met. Server requests final stats from the Client. IsValidTarget and IsSpellInterrupted are checked. CurrentPosition is compared to StartPosition.

>If all of these checks pass, Player stats are read from the server and relevant effect calculations are run against Target stats. Effect is applied to relevant Objects.

>If any condition does not pass, player fails Spell Casting.

>Return.

You see, the biggest issue with trying to get the client to do something during casting is the fact that the client and server don't actually communicate while casting. Position data is updated in a separate module, so you can still move of course, but the combat module isn't actually receiving or sending any data to you.

Keep in mind that you're also limited from excessively increasing server traffic, as this could have profoundly negative effects especially for users living in a non-ideal DNS range (eg, about half of the EU, Australia, etc). The current system is built the way it is to minimize the dependence on constant communication in order to make a more pleasant/streamlined experience for all users.

Good luck.