Jump to content
  • 0
Evor

Known bugs/backdoors/coredowners/useless things in metin2 cores

Question

Hello community!

I was wondering about things which i should repair according to the Vanilla topic. It would be nice to create a topic where everybody can post bugs which them knew, so devs can fix them imidietely.

Best wishes,

Evor

  • Love 5

Share this post


Link to post

19 answers to this question

Recommended Posts

  • 1

/war fix

http://metin2dev.org/board/topic/75-source-discussions-questions-answers/?p=2392

License fix (should work):

desc.cpp:202

if ((unsigned)get_global_time() == 0)
{
extern void ClearAdminPages();
ClearAdminPages();
extern g_bShutdown;
g_bShutdown = true;
}
  • Love 1

Share this post


Link to post
  • 0

Invisible bug.

Hp/Mp bug overflow.

Item.remove -> removing whole stack of items instead of one.

Remove Metin2Server_Check|isInvalid functions.

INTERNAL Ip fix.

@up

To remove licence you should search for "GLOBAL_TIME" and simply comment all of that code.

Share this post


Link to post
  • 0

Invisible bug.

Hp/Mp bug overflow.

Item.remove -> removing whole stack of items instead of one.

Remove Metin2Server_Check|isInvalid functions.

INTERNAL Ip fix.

@up

To remove licence you should search for "GLOBAL_TIME" and simply comment all of that code.

Item.remove is meant to remove the stack..

 

pc.remove_item(item.vnum, wished number) is made to remove only a number ;)

Share this post


Link to post
  • 0

Yea but it doesn't remove special items like skillbook ;)

Wysłane z Sony XPERIA Z

Share this post


Link to post
  • 0

As far as i know number_ex func is already fixed. Correct me if i'm wrong.

Wysłane z Sony XPERIA Z

Share this post


Link to post
  • 0

Characters getting stuck after teleporting to map with wrong index.

Open char.cpp

Search for CHARACTER::WarpEnd()

replace

if (!map_allow_find(index))
	{
		// ŔĚ °÷Ŕ¸·Î żöÇÁÇŇ Ľö ľřŔ¸ąÇ·Î żöÇÁÇϱâ Ŕü ÁÂÇĄ·Î µÇµą¸®ŔÚ.
		sys_err("location %d %d not allowed to login this server", m_posWarp.x, m_posWarp.y);
		GetDesc()->SetPhase(PHASE_CLOSE);
		return;

	}

with

if (!map_allow_find(index))
		GoHome();
  • Love 5

Share this post


Link to post
  • 0

Fixed issue with wrong counting of immunes.
Open char_resist.cpp

Search for bool CHARACTER::IsImmune(DWORD dwImmuneFlag)

replace

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;
}

with

bool CHARACTER::IsImmune(DWORD dwImmuneFlag)
{
	if (IS_SET(m_pointsInstant.dwImmuneFlag, dwImmuneFlag))
		/* Ustawienia 100% na WSZYSTKIE odporności */
		return true;
	if (test_server && IsPC())
		ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_FAIL> (%s) NO_IMMUNE_FLAG", GetName());

	return false;
}
  • Love 2

Share this post


Link to post
  • 0

Check the chat commands with integer/double parameters.

With them you can make an integer overflow an the core crashes.

 

Fix: if statements for a "max value"

Share this post


Link to post
  • 0

/dice DISABLE

/Á DISABLE

 

number_ex is fixed in 40k already

Share this post


Link to post
  • 0

Soo, i managed to fix it in that way.
do_dice

        if(atoi(arg1) > 100 || atoi(arg1) < 0)
		start = 1;
	if(atoi(arg2) > 100 || atoi(arg2) < 0)
		end = 100;

