Jump to content

Block Item Pickup Event System


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

A member from this community called for a tutorial with this so I made this little tutorial with several functions. These functions can be applied during an event to lock assembly automatic any items Self pickup because stiim with all that many players join a private server when an event such as a break Metin and get xx chests, and players use most illegal software in order to collect as many chests or any item.

 

Command in game for disable/activate:

/e enable_block_table_pickup 1  -> Activate

/e enable_block_table_pickup 0  -> Disable

 

Spoiler

222156a89864422b2ad320bc0c7b3c3faa0468.g

 

- [ File: /Src/common/service.h ]

#define __ENABLE_BLOCK_PICKUP__ // Enables blocking of special items that can not be collected
#define __ENABLE_BLOCK_PICKUP__WARNING "[Block PickUp] You cannot collect this item when event is active!"

- [ File: /Src/common/length.h ]

 

enum TablePickupItem
{
	BLOCK_VNUM_0 = 50011,
	BLOCK_VNUM_1 = 50124,
	BLOCK_VNUM_2 = 50125,
	BLOCK_VNUM_3 = 50126,
	BLOCK_VNUM_4 = 50127,
	BLOCK_VNUM_5 = 50128,
	BLOCK_VNUM_6 = 50129,
	BLOCK_VNUM_7 = 50130,
	BLOCK_VNUM_8 = 50131,
	BLOCK_VNUM_9 = 50132,
	BLOCK_VNUM_10 = 50133,
};

- [ File: /Src/game/char_item.cpp ]

#1.) Search:

    if (!item || !item->GetSectree())
	        return false;

#2.) Add bellow:

#ifdef __ENABLE_BLOCK_PICKUP__
	DWORD vegas_dwEventFlagBlockPickup = quest::CQuestManager::instance().GetEventFlag("enable_block_table_pickup");
	
	if (vegas_dwEventFlagBlockPickup > 0)
	{	
		if (IS_TABLE_BLOCK_PICKUP(item->GetVnum()))
		{
			ChatPacket(CHAT_TYPE_NOTICE, __ENABLE_BLOCK_PICKUP__WARNING);	
			return false;
		}
	}	
#endif 

#3.) Search:

static bool FN_check_item_socket(LPITEM item)
{
	[........]
}

#4.) Add bellow:

#ifdef __ENABLE_BLOCK_PICKUP__
static bool IS_TABLE_BLOCK_PICKUP(int vnum)
{
	switch (vnum)
	{
		case BLOCK_VNUM_0:
		case BLOCK_VNUM_1:
		case BLOCK_VNUM_2:
		case BLOCK_VNUM_3:
		case BLOCK_VNUM_4:
		case BLOCK_VNUM_5:
		case BLOCK_VNUM_6:
		case BLOCK_VNUM_7:
		case BLOCK_VNUM_8:
		case BLOCK_VNUM_9:
		case BLOCK_VNUM_10:
            return true;
	}
	return false;
}
#endif

 

  • Metin2 Dev 2
  • Love 1
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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