I'll clarify what information we know from the demo regarding paralyze and its interaction with spell casting.
When a player casts a spell, they go through a casting process that checks a number of things at the beginning the casting process, including whether they have the required reagents, their hands are empty (or are only holding a spellbook), and whether they have the required mana. If the player meets the requirements, the spell begins the casting animation (the "spell pump" animation). During the casting animation, a flag is set on the character that freezes them in place for the duration of the casting animation, and this flag happens to be the same flag that is set when a player is paralyzed.
This casting animation process is handled by a specific script in the demo that also has event handler code that is triggered whenever a player is hit. This means that at any time there is an event that counts as a player being hit by something, a signal is sent to the scripts alerting them to the fact that such an event happened, and that they should execute any blocks of code they have that are intended to trigger when something is hit. It is through this type of code that spell disruptions, finger slips on bandages, and angered animals for taming are handled in game.
The event handler code in the casting script takes the input of how much damage that the player was hit for and the circle of the spell being cast, and runs a calculation using those values and the skill of the person casting the spell to determine whether the spell is disrupted. If the spell is successfully disrupted, a specific piece of code is run that cancels the casting animation,
unfreezes the caster, and sends the disruption message to the caster. It is the interaction between the casting script and the paralyze script that makes it impossible to paralyze someone who's casting a spell.
Now, the paralyze spell itself is rather straight forward. The spell first determines how long the spell should last for,
sets the frozen flag on the victim,
does a hit of zero damage on the victim, and then sets up another script that is intended to unfreeze the player after the prescribed period of time. As a result of this order of operations, the effect of paralyze when combined with the spell casting script is the effect that a player cannot ever be properly paralyzed.
To better understand why it works this way, let's consider 3 different scenarios: a normal spell cast, a normal paralyze cast, and a paralyze cast on someone who is already casting a spell:
Normal spell cast
- Player A tries to cast a spell.
- Checks are made to see if the player has the reagents, the mana, and the empty hands to cast the spell.
- The spell casting script takes over at this point.
- The player has the frozen flag set to true on the caster, with a delay of the length of the spell being cast.
- The spell animation begins.
- The words of power are spoken.
- After the set delay, the frozen flag is set to false on the caster, and the target cursor is presented for the loaded spell.
Normal paralyze cast
- Player B targets Player A with a paralyze spell.
- The paralyze spell script calculates the duration of the paralyze effect for Player A.
- The frozen flag on Player A is set to true.
- A hit for 0 damage is done to Player A.
- A "paralyze management" script for Player A takes over, issuing the "You can not move!" system message to Player A.
- After the duration of the paralyze, the paralyze management script sets the frozen flag to false for Player A, and sends the "You can move!" system message to Player A.
Paralyzed while casting a spell
- Player A tries to cast a spell.
- Checks are made to see if the player has the reagents, the mana, and the empty hands to cast the spell.
- The spell casting script takes over at this point.
- The player has the frozen flag set to true on the caster, with a delay of the length of the spell being cast.
- The spell animation begins.
- The words of power are spoken.
- Some period of time passes that less time than the duration of the spell.
- At this point, Player B targets paralyze on Player A.
- The paralyze spell script calculates the duration of the paralyze effect for Player A.
- The frozen flag on Player A is set to true (which is already set to true due to casting a spell).
- A hit for 0 damage is done to Player A.
- The event handler code in the casting script for Player A is triggered.
- A calculation is made to determine whether the spell is disrupted or not.
- If the calculation "succeeds" the spell is disrupted.
- The disruption system message is sent.
- The frozen flag on Player A is set to false.
- The casting animation cancels, and the spell is now disrupted.
- A "paralyze management" script for Player A takes over, issuing the "You can not move!" system message to Player A (but they can move since a spell was just disrupted!).
- After the duration of the paralyze, the paralyze management script sets the frozen flag to false for Player A (which is already false because the spell was disrupted), and sends the "You can move!" system message to Player A.
- If the calculation "fails", the spell is not disrupted.
- A "paralyze management" script for Player A takes over, issuing the "You can not move!" system message to Player A.
- Shortly thereafter, the casting script completes the cast of the spell, the frozen flag is set to false on Player A, and the target cursor is presented for the loaded spell.
- After the duration of the paralyze, the paralyze management script sets the frozen flag to false for Player A (which is already set to false as a result of the completed spell cast), and sends the "You can move!" system message to Player A.
As you can see from the third series of events, there are two possible outcomes labeled in
green and
red based on whether a spell is disturbed or not by the paralyze hit. However, in both cases, the frozen flag which is manipulated by both the casting and paralyze scripts is set to false long before it should be set to false as a result of the natural end of paralysis. The only difference is a small difference in total time frozen, and whether the spell caster does or doesn't have a spell to cast once they are free to move. Incidentally, in both cases, there will be this odd "You can move!" message that appears when the caster would normally be unfrozen by the paralysis management script, but the player will be moving freely when that message is received.
I hope that this clarifies what we know about paralyze thus far.