Jump to content

Attack and defense bug - additional equipment page


Go to solution Solved by ARiver,

Recommended Posts

  • Premium

Hello,

I have installed this system : 

 

Everything works fine but i have a bug : 

Stats of attack and defense are not updated properly, it's not just a visual bug at least regarding defense. It seems like defense does not decrease if you switch equipment it seems like an addition of the two equipments tabs 

Other stats are updated correctly like HP move speed etc

I have reinstalled the system twice but can't seems to have other results i don't know what could i have missed.

Here is a video of the bug (bad quality im sorry hope you can sée the values):

https://youtu.be/DUiM0qMELQk

 

If someone have a lead on where to look i'll gladly take it ! 

 

Best regards ARiver ! 

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • Active Member
On 5/12/2025 at 10:51 AM, ARiver said:

Hello,

I have installed this system : 

 

Everything works fine but i have a bug : 

Stats of attack and defense are not updated properly, it's not just a visual bug at least regarding defense. It seems like defense does not decrease if you switch equipment it seems like an addition of the two equipments tabs 

Other stats are updated correctly like HP move speed etc

I have reinstalled the system twice but can't seems to have other results i don't know what could i have missed.

Here is a video of the bug (bad quality im sorry hope you can sée the values):

https://youtu.be/DUiM0qMELQk

 

If someone have a lead on where to look i'll gladly take it ! 

 

Best regards ARiver ! 

void CHARACTER::ChangeEquip(int index, bool bIgnore)
{
	if (GetSkillLevel(SKILL_ADDITIONAL_PAGE) == 0)
		return;

	if (GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen())
	{
		ChatPacket(CHAT_TYPE_INFO, "You can't change equipment page while you're doing something else.");
		return;
	}

	if (!bIgnore)
	{
		if (index == GetEquipIndex())
			return;
	}

	int iPulse = thecore_pulse();
	if (iPulse - GetEquipLoadTime() < PASSES_PER_SEC(5))
	{
		ChatPacket(CHAT_TYPE_INFO, "You'll need to wait 5 seconds in order to do that again.");
		return;
	}

	SetEquipIndex(index);

	switch (index)
	{
		case FIRST_TYPE_EQUIPMENT:
		{
			if (secondEquip.size())
			{
				for (auto secondIndex = secondEquip.begin(); secondIndex != secondEquip.end(); ++secondIndex)
					secondIndex->second->StopEquipEvent();
			}

			if (firstEquip.size())
			{
				for (auto firstIndex = firstEquip.begin(); firstIndex != firstEquip.end(); ++firstIndex)
					firstIndex->second->StartEquipEvent();
			}
		}
		break;

		case SECOND_TYPE_EQUIPMENT:
		{
			if (firstEquip.size())
			{
				for (auto firstIndex = firstEquip.begin(); firstIndex != firstEquip.end(); ++firstIndex)
					firstIndex->second->StopEquipEvent();
			}

			if (secondEquip.size())
			{
				for (auto secondIndex = secondEquip.begin(); secondIndex != secondEquip.end(); ++secondIndex)
					secondIndex->second->StartEquipEvent();
			}
		}
		break;
	}

	ComputePoints(); //Added
	//BuffOnAttr_RemoveBuffsFromItem(this); //maybe work
	SetEquipLoadTime();

	CheckMaximumPoints();
	ComputeBattlePoints();
	UpdatePacket();

	if (IsAffectFlag(AFF_GWIGUM))
		RemoveAffect(SKILL_GWIGEOM);

	if (IsAffectFlag(AFF_GEOMGYEONG))
		RemoveAffect(SKILL_GEOMKYUNG);

	ChatPacket(CHAT_TYPE_COMMAND, "SetEquipmentPage %d", index);

	if (!bIgnore)
		ChatPacket(CHAT_TYPE_INFO, "The equipment page was changed.");
}


 

  • Premium
