Mercurial > wow > wowdb-profiler
comparison Main.lua @ 338:9b683a560ed3 WoD
Fixed select replacement for bonus_ids. Fixed references to moved constants.
author | MMOSimca <MMOSimca@gmail.com> |
---|---|
date | Sat, 06 Sep 2014 02:57:57 -0400 |
parents | 48f7f671fc77 |
children | e4abf4f04db3 |
comparison
equal
deleted
inserted
replaced
337:48f7f671fc77 | 338:9b683a560ed3 |
---|---|
982 local function RecordItemData(item_id, item_link, durability) | 982 local function RecordItemData(item_id, item_link, durability) |
983 local _, _, item_string = item_link:find("^|%x+|H(.+)|h%[.+%]") | 983 local _, _, item_string = item_link:find("^|%x+|H(.+)|h%[.+%]") |
984 local item | 984 local item |
985 | 985 |
986 if item_string then | 986 if item_string then |
987 local _, _, _, _, _, _, _, suffix_id, unique_id, _, upgrade_id, instance_difficulty_id, num_bonus_ids = (":"):split(item_string) | 987 local item_results = { (":"):split(item_string) } |
988 local _, _, _, _, _, _, _, _, _, _, _, _, _, bonus_ids = (":"):split(item_string) | 988 |
989 | 989 local suffix_id = tonumber(item_results[8]) |
990 upgrade_id = tonumber(upgrade_id) | 990 local unique_id = item_results[9] |
991 instance_difficulty_id = tonumber(instance_difficulty_id) | 991 local upgrade_id = tonumber(item_results[11]) |
992 num_bonus_ids = tonumber(num_bonus_ids) | 992 local instance_difficulty_id = tonumber(item_results[12]) |
993 suffix_id = tonumber(suffix_id) | 993 local num_bonus_ids = tonumber(item_results[13]) |
994 | 994 |
995 if not num_bonus_ids or num_bonus_ids == 0 then | 995 if not num_bonus_ids or num_bonus_ids == 0 then |
996 if (suffix_id and suffix_id ~= 0) or (instance_difficulty_id and instance_difficulty_id ~= 0) then | 996 if (suffix_id and suffix_id ~= 0) or (instance_difficulty_id and instance_difficulty_id ~= 0) then |
997 item = DBEntry("items", item_id) | 997 item = DBEntry("items", item_id) |
998 item.unique_id = bit.band(unique_id, 0xFFFF) | 998 item.unique_id = bit.band(unique_id, 0xFFFF) |
1012 item.instance_difficulty_id = instance_difficulty_id | 1012 item.instance_difficulty_id = instance_difficulty_id |
1013 | 1013 |
1014 if not item.bonus_ids then | 1014 if not item.bonus_ids then |
1015 item.bonus_ids = {} | 1015 item.bonus_ids = {} |
1016 end | 1016 end |
1017 | 1017 |
1018 for bonus_index = 1, num_bonus_ids do | 1018 for bonus_index = 1, num_bonus_ids do |
1019 item.bonus_ids[tonumber(bonus_ids[bonus_index])] = true | 1019 item.bonus_ids[tonumber(item_results[13 + bonus_index])] = true |
1020 end | 1020 end |
1021 else | 1021 else |
1022 Debug("RecordItemData: Item_system is supposed to be 0 or positive, instead it was %s.", item_system) | 1022 Debug("RecordItemData: Item_system is supposed to be 0 or positive, instead it was %s.", item_system) |
1023 end | 1023 end |
1024 if upgrade_id and upgrade_id ~= 0 then | 1024 if upgrade_id and upgrade_id ~= 0 then |