Mercurial > wow > wowdb-profiler
comparison Main.lua @ 53:052c4075df13
Store any required point type, not just Conquest.
author | James D. Callahan III <jcallahan@curse.com> |
---|---|
date | Thu, 28 Jun 2012 15:57:57 -0500 |
parents | 2bfdce67c71e |
children | 2b5a2d60dd51 |
comparison
equal
deleted
inserted
replaced
52:2bfdce67c71e | 53:052c4075df13 |
---|---|
905 | 905 |
906 if item_id and item_id > 0 then | 906 if item_id and item_id > 0 then |
907 local price_string = ActualCopperCost(copper_price, merchant_standing) | 907 local price_string = ActualCopperCost(copper_price, merchant_standing) |
908 | 908 |
909 if extended_cost then | 909 if extended_cost then |
910 local bg_points = 0 | 910 local battleground_rating = 0 |
911 local personal_points = 0 | 911 local personal_rating = 0 |
912 local required_conquest | 912 local required_season_amount |
913 | 913 |
914 DatamineTT:ClearLines() | 914 DatamineTT:ClearLines() |
915 DatamineTT:SetMerchantItem(item_index) | 915 DatamineTT:SetMerchantItem(item_index) |
916 | 916 |
917 for line_index = 1, DatamineTT:NumLines() do | 917 for line_index = 1, DatamineTT:NumLines() do |
918 local current_line = _G["WDPDatamineTTTextLeft" .. line_index] | 918 local current_line = _G["WDPDatamineTTTextLeft" .. line_index] |
919 | 919 |
920 if not current_line then | 920 if not current_line then |
921 break | 921 break |
922 end | 922 end |
923 required_conquest = current_line:GetText():match("Requires earning a total of (%d+)\nConquest Points for the season.") | 923 local breakout |
924 required_season_amount = current_line:GetText():match("Requires earning a total of (%d+)\n(.-) for the season.") | |
924 | 925 |
925 for match_index = 1, #POINT_MATCH_PATTERNS do | 926 for match_index = 1, #POINT_MATCH_PATTERNS do |
926 local match1, match2 = current_line:GetText():match(POINT_MATCH_PATTERNS[match_index]) | 927 local match1, match2 = current_line:GetText():match(POINT_MATCH_PATTERNS[match_index]) |
927 personal_points = personal_points + (match1 or 0) | 928 personal_rating = personal_rating + (match1 or 0) |
928 bg_points = bg_points + (match2 or 0) | 929 battleground_rating = battleground_rating + (match2 or 0) |
929 | 930 |
930 if match1 or match2 then | 931 if match1 or match2 then |
931 break | 932 break |
932 end | 933 end |
933 end | 934 end |
934 end | 935 end |
935 local currency_list = {} | 936 local currency_list = {} |
936 local item_count = _G.GetMerchantItemCostInfo(item_index) | 937 local item_count = _G.GetMerchantItemCostInfo(item_index) |
937 | 938 |
938 -- Keeping this around in case Blizzard makes the two points diverge at some point. | 939 -- Keeping this around in case Blizzard makes the two points diverge at some point. |
939 -- price_string = ("%s:%s:%s:%s"):format(price_string, bg_points, personal_points, required_conquest or 0) | 940 -- price_string = ("%s:%s:%s:%s"):format(price_string, battleground_rating, personal_rating, required_season_amount or 0) |
940 price_string = ("%s:%s:%s"):format(price_string, personal_points, required_conquest or 0) | 941 price_string = ("%s:%s:%s"):format(price_string, personal_rating, required_season_amount or 0) |
941 | 942 |
942 for cost_index = 1, item_count do | 943 for cost_index = 1, item_count do |
943 local icon_texture, amount_required, currency_link = _G.GetMerchantItemCostItem(item_index, cost_index) | 944 local icon_texture, amount_required, currency_link = _G.GetMerchantItemCostItem(item_index, cost_index) |
944 local currency_id = currency_link and ItemLinkToID(currency_link) or nil | 945 local currency_id = currency_link and ItemLinkToID(currency_link) or nil |
945 | 946 |