Thread Tools Display Modes
04-18-18, 02:21 PM   #1
Zigrief
A Kobold Labourer
Join Date: Apr 2018
Posts: 1
How to retrieve the name of the player who took the healstone ?

Hi,

I can't manage to find an event or function to get the name of the player who took a healstone in the soulwell...

I need to know who does have a healstone and who doesn't, is that even possible ?

My idea was to create an array with all the party members's name and changing it everytime someone take a healstone from the soulwell, and then be able to print who doesn't take one.

So far i have this :

Lua Code:
  1. -- SPELL ID
  2.  
  3. -- Puit des âmes
  4. local soulwellID = 29893
  5.  
  6. local soulstoneID = 6201
  7.  
  8.  
  9.  
  10. local onSoulwellCasted = CreateFrame("Frame")
  11. onSoulwellCasted:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  12. onSoulwellCasted:SetScript("OnEvent",
  13.  
  14.   function(self, event, ...)
  15.  
  16.     local caster, spellName, spellRank, spellLineID, spellID = ...
  17.  
  18.     if(spellID == soulwellID) then
  19.         SendChatMessage("Puits des âmes à mes pieds !" , "YELL", nil, -1);
  20.     end
  21.  
  22.   end)
  23.  
  24.   local onSoulstoneTaken = CreateFrame("Frame")
  25.   onSoulstoneTaken:RegisterEvent("CHAT_MSG_LOOT")
  26.   onSoulstoneTaken:SetScript("OnEvent",
  27.  
  28.     function(self, event, ...)
  29.  
  30.       local chatMsg, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, chatLineID = ...
  31.  
  32.       if string.match(chatMsg, "Pierre de soins") then
  33.         --SendChatMessage("Someone took a healstone !" , "YELL", nil, -1);
  34.         message(chatLineID)
  35.       end
  36.  
  37.     end)

Thanks in advance

EDIT : Ok i used /eventtrace and figured out the wiki lied to me Thanks anyway

EDIT 2 : Now i struggle to get a list of all party members... any idea?

Last edited by Zigrief : 04-18-18 at 03:27 PM.
  Reply With Quote
04-18-18, 04:13 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 309
Code:
if IsInRaid() then

   for i = 1, GetNumGroupMembers() do

      if (UnitName("raid"..i)) then

         print((UnitName("raid"..i)))

      end

   end

elseif IsInGroup() then

   for i = 1, 4 do

      if (UnitName("party"..i)) then

         print((UnitName("party"..i)))

      end

   end

end
__________________
AddOns: Tim @ WoWInterface
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to retrieve the name of the player who took the healstone ?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off