Jump to content

Recommended Posts

Hi everyone

I added the Wukong roar or skateboard animation. However, when I mount it, the character switches to the mount animation instead of being on the rooster.

ActorInstance.cpp

 

void CActorInstance::INSTANCEBASE_Transform()
{
	if (m_pkHorse)
	{
		m_pkHorse->INSTANCEBASE_Transform();

		m_x = m_pkHorse->NEW_GetCurPixelPositionRef().x;
		m_y = -m_pkHorse->NEW_GetCurPixelPositionRef().y;
		m_z = m_pkHorse->NEW_GetCurPixelPositionRef().z;

#if defined(ENABLE_STANDING_MOUNT)
		if (m_bIsStandingMount)
		{
			m_pkHorse->Update();
			m_pkHorse->TransformProcess();
			m_pkHorse->Transform();
			m_pkHorse->UpdatePointInstance();
		}
#endif

		m_bNeedUpdateCollision = TRUE;
	}

	Update();
	TransformProcess();
	Transform();
	UpdatePointInstance();
	ShakeProcess();
	UpdateBoundingSphere();
	UpdateAttribute();
}


 

WORD CActorInstance::__GetCurrentComboType()
{
	if (IsBowMode())
		return 0;

	if (IsHandMode())
		return 0;

	if (__IsMountingHorse()
#if defined(ENABLE_STANDING_MOUNT)
		&& !m_bIsStandingMount
#endif
		)
		return 0;

	return m_wcurComboType;
}
bool CActorInstance::IsHandMode()
{
	if (CRaceMotionData::MODE_GENERAL == GetMotionMode())
		return true;

	if (CRaceMotionData::MODE_HORSE == GetMotionMode())
		return true;

#if defined(ENABLE_STANDING_MOUNT)
	if (CRaceMotionData::MODE_HORSE_STAND == GetMotionMode())
		return true;
#endif

	return false;
}
bool CActorInstance::IsBowMode()
{
	if (CRaceMotionData::MODE_BOW == GetMotionMode())
		return true;

	if (CRaceMotionData::MODE_HORSE_BOW == GetMotionMode())
		return true;

#if defined(ENABLE_STANDING_MOUNT)
	if (CRaceMotionData::MODE_HORSE_STAND_BOW == GetMotionMode())
		return true;
#endif

	return false;
}
void CActorInstance::AccumulationMovement()
{
	if (m_pkTree)
		return;

	if (m_pkHorse
#if defined(ENABLE_STANDING_MOUNT)
		&& (!m_bIsStandingMount || __IsMoveMotion())
#endif
		)
	{
		m_pkHorse->__AccumulationMovement (m_fcurRotation);
		return;
	}

	__AccumulationMovement (m_fAdvancingRotation);
}
void CActorInstance::AddMovement(float fx, float fy, float fz)
{
#if defined(ENABLE_STANDING_MOUNT)
	if (m_pkHorse && m_bIsStandingMount)
	{
		m_pkHorse->AddMovement(fx, fy, fz);
		return;
	}
#endif

	m_v3Movement.x += fx;
	m_v3Movement.y += fy;
	m_v3Movement.z += fz;
}
#if defined(ENABLE_STANDING_MOUNT)
	m_bIsStandingMount = false;
#endif

ActorInstanceAttach.cpp

bool CActorInstance::__IsLeftHandWeapon (DWORD type)
{
	if (CItemData::WEAPON_DAGGER == type || (CItemData::WEAPON_FAN == type && __IsMountingHorse()
#if defined(ENABLE_STANDING_MOUNT)
		&& !m_bIsStandingMount
#endif
		))
		return true;
	else if (CItemData::WEAPON_BOW == type)
		return true;
	else if (CItemData::WEAPON_CLAW == type)
		return true;
	else
		return false;
}

bool CActorInstance::__IsRightHandWeapon (DWORD type)
{
	if (CItemData::WEAPON_DAGGER == type || (CItemData::WEAPON_FAN == type && __IsMountingHorse()
#if defined(ENABLE_STANDING_MOUNT)
		&& !m_bIsStandingMount
#endif
		))
		return true;
	else if (CItemData::WEAPON_BOW == type)
		return false;
	else if (CItemData::WEAPON_CLAW == type)
		return true;
	else
		return true;
}

ActorInstanceBattle.cpp

 

