vendethiel / GladiusEx

13 stars 19 forks source link

Fix spell cast detection #5

Closed vendethiel closed 6 years ago

vendethiel commented 6 years ago

Scenario:

I am casting a Greater Heal I cast binding Greater Heal before the GCD is over The client receives a UI_ERROR_MESSAGE (54) then the client receives a UNIT_SPELLCAST_FAILED

both the alerts and the castbar modules think that the spell currently casted failed, and stop showing the current alert/cast.

vendethiel commented 6 years ago

Implemented using castID/lineID. Soon :tm: to be pused.

vendethiel commented 6 years ago
[12:04 AM] Resike: blizz changed some stuff tho
[12:05 AM] Resike: instead of incrementing a single number as lineID now every cast has it's own unique guid
[12:06 AM] Resike: channels are not 0 now but 0-000-000-000-000 etc(edited)
[12:11 AM] Resike: but i havn't checked the events in arenas they could be working different with different bugs
[12:12 AM] Resike: i reported mutiple cast relates issues to blizz but i would be surprised if they fixed them
[12:18 AM] Resike: Here this is a cast event, still returns channel GUID, broken as before, just instead of 0, its a GUID filled with zeros: https://i.imgur.com/kt2GcVR.png
[12:19 AM] Resike: And Hearthstone is surely not a channel cast
vendethiel commented 6 years ago

This isn't really fixed. At the beginning of the arena, it shows all druids casting a regrowth. Sometimes an alert won't stop showing after a cast was stopped (I think it happens when a cast stops because of a CC landed?).

vendethiel commented 6 years ago

@slaren the alerts module uses "cast_" .. spell. But it seems to me like one unit can only be casting a single spell at a time, right..?

slaren commented 6 years ago

I am not sure if I understand the question. To solve the problem, I guess you could try making the IDs of casting alerts based on the lineID rather than on the name of the spells. For example, something like "cast" .. lineID. The "cast" is there to differentiate it from other types of alerts.

vendethiel commented 6 years ago

I just mean -- keeping only "cast" here. so that if I receive a UNIT_SPELLCAST_SUCCEEDED, I cancel all alerts

slaren commented 6 years ago

Isn't that the opposite of the problem that you are trying to solve ? That alerts get cancelled when a UNIT_SPELLCAST_FAILED is received, even if it refers to a different cast ?

vendethiel commented 6 years ago

no, I solved that problem with line ids. Now I'm stuck with another problem...

Some casts never get a _FAILED or _SUCCEEDED, for some NPCs, vehicles or phased casts...

slaren commented 6 years ago

In that case, I don't know the details of what events are generated in what cases so I can't really help you with that, sorry.

vendethiel commented 6 years ago

I just wonder why the cast name is included, but I guess I can remove it. I'll keep the spellID for _FAILED

vendethiel commented 6 years ago

that means:

receive a _START: store line id add alert "cast" if spell is "wanted"

receive a _SUCCEEDED: disrecard spellID clear alert "cast"

receive a _FAILED: check line id

vendethiel commented 6 years ago

I already updated the cast bar to use a different technique: in the OnUpdate, if GetTime() > cast end time, mark it succeeded.

Let's see how far we go with these hacks...