Just curious if anyone off hand knows how to determine if a totem was cast by the player or not.
Right now I'm registering for the COMBAT_LOG_EVENT_UNFILTERED command to do some processing when a grounding totem is destroyed.
I'm able to easily use the "eventType" and "destName" variables passed in to determine if damage was dealt to a Grounding Totem. The only problem is if there are multiple Grounding Totems out there, (eg. I cast one, an enemy casts one, and another friendly Shaman casts one), I am unable to determine if the totem was mine or not.
I'm sure I'm supposed to use the destFlags variable, but I'm no pro at understanding how this variable is constructed.
That method might work to get the immediate owner of a totem, but I would recommend caching it instead right away when the totem is created. The reason for this is you may later wish to get the owner of an elemental, but elementals are treated as being owned by the spawning totem, not the owner of that totem.
So when a totem is planted, you should add it to a table like:
totems[srcGUID] = PlayerGUID (or PlayerName if you prefer)
Then when an elemental is spawned from a totem, you can simply do this:
elemental[destGUID] = totems[srcGUID]
Which should technically link that specific elemental to the owner of the totem that spawned it...