void CActorInstance::__RunNextCombo()
{
	++m_dwcurComboIndex;
	///////////////////////////

#if defined(ENABLE_STANDING_MOUNT)
	int iMotionMode = GetMotionMode();
	if (iMotionMode == CRaceMotionData::MODE_HORSE || (iMotionMode == CRaceMotionData::MODE_HORSE_STAND && (GetPartItemID(CRaceData::PART_MAIN) || GetPartItemID(CRaceData::PART_WEAPON_LEFT))))
		return;
#endif
void CActorInstance::__OnEndCombo()
{
	if (__IsMountingHorse())
	{
#if defined(ENABLE_STANDING_MOUNT)
		if (m_bIsStandingMount)
			return;
#endif

		m_dwcurComboIndex = 1;
	}

	// ���⼭ �޺��� �ʱ�ȭ �ؼ� �ȵȴ�.
	// �޺��� �ʱ�ȭ �Ǵ� ���� ������ �޺��� ������ Motion �� �ڵ����� Wait ���� ���ư��� �����̴�.
}

ActorInstanceCollesionDe...

 

void CActorInstance::BlockMovement()
{
	if (m_pkHorse)
	{
		m_pkHorse->__InitializeMovement();
#if defined(ENABLE_STANDING_MOUNT)
		if (!m_bIsStandingMount)
			return;
#else
		return;
#endif
	}

	__InitializeMovement();
}

 

ActorInstanceMotion.cpp

 

DWORD CActorInstance::__SetMotion (const SSetMotionData& c_rkSetMotData, DWORD dwRandMotKey)
{
...........
#if defined(ENABLE_STANDING_MOUNT)
		if (m_pkHorse->CheckMotionThingIndex(dwChildMotKey))
		{
			m_pkHorse->SetMotion(dwChildMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
			m_pkHorse->__BindMotionData(dwChildMotKey);

			if (c_rkSetMotData.iLoopCount)
				m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_ONCE; // ¹«Á¶°Ç ÀÌÀü ¸ğ¼Ç ŸÀÔÀ¸·Î ¼³Á¤µÇ°í ÀÖ¾úÀ½
			else
				m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_LOOP;

			m_pkHorse->m_kCurMotNode.dwFrameCount = m_pkHorse->GetMotionDuration(dwChildMotKey) / (1.0f / g_fGameFPS);
			m_pkHorse->m_kCurMotNode.dwcurFrame = 0;
			m_pkHorse->m_kCurMotNode.dwMotionKey = dwChildMotKey;
		}
#else
		m_pkHorse->SetMotion (dwChildMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
		m_pkHorse->__BindMotionData (dwChildMotKey);

		if (c_rkSetMotData.iLoopCount)
			m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_ONCE;    // ¹«Á¶°Ç ÀÌÀü ¸ğ¼Ç ŸÀÔÀ¸·Î ¼³Á¤µÇ°í ÀÖ¾úÀ½
		else
			m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_LOOP;

		m_pkHorse->m_kCurMotNode.dwFrameCount = m_pkHorse->GetMotionDuration (dwChildMotKey) / (1.0f / g_fGameFPS);
		m_pkHorse->m_kCurMotNode.dwcurFrame = 0;
		m_pkHorse->m_kCurMotNode.dwMotionKey = dwChildMotKey;
#endif
	}
	else
	{
		CGraphicThingInstance::SetMotion (dwMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
	}

	__HideWeaponTrace();


RaceData.cpp

 

#if defined(ENABLE_STANDING_MOUNT)
			case CRaceMotionData::MODE_HORSE_STAND:
			case CRaceMotionData::MODE_HORSE_STAND_CLAW:
			case CRaceMotionData::MODE_HORSE_STAND_ONEHAND_SWORD:
			case CRaceMotionData::MODE_HORSE_STAND_TWOHAND_SWORD:
			case CRaceMotionData::MODE_HORSE_STAND_DUALHAND_SWORD:
			case CRaceMotionData::MODE_HORSE_STAND_BOW:
			case CRaceMotionData::MODE_HORSE_STAND_FAN:
			case CRaceMotionData::MODE_HORSE_STAND_BELL:
				wGeneralMode = CRaceMotionData::MODE_HORSE_STAND;
				break;
#endif


RaceMotionData.h

 

#if defined(ENABLE_STANDING_MOUNT)
		MODE_HORSE_STAND,
		MODE_HORSE_STAND_CLAW,
		MODE_HORSE_STAND_ONEHAND_SWORD,
		MODE_HORSE_STAND_TWOHAND_SWORD,
		MODE_HORSE_STAND_DUALHAND_SWORD,
		MODE_HORSE_STAND_BOW,
		MODE_HORSE_STAND_FAN,
		MODE_HORSE_STAND_BELL,
#endif


InstanceBase.cpp

 

void CInstanceBase::MountHorse(UINT eRace)
{
	m_kHorse.Destroy();
	m_kHorse.Create(m_GraphicThingInstance.NEW_GetCurPixelPositionRef(), eRace, ms_adwCRCAffectEffect[EFFECT_HIT]);

#if defined(ENABLE_STANDING_MOUNT)
	if (m_bIsStandingMount)
		SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
	else
		SetMotionMode(CRaceMotionData::MODE_HORSE);
#else
	SetMotionMode(CRaceMotionData::MODE_HORSE);
#endif
	SetRotationSpeed(c_fDefaultHorseRotationSpeed);

	m_GraphicThingInstance.MountHorse(m_kHorse.GetActorPtr());
	m_GraphicThingInstance.Stop();
	m_GraphicThingInstance.RefreshActorInstance();
}
#if defined(ENABLE_MOUNT_COSTUME_SYSTEM)
bool CInstanceBase::SetMount(DWORD eMount)
{
	if (IsPoly())
		return false;

	if (__IsShapeAnimalWear())
		return false;

	m_GraphicThingInstance.ChangePart(CRaceData::PART_MOUNT, eMount);

	if (eMount)
	{
		CItemData* pItemData;
		if (CItemManager::Instance().GetItemDataPointer(eMount, &pItemData))
		{
			m_awPart[CRaceData::PART_MOUNT] = eMount;
#if defined(ENABLE_STANDING_MOUNT)
			m_bIsStandingMount = pItemData->GetSubType() == CItemData::COSTUME_MOUNT_STANDING;
#endif
		}
		else
		{
			ClearMount();
		}
	}
	else
	{
		ClearMount();
	}

#if defined(ENABLE_STANDING_MOUNT)
	m_GraphicThingInstance.SetStandingMount(m_bIsStandingMount);

	if (m_bIsStandingMount)
		RefreshWeapon();
#endif

	return true;
}
void CInstanceBase::ClearMount()
{
	m_awPart[CRaceData::PART_MOUNT] = 0;
#if defined(ENABLE_STANDING_MOUNT)
	m_bIsStandingMount = false;
#endif
}

#if defined(ENABLE_STANDING_MOUNT)
bool CInstanceBase::IsStandingMount()
{
	return m_bIsStandingMount;
}
void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop)
{
	DWORD dwPartItemID = m_GraphicThingInstance.GetPartItemID (CRaceData::PART_WEAPON);

	BYTE byItemType = 0xff;
	BYTE bySubType = 0xff;

	CItemManager& rkItemMgr = CItemManager::Instance();
	CItemData* pItemData;

	if (rkItemMgr.GetItemDataPointer(dwPartItemID, &pItemData))
	{
		byItemType = pItemData->GetType();
		bySubType = pItemData->GetWeaponType();
	}

	if (IsPoly())
		SetMotionMode(CRaceMotionData::MODE_GENERAL);
	else if (IsWearingDress())
		SetMotionMode(CRaceMotionData::MODE_WEDDING_DRESS);
	else if (byItemType == CItemData::ITEM_TYPE_PICK)
	{
		if (m_kHorse.IsMounting())
		{
#if defined(ENABLE_STANDING_MOUNT)
			if (m_bIsStandingMount)
				SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
			else
				SetMotionMode(CRaceMotionData::MODE_HORSE);
#else
			SetMotionMode(CRaceMotionData::MODE_HORSE);
#endif
		}
		else
		{
			SetMotionMode(CRaceMotionData::MODE_GENERAL);
		}
	}
	else if (byItemType == CItemData::ITEM_TYPE_ROD)
	{
		if (m_kHorse.IsMounting())
		{
#if defined(ENABLE_STANDING_MOUNT)
			if (m_bIsStandingMount)
				SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
			else
				SetMotionMode(CRaceMotionData::MODE_HORSE);
#else
			SetMotionMode(CRaceMotionData::MODE_HORSE);
#endif
		}
		else
		{
			SetMotionMode(CRaceMotionData::MODE_FISHING);
		}
	}
	else if (m_kHorse.IsMounting())
	{
#if defined(ENABLE_STANDING_MOUNT)
		if (m_bIsStandingMount)
		{
			switch (bySubType)
			{
				case CItemData::WEAPON_SWORD:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_ONEHAND_SWORD);
					break;

				case CItemData::WEAPON_TWO_HANDED:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_TWOHAND_SWORD); // Only Warrior
					break;

				case CItemData::WEAPON_DAGGER:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_DUALHAND_SWORD); // Only Assassin
					break;

				case CItemData::WEAPON_FAN:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_FAN); // Only Shaman
					break;

				case CItemData::WEAPON_BELL:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_BELL); // Only Shaman
					break;

				case CItemData::WEAPON_BOW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_BOW); // Only Shaman
					break;

				case CItemData::WEAPON_CLAW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_CLAW); // Only Wolfman
					break;

				default:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
					break;
			}
		}
		else
		{
			switch (bySubType)
			{
				case CItemData::WEAPON_SWORD:
					SetMotionMode(CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
					break;

				case CItemData::WEAPON_TWO_HANDED:
					SetMotionMode(CRaceMotionData::MODE_HORSE_TWOHAND_SWORD); // Only Warrior
					break;

				case CItemData::WEAPON_DAGGER:
					SetMotionMode(CRaceMotionData::MODE_HORSE_DUALHAND_SWORD); // Only Assassin
					break;

				case CItemData::WEAPON_FAN:
					SetMotionMode(CRaceMotionData::MODE_HORSE_FAN); // Only Shaman
					break;

				case CItemData::WEAPON_BELL:
					SetMotionMode(CRaceMotionData::MODE_HORSE_BELL); // Only Shaman
					break;

				case CItemData::WEAPON_BOW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_BOW); // Only Shaman
					break;

				case CItemData::WEAPON_CLAW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW); // Only Wolfman
					break;

				default:
					SetMotionMode(CRaceMotionData::MODE_HORSE);
					break;
			}
		}
