Jump to content

Block duplicate item purchase


tierrilopes
 Share

Recommended Posts

Go to file shop.cpp

Look for:

LPITEM item;
	if (m_pkPC) {
		item = r_item.pkItem;
	}
	else {
		item = ITEM_MANAGER::instance().CreateItem (r_item.vnum, r_item.count);
	}
	if (!item) {
		return SHOP_SUBHEADER_GC_SOLD_OUT;
	}

Add below:

	//block duplicate item purchase begin
	if (ch->CountSpecifyItem(item->GetVnum()) >= 1)
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "You can only buy one item of each type.");
		return SHOP_SUBHEADER_GC_END;
	}
	//block duplicate item purchase end

 

It should look like this:

imagem.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...