Jump to content

Game Master affects (logo, effects) aren't hidden


Recommended Posts

  • Gold

Hey guys,

when you are in the game with character, who have admin rights (GM) and who is in invisible mode (/inv) and you have GM logo & effects on that character, effects and GM logo aren't hidden when someone (player) appear (login, spawn) somewhere on the same map (or somewhere around you). Only AFF_YMIR_GM (AFF_YMIR - originally) works correctly. In other cases (AFF_YMIR_SA, //42 AFF_YMIR_GA, //43, AFF_YMIR_TGM, //44 ) it will cause the problem mentioned. I have no idea, where could be the problem. I tried to change almost everything and nothing worked.

I just noticed that's the problem caused by one system, which was on this forum in the past (GM AFFECTS) and I believe it's caused by a little mistake, but I don't know where it could be.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Below you can see file changes, which I did:

Server/char.cpp:

Spoiler
void CHARACTER::SetPlayerProto(const TPlayerTable * t)
{
  ...
		if (GetGMLevel() == GM_GOD)
		{
			m_afAffectFlag.Set(AFF_YMIR_GM);
		}

		else if (GetGMLevel() == GM_IMPLEMENTOR)
		{
			m_afAffectFlag.Set(AFF_YMIR_SA);
		}

		else if (GetGMLevel() == GM_HIGH_WIZARD)
		{
			m_afAffectFlag.Set(AFF_YMIR_GA);
		}

		else if (GetGMLevel() == GM_LOW_WIZARD)
		{
			m_afAffectFlag.Set(AFF_YMIR_TGM);
		}
  ...
}

 

Server/affects.h:

Spoiler
enum EAffectBits
{
	AFF_YMIR_GM, //0
  ...
	AFF_YMIR_SA, //42
	AFF_YMIR_GA, //43
	AFF_YMIR_TGM, //44
  ...
}

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Client/InstanceBase.h:

Spoiler
public:
		typedef DWORD TType;
enum
{
  			AFFECT_YMIR_GM, //0
  ...
			AFFECT_YMIR_SA, //42
			AFFECT_YMIR_GA, //43
			AFFECT_YMIR_TGM, //44
  ...
}

 

Client/InstanceBaseEffect.cpp:

Spoiler
void CInstanceBase::__SetAffect(UINT eAffect, bool isVisible)
  
 		case AFFECT_YMIR_GM:
		case AFFECT_YMIR_SA:
		case AFFECT_YMIR_GA:
		case AFFECT_YMIR_TGM:
			if (IsAffect(AFFECT_INVISIBILITY))
				return;
			break;

Client/InstanceBase.cpp:

Spoiler
BOOL CInstanceBase::IsGameMaster()
{	
	if (m_kAffectFlagContainer.IsSet(AFFECT_YMIR_GM))
		return true;

	if (m_kAffectFlagContainer.IsSet(AFFECT_YMIR_SA))
		return true;

	if (m_kAffectFlagContainer.IsSet(AFFECT_YMIR_GA))
		return true;

	if (m_kAffectFlagContainer.IsSet(AFFECT_YMIR_TGM))
		return true;

	return false;
}

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Pack/root:

localeInfo.py:

Spoiler
FN_GM_MARK = "%s/effect/gm_mark.mse" % app.GetLocalePath()
FN_SA_MARK = "%s/effect/sa_mark.mse" % app.GetLocalePath()
FN_GA_MARK = "%s/effect/ga_mark.mse" % app.GetLocalePath()
FN_TGM_MARK = "%s/effect/tga_mark.mse" % app.GetLocalePath()

playersettingmodule.py:

Spoiler
		chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+0, "Bip01", localeInfo.FN_GM_MARK)
  		chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+42, "Bip01", localeInfo.FN_SA_MARK)
		chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+43, "Bip01", localeInfo.FN_GA_MARK)
		chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+44, "Bip01", localeInfo.FN_TGM_MARK)

I would be really glad, if someone can tell me where could be the problem.

Thanks for possible answers!

Sincerely,

ReFresh

Edited by ReFresh
  • Metin2 Dev 1
  • Eyes 2

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 4 weeks later...
  • Bronze

Try to move the declarations of the new gm affects below the default gm affect, just before the invisible one (be aware of the affects enum in skill_proto).

As I see the affects are checked in order so the invisible affect is checked before the new gm affects are changed so no gm affect is present yet.

  • Metin2 Dev 1
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.