# HG changeset patch # User James D. Callahan III # Date 1346088089 18000 # Node ID 2ab6c802b4856647273680e69634a679550064c4 # Parent 9be5fc389c131304be72cfcaa62aa8fb0b6662db Record required quest completions for item purchase. diff -r 9be5fc389c13 -r 2ab6c802b485 Main.lua --- a/Main.lua Mon Aug 27 11:20:05 2012 -0500 +++ b/Main.lua Mon Aug 27 12:21:29 2012 -0500 @@ -1010,6 +1010,8 @@ } local ITEM_REQ_REPUTATION_MATCH = "Requires (.-) %- (.*)" + local ITEM_REQ_QUEST_MATCH1 = "Requires: .*" + local ITEM_REQ_QUEST_MATCH2 = "Must have completed: .*" function WDP:UpdateMerchantItems(event) local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target")) @@ -1053,6 +1055,21 @@ end end + for line_index = 1, num_lines do + local current_line = _G["WDPDatamineTTTextLeft" .. line_index] + + if not current_line then + break + end + local line_text = current_line:GetText() + local quest_name = line_text:match(ITEM_REQ_QUEST_MATCH1) or line_text:match(ITEM_REQ_QUEST_MATCH2) + + if quest_name then + DBEntry("items", item_id).req_quest = ("%s"):format(quest_name:gsub("(.+): ", ""), quest_name) + break + end + end + if extended_cost then local battleground_rating = 0 local personal_rating = 0