Jump to content

Mount without a horse level


Go to solution Solved by Mitachi,

Recommended Posts

Hello, I have the official mount system. How can I use the mount to move around and deal damage to monsters from it, but without needing any horse level? I’d like to simply give the mount from the start, but in my case, when I attack from the mount, I don’t deal any damage.
I can only deal damage from the mount starting from horse level 11 😕

And here is my file:

pvp.cpp - https://pastebin.com/1XSU4mwk

InstanceBase.cpp - https://pastebin.com/TmLMU8hC

Link to comment
https://metin2.dev/topic/33210-mount-without-a-horse-level/
Share on other sites

  • Developer
  • Solution

Many people are using this system and are asking me the same thing

You can do damage starting at horse level 11 (which translates to GetHorseGrade() == 1)

Grades translated in level:
0 = 0 - 10 [Pony]
1 = 11 - 20 [Medium]
2 = 21 = 30+ [Military]

'Cause of this in Srcs-Server/game/src/pvp.cpp:

	if (pkChr->IsHorseRiding())
	{
		if (pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade()) 
			return false;
	}

always return true, it will solve the problem if you don't care about checking the horse the level, so:

	if (pkChr->IsHorseRiding())
	{
		return true;
	}

Check under in the spoiler to understand where you can do almost the same client side;

Some people also asked me something like: "Ok I don't care about horse level, but my character need to be level X to deal damage from horses"
you can:

Spoiler
# Client
/// 1) go in Srcs-Client/UserInterface/macroDefines.h

// add:

#define ENABLE_HORSE_ATTACK_MIN_LEVEL

/// 2) go in Srcs-Client/UserInterface/InstanceBaseBattle.cpp

// search:

BOOL CInstanceBase::CanAttackHorseLevel()
{
	if (!IsMountingHorse())
		return FALSE;

	return m_kHorse.CanAttack();
}

// change like:

BOOL CInstanceBase::CanAttackHorseLevel()
{
	if (!IsMountingHorse())
		return FALSE;

	#ifdef ENABLE_HORSE_ATTACK_MIN_LEVEL
	return GetLevel() >= 20;
	#else
	return m_kHorse.CanAttack();
	#endif
}

# Server
/// 1) go in Srcs-Server/common/macroDefines.h

// add:

#define ENABLE_HORSE_ATTACK_MIN_LEVEL

/// 2) go in Srcs-Server/game/src/pvp.cpp

// search:

	if (pkChr->IsHorseRiding())
	{
		if (pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade()) 
			return false;
	}

// change like:

	if (pkChr->IsHorseRiding())
	{
		#ifdef ENABLE_HORSE_ATTACK_MIN_LEVEL
		return pkChr->GetLevel() >= 20;
		#else
		if (pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade()) 
			return false;
		#endif
	}

// Now you can change the 20 with the level you want as minimum level to deal damage from horse

 

Edited by Mitachi
Never write code directly on the codeblock .-.
  • Metin2 Dev 1
  • Love 2

Villains are not born, they are made.
Join

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.