[Help] Creating a GM Shop In Interlude

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
missyman
Posts: 6
Joined: Thu Mar 01, 2007 6:29 pm

[Help] Creating a GM Shop In Interlude

Post by missyman »

is it possible? if so, can anyone help or create me a guide. I have updated my server and players are getting annoyed xD
xtos
Posts: 26
Joined: Wed Jan 24, 2007 3:26 pm

Post by xtos »

Did you have one prior updating and it doesn't work or you never had one? It's unlikely that it stopped working after you updated.
There are many gmshops around but it will be fun to start your own. If you need here's how:

Select an npc. Let's say 30976.

First create a new text document and add the following

Code: Select all

DELETE FROM npc WHERE id = 30976;
INSERT INTO npc VALUES 
(30976, 30976, "Missy", 1, "GM Shop", 1, "NPC.a_traderB_FHuman", 8, "20,5", 70, "female", "L2Merchant", 40, 3862, 1493, "11,85", "2,78", 40, 43, 30, 21, 20, 10, 0, 0, 1314, 470, 780, 382, 278, 0, 333, 0, 0, 0, 55, 132, "NULL", 0, 1, 0);
Rename that file to missy.sql for example and put it aside.
What this did is gave her a title and set her as a L2Merchant.

Next, you have to create a .htm for her, something that will contain the initial menu options for the shop. Something like this :



Code: Select all

<html>
<body>
Trader Missy:
<br>
Greetings. Everybody needs the items that we sell here. So, why don t you take a look?
<br>
<a action="bypass -h npc_%objectId%_Buy 700">Buy Soulshots and Spiritshots</a>
<br>
<a action="bypass -h npc_%objectId%_Buy 701">Buy Consumables and Minerals</a>
<br>
<a action="bypass -h npc_%objectId%_Buy 702">Armor and Weapons.</a>
<br>
<a action="bypass -h npc_%objectId%_Buy 703">Buy Fashion items</a>
<br>
<a action="bypass -h npc_%objectId%_Sell">Sell</a>
<br>
<a action="bypass -h npc_%objectId%_TerritoryStatus">See the Lord and Tax Rate Information</a>
<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body>
</html>
Save that to a new document, rename it to 30976.htm and keep it aside.

Now it's time to make as you can see the buylists 700,701,702,703.
They will contain the items you want to sell. So make a new document again and you should add something like this in it

Code: Select all

DELETE FROM merchant_shopids WHERE npc_id = 30976;

INSERT INTO merchant_shopids VALUES
(700, 30976),
(701, 30976),
(702, 30976),
(703, 30976);
DELETE FROM merchant_buylists WHERE shop_id IN (700,701,702,703);

INSERT INTO merchant_buylists VALUES
(1464, 100, 700, 1),
(1465, 200, 700, 2),
--keep adding (item_id, price, shop_id, order), 
(1785, 275, 701, 1),
(734, 1320, 701, 2),
--keep adding (item_id, price, shop_id, order), 
(92, 8680000, 702, 1),
(603, 358000, 702, 2),
--keep adding (item_id, price, shop_id, order), 
(8911, 1000000, 703, 1),
(8916, 1000000, 703, 2);
--keep adding (item_id, price, shop_id, order)
-- last entry ends with ; not , 

Save and rename that code above to missy2.sql and add in there every item you want to , just keep the order ascending .
You got 3 files now. The sql files you simply execute them in your mysql administration program(ie. Navicat). The htm file you will place in your server data/html/merchant folder. On next reboot //spawn 30976 and it should be ok.
executor485
Posts: 2
Joined: Thu Feb 15, 2007 1:53 am
Contact:

Post by executor485 »

Awesome walkthrough for making a shop... Very detailed. :)
xtos
Posts: 26
Joined: Wed Jan 24, 2007 3:26 pm

Post by xtos »

Thanks but this will not work with the latest datapack revisions and on.
Table merchant_buylists have been altered so, the third code we need to change it to something like this now :


Code: Select all

DELETE FROM merchant_shopids WHERE npc_id = 30976; 

INSERT INTO merchant_shopids VALUES 
(700, 30976), 
(701, 30976), 
(702, 30976), 
(703, 30976); 
DELETE FROM merchant_buylists WHERE shop_id IN (700,701,702,703); 

INSERT INTO merchant_buylists VALUES 
(1464, 100, 700, 1, -1, -1, 0, 0), 
(1465, 200, 700, 2, -1, -1, 0, 0), 
--keep adding (item_id, price, shop_id, order,count,currentCount,time,savetimer), 
(1785, 275, 701, 1, -1, -1, 0, 0), 
(734, 1320, 701, 2, -1, -1, 0, 0), 
--keep adding (item_id, price, shop_id, order,count,currentCount,time,savetimer), 
(92, 8680000, 702, 1, -1, -1, 0, 0), 
(603, 358000, 702, 2, -1, -1, 0, 0), 
--keep adding (item_id, price, shop_id, order,count,currentCount,time,savetimer), 
(8911, 1000000, 703, 1, -1, -1, 0, 0), 
(8916, 1000000, 703, 2, -1, -1, 0, 0); 
--keep adding (item_id, price, shop_id, order,count,currentCount,time,savetimer) 
-- your last entry should end with ; not , 
After this change , works ok.
hanniel
Posts: 8
Joined: Wed Jun 06, 2007 4:31 pm

