[Tutorial] [Antrix] How to Create Vendors

Joined
Jun 17, 2007
Messages
14
Reaction score
0
I've heard a lot of people ask for instructions on how to create custom vendors that sell whatever items they want to sell. So i came up with a SQL file thats easy to customize which allows users to create their own vendors.
----------------------------------------------------------------
Instructions -

1. Download the SQL File.

-

2. Edit the SQL File with the Desired ID #'s.

3. Open Navicat.

4. Execute the Batch File.

5. Start Your Server

6. Say Thanks :P
----------------------------------------------------------------

If you have any problems just tell me here in this thread.

Also a thanks to Attila for helping me setup my server in the first place :sq_yellow



 
Here's a stored procedure for lazy DBA's like me:
(*Note, this is just for the creation, ill make another for the addition of items...*)

Cut and paste this
---------------------------------------------

Code:
DELIMITER $$
DROP PROCEDURE IF EXISTS `antrix`.`sp_addvendor`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_addvendor`(IN vendorid int(10), creaturename varchar(30), subname varchar(30))
begin
INSERT INTO creature_names
  (entry, creature_name, Subname, Flags1, type, Family, Rank, unk4, SpellDataID, displayid, unk2, unk3, Civilian, Leader)
VALUES
 (vendorid, creaturename, subname, 0, 4, 0, 3, 0, NULL, 17072, 1, 1, 1, 0);
end$$
DELIMITER ;
If you need help calling the procedure:
  1. Open SQLyog (or your preferred client) and go to your database.
  2. Issue this command (it takes 3 parameters: vendorID, Name, and Subname)
    example: call sp_addvendor(99999, 'JoeVendor', 'MySubText');
  3. That's it... you have created your vendor. Empty, but created ;-)
Deleting a vendor that you created
  1. *REMEMBER* the vendor ID that you used when you created it. Execute this code:
delete from creature_names where entry = 99999 (99999 being the vendor id)

Hope all this helps ;-)

Why did you post this? it's basically the same thing that the thread was about to begin with.
 
Why did I post it? Why not? You offered up the SQL syntax, I offered up the method to create a stored procedure for those who A.) Use this code on the web - B.) Are NOT serial "cut and pasters" and C.) Why wouldn't you use a sproc to do this? Jesus, take the short route up the hill... If I "stole your thunder" let me know, I'll send you a good mysql book.
 
how the heck is this a tutorial??

a tutorial would tell us what each field means...if u say to use sqlyog then u can insert it visually !!!!
 
even though i know about these things i agree with those 2 dudes on top of my post lol theres alot of ppl that have difficulties doing these type of things. its great that you took your time to do this but at least show them how to do it not just wat to do
 
Back