Jump to content

Recommended Posts

On 3/15/2024 at 12:49 AM, Jimmermania said:

This is the fix. item.cpp , search:
 

		case ITEM_COSTUME:
			{
				DWORD toSetValue = this->GetVnum();
				EParts toSetPart = PART_MAX_NUM;
				
				if (GetSubType() == COSTUME_BODY)

Replace the whole function with this:
 

				if (GetSubType() == COSTUME_BODY)
				{
					toSetPart = PART_MAIN;
					if (false == bAdd)
					{
						const CItem* pArmor = m_pOwner->GetWear(WEAR_BODY);
#if defined(__BL_TRANSMUTATION__)
						if (pArmor != NULL)
						{
							const DWORD dwVnum = pArmor->GetVnum();
							const DWORD dwTransmutationVnum = pArmor->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_MAIN);
						}
#else
						toSetValue = (NULL != pArmor) ? pArmor->GetVnum() : m_pOwner->GetOriginalPart(PART_MAIN);
#endif
					}
				}

 


can u share ur
 

else if (GetSubType() == COSTUME_WEAPON)

i have same problem in costume weapon too
 

  • Good 1
  • 1 month later...

There is this bug with this system:

 

“𝓐𝓵𝓵 𝔀𝓮 𝓱𝓪𝓿𝓮 𝓽𝓸 𝓭𝓮𝓬𝓲𝓭𝓮 𝓲𝓼 𝔀𝓱𝓪𝓽 𝓽𝓸 𝓭𝓸 𝔀𝓲𝓽𝓱 𝓽𝓱𝓮 𝓽𝓲𝓶𝓮 𝓽𝓱𝓪𝓽 𝓲𝓼 𝓰𝓲𝓿𝓮𝓷 𝓾𝓼.” ~ 𝓖𝓪𝓷𝓭𝓪𝓵𝓯 𝓽𝓱𝓮 𝓖𝓻𝓮𝔂

  • 4 weeks later...

Hey,

i did everything what it says in the files but at compiling client source i get the following error:

Fehler LNK2001 Nicht aufgelöstes externes Symbol ""public: unsigned long __thiscall CItemData::GetAntiFlags(void)const " (?GetAntiFlags@CItemData@@QBEKXZ)". UserInterface

 

I hope someone can help me to fix that.

  • 2 months later...

Fix

 

If you are using MartySama files and the weapon is still visible when you are not wearing it, change:

m_pOwner->SetPart(PART_WEAPON, m_pOwner->GetOriginalPart(PART_WEAPON));

change:

m_pOwner->SetPart(PART_WEAPON, 0);

  • 3 weeks later...
On 4/3/2024 at 8:59 PM, Ropen said:


can u share ur
 

else if (GetSubType() == COSTUME_WEAPON)

i have same problem in costume weapon too
 

#ifdef ENABLE_WEAPON_COSTUME_SYSTEM
				else if (GetSubType() == COSTUME_WEAPON)
				{
					toSetPart = PART_WEAPON;
					if (false == bAdd)
					{
						const CItem* pWeapon = m_pOwner->GetWear(WEAR_WEAPON);
#if defined(__BL_TRANSMUTATION__)
						if (pWeapon)
						{
							const DWORD dwVnum = pWeapon->GetVnum();
							const DWORD dwTransmutationVnum = pWeapon->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_WEAPON);
						}
#else
						toSetValue = (NULL != pWeapon) ? pWeapon->GetVnum() : m_pOwner->GetOriginalPart(PART_WEAPON);
#endif
					}
				}
#endif

 

  • 2 months later...
  • 2 months later...
		case ITEM_COSTUME:
		{
				DWORD toSetValue = this->GetVnum();
				EParts toSetPart = PART_MAX_NUM;
				
				if (GetSubType() == COSTUME_BODY)
				{
					toSetPart = PART_MAIN;
					if (false == bAdd)
					{
						const CItem* pArmor = m_pOwner->GetWear(WEAR_BODY);
#if defined(__BL_TRANSMUTATION__)
						if (pArmor != NULL)
						{
							const DWORD dwVnum = pArmor->GetVnum();
							const DWORD dwTransmutationVnum = pArmor->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_MAIN);
						}
#else
						toSetValue = (NULL != pArmor) ? pArmor->GetVnum() : m_pOwner->GetOriginalPart(PART_MAIN);
#endif
					}
				}

