Thanks speshulk926 that fixed it, but it still summons the stone elemental....its so annoying to see it everytime its off CD
For resto, it's a bit different. There are 3 different routines. I need to know if it was a Battleground, Raids, and Normal (anything not in an instance). Then there are different routines for in a party and not in a party.
For the interrupt part, it's probably not a terrible feature to add that there needs to be X milliseconds into the cast before it interrupts. If you look in Helpers/Common.cs you will see IsInterruptTarget(WoWUnit u). They already have another statement in there that looks at the time left to make sure we don't interrupt a target with too little time left, but did not look at too much time left.
Code:
if (u.CurrentCastTimeLeft.TotalMilliseconds < 250)
{
// not worth interrupting at this point
return false;
}
It would be easy to modify this to only interrupt if there's 1 full second left. That would give everyone else time to interrupt before you, but not let it slide if it does need to be interrupted. You may need to play with the time there.
Code:
if (u.CurrentCastTimeLeft.TotalMilliseconds > 1000)
{
// give it some time before interrupting
return false;
}
Another option similar to this one would be to convert the begin time and end time to percentages and only interrupt when it hits X percentage. If the entire cast time is 1.5 seconds, you can get the start time, end time and total Milliseconds left (like above) and figure out the percentage of that total milliseconds, which means you won't interrupt too fast or too slow. That one is considerably more work though to make happen and honestly, not even sure that will work right.
All of my code above is Theoretical though, so I haven't actually tried it.