Și dacă vrei ajutor direct, te așteptăm pe serverul nostru de Discord — chat activ, suport live și o comunitate faină gata să te ajute! Pentru a intra pe serverul de Discord: Click aici
You’ve already blocked damage below level 11, but the horse attack animation is still playing, and you want to completely disable it.
In Metin2, this isn’t only about damage – the input that triggers the attack motion/animation must also be controlled. You have a few options:
1. In the client source (the cleanest method)
The horse attack is linked to horse.cpp (or horse_riding.cpp) + GameCharacter.cpp.
When the player presses the horse attack key, the client sends the command to start the attack motion.
You can add a simple check: if horse level < 11 → don’t send the animation command.
Example (simplified pseudo-code):
if (pHorse->GetLevel() < 11)
return; // block the animation
This way, the animation never starts.
2. In the server source
You already blocked damage on the server.
If you also want to block the animation server-side, you could send back a motion cancel packet when the horse is under level 11. The downside: the animation will start and then stop abruptly, which doesn’t look very good.
3. Quick workaround (hacky method)
In horse_skill_proto or skill_proto, you can set the horse attack animation to empty for levels below 11 (so there’s no motion). But this complicates your DB and makes it harder to manage level differences.
Best recommendation: put the condition directly in the client (in the file that processes the horse attack input). This way, the animation won’t even start.
malý zub scrie: ↑
You’ve already blocked damage below level 11, but the horse attack animation is still playing, and you want to completely disable it.
In Metin2, this isn’t only about damage – the input that triggers the attack motion/animation must also be controlled. You have a few options:
1. In the client source (the cleanest method)
The horse attack is linked to horse.cpp (or horse_riding.cpp) + GameCharacter.cpp.
When the player presses the horse attack key, the client sends the command to start the attack motion.
You can add a simple check: if horse level < 11 → don’t send the animation command.
Example (simplified pseudo-code):
if (pHorse->GetLevel() < 11)
return; // block the animation
This way, the animation never starts.
2. In the server source
You already blocked damage on the server.
If you also want to block the animation server-side, you could send back a motion cancel packet when the horse is under level 11. The downside: the animation will start and then stop abruptly, which doesn’t look very good.
3. Quick workaround (hacky method)
In horse_skill_proto or skill_proto, you can set the horse attack animation to empty for levels below 11 (so there’s no motion). But this complicates your DB and makes it harder to manage level differences.
Best recommendation: put the condition directly in the client (in the file that processes the horse attack input). This way, the animation won’t even start.
On the server side I already do it. But the animation doesnt look good as you say. I want to disable it on the client side, but in InstanceBase.cpp there is no HorseLevel... There is only getlevel but the value is base on mob Vnum... Start like this:
UINT CInstanceBase::SHORSE::GetLevel()
{
if (m_pkActor)
{
DWORD mount = m_pkActor->GetRace();
switch (mount)
{
case 20101:
case 20102:
case 20103:
return 1;
case 20104:
case 20105:
case 20106:
return 2;
case 20107:
case 20108:
So now I am trying to send new packet with horse level.
UINT CInstanceBase::SHORSE::GetLevel()
{
if (m_pkActor)
{
DWORD mount = m_pkActor->GetRace();
switch (mount)
{
case 20101:
case 20102:
case 20103:
return 1;
case 20104:
case 20105:
case 20106:
return 2;
case 20107:
case 20108:
case 20109:
case 20110:
case 20111:
case 20112:
case 20113:
case 20114:
case 20115:
case 20116:
case 20117:
case 20118:
case 20120:
case 20121:
case 20122:
case 20123:
case 20124:
case 20125:
case 20233:
case 20234:
case 20235:
case 20236:
case 20237:
case 20238:
case 20239:
case 20240:
case 20241:
case 20242:
case 20243:
case 20244:
case 20245:
case 20246:
case 20247:
case 20248:
case 20249:
return 3;
case 20119:
case 20219:
case 20220:
case 20221:
case 20222:
return 2;
}
{
if ((20205 <= mount && 20208 >= mount) ||
(20214 == mount) || (20217 == mount)
)
return 2;
if ((20209 <= mount && 20212 >= mount) ||
(20215 == mount) || (20218 == mount) ||
(20220 == mount)
)
return 3;
}
}
return 0;
}
That's not work because getLevel return only level on specific mount vnum. But I figure it by myself. I am sending new packet to client with horse level.
I will upload how I did it.:
Acest forum folosește cookie-uri pentru a te menține conectat, a-ți proteja contul și a asigura funcționarea corectă a site-ului. Cu acordul tău, putem folosi și cookie-uri opționale și tehnologii similare pentru statistici, marketing și conținut încorporat. Îți poți schimba oricând preferințele din "Setări de confidențialitate" din antetul site-ului. Consultă Politica de confidențialitate și Politica de cookie-uri pentru mai multe informații.
Setări de confidențialitate
Acest forum folosește cookie-uri pentru a te menține conectat, a-ți proteja contul și a asigura funcționarea corectă a site-ului. Cu acordul tău, putem folosi și cookie-uri opționale și tehnologii similare pentru statistici, marketing și conținut încorporat.