Jump to content

Recommended Posts

  • Honorable Member

Hey,

As I promised that I make a fix for the wolfmans pickaxe, and fishing rod holding, I'm here with it.

225511ss-2016-07-30-at-09.27.08-.jpg

 

1.) Open GameLib\RaceData.h and find this:

		void RegisterAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName);

Paste this below:

		void ChangeAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName);

2. Open GameLib\RaceData.cpp and find this function:

void CRaceData::RegisterAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName)
{
	m_AttachingBoneNameMap.insert(TAttachingBoneNameMap::value_type(dwPartIndex, c_szBoneName));
}

Than paste this function below:

void CRaceData::ChangeAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName)
{
	TAttachingBoneNameMap::iterator it = m_AttachingBoneNameMap.find(dwPartIndex);
	if (it == m_AttachingBoneNameMap.end())
		return;

	//m_AttachingBoneNameMap[dwPartIndex] = c_szBoneName; //bad behavior possiblity
	it->second = c_szBoneName;
}

 

The following modification is may different by systems like costume weapon and so on, so I give a solution for clean version, you have to make it yourself.
3.) Open GameLib\ActorInstanceAttach.cpp and find this code(or something like that with other systems):

void CActorInstance::AttachWeapon(DWORD dwItemIndex,DWORD dwParentPartIndex, DWORD dwPartIndex)
{
 //[...]
	__DestroyWeaponTrace();
	//ľçĽŐ૱â(ŔÚ°´ Ŕ̵µ·ů) żŢĽŐ,żŔ¸ĄĽŐ ¸đµÎżˇ ŔĺÂř.
	if (__IsRightHandWeapon(pItemData->GetWeaponType()))
		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON, pItemData);
	if (__IsLeftHandWeapon(pItemData->GetWeaponType()))
		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON_LEFT, pItemData);

and replace it with this:

void CActorInstance::AttachWeapon(DWORD dwItemIndex,DWORD dwParentPartIndex, DWORD dwPartIndex)
{
//[...]
	DWORD dwWeaponType = pItemData->GetWeaponType();
#ifdef ENABLE_WOLFMAN_CHARACTER
	if (m_eRace == CRaceData::RACE_WOLFMAN_M)
	{
		char* szAttachingBoneName = "equip_right_weapon";
		if (dwWeaponType != CItemData::WEAPON_CLAW)
			szAttachingBoneName = "equip_right";
		m_pkCurRaceData->ChangeAttachingBoneName(CRaceData::PART_WEAPON, szAttachingBoneName);
	}
#endif
	__DestroyWeaponTrace();
	if (__IsRightHandWeapon(dwWeaponType))
		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON, pItemData);
	if (__IsLeftHandWeapon(dwWeaponType))
		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON_LEFT, pItemData);

 

Done, build and enjoy.
P3NG3R.
 

  • Metin2 Dev 1
  • Love 15
Link to comment
https://metin2.dev/topic/12858-fix-wolfman-pickaxe-and-fishing-rod/
Share on other sites

Only this Lines are needed.

	if ((GetRace() == 8) && (pItemData->GetWeaponType() == CItemData::WEAPON_SWORD) && (dwPartIndex == CRaceData::PART_WEAPON) &&
	(pItemData->GetType()==CItemData::ITEM_TYPE_ROD || pItemData->GetType() == CItemData::ITEM_TYPE_PICK))
	{
		szBoneName = "equip_right";
	}

	else if (!GetAttachingBoneName(dwPartIndex, &szBoneName))
		return;

How to implement, try out. - i say only - look into ActorinstanceAttach and look for: "const char * szBoneName;"

Best regards,

 

  • Honorable Member

So, you are saying that:
1. If we are wolfman. &&(aaand)
2. The attaching weapon type is sword!wtf! &&(and)
3. The attaching part is weapon. &&(aaaaand!)
4. Item type is rod or pickaxe.

Am I right?

I reversed my code from official binary, so do not tell me how should be working, you! who selling @martysama0134's source.
If anyone feel that to come and share their fix about this bug, why didn't come so far...? Shame.
 

  • Love 5
  • Premium
5 hours ago, xP3NG3Rx said:

So, you are saying that:
1. If we are wolfman. &&(aaand)
2. The attaching weapon type is sword!wtf! &&(and)
3. The attaching part is weapon. &&(aaaaand!)
4. Item type is rod or pickaxe.

Am I right?

I reversed my code from official binary, so do not tell me how should be working, you! who selling @martysama0134's source.
If anyone feel that to come and share their fix about this bug, why didn't come so far...? Shame.
 

Can you say me please how you reversed your code from official bin?

 

Thanx 

But not working for me 

when i compile the source 

and Open the game 

still the same problem

 

