Jump to content

Metin2 | Mount System Renewal


Recommended Posts

@ZeNu @Mali61 @Koray @Raylee

 

Hello everybody

 

I opened the questions section about this problem, but nobody helped. Yes, I know nobody has to help. But it's nice to help a person who needs help. Likewise, when a person asks me, I help.

 

My problem:

There is only ITEM_COSTUME problem.

This is a problem when you change objects like costume, weapon costume, wing(sash), and hair.

 

Do you have any idea how to fix this?

 

Thank you very much for your help in advance.

 

Also, this problem does not occur with normal weapons and armor. only occurs in ITEM_COSTUME system.

 

For example:

 

COSTUME_WEAPON
COSTUME_SASH
COSTUME_BODY
COSTUME_HAIR

 

Problem Gif

 

https://metin2.download/picture/H0yi0BHSc5S14X5xIvFO4jnX76Hm7Wtr/.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 6
  • Think 1
  • Confused 1
  • Good 4
  • Love 1
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
On 11/9/2020 at 4:51 PM, Neverr said:

 

Hi!

In questlua_horse.cpp add at the top:

#include "arena.h"

 

In arena.h add at the top:

#include "char.h"

 

The system works fine, i like it a lot, the only problem i occured in my test server is that if i have my horse summoned and i use the mount item, the server crashes, i don't know if its only me but you can test to see if you have this problem too, i have fixed the problem by doing the following:

 

In MountSystem.cpp:

// search for 
bool CMountActor::Mount(LPITEM mountItem)

// look down for
	Unmount();

//and add above:
	if (m_pkOwner->GetHorse())
		m_pkOwner->HorseSummon(false);

 

Should look like this:

https://metin2.download/picture/yzhbek856vb9cRbNC9nR29ZQfsNz218J/.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 4
  • Good 5
  • Love 1
  • Love 1
Link to comment
Share on other sites

  • 3 weeks later...

Good day together, I have 2 mounts in the inventory and press on Ctrl and G and then 1x mount goes into the slot and then the mount comes out and wants to ride on it now push again Ctrl and G and now want to ride and ride for 2 seconds and get kicked out again and the other mount comes in in the slot and the first mount in the inventory

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...
  • 2 weeks later...

cmd_general.cpp:1373:18: error: member access into incomplete type 'CMountSystem'
                        if(mountSystem->CountSummoned() == 0)
                                      ^
./char.h:2:7: note: forward declaration of 'CMountSystem'
class CMountSystem;
      ^
cmd_general.cpp:1375:16: error: member access into incomplete type 'CMountSystem'
                                mountSystem->Unmount(mobVnum);
                                           ^
./char.h:2:7: note: forward declaration of 'CMountSystem'
class CMountSystem;
      ^
cmd_general.cpp:2542:18: error: member access into incomplete type 'CMountSystem'
                        if(mountSystem->CountSummoned() == 0)
                                      ^
./char.h:2:7: note: forward declaration of 'CMountSystem'
class CMountSystem;
      ^
cmd_general.cpp:2544:16: error: member access into incomplete type 'CMountSystem'
                                mountSystem->Unmount(mobVnum);
                                           ^
./char.h:2:7: note: forward declaration of 'CMountSystem'
class CMountSystem;
      ^
cmd_general.cpp:2549:18: error: member access into incomplete type 'CMountSystem'
                        if(mountSystem->CountSummoned() == 1)
                                      ^
./char.h:2:7: note: forward declaration of 'CMountSystem'
class CMountSystem;
      ^
cmd_general.cpp:2551:16: error: member access into incomplete type 'CMountSystem'
                                mountSystem->Mount(mobVnum, mount);
                                           ^
./char.h:2:7: note: forward declaration of 'CMountSystem'
class CMountSystem;
      ^
6 errors generated.

Edited by I bims 1 WLAN
Link to comment
Share on other sites

  • 7 months later...
  • Silver

char.cpp

add this to char.cpp
 

void CHARACTER::ReloadMountBonus(LPITEM mountItem)
{
	RemoveAffect(AFFECT_MOUNT_BONUS);
	
	for (int i = 0; i < ITEM_APPLY_MAX_NUM; ++i)
	{
		if (mountItem->GetProto()->aApplies[i].bType == APPLY_NONE)
			continue;

		AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[mountItem->GetProto()->aApplies[i].bType].bPointType, mountItem->GetProto()->aApplies[i].lValue, AFF_NONE, 60*60*24*365, 0, false);
	}
}


char.h

search this:

 

		bool 				IsRidingMount();

add under this:

 

		void				ReloadMountBonus(LPITEM mountItem);

MountSystem.cpp

search this:
 

bool CMountActor::Mount(LPITEM mountItem)

modify the function this:

 

bool CMountActor::Mount(LPITEM mountItem)
{
	if (0 == m_pkOwner)
		return false;
	
	if(!mountItem)
		return false;

	if (m_pkOwner->IsHorseRiding())
		m_pkOwner->StopRiding();
	
	if (m_pkOwner->GetHorse())
		m_pkOwner->HorseSummon(false);

	Unmount();
	int fixtime;

	for (int i = 0; i < ITEM_LIMIT_MAX_NUM; i++)
	{
		if ((LIMIT_REAL_TIME == mountItem->GetLimitType(i)) || (LIMIT_REAL_TIME_START_FIRST_USE == mountItem->GetLimitType(i)))
			fixtime = (DWORD)mountItem->GetSocket(0);
		else
			fixtime = INFINITE_AFFECT_DURATION;
	}
	m_pkOwner->AddAffect(AFFECT_MOUNT, POINT_MOUNT, m_dwVnum, AFF_NONE, fixtime - time(0), 0, true);

	m_pkOwner->ReloadMountBonus(mountItem);
	m_pkOwner->ComputePoints();
	
	return m_pkOwner->GetMountVnum() == m_dwVnum;
}



