Jump to content

Shop Ex Renewal


Recommended Posts

  • Premium
23 minutes ago, TysonDMG said:

Now instead of item, yang displays exp

the first is with yang and second with item

https://metin2.download/picture/EZivzdZ2Z4zhRCIHkldcWhfVaR9ukQtX/.gif

spacer.png

price_type select gold if you want yang ('GOLD','SECONDCOIN','ITEM','EXP')

Example:

INSERT INTO `shopex_item` VALUES (63, 19, 1, 13, 0, 'GOLD', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 6
  • Not Good 1
  • Think 1
  • Confused 1
  • Scream 1
  • Good 3

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • Active Member
On 4/12/2020 at 8:11 PM, Owsap said:

Not sure where I could share this but here is a way to simply reload the ShopTableEx in-game.

In reply to @Chief, @CHMarvin, @thespeedy and a contribution to @masodikbela's & @Mali61 post.

 

 

Reload ShopTableEx

 

game/src/cmd_gm.cpp

  Hide contents
/// 1.
// Add
#include "shop_manager.h"

/// 2.
// Search
		switch (LOWER(*arg1))

// Add above
		if (strstr(arg1, "shop_ex"))
		{
			char szShopTableExFileName[256];
			snprintf(szShopTableExFileName, sizeof(szShopTableExFileName),
				"%s/shop_table_ex.txt", LocaleService_GetBasePath().c_str());

			if (CShopManager::instance().ReloadShopTableEx(szShopTableExFileName))
				ch->ChatPacket(CHAT_TYPE_INFO, "Reloading ShopTableEx.");
			else
				ch->ChatPacket(CHAT_TYPE_INFO, "Failed to reload ShopTableEx.");

			return;
		}

 

game/src/shop_manager.cpp

  Hide contents
/// 1.
// Search
bool CShopManager::ReadShopTableEx(const char* stFileName)

// Add above
bool CShopManager::ReloadShopTableEx(const char* stFileName)
{
	return ReadShopTableEx(stFileName, true);
}

/// 2.
// Search
bool CShopManager::ReadShopTableEx(const char* stFileName)

// Replace with
bool CShopManager::ReadShopTableEx(const char* stFileName, bool bReload)

/// 3.
// Search
	typedef std::multimap <DWORD, TShopTableEx> TMapNPCshop;
	TMapNPCshop map_npcShop;

// Add below
	if (bReload)
	{
		sys_log(0, "RELOADING ShopTableEx");
		map_npcShop.clear();
		m_map_pkShopByNPCVnum.clear();
		m_map_pkShop.clear();
	}

 

game/src/shop_manager.h

  Hide contents
/// 1.
// Search
	void Destroy();

// Add below
	bool ReloadShopTableEx(const char* stFileName);

/// 2.
// Search
	bool ReadShopTableEx(const char* stFileName);

// Replace with
	bool ReadShopTableEx(const char* stFileName, bool bReload = false);

 

 

Result

 

https://metin2.download/picture/o46OU9SVu96fNAANCWZ2lTT1krtmT0r0/.gif

 

4f5c26dcf871788ee09bef14d3392a7b.gif

 

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 2 weeks later...

Hey,
When opening an extended shop my game dies:

 0x0824093b in CShopEx::AddGuest (this=<optimized out>, ch=<optimized out>, owner_vid=<optimized out>, bOtherEmpire=<optimized out>) at shopEx.cpp:128
        pack = {header = 38 '&', size = 22428, subheader = 10 '\n'}
        pack2 = {owner_vid = 35740, shop_tab_count = 3 '\003'}
        temp = "ARMOR", '\000' <repeats 15 times>, ">\000\000\000\000\000\000\000\004\000\000\000\000\363.\000\000\372", '\000' <repeats 15 times>, "\001", '\000' <repeats 25 times>, "\001\320\a", '\000' <repeats 39 times>, "\001\000\000\000\000\375.\000\000\250a", '\000' <repeats 14 times>, "\001", '\000' <repeats 67 times>...
        buf = <optimized out>
        size = <optimized out>

Any ideas why?

Thanks in advance!

Link to comment
Share on other sites

  • 2 weeks later...

Hi, i have 3 pages on 1 npc, i want to open them with quest, like:
local select = select("First window", "Second window", "Third window")
if select == 1 then
      npc.open_shop(5)
      setskin(NOWINDOW)

if select == 2 then
      npc.open_shop(6)
      setskin(NOWINDOW)

if select == 3 then
      npc.open_shop(7)
      setskin(NOWINDOW)


But it always opens the first window, any solution?

Link to comment
Share on other sites

  • Active Member

@redscoutyt2 You should learn at least some basics about lua coding, then you won't have problem with solving things like you posted. 

This should work correctly:

Spoiler
local select = select("First window", "Second window", "Third window")

if select == 1 then
	npc.open_shop(5)
	setskin(NOWINDOW)

elseif select == 2 then
	npc.open_shop(6)
	setskin(NOWINDOW)

elseif select == 3 then
	npc.open_shop(7)
	setskin(NOWINDOW)

 

Enjoy! ?

I'll be always helpful! ? 

Link to comment
Share on other sites



×
×
  • 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.