Manasurge
=========

summary
-------
Manasurge is an addon that handles weapon switching depending on
spellsurge procs.

features
--------
- support for 2h/1h+oh combos
- tries to avoid triggering GCD on switch
- can be set to be active only inside instances
- can be set to autoequip spellsurge enchanted weapon on start of fight
- cancels any equipping if the weapon slot becomes empty during fight
(in order not to interfere with addons like ClosetGnome_OhNoes)

description
-----------
Two sets of weapon+offhand items has to be set. One is the normal set which
contains a weapon without spellsurge. The second is the spellsurge set
containing a weapon enchanted with spellsurge. The offhand slot does not
have to be set and in that case is not switched (that is the case when u
have two one handed weapons for switching). Setting the offhand slot is
usefull when one of the sets contains a two-handed weapon and the other
contains a one-handed weapon and an offhand.

Once Manasurge detects a proc of spellsurge that belongs to the player
it switches to the normal set (does not have to happen instantly, more
on that later) and schedules a re-equipment of the spellsurge set once
the cooldown on the spellsurge enchant runs out.

Because of the nature the spellsurge buff is presented it is not 100%
possible to determine the player that the proc initiated in a setup
where multiple group members have the spellsurge enchant. Manasurge
tries to 'guess' if a spellsurge proc belongs to the player by checking
multiple conditions. First the player has to have a weapon enchanted
with spellsurge equipped at the time. Second the players spellsurge has
to be out of cooldown and third, the proc has to occur within a set time
limit after the last spellcast that could trigger it. This limit is
calculated by adding a base threshold value to the current latency,
making it less likely to get a false guess on a high latency connection.

Another feature of manasurge is that it tries to avoid triggering a
global cooldown on the weapon switch by deferring the actual weapon
swap to the next spellcast (if a weapon is switched during a spellcast
it does not trigger a GCD). A time limit can be set to how long it waits
before forcing the switch.

usage
-----
- example setting weapon sets with two one-handed weapons:
/ms sets normal hm [itemlink]
/ms sets ss mh [itemlink]

- example setting weapon sets with one two-handed and one one-handed weapon:
/ms sets normal hm [itemlink]
/ms sets normal oh [itemlink]
/ms sets ss mh [itemlink]

- other options:
(toggle the 'only-in-instance' flag)
/ms instance
(set the max time to wait for a weapon switch in seconds)
/ms maxwait 10