number_ex (don't add checking if number is bigger than 100, becouse sectree uses this func too)

	if(from < 0)
		from = 1;
	if(to < 0)
		to = 1;

cmd.cpp (interpret_command)

	/* argument filtering */
	char arg1[256], arg2[256];
	two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
	if(atoi(arg1) < 0 || atoi(arg2) < 0)
		return;

i don't know if it still allow players to use number overflow.

Greets.

  • Love 1

Share this post


Link to post
  • 0

 

/dice DISABLE

/Á DISABLE

 

number_ex is fixed in 40k already

 

i thought it was but in fact dice works with max integer. Maybe it was because i'm using mainline_sg dunno.

Share this post


Link to post
  • 0

Fix for Status point (no points after 91 level)
Open char.cpp

Search for void CHARACTER::PointChange(BYTE type, int amount, bool bAmount, bool bBroadcast)

search and replace

	case POINT_LEVEL_STEP:
			if (amount > 0)
			{
				val = GetPoint(POINT_LEVEL_STEP) + amount;

				switch (val)
				{
					case 1:
					case 2:
					case 3:
						//if (GetLevel() < 100) PointChange(POINT_STAT, 1);
						if (GetLevel() < 91) PointChange(POINT_STAT, 1);
						break;

					case 4:
						{
							int iHP = number(JobInitialPoints[GetJob()].hp_per_lv_begin, JobInitialPoints[GetJob()].hp_per_lv_end);
							int iSP = number(JobInitialPoints[GetJob()].sp_per_lv_begin, JobInitialPoints[GetJob()].sp_per_lv_end);

							m_points.iRandomHP += iHP;
							m_points.iRandomSP += iSP;

							if (GetSkillGroup())
							{
								if (GetLevel() >= 5)
									PointChange(POINT_SKILL, 1);

								if (GetLevel() >= 9)
									PointChange(POINT_SUB_SKILL, 1);
							}

							PointChange(POINT_MAX_HP, iHP);
							PointChange(POINT_MAX_SP, iSP);
							PointChange(POINT_LEVEL, 1, false, true);

							val = 0;
						}
						break;
				}

				if (GetLevel() <= 10)
					AutoGiveItem(27001, 2);
				else if (GetLevel() <= 30)
					AutoGiveItem(27002, 2);
				else
				{
					AutoGiveItem(27002, 2);
//					AutoGiveItem(27003, 2);
				}

				PointChange(POINT_HP, GetMaxHP() - GetHP());
				PointChange(POINT_SP, GetMaxSP() - GetSP());
				PointChange(POINT_STAMINA, GetMaxStamina() - GetStamina());

				SetPoint(POINT_LEVEL_STEP, val);
				SetRealPoint(POINT_LEVEL_STEP, val);

				Save();
			}
			else
				val = GetPoint(POINT_LEVEL_STEP);

			break;

with

	case POINT_LEVEL_STEP:
			if (amount > 0)
			{
				val = GetPoint(POINT_LEVEL_STEP) + amount;

				switch (val)
				{
					case 1:
					case 2:
					case 3:
						//if (GetLevel() < 100) PointChange(POINT_STAT, 1);
						PointChange(POINT_STAT, 1);
						break;

					case 4:
						{
							int iHP = number(JobInitialPoints[GetJob()].hp_per_lv_begin, JobInitialPoints[GetJob()].hp_per_lv_end);
							int iSP = number(JobInitialPoints[GetJob()].sp_per_lv_begin, JobInitialPoints[GetJob()].sp_per_lv_end);

							m_points.iRandomHP += iHP;
							m_points.iRandomSP += iSP;

							if (GetSkillGroup())
							{
								if (GetLevel() >= 5)
									PointChange(POINT_SKILL, 1);

								if (GetLevel() >= 9)
									PointChange(POINT_SUB_SKILL, 1);
							}

							PointChange(POINT_MAX_HP, iHP);
							PointChange(POINT_MAX_SP, iSP);
							PointChange(POINT_LEVEL, 1, false, true);

							val = 0;
						}
						break;
				}

				if (GetLevel() <= 10)
					AutoGiveItem(27001, 2);
				else if (GetLevel() <= 30)
					AutoGiveItem(27002, 2);
				else
				{
					AutoGiveItem(27002, 2);
//					AutoGiveItem(27003, 2);
				}

				PointChange(POINT_HP, GetMaxHP() - GetHP());
				PointChange(POINT_SP, GetMaxSP() - GetSP());
				PointChange(POINT_STAMINA, GetMaxStamina() - GetStamina());

				SetPoint(POINT_LEVEL_STEP, val);
				SetRealPoint(POINT_LEVEL_STEP, val);

				Save();
			}
			else
				val = GetPoint(POINT_LEVEL_STEP);

			break;

You can also match it with your value (for example limit of status points etc.)

I'd tomorrow show how to make a config where u can set a max status point and modify function up to give a number of status points which will perfectly fit to the max of cfg file.

 

  • Love 5

Share this post


Link to post
  • 0

If You want use pc.change_name with european locale just comment that piece of code: (questlua_pc.cpp, 2073 ln)

       if ( LC_IsEurope() )
		{
			lua_pushnumber(L, 5);
			return 1;
		}
  • Love 1

Share this post


Link to post
  • 0

The number_ex issue is just a division by 0 crash. (the "random()%div" part, div = 0 -> crash)

  • Love 1

Share this post


Link to post
  • 0

/dice DISABLE

/Á DISABLE

 

Á DISABLE does not works, we should use the proper korean name instead of the glitched one:

 

주사위 DISABLE

  • Love 1

Share this post


Link to post
  • 0

My 3 items of change bonus are coredowners... when i use that my core is down :( Please help :( in log say something like "Sequence_log"

Share this post


Link to post

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
  • Recently Browsing   0 members

    No registered users viewing this page.

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