The author of Outfitter and I are trying to design a script that can automatically switch weapons based on whether or not one is in the 5 second rule.
Yes, I know this incurs a global cooldown.
Previously, we'd been using the event PLAYER_REGEN_DISABLED, but that is health regen, not mana. Is there a similar API call that uses mana regen, and fires when you're inside and outside the 5sr?
I don't think this thread is in the right forum. I had a quick look in PittBull_Spark and it registers UNIT_MANA and UNIT_SPELLCAST_SUCCEEDED and bassicly checks if mana was used after a succesfull spellcast. And then counts for 5 seconds. That should work for your purpose aswell.
Sorry if I derail a bit, but when exactly do the mana regeneration ticks happen?
Is it like energy for rogues, who get their energy ticks on a global timer?
(I.e. if you cast a spell that costs mana, you get your first tick 5-7s after your cast, depending on when your cast happens in the gloal timer.)
Or is it on a timer that ticks after spending mana?
(I.e. after you cast your spell, you always get your next tick of mana 7s (or 5s) after your cast, indepependant of exact timing.)
I'm still trying to figure that one out for evocation and weapon swapping.
Edit: Thanks for the replies that it's a global timer when all your mana regens ticks.
"The 5 second rule states that 5 seconds after your last spell cast you normally do not regenerate mana from spirit.
However, you do regenerate mana from mana every 5 second gear(mp5) and you can regenerate a reduced amount from spirit in the forum of talents, buffs (mage armor), and/or trinkets like Bangle of Endless Blessings.
In game, blizzard describes inside the 5 second rule as "while casting" and outside of the 5 second rule as "while not casting."
Sorry if I derail a bit, but when exactly do the mana regeneration ticks happen?
Is it like energy for rogues, who get their energy ticks on a global timer?
(I.e. if you cast a spell that costs mana, you get your first tick 5-7s after your cast, depending on when your cast happens in the gloal timer.)
Or is it on a timer that ticks after spending mana?
(I.e. after you cast your spell, you always get your next tick of mana 7s (or 5s) after your cast, indepependant of exact timing.)
I'm still trying to figure that one out for evocation and weapon swapping.
I'm pretty sure it behaves just like the regular energy ticks that rogues deal with. I'm not sure how often the energy ticks are, but for mana they happen every 2.5 seconds, which can easily be seen if you use Scrolling Combat Text and enable it to show all power gains(you'll see roughly half the mp5 listed on your character screen pop up every 2.5 seconds)
Regen ticks are every 2 seconds. Also confirmed ... somewhat, by having in combat regen % and seeing what the char screen says for your class regen formula. And as far as I saw from my druid it's a global tick, like energy.
I do not think you can automatically change the weapon, to be honest with you I think making a plugin which adds the 5 second rule to SCT would be something you can look for, though I could be wrong and it is possible, considering Wardrobe 2 looks for the combat flag to drop before switching items if you try midcombat
Currently, we're writing a script using Chronos's timers and the UNIT_MANA event that should accomplish what we're looking for. I'm testing it tonight, and will provide updates tomorrow.
I do believe you can change your gear based on events.. I think there is a closetgnome_Bigwigs that does this.
Quartz and pitbull both have global cooldown display, and a mod like regenFu (or naboo5sec), have good 5SR counters..
It's probably feasible to borrow code from a few of these to accomplish what you want.
I was stupid yesterday. Closetgnome_Switcher actually changes gear out on events, like evocate..... You might want to try and use this as a base mod, borrowing most of the code, and just changing the 'trigger'.
I wrote some early 5sr mods. IIRC, the only way to know if 5sr begins is when UNIT_MANA ("player") goes down at the same time as a SPELL_STOP_CASTING. IIRC, he only other check you have to do is for channeling--regen disabled the entire channel time. I can't remember if it resumes immediately after channel ends (assuming you channeled 5+ seconds) or if it tacks on another 5 sec at the end.
I'm still trying to figure that one out for evocation and weapon swapping.
Don't bother for evocation, it's an even number of channeled seconds, so regardless of when you start you get the same number of ticks with the buff up.
Something like innervate or the Bangle, however, there is a small timing issue to maximize it. It makes me wonder, is everyone on the same global tick, or is it player specific? ie can a druid time innervating a priest with their own regen tick?
I'll add a bit of info: the Pitbull power bar is for lack of better words, wrong. It's mainly a guide to help along. Spirit (and Energy) tick every 2 seconds:
0:00 Spirit tick. Oh shit tank needs a heal.
0:01 Start casting a 1.5 second spell.
0:02 Spirit tick. Still casting.
0:03 Spell finishes casting at 2.5 seconds.
0:04 Spirit tick but no gain due to 5sr.
0:05 Nothing.
0:06 Spirit tick but no gain due to 5sr.
0:07 Nothing.
0:08 Spirit tick outside of 5sr.
0:09 Nothing.
0:10 Spirit tick outside of 5sr.
Basically the heal casted at 2.5 seconds will put you inside the 5sr until the 8 seconds mark, not the 7.5 second. What would be really helpful is a mod that tracks every spirit tick (kinda like energy watch mods) and tracks the time of the last spell that landed the caster inside the 5sr until the next full spirit tick.
Edit: For the disbelievers, simply play a Warlock and use Life Drain. You'll see that it sometimes takes "a while" to get the first spirit tick after the spell finishes.
Theorycrafting procedures per role:
DPS = Theory -> Spreadsheet -> Practice
Healing = Theory -> Practice -> Logs
Tanking = Theory -> Theory -> Theory
You can indeed swap weapons on an event, mods can change your weapons any time (but not the rest of your gear in combat).
I'm not sure what the exact goal of the OP is, but feel free to check out CasterWeaponSwapper. This mod swaps weapons based on mana levels, in addition to Evocation/Innervate/etc. I don't watch for 5sr ticks, but I did find a way to only swap weapons as you are casting a spell, which means you piggyback the global cooldown and don't have to interrupt the player, which is nice.
What would be really helpful is a mod that tracks every spirit tick (kinda like energy watch mods) and tracks the time of the last spell that landed the caster inside the 5sr until the next full spirit tick.
I spent quite a bit of my time attempting to create such a mod. The big problem was that the mana ticks aren't actually evenly spaced out. I discovered this while trying to predict ticks. Then there is the whole presentation of this data... how would you make a meaningful visual that doesn't clutter up the screen?
Hmmm, upon looking at the code, RegenFu, NabuFiveSec, and the new Outfitter code all seem to only track 5 seconds after the player's mana decreases. It seems this would be inaccurate regarding long channeling spells, as well as mana burn effects. Does anyone know if a 5-sec mod that ccounts for these?
Hmmm, upon looking at the code, RegenFu, NabuFiveSec, and the new Outfitter code all seem to only track 5 seconds after the player's mana decreases. It seems this would be inaccurate regarding long channeling spells, as well as mana burn effects. Does anyone know if a 5-sec mod that ccounts for these?
Channeling 5SR starts counting from start of channel; you're held in 5SR until you exit channel, but if channel > 5s, you exit 5SR immediately after end of channel.
Melador> Incidentally, these last few pages are why people hate lawyers.
Viator> I really don't want to go all Kalman here.
Bury> Just imagine what the world would be like if you used your powers for good.