#else
		switch (bySubType)
		{
			case CItemData::WEAPON_SWORD:
				SetMotionMode (CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
				break;

			case CItemData::WEAPON_TWO_HANDED:
				SetMotionMode (CRaceMotionData::MODE_HORSE_TWOHAND_SWORD); // Only Warrior
				break;

			case CItemData::WEAPON_DAGGER:
				SetMotionMode (CRaceMotionData::MODE_HORSE_DUALHAND_SWORD); // Only Assassin
				break;

			case CItemData::WEAPON_FAN:
				SetMotionMode (CRaceMotionData::MODE_HORSE_FAN); // Only Shaman
				break;

			case CItemData::WEAPON_BELL:
				SetMotionMode (CRaceMotionData::MODE_HORSE_BELL); // Only Shaman
				break;

			case CItemData::WEAPON_BOW:
				SetMotionMode (CRaceMotionData::MODE_HORSE_BOW); // Only Shaman
				break;

				case CItemData::WEAPON_CLAW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW); // Only Wolfman
					break;

			default:
				SetMotionMode (CRaceMotionData::MODE_HORSE);
				break;
		}
#endif
	}
	else
	{
		switch (bySubType)
		{
			case CItemData::WEAPON_SWORD:
				SetMotionMode(CRaceMotionData::MODE_ONEHAND_SWORD);
				break;

			case CItemData::WEAPON_TWO_HANDED:
				SetMotionMode(CRaceMotionData::MODE_TWOHAND_SWORD); // Only Warrior
				break;

			case CItemData::WEAPON_DAGGER:
				SetMotionMode(CRaceMotionData::MODE_DUALHAND_SWORD); // Only Assassin
				break;

			case CItemData::WEAPON_BOW:
				SetMotionMode(CRaceMotionData::MODE_BOW); // Only Assassin
				break;

			case CItemData::WEAPON_FAN:
				SetMotionMode(CRaceMotionData::MODE_FAN); // Only Shaman
				break;

			case CItemData::WEAPON_BELL:
				SetMotionMode(CRaceMotionData::MODE_BELL); // Only Shaman
				break;

			case CItemData::WEAPON_CLAW:
				SetMotionMode(CRaceMotionData::MODE_CLAW); // Only Wolfman
				break;

			case CItemData::WEAPON_ARROW:
			default:
				SetMotionMode(CRaceMotionData::MODE_GENERAL);
				break;
		}
	}

	if (isLoop)
	{
		m_GraphicThingInstance.InterceptLoopMotion (dwMotIndex);
	}
	else
	{
		m_GraphicThingInstance.InterceptOnceMotion (dwMotIndex);
	}

	RefreshActorInstance();
}


