namreeb / nampower

Dramatically increase cast efficiency on the 1.12.1 client!
Other
90 stars 18 forks source link

Bug fixes #24

Closed jimmytaker closed 1 year ago

jimmytaker commented 1 year ago

I found the following 5 issues when using the master version of nampower:

  1. The cast animations never working.
  2. Sometimes the spell interrupt by walking did not register properly and as such after taking a step you could not start casting until the cast time of the interrupted spell passed.
  3. HealComm did not register the casts
  4. QuickHeal did not work
  5. "Create All" for items such as bandages would break after the 1st item is created.

To fix point 1 I disabled the "SendCast" hook. This hook seems to be only necessary for aoe spells (such as blizzard - with the green marker on the ground). Now the animations usually play as expected. They still do not play right if the cast is started before the ACK from the server for finishing the previous cast has arrived. I think to fix this we could try calling "interruptSpell" instead of "cancelSpell". However, the address of "interruptSpell" is not listed in "Offsets" and I do not feel like disassembling WoW.exe at this point in time. The author of nampower probably already has a nicely formatted disassembly and will find the address much faster than I.

I also enabled CastSpellHook to act on cursorMode == 2 - this is necessary for click casting.

To fix point 2 I added handling of SPELLCAST_INTERRUPTED event in the eventhandler setting cooldown to 0.

To fix point 3 I disabled the patch for CreateCastbar and the manual sending of SPELLCAST_START event right after calling castSpell; and allow the notification from the server to trigger the castbar. This visually delays the appearance of the castbar by the ping time. It does not alter the main purpose of this mod however - the actual casting time is still "patched". This is necessary, because HealComm sets up on a hook over CastSpell and triggers on a event filter over SPELLCAST_START. Having the manual signalEvent(SPELLCAST_START) call results in HealComm receiving SPELLCAST_START before CastSpell and as such cannot display anything because it does not yet know which spell this "START" is for.

To fix point 4 - QuickHeal works by sending a "CastSpell" immediately followed by "CancelSpell" with parameter notifyServer = true. The internal cooldown tracking of nampower only got reset when receiving (SPELLCAST_FAILED && !gNotifyServer). I simplified the condition to not be affected by the state of gNotifyServer. I am not aware of any adverse effects this might cause anywhere nor am I aware why this was there in the first place. Caution is advised here.

To fix poing 5 - I added and exclusion to handling spells with effect SPELL_EFFECT_CREATE_ITEM.

Mosch0512 commented 1 year ago

any updates on this i have testet @jimmytaker changes seams to be working just fine.

namreeb commented 1 year ago

I've avoided merging this because I keep wanting to test it myself, but I am now admitting that I will never get to that. Merging. Thanks for the contribution!

WuVenus commented 10 months ago

After casting mount or mining or most cast actions with a yellow cast bar really, I consistently find that the bar does not go away but remains at 100% cast. You can force the bar to disappear by casting another spell or changing stances, etc.