icbat / broker-call-to-arms

A Data Broker add-on for World of Warcraft that lists which Group Finder activities are offering extra rewards right now
MIT License
0 stars 0 forks source link

Note which LFR raids you've already received loot #3

Closed icbat closed 2 months ago

icbat commented 8 years ago

It's possible you still want to run them for just the money, but can be helpful when gearing up a new char to not waste time with stuff you won't be getting gear for

icbat commented 4 years ago

Started on this and didn't like the rabbit hole I was going down. From what I can tell, you need to:

  1. Iterate over 1 -> GetNumSavedInstances() (my char had 50)
  2. GetSavedInstanceInfo(index) to get the number of encounters total in the raid (after filtering to just LFR saves)
  3. GetSavedInstanceEncounterInfo(instanceIndex, encounterIndex) to see what all you've actually killed (above step only gives you X out of Y)
  4. Collate that back to what I can only guess is a hard-coded map of bosses -> raid instance

There might be some more helpful methods that I'm not aware of, but right now that all sounds like a lot, particularly the map of boss -> LFR chunk.

icbat commented 2 months ago

Kind of looks like:


function [LFGRewardsFrameEncounterList_OnEnter](https://www.townlong-yak.com/framexml/beta/go/LFGRewardsFrameEncounterList_OnEnter)(self)
    local dungeonID = self.dungeonID;
    local numEncounters, numCompleted = GetLFGDungeonNumEncounters(dungeonID);
    if ( numCompleted > 0 ) then
        [GameTooltip](https://www.townlong-yak.com/framexml/beta/go/GameTooltip):SetOwner(self, "ANCHOR_RIGHT");
        [GameTooltip](https://www.townlong-yak.com/framexml/beta/go/GameTooltip):AddLine(string.format(ERR_LOOT_GONE, numCompleted, numEncounters), HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
        for i=1, numEncounters do
            local bossName, _, isKilled = GetLFGDungeonEncounterInfo(dungeonID, i);
            if ( isKilled ) then
                [GameTooltip](https://www.townlong-yak.com/framexml/beta/go/GameTooltip):AddLine(bossName, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
            else
                [GameTooltip](https://www.townlong-yak.com/framexml/beta/go/GameTooltip):AddLine(bossName, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
            end
        end
        [GameTooltip](https://www.townlong-yak.com/framexml/beta/go/GameTooltip):Show();
    end
end

from https://www.townlong-yak.com/framexml/beta/Blizzard_GroupFinder/LFGFrame.lua