I've made a few changes to this (I hope you don't mind), primarily because I wanted to tie it in with the SoF rest state indicator that I found the opcode for, because I wanted it to work a bit more like live currently does, and to make it a bit more efficient.
Functionally, the changes are:
* Default RestRegenPercent to 0
* RestRegenTimeToActivate now specified in seconds rather than milliseconds. (This is because I needed to convert it to seconds for the SoF packet).
* Client must be sitting and not have a detrimental spell on them for rest state regen to kick-in.
* SoF clients get the combat/rest symbol and timer. Still works in Titanium, but with no indicators.
Codewise, rather than checking in every call to Client::Process whether the client has aggro, I added a 'HaveAggro' member to the client class which is set true whenever the client gets added to a mob's hate list.
When a mob's hate list is wiped (dies or is memblurred), then any client on that mob's hate checks to see if it has aggro from any other mob, and if not, starts the rest state timer.
I'll commit it later on today. Thanks for the contribution.
|