Yah, I think that looks good for totems which result in buff per hit. For completeness, you should probably add a multiplication with proc. chance also, for totems like stonebreaker which are not 100%. So:
averageTotemBonus = totemBonus * period * procChance * AttacksPerSecond.
And then hopefully there is a way in Rawr to define an item's properties such that we can get the above values. It might need a large switch/case though.
For the other issue of windfury, I was thinking yesterday about how the number of windfury hits could be modeled and this is what I came up with. There are a couple of points that I have not figured out entirely how to model, so this is an approximation.
For one weapon with WF (this is the easy case):
The problem is that when WF procs, if your weapon speed is bellow the WF cooldown (assuming 3 seconds) then you lose one or more hits that can not proc WF. So I hit and WF procs, 2.5s later I hit again - this can not proc WF, 5s later I hit again and I can proc WF.
So the formula should be something like:
(normal hits * WFProcRate) / (normal hits * (1 + WFProcRate))
where WFProcRate is 0.2 for base or 0.22 for glyphed.
This assumes that the weapon speed (hasted) is between 1.5 and 3.0. If it's lower than 1.5 but above 1.0 you lose 2 hits, so we get:
(normal hits * WFProcRate) / (normal hits * (1 + 2*WFProcRate))
So I guess even that part could be computed as:
(normal hits * WFProcRate) / (normal hits * (1 + FLOOR[3.0 / weapon speed] * WFProcRate))
Now the dual wield with WFs is tricky especially if weapons are not matched. Assuming matched weapons, we have 20% chance per weapon. So say in 100 hits with each weapon, we'd get 40 WF hits. However each of those results in 2 hits where we can not proc WF (weapon between 1.5 and 3.0). But in half of those cases, when the MH weapon procs, the OH can not proc (assuming MH gets priority). So what we have is: 40 / (200 - 2*40 - (20 / 2)) which is the 36.36% we see for hits which can proc. WF.
Modeling this would result in something like:
(normalHitsMH * WFProcRate) / (normalHitsMH * (1 + (FLOOR[3.0 / weaponSpeedMH] + FLOOR[3.0 / weaponSpeedOH] + 1)*WFProcRate))
For main hand we lose 1 or more MH hits, 1 or more OH hits plus one OH hit since MH proced. For Oh we get:
(normalHitsOH * WFProcRate) / (normalHitsOH * (1 + (FLOOR[3.0 / weaponSpeedMH] + FLOOR[3.0 / weaponSpeedOH])*WFProcRate))
For OH we do not lose that extra hit, since the MH's chance to proc WF already passed.
When we have off synced weapons, we need to calculate normalHitsOH and normalHitsMH such that we have a common base. I think this can be done as:
normalHitsMH = offHandSpeed and normalHitsOH = mainHandSpeed. But then the model needs to be divided by:
offHandSpeed * mainHandSpeed to get a common 1s base.
Where this model fails:
1. For unsynced weapons there will be cases where you lose 2 OH or 2 MH hits while WF is on CD due to the other weapon's proc.
2. Haste effects like bloodlust, furry, etc. can result in times when a 1WF loss results in a 2WF loss, if your weapon speed passes that threshold.