Multi itemInfo files with costume, slots, name fixes from item_db

Hi guys, do you noticed that kRO (Sakray) implemented new storage feature that separates costumes into different column on storage? I guess you will get an error message “error found :8th argument is must number“. It’s because you are using out-dated itemInfo that doesn’t have costume column in each item info.

The first and the fastest solution is you can simply do a “find & replace” the itemInfo file. Find the “unidentifiedDisplayName” then replace with “costume = false,\r\n\t\tunidentifiedDisplayName“. It works just dark magic! It works but it will ignore all costume you have in your itemInfo and item database.

In other solution, if you remember my guide for Multi itemInfo Files, there is some simple hack you can do. Just add dummy “DESC.costume = false” will works too. But just recently, I created a parse to read the item database file -item_db.txt- then create new itemInfo_ItemDB.lua so you can get real costume listings, also fixes the item name display and slots based on your item_db.txt.

Here are the steps you must to follow, you don’t need to read again my old tutorial. *meh* Eh also, this also fix the sprites of some weapons that are not showing while player is attacking.

Renames itemInfo.lua/lub

First you need to rename your itemInfo.lua/lub, example to itemInfo_kRO.lua. If you have other itemInfo.lua files, just rename them. I use several itemInfo files to cover each other. Example I use

  • itemInfo_Translation.lua is translation project’s
  • itemInfo_kRO.lua is kRO’s
  • itemInfo_idRO.lua is converted idRO files
  • itemInfo_iRO.lua is iRO’s
  • itemInfo_misc.lua is my customs
  • itemInfo_ItemDB.lua is for the fixes!

Create a new itemInfo.lua/lub

After you renaming all itemInfo.lua/lub, new create a dummy file for multi itemInfo files support! Add these codes into your new itemInfo.lua/lub file. See on my gist for better indent: itemInfo.lua

Edit your itemInfo_somename.lua/lub files

Now, open your renamed itemInfo.lua/lub files. Just press CTRL+End because we need to edit the last lines, to edit the main function. There are 3 types of edit I want you to understand. Or you can read it yourself here.

As example, because my itemInfo_Translation.lua and other arelack of ClassNum, so I use this function on my itemInfo_kRO.lua

for ItemID,DESC in pairs(tbl) do
	CheckItem(ItemID, DESC, true)
end

Then on other itemInfo files except itemInfo_ItemDB.lua is using simple addition by this function

for ItemID,DESC in pairs(tbl) do
	CheckItem(ItemID, DESC, false)
end

And the last for itemInfo_ItemDB.lua I will use this function to adjust costume values, display names, and slot numbers.

for ItemID,DESC in pairs(tbl) do
	setDESC(ItemID,DESC)
end

Generates the itemInfo_ItemDB.lua

I almost forgot, if you’re asking “what is the itemInfo_ItemDB.lua?” you can create it manually or use this my parser using PHP. Download my setItemInfo.php here. Copy it onto your db/[pre-]re/ folder. Just execute the .php file by using command

php setItemInfo.php

or

path/to/your/php/php.exe setItemInfo.php

Then copy the generated file into your Client/System. Or you just need a test, download my itemInfo_ItemDB.lua that I generated by using rAthena’s  item_db on e7e9cf6 (2017-11-03).

DONE, Thank you!

Now, your client is ready to rocks! Try it, and report if you got issues. Or just come back to say “thank you” if it works.

Tell your friends

5 Replies to “Multi itemInfo files with costume, slots, name fixes from item_db”

  1. Hi, I have problem when implement that system.
    – I make my client read file itemInfo_Sak.lua.
    – In itemInfo_Sak.lua content this code: https://gist.github.com/cydh/92678470008b3eccc37fab254a3c7228
    – I just edit to read 1 file only: to test
    iiFiles = {
    “System/itemInfo.lua”, — 1st priority
    }

    – End of file itemInfo.lua. I changed main function to:
    main = function()
    for ItemID, DESC in pairs(tbl) do
    CheckItem(ItemID, DESC, true)
    end
    return true, “good”
    end

    – But when in-game I got this error: https://i.imgur.com/nhAESxq.png

    I don’t know what step I’m wrong. Please help

    1. remove the main function in your lua file that contains the item list (itemInfo.lua).
      just leave the

      for ItemID, DESC in pairs(tbl) do
      CheckItem(ItemID, DESC, true)
      end

Leave a Reply