WoW:API GetMasterLootCandidate: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API GetMasterLootCandidate to API GetMasterLootCandidate without leaving a redirect)
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<center>'''GetMasterLootCandidate''' ''-Documentation by [[User:Haarm|Haarm]]-''</center>
{{wowapi}} __NOTOC__
 
Returns the name of the player at the specified index, who would receive an item assigned by [[API GiveMasterLoot|GiveMasterLoot(slot, index)]] using the same index.
Returns the name of the player at the specified index, who would receive an item assigned by [[API GiveMasterLoot|GiveMasterLoot(slot, index)]] using the same index.


candidate = GetMasterLootCandidate(index);
candidate = GetMasterLootCandidate(slot, index);
 
== Parameters ==
=== Arguments ===
;slot
: The loot slot number of the item you want to get information about
 
:;index
:: The number of the player whose name you wish to return. Typically between 1 and 40. Can exceed the value of [[API GetNumRaidMembers|GetNumRaidMembers()]]


----
=== Returns ===
;''Arguments''


:;index : The number of the player whose name you wish to return. Typically between 1 and [[API GetNumRaidMembers|GetNumRaidMembers()]]
:;candidate
----
:: The name of the player at '''index'''.
;''Returns''


:;candidate : The name of the player at '''index'''.
== Example ==
----
  for li = 1, GetNumLootItems() do
;''Example''
  for ci = 1, 40 do
  for i = 1, GetNumRaidMembers() do
      if GetMasterLootCandidate(li, ci) then
  DEFAULT_CHAT_FRAME:AddMessage(i.." -> "..GetMasterLootCandidate(i))
       DEFAULT_CHAT_FRAME:AddMessage(ci.." -> "..GetMasterLootCandidate(li, ci))
     end
  end
  end
  end


;''Result''
Lists master loot candidates by index. - These are the people capable of receiving loot from the Master Looter. This function is only usable by the master looter.


Lists master loot candidates by index.
== See Also ==
----
;''See Also''


:* [[API GetNumRaidMembers|GetNumRaidMembers()]]
:* [[API GetNumRaidMembers|GetNumRaidMembers()]]
:* [[API GiveMasterLoot|GiveMasterLoot(slot, index)]]
:* [[API GiveMasterLoot|GiveMasterLoot(slot, index)]]
----
 
;''Features / Bugs''
== Notes ==
This appears not to work unless you are the master looter, and not until the list of candidates has been built by the system, which looks like after you first try and assign an item.
This appears not to work unless you are the master looter, and not until the list of candidates has been built by the system, which looks like after you first try and assign an item.


Line 33: Line 40:
-- [[User:Haarm|Haarm]]
-- [[User:Haarm|Haarm]]


[[Category:API Functions|GetMasterLootCandidate]]
This does not return consistent results from invocation to invocation. With a simple for loop over two members of a party, GetMasterLootCandidate(1) was not always the same member of the party. No PARTY_MEMBERS_CHANGED events fired, either.
[[Category:API Group Functions|GetMasterLootCandidate]]
-- [[User:Hazara_Khan|Hazara Khan]]
[[Category:API Loot Functions|GetMasterLootCandidate]]

Latest revision as of 04:46, 15 August 2023

WoW API < GetMasterLootCandidate

Returns the name of the player at the specified index, who would receive an item assigned by GiveMasterLoot(slot, index) using the same index.

candidate = GetMasterLootCandidate(slot, index);

Parameters[edit]

Arguments[edit]

slot
The loot slot number of the item you want to get information about
index
The number of the player whose name you wish to return. Typically between 1 and 40. Can exceed the value of GetNumRaidMembers()

Returns[edit]

candidate
The name of the player at index.

Example[edit]

for li = 1, GetNumLootItems() do
  for ci = 1, 40 do
     if GetMasterLootCandidate(li, ci) then 
       DEFAULT_CHAT_FRAME:AddMessage(ci.." -> "..GetMasterLootCandidate(li, ci))
     end
  end
end

Lists master loot candidates by index. - These are the people capable of receiving loot from the Master Looter. This function is only usable by the master looter.

See Also[edit]

Notes[edit]

This appears not to work unless you are the master looter, and not until the list of candidates has been built by the system, which looks like after you first try and assign an item.

Also if you were master looter of a group, and then join another group later and are not the master looter, it will return the names of candidates from your previous group. -- Haarm

This does not return consistent results from invocation to invocation. With a simple for loop over two members of a party, GetMasterLootCandidate(1) was not always the same member of the party. No PARTY_MEMBERS_CHANGED events fired, either. -- Hazara Khan