Jump to content

Shop Ex Renewal


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

 

Anyway now you can sell shop items with sockets and attrs at shopex.

New price types.

New sorting options

Every Item can have different price type.

price_type: 1:Gold 2:Second Coin 3:Item 4:EXP

sort: Asc,Desc,Vnum,Price,Name,Type

Spoiler

28411568747470733a2f2f692e6962622e636f2f
28411568747470733a2f2f692e6962622e636f2f
28411568747470733a2f2f692e6962622e636f2f

 

  • Metin2 Dev 299
  • kekw 1
  • Eyes 4
  • Dislove 2
  • Not Good 1
  • Sad 1
  • Smile Tear 2
  • Think 3
  • Confused 2
  • Scream 2
  • Lmao 1
  • Good 83
  • Love 19
  • Love 192

 

Link to comment
Share on other sites

After 

		if (pItemGroup->GetValue(i, "price_type", shopItems[i].price_type) && pItemGroup->GetValue(i, "price_vnum", shopItems[i].price_vnum) && shopItems[i].price_type == 3) {
			if (shopItems[i].price_type > 4 || shopItems[i].price_type < 1) {
				sys_err("row(%d) of group items of group %s price_type is wrong!", i, pNode->GetNodeName().c_str());
				return false;
			}
			TItemTable * pProto = ITEM_MANAGER::instance().GetTable(shopItems[i].price_vnum);
			if (!pProto) {
				sys_err("NOT GET ITEM PROTO %d", shopItems[i].price_vnum);
				return false;
			}
		}

 

You can add this to clean the memory

 

memset(&getval, 0, sizeof(getval));

 

  • Good 1
  • Love 2
Link to comment
Share on other sites

  • Honorable Member
19 minutes ago, ManiacRobert said:

After 


		if (pItemGroup->GetValue(i, "price_type", shopItems[i].price_type) && pItemGroup->GetValue(i, "price_vnum", shopItems[i].price_vnum) && shopItems[i].price_type == 3) {
			if (shopItems[i].price_type > 4 || shopItems[i].price_type < 1) {
				sys_err("row(%d) of group items of group %s price_type is wrong!", i, pNode->GetNodeName().c_str());
				return false;
			}
			TItemTable * pProto = ITEM_MANAGER::instance().GetTable(shopItems[i].price_vnum);
			if (!pProto) {
				sys_err("NOT GET ITEM PROTO %d", shopItems[i].price_vnum);
				return false;
			}
		}

 

You can add this to clean the memory

 


memset(&getval, 0, sizeof(getval));

 

not necessary

  • Love 1

 

Link to comment
Share on other sites

  • Contributor

I am glad you added new prices as i said in your last topic

Great work

 

Just one thing to ask , in shopex is there a way to make the shop gui extend height if there are more choices let's say like : ARMOR-ITEMS-WEAPONS...etc so it look good

  • Love 1

My only accounts are here and on M2D, Don't trust anyone else from other shitty sites.
266868740522639360.png

Link to comment
Share on other sites

  • Honorable Member

#New sorting options added:

sort: Asc,Desc,Vnum,Price,Name,Type

----------

21 hours ago, MrQuin said:

I am glad you added new prices as i said in your last topic

Great work

 

Just one thing to ask , in shopex is there a way to make the shop gui extend height if there are more choices let's say like : ARMOR-ITEMS-WEAPONS...etc so it look good

You are looking for:

Spoiler

asd.png

Don't forget the change SHOP_TAB_COUNT_MAX from Server/length.h and Client/Packet.h

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2

 

Link to comment
Share on other sites

vor 2 Stunden schrieb Mali61:

#New sorting options added:


sort: Asc,Desc,Vnum,Price,Name,Type

----------

You are looking for:

  Inhalt unsichtbar machen

asd.png

Don't forget the change SHOP_TAB_COUNT_MAX from Server/length.h and Client/Packet.h

Cant see the picture

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

expected primary-expression before '['token on shop manager line 534

line 534


std::sort(shopItems.begin(), shopItems.end(), [stSort](const TShopItemTable& i1, const TShopItemTable& i2)


full line


#ifdef ENABLE_RENEWAL_SHOPEX
else {
std::sort(shopItems.begin(), shopItems.end(), [stSort](const TShopItemTable& i1, const TShopItemTable& i2)
{
TItemTable* lItem = ITEM_MANAGER::instance().GetTable(i1.vnum);
TItemTable* rItem = ITEM_MANAGER::instance().GetTable(i2.vnum);
if (stSort == "Vnum")
return i1.vnum > i2.vnum;
else if (stSort == "Price")
return i1.price > i2.price;
else if (stSort == "Name" && lItem && rItem)
return strcmp(lItem->szLocaleName, rItem->szLocaleName) < 0;
else if (stSort == "Type" && lItem && rItem)
return lItem->bType > rItem->bType;
});
}
#endif

 

@VegaS™  do you know how to solve?

Link to comment
Share on other sites

  • Forum Moderator
On 9/5/2019 at 6:13 PM, Thundernatsu said:

expected primary-expression before '['token on shop manager line 534
line 534
std::sort(shopItems.begin(), shopItems.end(), [stSort](const TShopItemTable& i1, const TShopItemTable& i2)

Lambda expressions (since C++11), you need CFLAG += -std=c++11, if you want to do it without, then you've to do something like this:

This is the hidden content, please

 

  • Metin2 Dev 53
  • kekw 1
  • Eyes 1
  • Cry 1
  • Think 1
  • Confused 1
  • Scream 1
  • Good 17
  • Love 2
  • Love 51
Link to comment
Share on other sites

15 minut temu, displayjokes napisał:

I've tested a lot of things and that happens everytime, i even tried to open the shop with quest, but it seems like it's not there the shop at all, only the file is beeing loaded because it gave me conflicts with same npc that had shops

We have to wait for solution i think.

Link to comment
Share on other sites

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.