With the latest revision I noticed illogical casting sequence
It casts (a) DoT(s) and then Mindspike (erasing the DoT(s)).
I've noticed this several time while running the questing mode in HB.
I've seen it do this with SW

, DP, and with VT (and random combinations of these 3).
Has something changed? Using the SVN version.
Please provide a log for this kind of stuff in the future. We can tweak this logic as needed but examples of this occuring would be helpful in determining what the exact situation is. In the meantime, I'm going to go into the logic involved in determining whether we should use the Normal (DoT-based) Rotation or the Mind Spike Rotation on target.
Two primary factors are at play here. The target's health and which DoT's are currently up.
Current Health
For health, we use the current health of the target (as opposed to the maximum/starting health). The reason for this is so that if a mob is about to die, we don't apply DoT's that will never have a chance to tick because the target is dead.
We calculate the number at which we start considering Mind Spike in three different ways. If the target's health is above this value, we *will* use the Normal Rotation. If the target's health is below this value, we *consider* using the Mind Spike rotation. Let's call this number the
Mind Spike Threshold Value (MSTV from henceforth).
In Raid:
(My Maximum Health * Raid Size) / 5
Assuming 100k health and a 10-man raid, the MSTV would be 200k.
Assuming 100k health and a 25-man raid, the MSTV would be 500k.
In Dungeon:
My Maximum Health - (My Maximum Health / 4)
Assuming 100k health, the MSTV would be 75k.
Solo:
My Maximum Health - (My Maximum Health / 4)
Assuming 100k health, the MSTV would be 75k.
Note: I did not realize the values for Dungeon and Solo were the same until just now and frankly, all of the values except for solo seem pretty low to me. Feedback and theorycraft on this topic would be greatly appreciated.
If the target's health falls below the value determine above, we next look at which DoT's are up on the target.
Active Damage Over Time Debuffs
If
Devouring Plague is present the target, we use the
Normal Rotation.
If
Vampiric Touch is missing, we use the
Mind Spike Rotation.
If
Shadow Word: Pain is missing (or will fall off before a Mind Spike cast will finish), we use the
Mind Spike Rotation.
So, pulling this altogether, let me give a few examples...
Examples
Shadow Priest in 10-man raid has 100,000 maximum health. (MSTV 200,000)
Target Health: 200,001
DoT's: None.
Rotation: Normal Rotation
Target Health: 199,999
DoT's: Vampiric Touch OR Shadow Word: Pain only
Rotation: Mind Spike Rotation
Target Health: 199,999
DoT's: Devouring Plague only
Rotation: Normal Rotation
Target Health: 199,999
DoT's: Shadow Word: Pain and Vampiric Touch
Rotation: Normal Rotation
Target Health: 199,999
DoT's: Shadow Word: Pain (has .5 seconds left) and Vampiric Touch
Rotation: Mind Spike Rotation.
Clear as mud, right?