Mercurial > wow > wowdb-profiler
comparison Main.lua @ 330:267e7100407c WoD
Misc WoD fixes, including 'region' support, many WoD loot containers, and changed 1/0 flags to booleans. Also bumped TOC.
author | MMOSimca <MMOSimca@gmail.com> |
---|---|
date | Fri, 22 Aug 2014 03:45:27 -0400 |
parents | 84817627cb22 |
children | 5ef583564381 |
comparison
equal
deleted
inserted
replaced
329:84817627cb22 | 330:267e7100407c |
---|---|
215 | 215 |
216 if have_skillup then | 216 if have_skillup then |
217 _G.TradeSkillFrame.filterTbl.hasSkillUp = false | 217 _G.TradeSkillFrame.filterTbl.hasSkillUp = false |
218 _G.TradeSkillOnlyShowSkillUps(false) | 218 _G.TradeSkillOnlyShowSkillUps(false) |
219 end | 219 end |
220 _G.SetTradeSkillInvSlotFilter(0, 1, 1) | 220 _G.SetTradeSkillInvSlotFilter(0, true, true) |
221 _G.TradeSkillUpdateFilterBar() | 221 _G.TradeSkillUpdateFilterBar() |
222 _G.TradeSkillFrame_Update() | 222 _G.TradeSkillFrame_Update() |
223 | 223 |
224 -- Expand all headers so we can see all the recipes there are | 224 -- Expand all headers so we can see all the recipes there are |
225 for tradeskill_index = 1, _G.GetNumTradeSkills() do | 225 for tradeskill_index = 1, _G.GetNumTradeSkills() do |
290 return math.floor(copper_cost / modifier) | 290 return math.floor(copper_cost / modifier) |
291 end | 291 end |
292 end -- do-block | 292 end -- do-block |
293 | 293 |
294 | 294 |
295 -- constant for duplicate boss data; a dirty hack to get around world bosses that cannot be identified individually and cannot be linked on wowdb because they are not in a raid | 295 -- Constant for duplicate boss data; a dirty hack to get around world bosses that cannot be identified individually and cannot be linked on wowdb because they are not in a raid |
296 local DUPLICATE_WORLD_BOSS_IDS = { | 296 local DUPLICATE_WORLD_BOSS_IDS = { |
297 [71952] = { 71953, 71954, 71955, }, | 297 [71952] = { 71953, 71954, 71955, }, |
298 } | 298 } |
299 | 299 |
300 | 300 |
872 for entry in pairs(DATABASE_DEFAULTS.global) do | 872 for entry in pairs(DATABASE_DEFAULTS.global) do |
873 global_db[entry] = {} | 873 global_db[entry] = {} |
874 end | 874 end |
875 end | 875 end |
876 raw_db.build_num = build_num | 876 raw_db.build_num = build_num |
877 raw_db.region = private.region | |
877 raw_db.version = DB_VERSION | 878 raw_db.version = DB_VERSION |
878 | 879 |
879 private.InitializeCommentSystem() | 880 private.InitializeCommentSystem() |
880 self:RegisterChatCommand("comment", private.ProcessCommentCommand) | 881 self:RegisterChatCommand("comment", private.ProcessCommentCommand) |
881 end | 882 end |
989 local _, _, _, _, _, _, _, suffix_id, unique_id, _, upgrade_id, instance_difficulty_id, num_bonus_ids = (":"):split(item_string) | 990 local _, _, _, _, _, _, _, suffix_id, unique_id, _, upgrade_id, instance_difficulty_id, num_bonus_ids = (":"):split(item_string) |
990 local bonus_ids = {select(14, (":"):split(item_string))} | 991 local bonus_ids = {select(14, (":"):split(item_string))} |
991 upgrade_id = tonumber(upgrade_id) | 992 upgrade_id = tonumber(upgrade_id) |
992 instance_difficulty_id = tonumber(instance_difficulty_id) | 993 instance_difficulty_id = tonumber(instance_difficulty_id) |
993 num_bonus_ids = tonumber(num_bonus_ids) | 994 num_bonus_ids = tonumber(num_bonus_ids) |
995 suffix_id = tonumber(suffix_id) | |
994 if (not num_bonus_ids) or (num_bonus_ids == 0) then | 996 if (not num_bonus_ids) or (num_bonus_ids == 0) then |
995 if (suffix_id and suffix_id ~= 0) or (instance_difficulty_id and instance_difficulty_id ~= 0) then | 997 if (suffix_id and suffix_id ~= 0) or (instance_difficulty_id and instance_difficulty_id ~= 0) then |
996 item = DBEntry("items", item_id) | 998 item = DBEntry("items", item_id) |
997 item.unique_id = bit.band(unique_id, 0xFFFF) | 999 item.unique_id = bit.band(unique_id, 0xFFFF) |
998 if (suffix_id and suffix_id ~= 0) then | 1000 if (suffix_id and suffix_id ~= 0) then |
1011 if not item.bonus_ids then | 1013 if not item.bonus_ids then |
1012 item.bonus_ids = {} | 1014 item.bonus_ids = {} |
1013 end | 1015 end |
1014 | 1016 |
1015 for bonus_index = 1, num_bonus_ids do | 1017 for bonus_index = 1, num_bonus_ids do |
1016 item.bonus_ids[bonus_ids[bonus_index]] = true | 1018 item.bonus_ids[tonumber(bonus_ids[bonus_index])] = true |
1017 end | 1019 end |
1018 else | 1020 else |
1019 Debug("RecordItemData: Item_system is supposed to be 0 or positive, instead it was %s.", item_system) | 1021 Debug("RecordItemData: Item_system is supposed to be 0 or positive, instead it was %s.", item_system) |
1020 end | 1022 end |
1021 if upgrade_id and upgrade_id ~= 0 then | 1023 if upgrade_id and upgrade_id ~= 0 then |
2398 local available = _G.GetTrainerServiceTypeFilter("available") | 2400 local available = _G.GetTrainerServiceTypeFilter("available") |
2399 local unavailable = _G.GetTrainerServiceTypeFilter("unavailable") | 2401 local unavailable = _G.GetTrainerServiceTypeFilter("unavailable") |
2400 local used = _G.GetTrainerServiceTypeFilter("used") | 2402 local used = _G.GetTrainerServiceTypeFilter("used") |
2401 | 2403 |
2402 -- Clear the trainer filters | 2404 -- Clear the trainer filters |
2403 _G.SetTrainerServiceTypeFilter("available", 1) | 2405 _G.SetTrainerServiceTypeFilter("available", true) |
2404 _G.SetTrainerServiceTypeFilter("unavailable", 1) | 2406 _G.SetTrainerServiceTypeFilter("unavailable", true) |
2405 _G.SetTrainerServiceTypeFilter("used", 1) | 2407 _G.SetTrainerServiceTypeFilter("used", true) |
2406 | 2408 |
2407 for index = 1, _G.GetNumTrainerServices(), 1 do | 2409 for index = 1, _G.GetNumTrainerServices(), 1 do |
2408 local spell_name, rank_name, _, _, required_level = _G.GetTrainerServiceInfo(index) | 2410 local spell_name, rank_name, _, _, required_level = _G.GetTrainerServiceInfo(index) |
2409 | 2411 |
2410 if spell_name then | 2412 if spell_name then |
2432 profession_skills[spell_id] = ("%d:%d:%d"):format(required_level, min_skill, _G.GetTrainerServiceCost(index)) | 2434 profession_skills[spell_id] = ("%d:%d:%d"):format(required_level, min_skill, _G.GetTrainerServiceCost(index)) |
2433 end | 2435 end |
2434 end | 2436 end |
2435 end | 2437 end |
2436 -- Reset the filters to what they were before | 2438 -- Reset the filters to what they were before |
2437 _G.SetTrainerServiceTypeFilter("available", available or 0) | 2439 _G.SetTrainerServiceTypeFilter("available", available or false) |
2438 _G.SetTrainerServiceTypeFilter("unavailable", unavailable or 0) | 2440 _G.SetTrainerServiceTypeFilter("unavailable", unavailable or false) |
2439 _G.SetTrainerServiceTypeFilter("used", used or 0) | 2441 _G.SetTrainerServiceTypeFilter("used", used or false) |
2440 end | 2442 end |
2441 | 2443 |
2442 | 2444 |
2443 function WDP:UNIT_SPELLCAST_SENT(event_name, unit_id, spell_name, spell_rank, target_name, spell_line) | 2445 function WDP:UNIT_SPELLCAST_SENT(event_name, unit_id, spell_name, spell_rank, target_name, spell_line) |
2444 if private.tracked_line or unit_id ~= "player" then | 2446 if private.tracked_line or unit_id ~= "player" then |