changeset 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
files Constants.lua Main.lua
diffstat 2 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Constants.lua	Fri Sep 05 01:50:04 2014 -0400
+++ b/Constants.lua	Sat Sep 06 02:57:57 2014 -0400
@@ -24,33 +24,33 @@
 
 private.REP_BUFFS = {
     [_G.GetSpellInfo(30754)] = { -- CENARION FAVOR
-        faction = FACTION_NAMES.CENARION_CIRCLE,
+        faction = private.FACTION_NAMES.CENARION_CIRCLE,
         modifier = 0.25,
     },
     [_G.GetSpellInfo(24705)] = { -- GRIM VISAGE
         modifier = 0.1,
     },
     [_G.GetSpellInfo(32098)] = { -- HONOR HOLD FAVOR
-        faction = FACTION_NAMES.HONOR_HOLD,
+        faction = private.FACTION_NAMES.HONOR_HOLD,
         modifier = 0.25,
     },
     [_G.GetSpellInfo(39913)] = { -- NAZGRELS FERVOR
-        faction = FACTION_NAMES.THRALLMAR,
+        faction = private.FACTION_NAMES.THRALLMAR,
         modifier = 0.1,
     },
     [_G.GetSpellInfo(39953)] = { -- SONG OF BATTLE
-        faction = FACTION_NAMES.THE_SHATAR,
+        faction = private.FACTION_NAMES.THE_SHATAR,
         modifier = 0.1,
     },
     [_G.GetSpellInfo(61849)] = { -- SPIRIT OF SHARING
         modifier = 0.1,
     },
     [_G.GetSpellInfo(32096)] = { -- THRALLMARS FAVOR
-        faction = FACTION_NAMES.THRALLMAR,
+        faction = private.FACTION_NAMES.THRALLMAR,
         modifier = 0.25,
     },
     [_G.GetSpellInfo(39911)] = { -- TROLLBANES COMMAND
-        faction = FACTION_NAMES.HONOR_HOLD,
+        faction = private.FACTION_NAMES.HONOR_HOLD,
         modifier = 0.1,
     },
     [_G.GetSpellInfo(95987)] = { -- UNBURDENED
--- a/Main.lua	Fri Sep 05 01:50:04 2014 -0400
+++ b/Main.lua	Sat Sep 06 02:57:57 2014 -0400
@@ -984,13 +984,13 @@
     local item
 
     if item_string then
-        local _, _, _, _, _, _, _, suffix_id, unique_id, _, upgrade_id, instance_difficulty_id, num_bonus_ids = (":"):split(item_string)
-        local _, _, _, _, _, _, _, _, _, _, _, _, _, bonus_ids = (":"):split(item_string)
-
-        upgrade_id = tonumber(upgrade_id)
-        instance_difficulty_id = tonumber(instance_difficulty_id)
-        num_bonus_ids = tonumber(num_bonus_ids)
-        suffix_id = tonumber(suffix_id)
+        local item_results = { (":"):split(item_string) }
+
+        local suffix_id = tonumber(item_results[8])
+        local unique_id = item_results[9]
+        local upgrade_id = tonumber(item_results[11])
+        local instance_difficulty_id = tonumber(item_results[12])
+        local num_bonus_ids = tonumber(item_results[13])
 
         if not num_bonus_ids or num_bonus_ids == 0 then
             if (suffix_id and suffix_id ~= 0) or (instance_difficulty_id and instance_difficulty_id ~= 0) then
@@ -1014,9 +1014,9 @@
             if not item.bonus_ids then
                 item.bonus_ids = {}
             end
-
+            
             for bonus_index = 1, num_bonus_ids do
-                item.bonus_ids[tonumber(bonus_ids[bonus_index])] = true
+                item.bonus_ids[tonumber(item_results[13 + bonus_index])] = true
             end
         else
             Debug("RecordItemData: Item_system is supposed to be 0 or positive, instead it was %s.", item_system)