Itemtable & item to npc relation

Discussion in 'General Gameplay Discussion' started by SandsMans, Oct 15, 2015.

  1. SandsMans Active Member

    There seems to be a very small amount of itemtable and treasureclass entries available compared to items and npcs.

    It looks like npcs and spawncamps have treasureclasses and treasureclasses have items or itemtables.

    Am I going about this the right way? Is there enough data for these relations in the census?
  2. Korucuu Well-Known Member

    Feldon recently did a Twitch livestream where treasureclass etc was mentioned. Two years ago there was going to be accessible loot table information, but that idea was scrapped.

    So this affects:
    Spawncamp
    treasureclass
    itemtable

    The info basically hasn't been updated, which is why you aren't seeing any correlation between them and the items/NPC's.

    Feldon explains: https://www.youtube.com/watch?time_continue=2886&v=9fj32wekuOc (hopefully that links to the right time, it's about 48 mins in).
    SandsMans and Feldon like this.
  3. SandsMans Active Member

    Ahh, thanks much! I had not watched the video yet, but I''m going to now. :D

    It really would be nice to have access to this information without relying on log parsing.
  4. Feldon Well-Known Member

    I've been waiting for all the data to be published so I can write and post documentation as I have done in the past for other data type, however I'm not sure it will ever happen for loot data, so I might as well write this down while I still have it somewhat figured out in my brain.

    WARNING: The Surgeon General warns that studying EQ2 Zone/Encounter/NPC/Item relationships may cause paralysis and/or brain cancer.

    Seriously, I had a headache for a week when I first started looking at this data. While I won't have edit rights beyond the normal 20 minutes to maintain this post, I can update the diagram if I make any mistakes on the data relationships and post replies to this thread as we find things. Ok here we go down the rabbit hole...

    EQ2 Zones contain Spawncamps. A Spawncamp can be anything -- an Enemy, a Broker, a Banker, a Vendor, a Quest Giver, a Shiny, a Harvest node, a clickable rock, or other interactive object.

    A Spawncamp can contain NPCs and Encounters (NPC tables) which subsequently contain NPC_Lists. The part that will make your brain hurt is, Spawncamps, Encounters, and NPC_Lists can all be nested to an infinite depth. They also contain spawn coordinates and offsets, which allows game designers to have some random placement of mobs when a camp spawns. NPC Tables also allow for a selection of mobs to spawn at a specific location. For instance, when badgers are killed in the Enchanted Lands zone, they can respawn as deer and vice versa.

    EQ2 loot is stored in Treasureclasses. Treasureclasses are crazy complex because they can contain:

    • item_list -- Bare items with a Count and Percentage chance to drop.
    • itemtable_list -- Itemtables (with each item having a Count and Weight) with a Count and a Percentage chance for that table to drop. Refer to /itemtable/ collection.
    • treasureclass_list -- Yes, treasureclasses can be nested infinitely deep!

    You might have to go 5 or more levels deep, scanning tresureclasses, item_lists, and item_tables to get all the loot for one spawncamp. Then you have to read all the Counts, Percents, and Weights to figure out what the actual chance for all this loot is to drop.

    Wait...Weight?

    In any itemlist, items can be weighted. For instance take an itemtable like this:
    • 20% chance to itemtable 12345 to drop, with a count of 2.
    Itemtable 12345:
    • mage weapon - 3
    • scout weapon - 3
    • priest weapon - 3
    • plate fighter weapon - 2
    • brawler weapon - 1
    When you kill the enemy, let's say we successfully hit the 20% chance. Ok now two weapons will drop. Each of those weapons will roll a number from 1-12. Each roll has a 3 in 12 chance to get a scout weapon, 3 in 12 chance to get mage weapon, 3 in 12 chance to get priest weapon, 2 in 12 chance to get plate fighter weapon, and 1 in 12 chance to get brawler weapon. So there will be two weapons, each independently rolling the dice to see if it's a mage, scout, priest, plate fighter, or brawler weapon. Note that it's not actually checking the class of the character present unless Smart Loot is enabled for the Spawncamp.

    Here's my data schema based on the data currently in Census based on the work by Zoltaroth two years ago:

    [IMG]
    Every starred value (*) can have multiple values.

    I have mostly limited the above diagram to the fields that are necessary to link this data together. All the other data found in these records is pretty self-evident. You may be looking at this data and wondering how you find out which NPCs give Quests or which Vendors sell which items. Unfortunately this would be insanely complex data because Quests and Vendors use Predicates to decide whether they are visible/hidden based on your Class, Race, Level, Progress on a Quest, Faction, even if you are under the effect of a spell, etc. Everything sold on a Vendor can be predicated based on any number of things as well.

    I hope one day that we can convince the powers that be that while Loot Data takes away some of the initial mystery of where things drop, that the benefits of this data outweigh the negatives. Note that all we have is itemids until the items are actually discovered.
  5. Dedith Well-Known Member

    yeah, what he said, lots of self pointing capable things..
    SandsMans and Feldon like this.
  6. SandsMans Active Member

    Wow, great write-up Feldon, thanks! It all seems pretty logical.

    I too wish that they would let us have access to all of this data.
    It would be nice to have an always current source to search for where items drop.
    Which is where I was going to go with this if the data was there to make it work.
    Feldon likes this.
  7. Feldon Well-Known Member

    I've updated the schema diagram above to include a couple of fixes and to make clearer what's going on as far as dice rolls.

    By the way, when looking at an NPC, it has a base_level and then min_addr_level and max_addr_level. Unless I'm mistaken, these are NPC tiers. The secret decoder for that is...

    Code:
    0 => 'vvv' 
    1 => 'vvv'
    2 => 'vvv'
    3 => 'vv'
    4 => 'v'
    5 => ''
    6 => '^'
    7 => '^^ { Heroic }'
    8 => '^^^ { Heroic }'
    9 => ' ^{ Epic x2 }^'
    10 => ' ^{ Epic x3 }^'
    11 => ' ^{ Epic x4 }^'
    SandsMans likes this.