Mercurial > wow > wowdb-profiler
changeset 87:2ab6c802b485
Record required quest completions for item purchase.
author | James D. Callahan III <jcallahan@curse.com> |
---|---|
date | Mon, 27 Aug 2012 12:21:29 -0500 |
parents | 9be5fc389c13 |
children | 5da0e8da22de |
files | Main.lua |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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