spacer.png

Link to comment
https://metin2.dev/topic/34699-standing-mount-system-mount-animation/
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Active+ Member
On 8/30/2026 at 9:21 PM, Ronaldo said:

Hi everyone

I added the Wukong roar or skateboard animation. However, when I mount it, the character switches to the mount animation instead of being on the rooster.

ActorInstance.cpp

 

void CActorInstance::INSTANCEBASE_Transform()
{
	if (m_pkHorse)
	{
		m_pkHorse->INSTANCEBASE_Transform();

		m_x = m_pkHorse->NEW_GetCurPixelPositionRef().x;
		m_y = -m_pkHorse->NEW_GetCurPixelPositionRef().y;
		m_z = m_pkHorse->NEW_GetCurPixelPositionRef().z;

#if defined(ENABLE_STANDING_MOUNT)
		if (m_bIsStandingMount)
		{
			m_pkHorse->Update();
			m_pkHorse->TransformProcess();
			m_pkHorse->Transform();
			m_pkHorse->UpdatePointInstance();
		}
#endif

		m_bNeedUpdateCollision = TRUE;
	}

	Update();
	TransformProcess();
	Transform();
	UpdatePointInstance();
	ShakeProcess();
	UpdateBoundingSphere();
	UpdateAttribute();
}


 

