Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-28-2008, 04:32 PM
ndnet
Hill Giant
 
Join Date: Oct 2003
Posts: 105
Default

A bit more time spent with this. Someone more versed with SQL might be able to whip this into something more optimized, but here's what I came up with.

This bit of SQL accomplishes the following:
- Creates a new npc_type entry and merchantlist entries
Given the following:
- Tradeskill number (from post above)
- MerchantID number (check your database and find a number not in use, plug it in)
- Merchant name and associated values to use in the npc_types entry, e.g. race, class, level, hp, etc -- you can customize this as much as you want.

Code:
DROP TABLE IF EXISTS merchantlist_tskills;

CREATE TABLE IF NOT EXISTS
merchantlist_tskills
(slot INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, itemid INTEGER);

INSERT INTO merchantlist_tskills (itemid) (
SELECT 
	tradeskill_recipe_entries.item_id
FROM
	tradeskill_recipe,
	tradeskill_recipe_entries
WHERE
	tradeskill_recipe.id = tradeskill_recipe_entries.recipe_id AND
	tradeskill_recipe.tradeskill = TRADESKILLNUMBER AND
	tradeskill_recipe_entries.successcount = 1
);
INSERT INTO merchantlist (merchantid, slot, item)
(SELECT 'MERCHANTID', slot, itemid FROM merchantlist_tskills);

DROP TABLE merchantlist_tskills;

INSERT INTO npc_types (name, level, race, class, gender, texture, merchant_id) VALUES ('MERCHANT_NAME00', 1, 1, 41, 0, 0, MERCHANTID);
When done, you should have a lot of new merchantlist entries and a new npc_type entry. You should then be able to use the #dbspawn command (I believe) to go poop your new merchant out wherever you want and perform other associated world-building magicks to set them up.

To note, I have not tested this in-game. I'm not sure what the ramifications are for having a merchantlist's slot value go so high (prior to this, the max amount of items a merchant has listed in my DB from PEQ is 78.. 80 might be the most the server will recognize).

Let me know how it goes
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:46 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3