From b96959df85f8144660a6cfb9d9f8583f370fe468 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 5 Mar 2013 06:05:08 +0000 Subject: [PATCH] Add ItemList(name id ...) that sets ``name'' to a list of item IDs. This works in the same fashion as SpellList(name id ...) for assigning a single name to a list of spell IDs. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@722 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCompile.lua | 11 +++++++++++ OvaleData.lua | 1 + 2 files changed, 12 insertions(+) diff --git a/OvaleCompile.lua b/OvaleCompile.lua index 2ddd8ef..10197a1 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -22,6 +22,7 @@ local missingSpellList = {} local ipairs, pairs, tonumber = ipairs, pairs, tonumber local strfind, strgmatch, strgsub = string.find, string.gmatch, string.gsub local strlen, strlower, strmatch, strsub = string.len, string.lower, string.match, string.sub +local tinsert = table.insert -- -- @@ -309,6 +310,15 @@ local function ParseSpellList(name, params) end end +local function ParseItemList(name, params) + OvaleData.itemList[name] = {} + local i = 1 + for v in strgmatch(params, "(%d+)") do + OvaleData.itemList[name][i] = tonumber(v) + i = i + 1 + end +end + local function ParseIf(a, b) local newNode = {type="if", a=node[tonumber(a)], b=node[tonumber(b)]} return AddNode(newNode) @@ -585,6 +595,7 @@ local function CompileDeclarations(text) text = strgsub(text, "SpellInfo%s*%((.-)%)", ParseSpellInfo) text = strgsub(text, "ScoreSpells%s*%((.-)%)", ParseScoreSpells) text = strgsub(text, "SpellList%s*%(%s*([%w_]+)%s*(.-)%)", ParseSpellList) + text = strgsub(text, "ItemList%s*%(%s*([%w_]+)%s*(.-)%)", ParseItemList) -- On vire les espaces en trop text = strgsub(text, "\n", " ") diff --git a/OvaleData.lua b/OvaleData.lua index 255e235..e25464b 100644 --- a/OvaleData.lua +++ b/OvaleData.lua @@ -35,6 +35,7 @@ local SPELL_POWER_SOUL_SHARDS = SPELL_POWER_SOUL_SHARDS -- OvaleData.spellList = {} +OvaleData.itemList = {} OvaleData.className = nil OvaleData.level = nil --allows to fill the player talent tables on first use -- 1.7.9.5