WORD CActorInstance::__GetCurrentComboType()
{
	if (IsBowMode())
		return 0;

	if (IsHandMode())
		return 0;

	if (__IsMountingHorse()
#if defined(ENABLE_STANDING_MOUNT)
		&& !m_bIsStandingMount
#endif
		)
		return 0;

	return m_wcurComboType;
}
bool CActorInstance::IsHandMode()
{
	if (CRaceMotionData::MODE_GENERAL == GetMotionMode())
		return true;

	if (CRaceMotionData::MODE_HORSE == GetMotionMode())
		return true;

#if defined(ENABLE_STANDING_MOUNT)
	if (CRaceMotionData::MODE_HORSE_STAND == GetMotionMode())
		return true;
#endif

	return false;
}
bool CActorInstance::IsBowMode()
{
	if (CRaceMotionData::MODE_BOW == GetMotionMode())
		return true;

	if (CRaceMotionData::MODE_HORSE_BOW == GetMotionMode())
		return true;

#if defined(ENABLE_STANDING_MOUNT)
	if (CRaceMotionData::MODE_HORSE_STAND_BOW == GetMotionMode())
		return true;
#endif

	return false;
}
void CActorInstance::AccumulationMovement()
{
	if (m_pkTree)
		return;

	if (m_pkHorse
#if defined(ENABLE_STANDING_MOUNT)
		&& (!m_bIsStandingMount || __IsMoveMotion())
#endif
		)
	{
		m_pkHorse->__AccumulationMovement (m_fcurRotation);
		return;
	}

	__AccumulationMovement (m_fAdvancingRotation);
}
void CActorInstance::AddMovement(float fx, float fy, float fz)
{
#if defined(ENABLE_STANDING_MOUNT)
	if (m_pkHorse && m_bIsStandingMount)
	{
		m_pkHorse->AddMovement(fx, fy, fz);
		return;
	}
#endif

	m_v3Movement.x += fx;
	m_v3Movement.y += fy;
	m_v3Movement.z += fz;
}
#if defined(ENABLE_STANDING_MOUNT)
	m_bIsStandingMount = false;
#endif

ActorInstanceAttach.cpp

bool CActorInstance::__IsLeftHandWeapon (DWORD type)
{
	if (CItemData::WEAPON_DAGGER == type || (CItemData::WEAPON_FAN == type && __IsMountingHorse()
#if defined(ENABLE_STANDING_MOUNT)
		&& !m_bIsStandingMount
#endif
		))
		return true;
	else if (CItemData::WEAPON_BOW == type)
		return true;
	else if (CItemData::WEAPON_CLAW == type)
		return true;
	else
		return false;
}

bool CActorInstance::__IsRightHandWeapon (DWORD type)
{
	if (CItemData::WEAPON_DAGGER == type || (CItemData::WEAPON_FAN == type && __IsMountingHorse()
#if defined(ENABLE_STANDING_MOUNT)
		&& !m_bIsStandingMount
#endif
		))
		return true;
	else if (CItemData::WEAPON_BOW == type)
		return false;
	else if (CItemData::WEAPON_CLAW == type)
		return true;
	else
		return true;
}

ActorInstanceBattle.cpp

 

