Item_template -> Item_dbc (MYSQL)

3.3.5a Item_template -> Item_dbc (MYSQL) 1_0

Insert all item_template rows into clean item_dbc db table
As title suggest: Clean the WDBX table for item.dbc and insert new values (all of dev_world.item_template)
REMEMBER: To replace the dev_dbc_files. and the dev_world. with your own database-names.
REQUIRES: That you have a table for the item.dbc

It will most likely call this an unsafe query, since this will delete all entries in dev_dbc_files.db_item_12340 AND insert all values appropriate for your item.dbc db table from the entire item_template.


You can uncomment select queries for troubleshooting.

Query = Attachment.

SQL:
-- ## # ## # ## ## # ## # ##
-- ## Item.dbc # ## # ## # #
-- ## Data collector # ## ##
-- ## # # ~Frathir # # ## # ##
-- ## # ## # ## ## # ## # ##

-- the db_item_12340 DOES NOT need ANY editing other than this query
-- the db_item_12340 ALWAYS HAVE TO BE a direct reflection of the item_template database from world

-- first we clean the item.dbc's database
DELETE FROM dev_dbc_files.db_item_12340;

-- we then insert the data we need from the item_template(world) into the dbc
INSERT INTO dev_dbc_files.db_item_12340
    (dev_dbc_files.db_item_12340.ID,
        dev_dbc_files.db_item_12340.ClassID, dev_dbc_files.db_item_12340.SubclassID,
        dev_dbc_files.db_item_12340.Sound_Override_Subclassid, dev_dbc_files.db_item_12340.Material,
        dev_dbc_files.db_item_12340.DisplayInfoID, dev_dbc_files.db_item_12340.InventoryType,
        dev_dbc_files.db_item_12340.SheatheType)

SELECT
    dev_world.item_template.entry,
    dev_world.item_template.class,
    dev_world.item_template.subclass,
    dev_world.item_template.SoundOverrideSubclass,
    dev_world.item_template.Material,
    dev_world.item_template.displayid,
    dev_world.item_template.InventoryType,
    dev_world.item_template.sheath


FROM
    dev_world.item_template

-- we DO NOT want a row with the entry 0, as this will fuck up every character in the game
-- but we NEED EVERYTHING else
WHERE
    dev_world.item_template.entry NOT IN (0)

ORDER BY
    dev_world.item_template.entry DESC        -- Needs to be DESC to be ascending in dbc
    ; -- END SEMICOLON


-- everything below this line is for data checking to troubleshoot this query for errors
/*
-- select a few rows to compare data
SELECT
    dev_world.item_template.entry AS itemTemplateEntry,
    dev_dbc_files.db_item_12340.ID AS dbcEntry,
    dev_world.item_template.displayid AS itemTemplateEntry,
    dev_dbc_files.db_item_12340.DisplayInfoID AS dbcDisplayID

FROM
    dev_world.item_template

INNER JOIN
    dev_dbc_files.db_item_12340
        ON
            dev_world.item_template.entry = dev_dbc_files.db_item_12340.ID

WHERE
    dev_world.item_template.entry BETWEEN (17) AND (100);

-- we do some counting to check if the two tables have the same amount of rows

SELECT
    COUNT(*) AS itemTemplateCOUNT

FROM
    dev_world.item_template

WHERE
    dev_world.item_template.entry NOT IN (0);

SELECT
    COUNT(*) AS dbcCOUNT

FROM
    dev_dbc_files.db_item_12340;


-- quick check for 0 entry rows
SELECT
    dev_world.item_template.entry, dev_world.item_template.NAME

FROM
    dev_world.item_template

WHERE
    dev_world.item_template.entry = 0;

SELECT
    dev_dbc_files.db_item_12340.ID, dev_dbc_files.db_item_12340.DisplayInfoID

FROM
    dev_dbc_files.db_item_12340

WHERE
    dev_dbc_files.db_item_12340.ID = 0;

*/



Thanks,
~Frathir
  • item dbc logo.png
    item dbc logo.png
    7.4 KB · Views: 170
Register & Get access to index
Frathir
Author Frathir
Divine

Posts

18

Likes

28

Resources

6

Version 1_0
Downloads 4
Views 732
Last Update
0.00 star(s) 0 ratings
None

3,382

1,252

9,526

410

Top