This fixed the issue with the costumes remaining on the character after equipping but I have another issue for which I didn't resolve yet, the transmutation doesn't seem to work for costumes, when I equip a transmutted(?) costume the skin that is shown is from the original item ( working on marty5.+ btw)

Also I found a bug that no one talked about, if the user equips a transmutted weapon and then a weapon skin, when it removes the weapon skin, it shows the original item, not the transmutted one.

  • 8 months later...
  • Premium

hello, 

first of all many thanks to Mali for this system, Owsap for the costume support and to all other people sharing the part for the costume weapon.

 

I have notice that official let you transmute a costume weapon or costume armor with a skin of a weapon or armor  and that it couldn't be done with this system or i least it wasn't showing the right skin

to make that possible I have made those changes I hope they are fine

Spoiler
//In Item.cpp This is my case ITEM_COSTUME:
		case ITEM_COSTUME:
			{
				DWORD toSetValue = this->GetVnum();
				EParts toSetPart = PART_MAX_NUM;

				if (GetSubType() == COSTUME_BODY)
				{
					toSetPart = PART_MAIN;

#if defined(__BL_TRANSMUTATION__)
					if (bAdd)
					{
						const DWORD dwTransmutationVnum = GetTransmutationVnum();
						toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : GetVnum();
					}
					else
#endif
					if (false == bAdd)
					{
						const CItem* pArmor = m_pOwner->GetWear(WEAR_BODY);
#if defined(__BL_TRANSMUTATION__)
						if (pArmor != NULL)
						{
							const DWORD dwVnum = pArmor->GetVnum();
							const DWORD dwTransmutationVnum = pArmor->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_MAIN);
						}
#else
						toSetValue = (NULL != pArmor) ? pArmor->GetVnum() : m_pOwner->GetOriginalPart(PART_MAIN);
#endif
					}
					
				}

#ifdef __WEAPON_COSTUME_SYSTEM__
				else if (GetSubType() == COSTUME_WEAPON)
				{
					toSetPart = PART_WEAPON;
#if defined(__BL_TRANSMUTATION__)
					if (bAdd)
					{
						const DWORD dwTransmutationVnum = GetTransmutationVnum();
						toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : GetVnum();
					}
					else
#endif

					if (!bAdd)
					{
						const CItem* pWeapon = m_pOwner->GetWear(WEAR_WEAPON);
#if defined(__BL_TRANSMUTATION__)
						if (pWeapon != NULL)
						{
							const DWORD dwVnum = pWeapon->GetVnum();
							const DWORD dwTransmutationVnum = pWeapon->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_WEAPON);
						}
#else
						toSetValue = (NULL != pWeapon) ? pWeapon->GetVnum() : m_pOwner->GetPart(PART_WEAPON);
#endif
					}
				}
#endif

 

To sumarize i have added a "if (badd)" condition to the costume part.
 

 The limitation for armor being transmuted as costume is the sex of the costume.

To show that in game i needed to modify client/root/uitooltip.py that way
 

Spoiler
#you have to search five times for that (in def AppendChangeLookInfoPrivateShopWIndow, in def AppendChangeLookInfoItemVnum, in def AppendChangeLookInfoShopWIndow, in def AppendChangeLookInformation and in def AppendChangeLookInfoExchangeWIndow):

				if item.GetItemType() == item.ITEM_TYPE_COSTUME:
					if item.GetItemSubType() == item.COSTUME_TYPE_BODY:
						malefemale = ""
						if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
							malefemale = localeInfo.FOR_FEMALE

						if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
							malefemale = localeInfo.FOR_MALE
						itemName += " ( " + malefemale +  " )"
                        
# Add after : 

				if item.GetItemType() == item.ITEM_TYPE_ARMOR:
					if item.GetItemSubType() == item.ARMOR_BODY:
						item.SelectItem(changelookvnum)
						malefemale = ""
						if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
							malefemale = localeInfo.FOR_FEMALE
							itemName += " ( " + malefemale +  " )"
                            
						if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
							malefemale = localeInfo.FOR_MALE
							itemName += " ( " + malefemale +  " )"

 

 

Also in Owsap version you might have some trouble compiling with TMP4 sources because of those parts in char_item.cpp :
 

