View Single Post
07-17-16, 07:38 PM   #8
Kith
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 9
Originally Posted by kokomala View Post
Anything that is is displayed to the totem frame can be obtained with the totem API and events.

Pseudo code.
Code:
OnEvent(self, event, ...)
   if ( event == "PLAYER_TOTEM_UPDATE" ) then
      local slot = ...;
      local haveTotem, name, startTime, duration, icon = GetTotemInfo(slot)
  
      -- do stuff

   end
end
This API is also used for Death Knights and Druids.

http://wowprogramming.com/docs/api/GetTotemInfo
I'm not sure whether its a bug in beta right now (or how its always been), but while working on the 'special cases' for my aura tracking mod, I found that the Serpent Statue (Mistweaver) triggers TOTEM_UPDATE but the info given by GetTotemInfo refers to the totem itself which doesn't return a valid spellID via GetSpellInfo(<namegiven>). May want to just check whether this is a one off (i'm intending to trial a few) or something that would need to be handled case-by-case.

Edit: Just to follow up, the TOTEM event now fires on several classes for different things that i've played with

Warlock (Demonology): The Wild Imps and the Dreadstalkers both trigger the event but return nothing for GetTotemInfo (i'm faking it by watching the SPELL_SUMMON event in the combat log)

Monk (Mistweaver): The Jade Serpent Statue works the same as Warlocks

Druid (Restoration): Efflorescence is the same

Shaman (Restoration): While they give the proper GetTotemInfo returns, if you take Echo which allows 2 charges of Healing Stream Totem, both have the same spellID and thus need to be handled specially (if using spellID as an indentifier)

Last edited by Kith : 07-18-16 at 03:15 AM.