Go Back   MMOStorm.com - Beating the Game Elements > Maple Story > Maple Story Private Server

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-16-2009, 07:50 AM
tomson tomson is offline
Junior Member
 
Join Date: Jan 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default [Guide] How to Code an NPC

How to create a simple shop in OdinMS by using a .sql file
It seemed it was time that somebody made a guide to clarify how to make a simple shop .sql file for you shops. So, I made a guide on how to make one.

Let's start out.

1. Open a text editor, any is fine. I personally just use notepad for these.

2. Copy and paste this into your editor:
Code:
INSERT INTO `shops` VALUES ('', '');
INSERT INTO `shopitems` (`shopitemid`,`shopid`,`itemid`,`price`,`position` ) VALUES
(,,,,),
(,,,,);
That's the basic outline for a shop.

3. The
Code:
INSERT INTO `shops` VALUES ('', '');
Is where you put in your npc and shop ids.
Code:
INSERT INTO `shops` VALUES (''Shop id here, This is where you put in your npc id'');
For your shop id, you're picking any number you wish to use. I'd suggest using the next available one in the shop section of your database to be more organized. As for the npc id, you can find them on this thread > Thanks Nuklear

In this guide, we'll be using Fredrick as our npc, and add some elixers to him, along with summoning rocks.

So, we'd set it like this:
Code:
INSERT INTO `shops` VALUES (''600, 9030000'');
So, the shop id there would be 600 and the npc is Fredrick (9030000)

4. On to the next part. Now we need to add the items to our shop.
Code:
INSERT INTO `shopitems` (`shopitemid`,`shopid`,`itemid`,`price`,`position` ) VALUES
(,,,,),
(,,,,);
This part is pretty simple, the
Code:
INSERT INTO `shopitems` (`shopitemid`,`shopid`,`itemid`,`price`,`position` ) VALUES
Pretty much gives it away.
Here's how it goes:
Code:
INSERT INTO `shopitems` (`shopitemid`,`shopid`,`itemid`,`price`,`position` ) VALUES
(This is another id used by the shopitems, The id of the shop, The id of the item, The price you want, It's position (Will talk about later)),
(This is another id used by the shopitems, The id of the shop, The id of the item, The price you want, It's position (Will talk about later));
Here's what each is:

-Shopitemid: Each shop item also requires another id, a number.
-Shopid: Remember the shop id you used before? The one I used 600 for? Well that's this.
-Itemid: The id of the item you want sold. Try [Only registered and activated users can see links. ] for the id's.
-Price: The price of the item. Ex: 1000000 = 1,000,000 mesos.
-Position: This is to show where the item you're selling is located at the shop. 1 is the first item, 0 does not work and the item won't show if used. For every item after that one, use the next number. 2, 3, 4, etc.

For these, you can use as many
Code:
(,,,,),
as you want, just that the last one must end with a ; not a ,

Here's an example I've made with fredrick's shop:
Code:
INSERT INTO `shops` VALUES (''600, 9030000'');
INSERT INTO `shopitems` (`shopitemid`,`shopid`,`itemid`,`price`,`position` ) VALUES
(60000, 60, 2000005, 50000, 1),
(60001, 60, 2022179, 50000, 2),
(60002, 60, 4006001, 1, 3);
From that, if you executed it, fredrick would sell those items.

5. Saving your file.

In order to make this work out, you must save the file as a .sql file.

To do this in notepad, you can do the following:

File>Save as> Name your file 'Shop.sql' (Anything name that ends with .sql works. > Right below it, click on the bar and click 'All files' > Save.

6. Now, execute your .sql folder in your database.

For navicat, do the following:

Open Navicat > Get to your database, and double click it > Right click it > Click 'Execute batch file' > Click the '...' Browse for the .sql file you saved, press 'ok' > Then press start > Done

7. You're now done with your store, it should be in your database. You can now open up your server and test it out.

Note : You can make and execute shops while your server is up.
Note #2 : If the npc has a script or quest, the shop will not work.

This is all for now. I plan to add pictures soon. Tell me what you think of it.

(more Guides Coming)
Reply With Quote
  #2  
Old 01-17-2009, 08:47 AM
oceana oceana is offline
Member
 
Join Date: Jan 2009
Location: Brisbane, Queensland, Australia
Posts: 72
Thanks: 0
Thanked 1 Time in 1 Post
Default

im sure someone will try this out soon enough.
__________________
Reply With Quote
  #3  
Old 11-22-2009, 08:02 AM
enclosure123 enclosure123 is offline
Junior Member
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Here's an example I've made with fredrick's shop:
Code:
INSERT INTO `shops` VALUES (''600, 9030000'');
INSERT INTO `shopitems` (`shopitemid`,`shopid`,`itemid`,`price`,`position` ) VALUES
(60000, 60, 2000005, 50000, 1),
(60001, 60, 2022179, 50000, 2),
(60002, 60, 4006001, 1, 3);
From that, if you executed it, fredrick would sell those items.
why shopid is 60 when u put ''600, 9030000''
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Your Ad Here Your Ad Here


Powered by vBulletin © 2000 - 2008, Jelsoft Enterprises Ltd.

Copyright © 2009, ByteAir Media

Design by HTWoRKS
Links: Gigategy | IG4L Forums