Jump to content

Recommended Posts

How do I add a 1-second block on using skills after removing or swapping an item, like a weapon, armor, costume, costume weapon, or costume hair?

Thanks in advance.🙂

 

Example code on the client and server for map blocking.

Client

Spoiler
//@svn/Source/Client/UserInterface/InstanceBaseBattle.cpp
//1.) Search:

bool CInstanceBase::NEW_UseSkill(UINT uSkill, UINT uMot, UINT uMotLoopCount, bool isMovingSkill)
{

//2.) Add bellow:

#ifdef ENABLE_FEATURES_BLOCK_SKILL
	static std::string uCurrentMap = CPythonBackground::Instance().GetWarpMapName();
	static std::string uArrayListOfMaps[] = {
		"metin2_map_a1",
		"metin2_map_b1",	/* loaded from atlasinfo.txt */
		"metin2_map_c1"
	}; 		
	
	for (int i=0;i<_countof(uArrayListOfMaps);i++)
	{
		if (!IsGameMaster() && (!uCurrentMap.compare(uArrayListOfMaps[i])))
		{
			TraceError("CInstanceBase::UseSkill on map %s was blocked.", uArrayListOfMaps[i].c_str());
			return false;
		}
	}
#endif

 

Server

Spoiler
//@svn/Server/game/src/game/char_skill.cpp
//1.) Search:

	if (0 == dwSkillVnum) return false;
	
//2.) Add bellow:

#ifdef ENABLE_FEATURES_BLOCK_SKILL
	static int arrayMapIndex[] = {
		1, 21, 41 /* loaded from map/index.txt */
	}; 		
	
	for (int i=0;i<_countof(arrayMapIndex);i++)
	{
		if (!IsGM() && GetMapIndex() == arrayMapIndex[i])
		{
			ChatPacket(CHAT_TYPE_NOTICE, "CHARACTER::UseSkill on mapIndex %d was blocked.", arrayMapIndex[i]);
			return false;
		}
	}
#endif

 

 

Link to comment
https://metin2.dev/topic/33276-block-skill/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.