void CActorInstance::__RunNextCombo()
{
	++m_dwcurComboIndex;
	///////////////////////////

#if defined(ENABLE_STANDING_MOUNT)
	int iMotionMode = GetMotionMode();
	if (iMotionMode == CRaceMotionData::MODE_HORSE || (iMotionMode == CRaceMotionData::MODE_HORSE_STAND && (GetPartItemID(CRaceData::PART_MAIN) || GetPartItemID(CRaceData::PART_WEAPON_LEFT))))
		return;
#endif
void CActorInstance::__OnEndCombo()
{
	if (__IsMountingHorse())
	{
#if defined(ENABLE_STANDING_MOUNT)
		if (m_bIsStandingMount)
			return;
#endif

		m_dwcurComboIndex = 1;
	}

	// ���⼭ �޺��� �ʱ�ȭ �ؼ� �ȵȴ�.
	// �޺��� �ʱ�ȭ �Ǵ� ���� ������ �޺��� ������ Motion �� �ڵ����� Wait ���� ���ư��� �����̴�.
}

ActorInstanceCollesionDe...

 

void CActorInstance::BlockMovement()
{
	if (m_pkHorse)
	{
		m_pkHorse->__InitializeMovement();
#if defined(ENABLE_STANDING_MOUNT)
		if (!m_bIsStandingMount)
			return;
#else
		return;
#endif
	}

	__InitializeMovement();
}

 

ActorInstanceMotion.cpp

 

DWORD CActorInstance::__SetMotion (const SSetMotionData& c_rkSetMotData, DWORD dwRandMotKey)
{
...........
#if defined(ENABLE_STANDING_MOUNT)
		if (m_pkHorse->CheckMotionThingIndex(dwChildMotKey))
		{
			m_pkHorse->SetMotion(dwChildMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
			m_pkHorse->__BindMotionData(dwChildMotKey);

			if (c_rkSetMotData.iLoopCount)
				m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_ONCE; // ¹«Á¶°Ç ÀÌÀü ¸ğ¼Ç ŸÀÔÀ¸·Î ¼³Á¤µÇ°í ÀÖ¾úÀ½
			else
				m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_LOOP;

			m_pkHorse->m_kCurMotNode.dwFrameCount = m_pkHorse->GetMotionDuration(dwChildMotKey) / (1.0f / g_fGameFPS);
			m_pkHorse->m_kCurMotNode.dwcurFrame = 0;
			m_pkHorse->m_kCurMotNode.dwMotionKey = dwChildMotKey;
		}
#else
		m_pkHorse->SetMotion (dwChildMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
		m_pkHorse->__BindMotionData (dwChildMotKey);

		if (c_rkSetMotData.iLoopCount)
			m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_ONCE;    // ¹«Á¶°Ç ÀÌÀü ¸ğ¼Ç ŸÀÔÀ¸·Î ¼³Á¤µÇ°í ÀÖ¾úÀ½
		else
			m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_LOOP;

		m_pkHorse->m_kCurMotNode.dwFrameCount = m_pkHorse->GetMotionDuration (dwChildMotKey) / (1.0f / g_fGameFPS);
		m_pkHorse->m_kCurMotNode.dwcurFrame = 0;
		m_pkHorse->m_kCurMotNode.dwMotionKey = dwChildMotKey;
#endif
	}
	else
	{
		CGraphicThingInstance::SetMotion (dwMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
	}

	__HideWeaponTrace();


RaceData.cpp

 

#if defined(ENABLE_STANDING_MOUNT)
			case CRaceMotionData::MODE_HORSE_STAND:
			case CRaceMotionData::MODE_HORSE_STAND_CLAW:
			case CRaceMotionData::MODE_HORSE_STAND_ONEHAND_SWORD:
			case CRaceMotionData::MODE_HORSE_STAND_TWOHAND_SWORD:
			case CRaceMotionData::MODE_HORSE_STAND_DUALHAND_SWORD:
			case CRaceMotionData::MODE_HORSE_STAND_BOW:
			case CRaceMotionData::MODE_HORSE_STAND_FAN:
			case CRaceMotionData::MODE_HORSE_STAND_BELL:
				wGeneralMode = CRaceMotionData::MODE_HORSE_STAND;
				break;
#endif


RaceMotionData.h

 

#if defined(ENABLE_STANDING_MOUNT)
		MODE_HORSE_STAND,
		MODE_HORSE_STAND_CLAW,
		MODE_HORSE_STAND_ONEHAND_SWORD,
		MODE_HORSE_STAND_TWOHAND_SWORD,
		MODE_HORSE_STAND_DUALHAND_SWORD,
		MODE_HORSE_STAND_BOW,
		MODE_HORSE_STAND_FAN,
		MODE_HORSE_STAND_BELL,
#endif


InstanceBase.cpp

 

void CInstanceBase::MountHorse(UINT eRace)
{
	m_kHorse.Destroy();
	m_kHorse.Create(m_GraphicThingInstance.NEW_GetCurPixelPositionRef(), eRace, ms_adwCRCAffectEffect[EFFECT_HIT]);

#if defined(ENABLE_STANDING_MOUNT)
	if (m_bIsStandingMount)
		SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
	else
		SetMotionMode(CRaceMotionData::MODE_HORSE);
#else
	SetMotionMode(CRaceMotionData::MODE_HORSE);
#endif
	SetRotationSpeed(c_fDefaultHorseRotationSpeed);

	m_GraphicThingInstance.MountHorse(m_kHorse.GetActorPtr());
	m_GraphicThingInstance.Stop();
	m_GraphicThingInstance.RefreshActorInstance();
}
#if defined(ENABLE_MOUNT_COSTUME_SYSTEM)
bool CInstanceBase::SetMount(DWORD eMount)
{
	if (IsPoly())
		return false;

	if (__IsShapeAnimalWear())
		return false;

	m_GraphicThingInstance.ChangePart(CRaceData::PART_MOUNT, eMount);

	if (eMount)
	{
		CItemData* pItemData;
		if (CItemManager::Instance().GetItemDataPointer(eMount, &pItemData))
		{
			m_awPart[CRaceData::PART_MOUNT] = eMount;
#if defined(ENABLE_STANDING_MOUNT)
			m_bIsStandingMount = pItemData->GetSubType() == CItemData::COSTUME_MOUNT_STANDING;
#endif
		}
		else
		{
			ClearMount();
		}
	}
	else
	{
		ClearMount();
	}

#if defined(ENABLE_STANDING_MOUNT)
	m_GraphicThingInstance.SetStandingMount(m_bIsStandingMount);

	if (m_bIsStandingMount)
		RefreshWeapon();
#endif

	return true;
}
void CInstanceBase::ClearMount()
{
	m_awPart[CRaceData::PART_MOUNT] = 0;
#if defined(ENABLE_STANDING_MOUNT)
	m_bIsStandingMount = false;
#endif
}

#if defined(ENABLE_STANDING_MOUNT)
bool CInstanceBase::IsStandingMount()
{
	return m_bIsStandingMount;
}
void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop)
{
	DWORD dwPartItemID = m_GraphicThingInstance.GetPartItemID (CRaceData::PART_WEAPON);

	BYTE byItemType = 0xff;
	BYTE bySubType = 0xff;

	CItemManager& rkItemMgr = CItemManager::Instance();
	CItemData* pItemData;

	if (rkItemMgr.GetItemDataPointer(dwPartItemID, &pItemData))
	{
		byItemType = pItemData->GetType();
		bySubType = pItemData->GetWeaponType();
	}

	if (IsPoly())
		SetMotionMode(CRaceMotionData::MODE_GENERAL);
	else if (IsWearingDress())
		SetMotionMode(CRaceMotionData::MODE_WEDDING_DRESS);
	else if (byItemType == CItemData::ITEM_TYPE_PICK)
	{
		if (m_kHorse.IsMounting())
		{
#if defined(ENABLE_STANDING_MOUNT)
			if (m_bIsStandingMount)
				SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
			else
				SetMotionMode(CRaceMotionData::MODE_HORSE);
#else
			SetMotionMode(CRaceMotionData::MODE_HORSE);
#endif
		}
		else
		{
			SetMotionMode(CRaceMotionData::MODE_GENERAL);
		}
	}
	else if (byItemType == CItemData::ITEM_TYPE_ROD)
	{
		if (m_kHorse.IsMounting())
		{
#if defined(ENABLE_STANDING_MOUNT)
			if (m_bIsStandingMount)
				SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
			else
				SetMotionMode(CRaceMotionData::MODE_HORSE);
#else
			SetMotionMode(CRaceMotionData::MODE_HORSE);
#endif
		}
		else
		{
			SetMotionMode(CRaceMotionData::MODE_FISHING);
		}
	}
	else if (m_kHorse.IsMounting())
	{
#if defined(ENABLE_STANDING_MOUNT)
		if (m_bIsStandingMount)
		{
			switch (bySubType)
			{
				case CItemData::WEAPON_SWORD:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_ONEHAND_SWORD);
					break;

				case CItemData::WEAPON_TWO_HANDED:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_TWOHAND_SWORD); // Only Warrior
					break;

				case CItemData::WEAPON_DAGGER:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_DUALHAND_SWORD); // Only Assassin
					break;

				case CItemData::WEAPON_FAN:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_FAN); // Only Shaman
					break;

				case CItemData::WEAPON_BELL:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_BELL); // Only Shaman
					break;

				case CItemData::WEAPON_BOW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_BOW); // Only Shaman
					break;

				case CItemData::WEAPON_CLAW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND_CLAW); // Only Wolfman
					break;

				default:
					SetMotionMode(CRaceMotionData::MODE_HORSE_STAND);
					break;
			}
		}
		else
		{
			switch (bySubType)
			{
				case CItemData::WEAPON_SWORD:
					SetMotionMode(CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
					break;

				case CItemData::WEAPON_TWO_HANDED:
					SetMotionMode(CRaceMotionData::MODE_HORSE_TWOHAND_SWORD); // Only Warrior
					break;

				case CItemData::WEAPON_DAGGER:
					SetMotionMode(CRaceMotionData::MODE_HORSE_DUALHAND_SWORD); // Only Assassin
					break;

				case CItemData::WEAPON_FAN:
					SetMotionMode(CRaceMotionData::MODE_HORSE_FAN); // Only Shaman
					break;

				case CItemData::WEAPON_BELL:
					SetMotionMode(CRaceMotionData::MODE_HORSE_BELL); // Only Shaman
					break;

				case CItemData::WEAPON_BOW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_BOW); // Only Shaman
					break;

				case CItemData::WEAPON_CLAW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW); // Only Wolfman
					break;

				default:
					SetMotionMode(CRaceMotionData::MODE_HORSE);
					break;
			}
		}