Spoiler
#if defined(__BL_TRANSMUTATION__) && defined(__COSTUME_SYSTEM__)
	DWORD dwTransmutationVnum = item->GetTransmutationVnum();
	if (dwTransmutationVnum != 0)
	{
		TItemTable* pItemTable = ITEM_MANAGER::instance().GetTable(dwTransmutationVnum);
		if (pItemTable && (pItemTable->GetType() == ITEM_COSTUME))
		{
			if ((IS_SET(pItemTable->GetAntiFlags(), ITEM_ANTIFLAG_MALE) && SEX_MALE == GET_SEX(this)) ||
				(IS_SET(pItemTable->GetAntiFlags(), ITEM_ANTIFLAG_FEMALE) && SEX_FEMALE == GET_SEX(this)))
			{
				ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[Transmutation] You cannot equip the transmuted item as it does not match your gender."));
				return false;
			}
		}
	}
#endif

 

 

the compiler tell you that GetType() or/and  GetAntiFlags() are not members of SItemTable ( in table.h) i don't know I we can make function in this table so i have fixed it by changing the "GetType()" into "bType" and "GetAntiFlags()" into dwAntiFlags as such :

Spoiler
#if defined(__BL_TRANSMUTATION__) && defined(__COSTUME_SYSTEM__)
	DWORD dwTransmutationVnum = item->GetTransmutationVnum();
	if (dwTransmutationVnum != 0)
	{
		TItemTable* pItemTable = ITEM_MANAGER::instance().GetTable(dwTransmutationVnum);
		if (pItemTable && (pItemTable->bType == ITEM_COSTUME))
		{
			if ((IS_SET(pItemTable->dwAntiFlags, ITEM_ANTIFLAG_MALE) && SEX_MALE == GET_SEX(this)) ||
				(IS_SET(pItemTable->dwAntiFlags, ITEM_ANTIFLAG_FEMALE) && SEX_FEMALE == GET_SEX(this)))
			{
				ChatPacket(CHAT_TYPE_INFO, "[LS;70]");
				return false;
			}
		}
	}
#endif

 



 

Edited by ARiver
tooltip
  • Love 1
  • 2 months later...
  • Bot
On 10/9/2025 at 4:59 PM, ARiver said:

hello, 

first of all many thanks to Mali for this system, Owsap for the costume support and to all other people sharing the part for the costume weapon.

 

I have notice that official let you transmute a costume weapon or costume armor with a skin of a weapon or armor  and that it couldn't be done with this system or i least it wasn't showing the right skin

to make that possible I have made those changes I hope they are fine

  Reveal hidden contents
//In Item.cpp This is my case ITEM_COSTUME:
		case ITEM_COSTUME:
			{
				DWORD toSetValue = this->GetVnum();
				EParts toSetPart = PART_MAX_NUM;

				if (GetSubType() == COSTUME_BODY)
				{
					toSetPart = PART_MAIN;

#if defined(__BL_TRANSMUTATION__)
					if (bAdd)
					{
						const DWORD dwTransmutationVnum = GetTransmutationVnum();
						toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : GetVnum();
					}
					else
#endif
					if (false == bAdd)
					{
						const CItem* pArmor = m_pOwner->GetWear(WEAR_BODY);
#if defined(__BL_TRANSMUTATION__)
						if (pArmor != NULL)
						{
							const DWORD dwVnum = pArmor->GetVnum();
							const DWORD dwTransmutationVnum = pArmor->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_MAIN);
						}
#else
						toSetValue = (NULL != pArmor) ? pArmor->GetVnum() : m_pOwner->GetOriginalPart(PART_MAIN);
#endif
					}
					
				}

#ifdef __WEAPON_COSTUME_SYSTEM__
				else if (GetSubType() == COSTUME_WEAPON)
				{
					toSetPart = PART_WEAPON;
#if defined(__BL_TRANSMUTATION__)
					if (bAdd)
					{
						const DWORD dwTransmutationVnum = GetTransmutationVnum();
						toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : GetVnum();
					}
					else
#endif

					if (!bAdd)
					{
						const CItem* pWeapon = m_pOwner->GetWear(WEAR_WEAPON);
#if defined(__BL_TRANSMUTATION__)
						if (pWeapon != NULL)
						{
							const DWORD dwVnum = pWeapon->GetVnum();
							const DWORD dwTransmutationVnum = pWeapon->GetTransmutationVnum();
							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
						}
						else
						{
							toSetValue = m_pOwner->GetOriginalPart(PART_WEAPON);
						}
#else
						toSetValue = (NULL != pWeapon) ? pWeapon->GetVnum() : m_pOwner->GetPart(PART_WEAPON);
#endif
					}
				}
