-- DopingControl data/consumables.lua
-- Consumables tab: slot definitions + buff->slot table + spellID->slot map.
-- Pure Lua 5.0, no WoW API -- dofile-loadable offline.

DopingControl = DopingControl or {}
local DC = DopingControl

-- ------------------------------------------------------------------
-- Slot definitions (array, order = column order).
-- Fields: id (stable key, used by DEFAULT_EXPECT / model / UI),
--         label (column tile abbrev), sub (tile sub-label), full (long name,
--         used in whisper/report), kind ("aura" | "weapon"),
--         items (tooltip example text, optional).
-- Separator decision (once for all data files): items strings are
-- tooltip/FontString-only, so they may use the middle-dot list separator
-- "\194\183" (UTF-8 middle dot renders fine in own
-- FontStrings; the group headers already use the same glyph). Em dashes
-- stay ASCII "-" (that glyph is unproven in the 1.12 font). SENT
-- chat lines remain pure ASCII -- they never use these
-- strings.
-- ------------------------------------------------------------------
DC.SLOTS_CONSUMABLES = {
    { id = "FLASK", label = "FLK", sub = "Flask", full = "Flask",           kind = "aura",
      items = "Flask of the Titans \194\183 Distilled Wisdom \194\183 Supreme Power" },
    { id = "FOOD",  label = "FOD", sub = "Food",  full = "Food buff",       kind = "aura",
      items = "Well Fed - e.g. Grilled Squid \194\183 Blessed Sunfruit" },
    { id = "AP",    label = "AP",  sub = "Attack", full = "Attack power",   kind = "aura",
      items = "Winterfall Firewater \194\183 Juju Might" },
    { id = "STR",   label = "STR", sub = "Str.",  full = "Strength",        kind = "aura",
      items = "Juju Power \194\183 Elixir of Giants" },
    { id = "AGI",   label = "AGI", sub = "Agi.",  full = "Agility",         kind = "aura",
      items = "Elixir of the Mongoose" },
    { id = "SP",    label = "SP",  sub = "Spell", full = "Spell power",     kind = "aura",
      items = "Greater Arcane Elixir \194\183 Shadow Power \194\183 Firepower" },
    { id = "MP5",   label = "MP5", sub = "Mana",  full = "Mana regen",      kind = "aura",
      items = "Mageblood Potion \194\183 Nightfin Soup" },
    { id = "ARM",   label = "ARM", sub = "Armor", full = "Armor",           kind = "aura",
      items = "Elixir of Superior Defense" },
    { id = "HP",    label = "HP",  sub = "Stam.", full = "Stamina/HP",      kind = "aura",
      items = "Elixir of Fortitude \194\183 Rumsey Rum Black Label" },
    { id = "FR",    label = "FR",  sub = "fire",  full = "Fire protection", kind = "aura",
      items = "Greater Fire Protection Potion - situational per boss; enable/disable via the expectation matrix" },
    { id = "WPN",   label = "WPN", sub = "temp.", full = "Weapon (temporary)", kind = "weapon",  -- NOT an aura slot
      items = "Dense Sharpening Stone \194\183 Brilliant Wizard/Mana Oil - permanent enchant: Equipment tab" },
}

