Jump to content

Shop Ex Renewal


Recommended Posts

  • Active Member
Just now, redscoutyt2 said:

@ ReFreshThank you, it was just an example. I wrote the quest like this, even before commenting here. I tried yours(even its the same as mine), its not working.

Send me your quest to PM. I will try to fix it for you.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 1 month later...

i have this error

tables.h:1495: error: use of enum 'STableExTypes' without previous declaration
../../common/tables.h:1495: error: expected unqualified-id before ':' token

 

#ifdef __SHOPEX_RENEWAL__
enum STableExTypes : decltype(TShopItemTable::price_type)
{
    EX_GOLD = 1,
    EX_SECONDARY,
    EX_ITEM,
    EX_EXP,
    EX_MAX
};
#endif

 

with gcc+49

 

Link to comment
Share on other sites

  • 3 weeks later...
  • Active Member
10 hours ago, blaxis said:

spacer.png

I am having this problem. From what I can see in the comments, a few people have had the same problem. No response from any of them!

Doesn't anyone care?

Send whole error 

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

  • Active+ Member
On 8/4/2020 at 11:32 AM, V0lvox said:

Have a other problem.

He use to show items: 
CShopEx::AddGuest()
But when i buy something, he use:
pkShop->Buy()

This Buy is shop.cpp and not shopex.cpp

So the Buy of shop.cpp does not know the items from shopex.

So everytime m_itemVector.size() = 0

And so i cant buy items on shopex

Solve ?

  • Not Good 1
  • Think 1
Link to comment
Share on other sites

  • Active+ Member
On 12/21/2021 at 6:25 PM, Mali said:

How?

Edit: No answer. It's an error that was your fault then.

The description file you shared is incorrect. That's why I had this problem.
The explanation below is incorrect. (shopex.cpp)

//Find
			switch (shop_tab.coinType)
			{
			case SHOP_COIN_TYPE_GOLD:
				if (bOtherEmpire) // no empire price penalty for pc shop
					pack_tab.items[i].price = shop_tab.items[i].price * 3;
				else
					pack_tab.items[i].price = shop_tab.items[i].price;
				break;
			case SHOP_COIN_TYPE_SECONDARY_COIN:
				pack_tab.items[i].price = shop_tab.items[i].price;
				break;
			}
			memset(pack_tab.items[i].aAttr, 0, sizeof(pack_tab.items[i].aAttr));
			memset(pack_tab.items[i].alSockets, 0, sizeof(pack_tab.items[i].alSockets));
			
///Change
#if defined(ENABLE_RENEWAL_SHOPEX)
			pack_tab.items[i].price_type = shop_tab.items[i].price_type;
			pack_tab.items[i].price_vnum = shop_tab.items[i].price_vnum;
			pack_tab.items[i].price = shop_tab.items[i].price;
			if (bOtherEmpire && pack_tab.items[i].price_type == SHOPEX_GOLD)
				pack_tab.items[i].price *= 3;
			thecore_memcpy(pack_tab.items[i].aAttr, shop_tab.items[i].aAttr, sizeof(pack_tab.items[i].aAttr));
			thecore_memcpy(pack_tab.items[i].alSockets, shop_tab.items[i].alSockets, sizeof(pack_tab.items[i].alSockets));
#else
			switch (shop_tab.coinType)
			{
			case SHOP_COIN_TYPE_GOLD:
				if (bOtherEmpire) // no empire price penalty for pc shop
					pack_tab.items[i].price = shop_tab.items[i].price * 3;
				else
					pack_tab.items[i].price = shop_tab.items[i].price;
				break;
			case SHOP_COIN_TYPE_SECONDARY_COIN:
				pack_tab.items[i].price = shop_tab.items[i].price;
				break;
			}
			memset(pack_tab.items[i].aAttr, 0, sizeof(pack_tab.items[i].aAttr));
			memset(pack_tab.items[i].alSockets, 0, sizeof(pack_tab.items[i].alSockets));
#endif

Indeed, this is how it should be:

 

//Find
			memset(pack_tab.items[i].aAttr, 0, sizeof(pack_tab.items[i].aAttr));
			memset(pack_tab.items[i].alSockets, 0, sizeof(pack_tab.items[i].alSockets));
			
///Change
#if defined(ENABLE_RENEWAL_SHOPEX)
			pack_tab.items[i].price_type = shop_tab.items[i].price_type;
			pack_tab.items[i].price_vnum = shop_tab.items[i].price_vnum;
			pack_tab.items[i].price = shop_tab.items[i].price;
			if (bOtherEmpire && pack_tab.items[i].price_type == SHOPEX_GOLD)
				pack_tab.items[i].price *= 3;
			thecore_memcpy(pack_tab.items[i].aAttr, shop_tab.items[i].aAttr, sizeof(pack_tab.items[i].aAttr));
			thecore_memcpy(pack_tab.items[i].alSockets, shop_tab.items[i].alSockets, sizeof(pack_tab.items[i].alSockets));
#else
			memset(pack_tab.items[i].aAttr, 0, sizeof(pack_tab.items[i].aAttr));
			memset(pack_tab.items[i].alSockets, 0, sizeof(pack_tab.items[i].alSockets));