but when i tryied to add 

 

Spoiler

#define ENABLE_WOLFMAN_CHARACTER

 

to locale_inc and compile still the same nothing change 

i go back to the source and delete this line 

Spoiler

#ifdef ENABLE_WOLFMAN_CHARACTER

and 

Spoiler

#endif

when i compile it's give me Error about Wolfman Race 

 

p_212u5sp1.jpg

Edited by Metin2 Dev
Core X - External 2 Internal
  • Bot
3 minutes ago, icewolf said:

Thanx 

But not working for me 

when i compile the source 

and Open the game 

still the same problem

 

but when i tryied to add 

 

  Hide contents

#define ENABLE_WOLFMAN_CHARACTER

 

to locale_inc and compile still the same nothing change 

i go back to the source and delete this line 

  Hide contents


#ifdef ENABLE_WOLFMAN_CHARACTER

and 

  Hide contents


#endif

when i compile it's give me Error about Wolfman Race 

 

p_212u5sp1.jpg

Replace   if (m_eRace == CRaceData::RACE_WOLFMAN_M) with if (m_eRace == 8) or make a enum with all races . 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1

english_banner.gif

  • Bot
10 minutes ago, icewolf said:

Thanx 

Compile  succeeded

and work's Perfect :)

but how i can  make a enum with all races . !!!

8011fc74b9e6e3bbceb232c40398a0c2.png 

in RaceData.h

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1

english_banner.gif

  • 2 weeks later...
2 hours ago, stein20 said:

Compile  succeeded.

But not working for me 

:(

b4d761e0896560c1f650cdb997a278d0.png

 

only it works well:

(m_eRace == 8)

 

Just add  enum from PythonPlayer.cpp to PythonPlayer.h as public

749855117da54c7583e87475a78bc36e.png

Then include PythonPlayer.h intro StdAfx.h if not work include directly just in that file where is needed.

And use CPythonPlayer:: class.. above you have an example.

0b4d03d3a3d6427aa574b91c566aea27.png

 

This is because in new binary they moved enum from PythonPlayer.cpp to RaceData.h adn they renamed inseated of example :

Old :

MAIN_RACE_SHAMAN_M,

new

RACE_SHAMAN_M,

 

same for wolfman.. you can  move entire enum intro RaceData class as public if you want to be accesed for all members and use CRaceData::

I did all those some time ago.. 

 

Intro the public source those enum is used just and just intro  DWORD CPythonPlayer::GetRaceStat()  FROM PythonPlayer.cpp  they moved enums and renmed to give another scope ..  

 

Make it like this :

RaceData.h

79a67b0e7ed641b5a644f7ede43c610f.png

PythonPlayer.cpp

3d9b46b156f442d9b6d097e0cea3e412.png

ActorInstance.cpp

f5f419cbaad344acac40ab6a70867171.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
  • Honorable Member

Omg.

Just add this enum into RaceData.h as public inside the CRaceData class:

		enum ERaces
		{
			RACE_WARRIOR_M,
			RACE_ASSASSIN_W,
			RACE_SURA_M,
			RACE_SHAMAN_W,
			RACE_WARRIOR_W,
			RACE_ASSASSIN_M,
			RACE_SURA_W,
			RACE_SHAMAN_M,
#ifdef ENABLE_WOLFMAN_CHARACTER
			RACE_WOLFMAN_M,
#endif
			RACE_MAX_NUM,
		};

w/ or w/o wolfman macro..

 

18 hours ago, ds_aim said:

Just add  enum from PythonPlayer.cpp to PythonPlayer.h as public

749855117da54c7583e87475a78bc36e.png

Then include PythonPlayer.h intro StdAfx.h if not work include directly just in that file where is needed.

And use CPythonPlayer:: class.. above you have an example.

0b4d03d3a3d6427aa574b91c566aea27.png

 

This is because in new binary they moved enum from PythonPlayer.cpp to RaceData.h adn they renamed inseated of example :

Old :

MAIN_RACE_SHAMAN_M,

new

RACE_SHAMAN_M,

 

same for wolfman.. you can  move entire enum intro RaceData class as public if you want to be accesed for all members and use CRaceData::

I did all those some time ago.. 

 

Intro the public source those enum is used just and just intro  DWORD CPythonPlayer::GetRaceStat()  FROM PythonPlayer.cpp  they moved enums and renmed to give another scope ..  

 

Make it like this :

RaceData.h

79a67b0e7ed641b5a644f7ede43c610f.png

PythonPlayer.cpp

3d9b46b156f442d9b6d097e0cea3e412.png

ActorInstance.cpp

f5f419cbaad344acac40ab6a70867171.png

but here there lican. xD

Edited by Metin2 Dev
Core X - External 2 Internal

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.