-- ------------------------------------------------------------------
-- Buff name -> slot table.
-- spellID = 0 means "match by name only" (no known aura spell ID).
-- ------------------------------------------------------------------
DC.CONSUMABLES = {
    -- FLASK
    ["Flask of the Titans"]           = { slot = "FLASK", spellID = 17626, item = "Flask of the Titans" },
    ["Flask of Supreme Power"]        = { slot = "FLASK", spellID = 17628, item = "Flask of Supreme Power" },
    ["Flask of Distilled Wisdom"]     = { slot = "FLASK", spellID = 17627, item = "Flask of Distilled Wisdom" },
    ["Flask of Chromatic Resistance"] = { slot = "FLASK", spellID = 17629, item = "Flask of Chromatic Resistance" },
    ["Flask of Petrification"]        = { slot = "FLASK", spellID = 17624, item = "Flask of Petrification" },

    -- FOOD (buff names, not item names; TWoW custom foods likely all show "Well Fed" - unverified)
    ["Well Fed"]                      = { slot = "FOOD", spellID = 0,     item = "Grilled Squid etc." },
    -- ["Food"] (the eating tick) deliberately REMOVED: it is
    -- the sit-and-eat channel aura, not a food buff -- it made the FOOD
    -- cell green for anyone currently chewing (field-tested). Only
    -- lasting food buffs count.
    ["Increased Stamina"]             = { slot = "FOOD", spellID = 0,     item = "stamina food" },
    ["Dragonbreath Chili"]            = { slot = "FOOD", spellID = 15852, item = "Dragonbreath Chili" },

    -- AP
    ["Winterfall Firewater"]          = { slot = "AP", spellID = 17038, item = "Winterfall Firewater" },
    ["Juju Might"]                    = { slot = "AP", spellID = 16329, item = "Juju Might" },

    -- STR
    ["Juju Power"]                    = { slot = "STR", spellID = 16323, item = "Juju Power" },
    ["Elixir of Giants"]              = { slot = "STR", spellID = 11405, item = "Elixir of Giants" },
    ["Elixir of the Giants"]          = { slot = "STR", spellID = 11405, item = "Elixir of Giants" },        -- AURA name on this client (measured live: SpellInfo(11405) = "Elixir of the Giants"); the item is named without "the", and matching runs on the aura name first
    ["Elixir of Brute Force"]         = { slot = "STR", spellID = 17537, item = "Elixir of Brute Force" },
    ["Strike of the Scorpok"]         = { slot = "STR", spellID = 10669, item = "Strike of the Scorpok" },   -- measured live in a raid (26 players); was tallied as unknown
    ["Rage of Ages"]                  = { slot = "STR", spellID = 0,     item = "R.O.I.D.S." },              -- aura name differs from the item; own spell ID not measured yet

    -- AGI
    ["Elixir of the Mongoose"]        = { slot = "AGI", spellID = 17538, item = "Elixir of the Mongoose" },
    ["Elixir of Greater Agility"]     = { slot = "AGI", spellID = 11334, item = "Elixir of Greater Agility" },
    ["Greater Agility"]               = { slot = "AGI", spellID = 11334, item = "Elixir of Greater Agility" }, -- AURA name (the item name never appears as a buff); was tallied as unknown 14x
    ["Elixir of Agility"]             = { slot = "AGI", spellID = 11328, item = "Elixir of Agility" },

    -- SP (merged: arcane_elixir + school_elixir + dreamtonic + dreamshard)
    ["Greater Arcane Elixir"]         = { slot = "SP", spellID = 17539, item = "Greater Arcane Elixir" },
    ["Arcane Elixir"]                 = { slot = "SP", spellID = 11390, item = "Arcane Elixir" },
    ["Elixir of Shadow Power"]        = { slot = "SP", spellID = 11474, item = "Elixir of Shadow Power" },
    ["Elixir of Frost Power"]         = { slot = "SP", spellID = 21920, item = "Elixir of Frost Power" },
    ["Greater Frost Power"]           = { slot = "SP", spellID = 56544, item = "Elixir of Greater Frost Power" }, -- AURA name (TurtleWoW-added). NOT measured in-game: taken from a TurtleWoW spell database (56544 = "Greater Frost Power", "Increases frost spell damage by up to 40 for 3600 sec.") plus the item name in pfQuest-turtle's item DB; the aura drops "Elixir of" the same way Giants/Agility above do
    ["Elixir of Greater Firepower"]   = { slot = "SP", spellID = 26276, item = "Elixir of Greater Firepower" },
    ["Elixir of Firepower"]           = { slot = "SP", spellID = 7844,  item = "Elixir of Firepower" },
    ["Dreamtonic"]                    = { slot = "SP", spellID = 45489, item = "Dreamtonic" },        -- use-spell ID; the aura's own ID is unverified
    ["Dreamshard Elixir"]             = { slot = "SP", spellID = 45427, item = "Dreamshard Elixir" }, -- use-spell ID; the aura's own ID is unverified

    -- MP5
    ["Mageblood Potion"]              = { slot = "MP5", spellID = 24363, item = "Mageblood Potion" },
    ["Mageblood"]                     = { slot = "MP5", spellID = 24363, item = "Mageblood Potion" }, -- TWoW buff-name variant (old Data.lua kept both)

    -- ARM
    ["Elixir of Superior Defense"]    = { slot = "ARM", spellID = 11348, item = "Elixir of Superior Defense" },
    ["Elixir of Greater Defense"]     = { slot = "ARM", spellID = 11349, item = "Elixir of Greater Defense" },

    -- HP (merged: def_fortitude + alcohol STA variants)
    ["Elixir of Fortitude"]           = { slot = "HP", spellID = 3593,  item = "Elixir of Fortitude" },
    ["Health II"]                     = { slot = "HP", spellID = 3593,  item = "Elixir of Fortitude" },      -- AURA name on this client (measured live: SpellInfo(3593) = "Health II")
    ["Rumsey Rum Black Label"]        = { slot = "HP", spellID = 25804, item = "Rumsey Rum Black Label" },
    ["Rumsey Rum"]                    = { slot = "HP", spellID = 0,     item = "Rumsey Rum" },
    ["Rumsey Rum Light"]              = { slot = "HP", spellID = 0,     item = "Rumsey Rum Light" },
    ["Medivh's Merlot"]               = { slot = "HP", spellID = 57106, item = "Medivh's Merlot" },   -- use-spell ID; the aura's own ID is unverified
    ["Gordok Green Grog"]             = { slot = "HP", spellID = 0,     item = "Gordok Green Grog" },

    -- FR
    ["Greater Fire Protection"]       = { slot = "FR", spellID = 17543, item = "Greater Fire Protection Potion" },
    ["Fire Protection"]               = { slot = "FR", spellID = 7233,  item = "Fire Protection Potion" },

    -- WPN: intentionally NO aura entries - temp enchant is not a buff
}

-- ------------------------------------------------------------------
-- spellID -> slotId map, generated from DC.CONSUMABLES (spellID > 0).
-- Collision rule: at classify time an ID match beats a
-- name match. data/classbuffs.lua later MERGES its rank IDs into this same
-- map (slot ids are unique across tabs, so one flat map is safe).
-- ------------------------------------------------------------------
DC.SPELL_TO_SLOT = {}
for name, def in pairs(DC.CONSUMABLES) do
    if def.spellID and def.spellID > 0 then
        DC.SPELL_TO_SLOT[def.spellID] = def.slot
    end
end
