Jump to content

Recommended Posts

Hello Speak Turkish Please

 

 
PetSystem.cpp:318:25: error: 'class CPetActor' has no member named 'Attack'
         bResult = this->Attack();
                         ^
 
-----------------------------
bResult = this->Attack(); Please
Link to comment
https://metin2.dev/topic/5674-attacking-pets-system/page/3/#findComment-44291
Share on other sites

  • 1 month later...
  • Premium
char_battle.cpp: In member function 'bool CHARACTER::Attack(CHARACTER*, BYTE)':
char_battle.cpp:275: error: invalid use of incomplete type 'struct CPetSystem'
char.h:18: error: forward declaration of 'struct CPetSystem'
char_battle.cpp:276: error: invalid use of incomplete type 'struct CPetSystem'
char.h:18: error: forward declaration of 'struct CPetSystem'

well any idea

Link to comment
https://metin2.dev/topic/5674-attacking-pets-system/page/3/#findComment-48100
Share on other sites

  • 4 weeks later...
  • 2 months later...
  • 2 months later...
  • 1 month later...
  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...

[FIX] Drops von Pets

Vorhin meinte n Kumpel so, dass es den Bug gibt, dass wenn Pets Mobs killen der Name vom Pet über den gedropten Items steht und man diese nicht aufheben kann.


Naja habs kurz gebastelt.
Da es nur ne kleinigkeit is schenk ichs euch mal.
Autor: xCPx EPVP

service.h:
	add:
		#define __FIX_PET_ATTACK


char.h:
	search:
		#ifdef __PET_SYSTEM__
			private:
				bool m_bIsPet;
			public:
				void SetPet() { m_bIsPet = true; }
				bool IsPet() { return m_bIsPet; }
		#endif
	add below:
		#ifdef __FIX_PET_ATTACK
			private:
				LPCHARACTER m_Owner = NULL;
			public:
				void SetOwner(LPCHARACTER owner) { m_Owner = owner; }
				LPCHARACTER GetOwner() { return m_Owner; }
		#endif
char.cpp:
	search:
		#ifdef PET_SYSTEM
		 m_petSystem = 0;
		 m_bIsPet = false;
		#endif
	add below:
		#ifdef __FIX_PET_ATTACK
		m_Owner = NULL;
		#endif
PetSystem.cpp:
	in:
		DWORD CPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)
	search:
		if (0 != m_pkChar)
		{
			m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
			m_dwVID = m_pkChar->GetVID();

			return m_dwVID;
		}
	replace it with:
		if (0 != m_pkChar)
		{
		#ifdef __FIX_PET_ATTACK
				m_pkChar->SetOwner(m_pkOwner);
				m_pkChar->SetPet();
		#endif
			m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
			m_dwVID = m_pkChar->GetVID();

			return m_dwVID;
		}
		

	search:
		m_pkChar->SetEmpire(m_pkOwner->GetEmpire());
	add below:
		#ifdef __FIX_PET_ATTACK
				m_pkChar->SetOwner(m_pkOwner);
		#endif

item.cpp:
	in:
		void CItem::SetOwnership(LPCHARACTER ch, int iSec)


	add at the beginning of the function:
		#ifdef __FIX_PET_ATTACK
			if(ch)
			{
				if (ch->IsPet())
				{
					LPCHARACTER owner = ch->GetOwner();
					if(owner)
						ch = owner;
				}
			}
		#endif
  • Metin2 Dev 1
  • Good 1
Link to comment
https://metin2.dev/topic/5674-attacking-pets-system/page/3/#findComment-67773
Share on other sites

On 03.05.2016 at 11:18 PM, margoss said:

[FIX] Drops von Pets

Vorhin meinte n Kumpel so, dass es den Bug gibt, dass wenn Pets Mobs killen der Name vom Pet über den gedropten Items steht und man diese nicht aufheben kann.


Naja habs kurz gebastelt.
Da es nur ne kleinigkeit is schenk ichs euch mal.
Autor: xCPx EPVP


service.h:
	add:
		#define __FIX_PET_ATTACK


char.h:
	search:
		#ifdef __PET_SYSTEM__
			private:
				bool m_bIsPet;
			public:
				void SetPet() { m_bIsPet = true; }
				bool IsPet() { return m_bIsPet; }
		#endif
	add below:
		#ifdef __FIX_PET_ATTACK
			private:
				LPCHARACTER m_Owner = NULL;
			public:
				void SetOwner(LPCHARACTER owner) { m_Owner = owner; }
				LPCHARACTER GetOwner() { return m_Owner; }
		#endif
char.cpp:
	search:
		#ifdef PET_SYSTEM
		 m_petSystem = 0;
		 m_bIsPet = false;
		#endif
	add below:
		#ifdef __FIX_PET_ATTACK
		m_Owner = NULL;
		#endif
PetSystem.cpp:
	in:
		DWORD CPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)
	search:
		if (0 != m_pkChar)
		{
			m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
			m_dwVID = m_pkChar->GetVID();

			return m_dwVID;
		}
	replace it with:
		if (0 != m_pkChar)
		{
		#ifdef __FIX_PET_ATTACK
				m_pkChar->SetOwner(m_pkOwner);
				m_pkChar->SetPet();
		#endif
			m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
			m_dwVID = m_pkChar->GetVID();

			return m_dwVID;
		}
		

	search:
		m_pkChar->SetEmpire(m_pkOwner->GetEmpire());
	add below:
		#ifdef __FIX_PET_ATTACK
				m_pkChar->SetOwner(m_pkOwner);
		#endif

item.cpp:
	in:
		void CItem::SetOwnership(LPCHARACTER ch, int iSec)


	add at the beginning of the function:
		#ifdef __FIX_PET_ATTACK
			if(ch)
			{
				if (ch->IsPet())
				{
					LPCHARACTER owner = ch->GetOwner();
					if(owner)
						ch = owner;
				}
			}
		#endif

i tested.not working

  • Metin2 Dev 1
Link to comment
https://metin2.dev/topic/5674-attacking-pets-system/page/3/#findComment-67930
Share on other sites

On 6.5.2016 at 10:12 PM, Nickas said:

i tested.not working

First of all:

Nice that you asked to release my Code here.

Second:

the compiling of this version sometimes failes ( gcc issue)


so to make it work right:

change:
LPCHARACTER m_Owner = NULL;

 

to:
LPCHARACTER m_Owner;

  • Love 1
Link to comment
https://metin2.dev/topic/5674-attacking-pets-system/page/3/#findComment-68037
Share on other sites

  • 9 years later...

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.