|
||
|
#1
|
|||
|
|||
|
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) |
|
#2
|
|||
|
|||
|
im sure someone will try this out soon enough.
__________________
|
|
#3
|
|||
|
|||
|
Quote:
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|