#endif

And search:

char temp[8096]; // ÃÖ´ë 1728 * 3

Change:

char temp[8096 * 3]; // ÃÖ´ë 1728 * 3

This is how I solved the problem. Items and prices seem fine, but like I said, I can't buy. I am getting the error mentioned in my above post.

 

Edited by blaxis
  • kekw 1
  • Not Good 1
  • Lmao 1
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

Hello has anyone had this problem with shopex? It only happens rarely but sometimes i get this and crash when opening a shopex shop: 0626 00:00:25876 :: Phase Game does not handle this header (header: 38, last: 4, 38) 0626 00:00:25893 :: Unprocessed packet header 8, state Game

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
  • 1 month later...
  • 2 months later...
On 12/21/2021 at 7:03 PM, blaxis said:

I solved core error but I have this problem.. 

I can't buy items

Error: SHOP_INVALID_POS(locale_game.txt)

 

FİX;

Make sure the shop and shopex classes take the same parameters. Check the parameters you pass in the buy function in the Shopmanager class. If shopex does not take the same parameters, it will rely on the buy function in the shop class.

Link to comment
Share on other sites

  • 4 weeks later...
bool CompareShopItemVnum(const SShopItemTable& lhs, const SShopItemTable& rhs)
{
	return (lhs.vnum == rhs.vnum ? lhs.vnum + lhs.count < rhs.vnum + rhs.count : lhs.vnum < rhs.vnum);
}

first vnum after count compare 

like this 

Spoiler

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

  • 2 months later...

new errors

shop.cpp: In member function 'virtual bool CShop::AddGuest(LPCHARACTER, DWORD, bool)':
shop.cpp:420:33: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'TPacketGCShopStart' {aka 'struct packet_shop_start'}; use assignment or value-initialization instead [-Wclass-memaccess]
  420 |  memset(&pack2, 0, sizeof(pack2));
      |                                 ^
In file included from packet_info.h:4,
                 from input.h:4,
                 from desc.h:5,
                 from shop.cpp:7:
packet.h:1273:16: note: 'TPacketGCShopStart' {aka 'struct packet_shop_start'} declared here
 1273 | typedef struct packet_shop_start
====================================================================================

ClientManagerBoot.cpp: In member function 'bool CClientManager::InitializeShopEXTable()':
ClientManagerBoot.cpp:391:49: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'TShopTable' {aka 'struct SShopTable'}; use assignment or value-initialization instead [-Wclass-memaccess]
  391 |    std::memset(shop_table, 0, sizeof(TShopTable));
      |                                                 ^
In file included from stdafx.h:14,
                 from ClientManagerBoot.cpp:2:
../../common/tables.h:624:16: note: 'TShopTable' {aka 'struct SShopTable'} declared here
  624 | typedef struct SShopTable
      |                ^~~~~~~~~~
ClientManagerBoot.cpp:398:27: error: 'TShopTable' {aka 'struct SShopTable'} has no member named 'szShopName'
  398 |   std::memcpy(shop_table->szShopName, data[col++], sizeof(shop_table->szShopName));
      |                           ^~~~~~~~~~
ClientManagerBoot.cpp:398:71: error: 'TShopTable' {aka 'struct SShopTable'} has no member named 'szShopName'
  398 |   std::memcpy(shop_table->szShopName, data[col++], sizeof(shop_table->szShopName));
      |                                                                       ^~~~~~~~~~
ClientManagerBoot.cpp:406:24: error: 'TShopItemTable' {aka 'struct SShopItemTable'} has no member named 'price_vnum'
  406 |   str_to_number(pItem->price_vnum, data[col++]);
      |                        ^~~~~~~~~~
ClientManagerBoot.cpp:407:24: error: 'TShopItemTable' {aka 'struct SShopItemTable'} has no member named 'price_type'
  407 |   str_to_number(pItem->price_type, data[col++]);
      |                        ^~~~~~~~~~
ClientManagerBoot.cpp:410:25: error: 'TShopItemTable' {aka 'struct SShopItemTable'} has no member named 'alSockets'
  410 |    str_to_number(pItem->alSockets[i], data[col++]);
      |                         ^~~~~~~~~
ClientManagerBoot.cpp:412:25: error: 'TShopItemTable' {aka 'struct SShopItemTable'} has no member named 'aAttr'
  412 |    str_to_number(pItem->aAttr[i].bType, data[col++]);
      |                         ^~~~~
ClientManagerBoot.cpp:413:25: error: 'TShopItemTable' {aka 'struct SShopItemTable'} has no member named 'aAttr'
  413 |    str_to_number(pItem->aAttr[i].sValue, data[col++]);
      |                         ^~~~~
 

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
On 9/8/2021 at 10:29 PM, metser said:

SHOP_INVALID_POS    This Item cannot be used here.

i get this error any item i am trying to buy, what could be the cause of the error?

@ Mali

Same error there 
https://metin2.download/picture/BLCx3bRei94DTqJMFiysV38b2ebJ2fhB/.gif

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

  • 2 weeks later...

Announcements



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