item_proto you can remove real_time for mount.

Edited by SamuraiHUN
Link to comment
Share on other sites

  • 3 months later...
Spoiler

metin2client_IYIfNudb78.png

 

The System seems functional and without BUG for the moment. Do we know how to solve the name distance problem? "Metin2Dev Mount" is too high above the mount's body. Anyone have any ideas? Thanks in the meantime!

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
1 hour ago, Ymir said:
  Hide contents

metin2client_IYIfNudb78.png

 

The System seems functional and without BUG for the moment. Do we know how to solve the name distance problem? "Metin2Dev Mount" is too high above the mount's body. Anyone have any ideas? Thanks in the meantime!

 

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • 2 weeks later...

i get this error:

In file included from char.cpp:66:
./MountSystem.h:53:10: error: no template named 'unordered_map' in namespace 'bo                                                                                        ost'; did you mean 'quest::unordered_map'?
        typedef boost::unordered_map<DWORD,     CMountActor*>           TMountAc                                                                                        torMap;
                ^~~~~~~~~~~~~~~~~~~~
                quest::unordered_map
/usr/include/c++/v1/unordered_map:920:28: note: 'quest::unordered_map' declared                                                                                         here
class _LIBCPP_TEMPLATE_VIS unordered_map

should to type quest instead of boost??

Link to comment
Share on other sites

13 hours ago, Filiq said:

i get this error:

In file included from char.cpp:66:
./MountSystem.h:53:10: error: no template named 'unordered_map' in namespace 'bo                                                                                        ost'; did you mean 'quest::unordered_map'?
        typedef boost::unordered_map<DWORD,     CMountActor*>           TMountAc                                                                                        torMap;
                ^~~~~~~~~~~~~~~~~~~~
                quest::unordered_map
/usr/include/c++/v1/unordered_map:920:28: note: 'quest::unordered_map' declared                                                                                         here
class _LIBCPP_TEMPLATE_VIS unordered_map

should to type quest instead of boost??

fixed, instead of boost i put "std"

Link to comment
Share on other sites

  • 3 months later...

can someone help me? 
for the first 2 errors i tried the fix up here and it doesn't work

In file included from questlua_horse.cpp:9:
./arena.h:59:36: error: use of undeclared identifier 'CHARACTER_MANAGER'
        LPCHARACTER GetPlayerA() { return CHARACTER_MANAGER::instance().FindByPID(m_dwPIDA); }
                                          ^
./arena.h:60:36: error: use of undeclared identifier 'CHARACTER_MANAGER'
        LPCHARACTER GetPlayerB() { return CHARACTER_MANAGER::instance().FindByPID(m_dwPIDB); }
                                          ^
2 errors generated.
gmake: *** [Makefile:118: OBJDIR/questlua_horse.o] Error 1
gmake: *** Waiting for unfinished jobs....
cmd_general.cpp:2180:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2190:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2233:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2238:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2347:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2459:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2488:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2493:1: error: function definition is not allowed here
{
^
8 errors generated.
gmake: *** [Makefile:118: OBJDIR/cmd_general.o] Error 1
root@metin2:/usr/metin2/src/game/src #
Edited by Alessio
Link to comment
Share on other sites

1 hour ago, Alessio said:

can someone help me? 
for the first 2 errors i tried the fix up here and it doesn't work

In file included from questlua_horse.cpp:9:
./arena.h:59:36: error: use of undeclared identifier 'CHARACTER_MANAGER'
        LPCHARACTER GetPlayerA() { return CHARACTER_MANAGER::instance().FindByPID(m_dwPIDA); }
                                          ^
./arena.h:60:36: error: use of undeclared identifier 'CHARACTER_MANAGER'
        LPCHARACTER GetPlayerB() { return CHARACTER_MANAGER::instance().FindByPID(m_dwPIDB); }
                                          ^
2 errors generated.
gmake: *** [Makefile:118: OBJDIR/questlua_horse.o] Error 1
gmake: *** Waiting for unfinished jobs....
cmd_general.cpp:2180:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2190:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2233:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2238:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2347:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2459:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2488:1: error: function definition is not allowed here
{
^
cmd_general.cpp:2493:1: error: function definition is not allowed here
{
^
8 errors generated.
gmake: *** [Makefile:118: OBJDIR/cmd_general.o] Error 1
root@metin2:/usr/metin2/src/game/src #

i fixed this but now when i start the server i get this error with item_proto.txt
 

SYSERR: Mar  8 17:18:29 :: Set_Proto_Item_Table: ItemProto Reading Failed : Invalid value. (index: 3, col: 3, value: COSTUME_MOUNT)
SYSERR: Mar  8 17:18:29 :: Set_Proto_Item_Table: 	0 ~ 3 Values: 52001,0,28,

look like it doesn't recognize "COSTUME_MOUNT"

 

Link to comment
Share on other sites

  • 4 months later...

Announcements



×
×
  • 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.