Jump to content

ImmuneFlag not work


Recommended Posts

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Check 

bool CHARACTER::IsImmune(DWORD dwImmuneFlag)

in char_resist.cpp

Also make shure to put immune_flags in correct order in setImmuneFlag in mob_proto. For example if you have enum:
 

	IMMUNE_STUN = (1 << 0),
	IMMUNE_SLOW = (1 << 1),
	IMMUNE_FALL = (1 << 2),
	IMMUNE_CURSE = (1 << 3),
	IMMUNE_POISON = (1 << 4),
	IMMUNE_TERROR = (1 << 5),
	IMMUNE_REFLECT = (1 << 6),

then immune_stun should be firsst, next slow etc. It cannot be like

IMMUNE_POISON | IMMUNE_CURSE | IMMUNE_TERROR

 

Edited by jKing
Link to comment
Share on other sites

1 hour ago, jKing said:

Check 

bool CHARACTER::IsImmune(DWORD dwImmuneFlag)

in char_resist.cpp

Also make shure to put immune_flags in correct order in setImmuneFlag in mob_proto. For example if you have enum:
 

	IMMUNE_STUN = (1 << 0),
	IMMUNE_SLOW = (1 << 1),
	IMMUNE_FALL = (1 << 2),
	IMMUNE_CURSE = (1 << 3),
	IMMUNE_POISON = (1 << 4),
	IMMUNE_TERROR = (1 << 5),
	IMMUNE_REFLECT = (1 << 6),

then immune_stun should be firsst, next slow etc. It cannot be like

IMMUNE_POISON | IMMUNE_CURSE | IMMUNE_TERROR

 

enum EImmuneFlags
{
	IMMUNE_STUN		= (1 << 0),
	IMMUNE_SLOW		= (1 << 1),
	IMMUNE_FALL		= (1 << 2),
	IMMUNE_CURSE	= (1 << 3),
	IMMUNE_POISON	= (1 << 4),
	IMMUNE_TERROR	= (1 << 5),
	IMMUNE_REFLECT	= (1 << 6),
};




int get_Mob_ImmuneFlag_Value(string inputString)
{
	string arImmuneFlag[] = {"STUN","SLOW","FALL","CURSE","POISON","TERROR", "REFLECT"};
  
  
  
  
  
  
  
  
  
  
  
  
  
bool CHARACTER::IsImmune(DWORD dwImmuneFlag)
{
	if (IS_SET(m_pointsInstant.dwImmuneFlag, dwImmuneFlag))
	{
		int immune_pct = 100;
		int	percent = number(1, 100);

		if (percent <= immune_pct)	// 90% Immune
		{
			if (test_server && IsPC())
				ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_SUCCESS> (%s)", GetName()); 

			return true;
		}
		else
		{
			if (test_server && IsPC())
				ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_FAIL> (%s)", GetName());

			return false;
		}
	}

	if (test_server && IsPC())
		ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_FAIL> (%s) NO_IMMUNE_FLAG", GetName());

	return false;
}

 

Edited by Nuzzo
Link to comment
Share on other sites

4 minutes ago, jKing said:

So as I said above, make shure you put your immune flags in correct order

https://metin2.download/picture/FcSMbIKxgRgDP2xX8V6jSbx2OgimB9rn/.png

https://metin2.download/picture/43Y7m88hY827G36fH3thx8I4136m97iS/.png

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.