6 hours ago, Kuqsal said:
void CHARACTER::ChangeEquip(int index, bool bIgnore)
{
	if (GetSkillLevel(SKILL_ADDITIONAL_PAGE) == 0)
		return;

	if (GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen())
	{
		ChatPacket(CHAT_TYPE_INFO, "You can't change equipment page while you're doing something else.");
		return;
	}

	if (!bIgnore)
	{
		if (index == GetEquipIndex())
			return;
	}

	int iPulse = thecore_pulse();
	if (iPulse - GetEquipLoadTime() < PASSES_PER_SEC(5))
	{
		ChatPacket(CHAT_TYPE_INFO, "You'll need to wait 5 seconds in order to do that again.");
		return;
	}

	SetEquipIndex(index);

	switch (index)
	{
		case FIRST_TYPE_EQUIPMENT:
		{
			if (secondEquip.size())
			{
				for (auto secondIndex = secondEquip.begin(); secondIndex != secondEquip.end(); ++secondIndex)
					secondIndex->second->StopEquipEvent();
			}

			if (firstEquip.size())
			{
				for (auto firstIndex = firstEquip.begin(); firstIndex != firstEquip.end(); ++firstIndex)
					firstIndex->second->StartEquipEvent();
			}
		}
		break;

		case SECOND_TYPE_EQUIPMENT:
		{
			if (firstEquip.size())
			{
				for (auto firstIndex = firstEquip.begin(); firstIndex != firstEquip.end(); ++firstIndex)
					firstIndex->second->StopEquipEvent();
			}

			if (secondEquip.size())
			{
				for (auto secondIndex = secondEquip.begin(); secondIndex != secondEquip.end(); ++secondIndex)
					secondIndex->second->StartEquipEvent();
			}
		}
		break;
	}

	ComputePoints(); //Added
	//BuffOnAttr_RemoveBuffsFromItem(this); //maybe work
	SetEquipLoadTime();

	CheckMaximumPoints();
	ComputeBattlePoints();
	UpdatePacket();

	if (IsAffectFlag(AFF_GWIGUM))
		RemoveAffect(SKILL_GWIGEOM);

	if (IsAffectFlag(AFF_GEOMGYEONG))
		RemoveAffect(SKILL_GEOMKYUNG);

	ChatPacket(CHAT_TYPE_COMMAND, "SetEquipmentPage %d", index);

	if (!bIgnore)
		ChatPacket(CHAT_TYPE_INFO, "The equipment page was changed.");
}


 

Hello, thanks for the answer unfortunately this is not working for me (tried both solutions), it's the same result ! 

  • 3 weeks later...
  • 2 months later...
  • Premium
  • Solution

found a fix don't know if it's good : 

 

// in char.cpp at ComputeBattlePoints function search for : 
for (int i = 0; i < WEAR_MAX_NUM; ++i)
	if ((pkItem = GetWear(i)) && pkItem->GetType() == ITEM_ARMOR)
	{
		if (pkItem->GetSubType() == ARMOR_BODY || pkItem->GetSubType() == ARMOR_HEAD || pkItem->GetSubType() == ARMOR_FOOTS || pkItem->GetSubType() == ARMOR_SHIELD)
		{
			iArmor += pkItem->GetValue(1);
			iArmor += (2 * pkItem->GetValue(5));
		}
	}

//Change for : 
for (int i = 0; i < WEAR_MAX_NUM; ++i)
{
#ifdef ENABLE_ADDITIONAL_EQUIPMENT_PAGE
	if (GetEquipIndexByWear(i) != GetEquipIndex())
		continue;
#endif
	if ((pkItem = GetWear(i)) && pkItem->GetType() == ITEM_ARMOR)
	{
		if (pkItem->GetSubType() == ARMOR_BODY || pkItem->GetSubType() == ARMOR_HEAD || pkItem->GetSubType() == ARMOR_FOOTS || pkItem->GetSubType() == ARMOR_SHIELD)
		{
			iArmor += pkItem->GetValue(1);
			iArmor += (2 * pkItem->GetValue(5));
		}
	}
}

//Mind the addition of the "{}" for loop if you do not have it



Best regards 

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.