Wow, great work!
Will this code be included in the next release of the emulator?
This is just my personal opinion, but I think it might be better to have a merchant_id or similar value in npc_types, rather than a npc_type value in the merchant data. This is just from the point of view of adding merchant info to my spawn data, since my npc_type data is output by a parser program rather than written by hand, the ID of a particular NPC might change from version to version depending on what I add. Just my opinion though.
Unless you're brewing a lot of wine, however, it might be good if database merchant lists can be added so you can buy something other than grapes
