Jump to content

Recommended Posts

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

/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

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.

  • Former Staff

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

  • Honorable Member

/dice DISABLE

/Á DISABLE

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

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

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

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

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 6
  • Active Member

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
  • 2 months later...
  • 1 year later...

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.