#else
		switch (bySubType)
		{
			case CItemData::WEAPON_SWORD:
				SetMotionMode (CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
				break;

			case CItemData::WEAPON_TWO_HANDED:
				SetMotionMode (CRaceMotionData::MODE_HORSE_TWOHAND_SWORD); // Only Warrior
				break;

			case CItemData::WEAPON_DAGGER:
				SetMotionMode (CRaceMotionData::MODE_HORSE_DUALHAND_SWORD); // Only Assassin
				break;

			case CItemData::WEAPON_FAN:
				SetMotionMode (CRaceMotionData::MODE_HORSE_FAN); // Only Shaman
				break;

			case CItemData::WEAPON_BELL:
				SetMotionMode (CRaceMotionData::MODE_HORSE_BELL); // Only Shaman
				break;

			case CItemData::WEAPON_BOW:
				SetMotionMode (CRaceMotionData::MODE_HORSE_BOW); // Only Shaman
				break;

				case CItemData::WEAPON_CLAW:
					SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW); // Only Wolfman
					break;

			default:
				SetMotionMode (CRaceMotionData::MODE_HORSE);
				break;
		}
#endif
	}
	else
	{
		switch (bySubType)
		{
			case CItemData::WEAPON_SWORD:
				SetMotionMode(CRaceMotionData::MODE_ONEHAND_SWORD);
				break;

			case CItemData::WEAPON_TWO_HANDED:
				SetMotionMode(CRaceMotionData::MODE_TWOHAND_SWORD); // Only Warrior
				break;

			case CItemData::WEAPON_DAGGER:
				SetMotionMode(CRaceMotionData::MODE_DUALHAND_SWORD); // Only Assassin
				break;

			case CItemData::WEAPON_BOW:
				SetMotionMode(CRaceMotionData::MODE_BOW); // Only Assassin
				break;

			case CItemData::WEAPON_FAN:
				SetMotionMode(CRaceMotionData::MODE_FAN); // Only Shaman
				break;

			case CItemData::WEAPON_BELL:
				SetMotionMode(CRaceMotionData::MODE_BELL); // Only Shaman
				break;

			case CItemData::WEAPON_CLAW:
				SetMotionMode(CRaceMotionData::MODE_CLAW); // Only Wolfman
				break;

			case CItemData::WEAPON_ARROW:
			default:
				SetMotionMode(CRaceMotionData::MODE_GENERAL);
				break;
		}
	}

	if (isLoop)
	{
		m_GraphicThingInstance.InterceptLoopMotion (dwMotIndex);
	}
	else
	{
		m_GraphicThingInstance.InterceptOnceMotion (dwMotIndex);
	}

	RefreshActorInstance();
}


spacer.png

somewhere in your source there is a vrace defined to where mount should the standing mount system apply its animations. 

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.