Jump to content

How to create a shop or multi shop and modify it with an NPC


Recommended Posts

  • Management

Hello,

 

This tutorial will show you how to create a shop with an NPC. There are two types of shops:

  • One shop: When you click on a NPC, a shop window opens. The first part will be enough for you to create a simple shop.
  • Multi shop: Which consists of assigning several shops to an NPC using a quest.

 

Prerequisites

  • Own a Metin2 server with access to the database.
  • Have an NPC available.
  • Set up a quest.

 

I. Create a shop or modify a shop

 

Révélation

1. On Navicat, go to the player database and open the shop table.

 

042017how1.png

 

2. The shop table looks like this:

 

042017how2.png

 

We have the following columns:

  • vnum: A vnum that you will give to your shop. It must be unique.
  • name: The name does not appear anywhere but you can put what you want, it will serve as a guide.
  • npc_vnum: The NPC vnum. You can find your NPC in the mob_names.txt of your server.

 

Success! You can now add a line (with the + button at the bottom of Navicat) to add a new shop. Once completed, remember to save your changes.

 

3. Now that the shop is created, let's assign the desired items in it. Open the shop_item table (which is still in player database)

 

042017how3.png

 

042017how4.png

 

We have the following columns:

 

  • shop_vnum: Corresponds to the vnum of your shop.
  • item_vnum: Corresponds to the vnum of the item you want to add. The item vnum can be found in the item_names.txt of your server.
  • count: Corresponds to the quantity of the item you want to sell (make sure the item is stackable)

 

Success! Add as many lines as there are items you want to add. Once done, you can restart your Metin2 server.

 

II. Multi Shop

 

Révélation

1. Start by creating your shops and assigning them items by following Part I (if you haven't already done so).

 

2. To assign several shops to an NPC, you will have to create a quest. Here is a simple quest to explain how it works:

 

quest QUESTNAME begin
	state start begin
		when NPCID1.chat."NAME1" begin
			npc.open_shop(SHOPID1)
			setskin(NOWINDOW)
		end
		when NPCID1.chat."NAME2" begin
			npc.open_shop(SHOPID2)
			setskin(NOWINDOW)
		end
		when NPCID1.chat."NAME3" begin
			npc.open_shop(SHOPID3)
			setskin(NOWINDOW)
		end
	end
end

 

Here is what my annotations correspond to:

  • QUESTNAME: The name of your quest. Put what you want.
  • NPCIDx: The vnum of the NPC you want to assign a shop to.
  • NAMEx: The name of the shop (which will appear in the shops menu when the NPC is clicked).
  • SHOPIDxx: The vnum of the shop you want to assign.

 

3. Suppose I want to assign an NPC several arms shops. This would give:

 

quest multi_shop begin
	state start begin
		when 9001.chat."Armors" begin
			npc.open_shop(100)
			setskin(NOWINDOW)
		end
		when 9001.chat."Shields" begin
			npc.open_shop(101)
			setskin(NOWINDOW)
		end
		when 9002.chat."Weapons" begin
			npc.open_shop(200)
			setskin(NOWINDOW)
		end
	end
end

 

4. Implement the new quest and restart your Metin2 server.

 

Example:

 

044820254852shop5.jpg

 

Warning! When you create a quest, it's important to implement it in-game for it work.
Success! Now you know how to manage your server shops!

 

Sincerly,

ASIKOO

  • Metin2 Dev 7
  • Love 10
  • Good 4
  • Think 2

If you want to contact the M2Dev team, please open a ticket on the Discord server...

english_banner.gif

Link to comment
Share on other sites

  • Moderator
5 hours ago, speedyHAZE said:

Holy Moly old shit...

its 2008?

Please use ShopEX, not Quest...

 

This tutorial is one of a serie of tutorial that has the goal to help newcomers. Those are fairly old but still up to date. Shop ex was not a thing in 2012 and a tutorial with ShopEX will be released anyway.

  • Good 5

Gurgarath
coming soon

Link to comment
Share on other sites

  • 3 weeks later...
  • Premium
On 2/5/2021 at 10:12 AM, speedyHAZE said:

Holy Moly old shit...

its 2008?

Please use ShopEX, not Quest...

You have to come from the bottom to get to the top, are you sure ShopEX is better than this? 🤭

Link to comment
Share on other sites

  • 9 months later...
  • 5 weeks later...
  • 9 months later...

I hope this is not considered spam :

- If I create a store according to the instructions, how/what do I have to do to position the shop/NPC permanently on e.g. Map1 ?
Unfortunately I could not find any information here in the forum.

Link to comment
Share on other sites

  • Premium
On 10/28/2022 at 6:07 AM, ugm2 said:

If I create a store according to the instructions, how/what do I have to do to position the shop/NPC permanently on e.g. Map1 ?

.../share/locale/english/map/metin2_map_c1 --> npc.txt

  • Love 1

I'll be always helpful! 👊 

Link to comment
Share on other sites



  • Activity

    1. 5
    2. 5

      Zodiac Roulette (Aeldra event concept)

    3. 0

      I am looking for a team for PVP Server!

    4. 0

      How about get quest flag from binary??

    5. 5

      Zodiac Roulette (Aeldra event concept)

    6. 5

      Zodiac Roulette (Aeldra event concept)

    7. 5

      Zodiac Roulette (Aeldra event concept)

    8. 12

      REAL_TIME_FIRST_USE items not being expired in the safe-box

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.