Post by hanniel »

elow , someone can give me a link or method to set a good gmshop and global gk (npc buffer if possible) pliz , i realy need ...
tylerrrgs
Posts: 6
Joined: Tue Jul 07, 2009 7:14 pm

Re: [Help] Creating a GM Shop In Interlude

Post by tylerrrgs »

I received this error when executing the first sql file we created in this guide.


[Err] 1136 - Column count doesn't match value count at row 1
[Err] INSERT INTO npc VALUES
(31440, 31440, "Lanna", 1, "Consumable Merchant", 1, "NPC.e_traderB_FDwarf", 8, "20,5", 70, "female", "L2Merchant", 40, 3862, 1493, "11,85", "2,78", 40, 43, 30, 21, 20, 10, 0, 0, 1314, 470, 780, 382, 278, 0, 333, 0, 0, 0, 55, 132, "NULL", 0, 1, 0);
[Msg] Finished - Unsuccessfully
Tessa
Posts: 20
Joined: Sun Nov 15, 2009 3:44 pm
Location: Bulgaria

Re: [Help] Creating a GM Shop In Interlude

Post by Tessa »

tylerrrgs wrote:I received this error when executing the first sql file we created in this guide.


[Err] 1136 - Column count doesn't match value count at row 1
[Err] INSERT INTO npc VALUES
(31440, 31440, "Lanna", 1, "Consumable Merchant", 1, "NPC.e_traderB_FDwarf", 8, "20,5", 70, "female", "L2Merchant", 40, 3862, 1493, "11,85", "2,78", 40, 43, 30, 21, 20, 10, 0, 0, 1314, 470, 780, 382, 278, 0, 333, 0, 0, 0, 55, 132, "NULL", 0, 1, 0);
[Msg] Finished - Unsuccessfully
Try with this

Code: Select all

 INSERT INTO `npc` VALUES (31440, 31440, 'Lanna', 1, 'Consumable Merchant',1, 'NPC.e_traderB_FDwarf', 8, 20,5, 70, 'female', 'L2Merchant', 40, 3862,1493, 11,85, 2,78, 40, 43, 30, 21, 20, 10, 0, 0, 1314, 470, 780, 382, 278,0, 333, 0, 0, 0, 55, 132, NULL, 0, 1, 0, 'LAST_HIT'); 
TFNG
Posts: 52
Joined: Wed Nov 04, 2009 2:37 am

Re: [Help] Creating a GM Shop In Interlude

Post by TFNG »

I am new to this so please bear with me.
I tried this shop and encountered the same problem as others with the first sql code.
Taking the poster's code above me and editing it to this worked:

Code: Select all

INSERT INTO `npc` VALUES (101010, 31440, 'Margie', 1, 'Consumable Merchant',1, 'NPC.e_traderB_FDwarf', 8, 20, 70, 'female', 'L2Merchant', 40, 3862,1493, 0, 0, 40, 43, 30, 21, 20, 20, 0, 0, 1314, 470, 780, 382, 278,0, 333, 0, 0, 0, 30, 132, NULL, 0, 0, 0, 'LAST_HIT', 0, 0, 0, 'fighter', 'false');
*I wasnt sure if I should/could use a npc_id that is already used so I made a new one (101010) but used an existing npc_id template (31440). I hope this isnt causing an error/problem I am having.

I ran both sql code strings and they successfully completed. I then placed the htm file in the gameserver/data/html/merchant folder and the merchant does indeed spawn for me.
the problem I have is that nothing happens when I click an a link in her dialogue window for the buylists. The other links for the lord of the manor and the sell link work as expected.

I checked the merchant_buylist table and there are rows there for 700, 701, 702 and 703 ... so as far as my limited knowledge can tell it looks ok?

Hopefully this is my noobie mistake and its something simple I need to do to make it work properly.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: [Help] Creating a GM Shop In Interlude

Post by janiii »

an entry in merchant_buylists isnt enough. you have to have a mapping between the shop id and npc id in merchant_shopids table. so if you created a new npc id, you have to map it to the shop id.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
TFNG
Posts: 52
Joined: Wed Nov 04, 2009 2:37 am

Re: [Help] Creating a GM Shop In Interlude

Post by TFNG »

aha .. ok.. I will give that a look... thanks! :)

EDIT: YEP! There were entries there that corresponded to the original npc_id in the sql code before I changed it.. missed that ..
So now I know a little more than I did about adding an npc.. many thanks! :)
Post Reply