View Single Post
04-28-08, 02:39 PM   #3
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
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...
  Reply With Quote