skadistats / clarity-examples

Example code for clarity
BSD 3-Clause "New" or "Revised" License
115 stars 38 forks source link

How to get buff/debuff information #23

Closed TodorovicF closed 8 years ago

TodorovicF commented 8 years ago

I'm looking through the clarity analyzer and I can't seem to find the correct property within CDOTA_UnitHero[heroname] to get the information of any buffs, such as Greevil's Greed or Arghanim's Scepter Synth. I've looked at other entities, but nothing looks like it has that information. Where is buff information stored for each character? Thanks a lot!

spheenik commented 8 years ago

This information is stored in the modifiers. There's some basic code for dumping those.

TodorovicF commented 8 years ago

Thanks a lot! I've taken a look at it and I can't seem to find any information about the buff name in the modifier data. Is it given somewhere else?

spheenik commented 8 years ago

There was a string table "ModifierNames" in Source 1. Chances are it's still there.

TodorovicF commented 8 years ago

Thank you, that's exactly what I need!

TodorovicF commented 8 years ago

I forgot to add, for Rune use like Bounty rune, where there is not visible buff when the rune is used, how can I get the moment a rune is consumed, like when it shows up in the chat log?

spheenik commented 8 years ago

This is tough. You could listen for @OnEntityDeleted and check if it was a bounty rune. If it was, you have to find the entity that took it. For that, you could use Overhead-events (special usermessage iirc, that get's emitted each time the little + gold animation gets played. Or you can check gold of heros, correlate with the heros position, and find the most probable one...

TodorovicF commented 8 years ago

Haha, I had a feeling it wasn't going to be simple. Thanks for the tips!