#endif

 

To sumarize i have added a "if (badd)" condition to the costume part.
 

 The limitation for armor being transmuted as costume is the sex of the costume.

To show that in game i needed to modify client/root/uitooltip.py that way
 

  Reveal hidden contents
#you have to search five times for that (in def AppendChangeLookInfoPrivateShopWIndow, in def AppendChangeLookInfoItemVnum, in def AppendChangeLookInfoShopWIndow, in def AppendChangeLookInformation and in def AppendChangeLookInfoExchangeWIndow):

				if item.GetItemType() == item.ITEM_TYPE_COSTUME:
					if item.GetItemSubType() == item.COSTUME_TYPE_BODY:
						malefemale = ""
						if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
							malefemale = localeInfo.FOR_FEMALE

						if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
							malefemale = localeInfo.FOR_MALE
						itemName += " ( " + malefemale +  " )"
                        
# Add after : 

				if item.GetItemType() == item.ITEM_TYPE_ARMOR:
					if item.GetItemSubType() == item.ARMOR_BODY:
						item.SelectItem(changelookvnum)
						malefemale = ""
						if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
							malefemale = localeInfo.FOR_FEMALE
							itemName += " ( " + malefemale +  " )"
                            
						if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
							malefemale = localeInfo.FOR_MALE
							itemName += " ( " + malefemale +  " )"

 

 

Also in Owsap version you might have some trouble compiling with TMP4 sources because of those parts in char_item.cpp :
 

  Reveal hidden contents
#if defined(__BL_TRANSMUTATION__) && defined(__COSTUME_SYSTEM__)
	DWORD dwTransmutationVnum = item->GetTransmutationVnum();
	if (dwTransmutationVnum != 0)
	{
		TItemTable* pItemTable = ITEM_MANAGER::instance().GetTable(dwTransmutationVnum);
		if (pItemTable && (pItemTable->GetType() == ITEM_COSTUME))
		{
			if ((IS_SET(pItemTable->GetAntiFlags(), ITEM_ANTIFLAG_MALE) && SEX_MALE == GET_SEX(this)) ||
				(IS_SET(pItemTable->GetAntiFlags(), ITEM_ANTIFLAG_FEMALE) && SEX_FEMALE == GET_SEX(this)))
			{
				ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[Transmutation] You cannot equip the transmuted item as it does not match your gender."));
				return false;
			}
		}
	}
#endif

 

 

the compiler tell you that GetType() or/and  GetAntiFlags() are not members of SItemTable ( in table.h) i don't know I we can make function in this table so i have fixed it by changing the "GetType()" into "bType" and "GetAntiFlags()" into dwAntiFlags as such :

  Hide contents
#if defined(__BL_TRANSMUTATION__) && defined(__COSTUME_SYSTEM__)
	DWORD dwTransmutationVnum = item->GetTransmutationVnum();
	if (dwTransmutationVnum != 0)
	{
		TItemTable* pItemTable = ITEM_MANAGER::instance().GetTable(dwTransmutationVnum);
		if (pItemTable && (pItemTable->bType == ITEM_COSTUME))
		{
			if ((IS_SET(pItemTable->dwAntiFlags, ITEM_ANTIFLAG_MALE) && SEX_MALE == GET_SEX(this)) ||
				(IS_SET(pItemTable->dwAntiFlags, ITEM_ANTIFLAG_FEMALE) && SEX_FEMALE == GET_SEX(this)))
			{
				ChatPacket(CHAT_TYPE_INFO, "[LS;70]");
				return false;
			}
		}
	}
#endif

 



 

I removed the code that you mentioned to bypass sex if.  And if you transmute an armor with a male only costume and equip it on a female it works just fine. Why do we have to check if it fits the right gender?

english_banner.gif

  • Premium
8 hours ago, lolek0105 said:

I removed the code that you mentioned to bypass sex if.  And if you transmute an armor with a male only costume and equip it on a female it works just fine. Why do we have to check if it fits the right gender?

you mean the python or CPP part ? 

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.