Jump to content

[C++] Book/Poly names on ground


tierrilopes
 Share

Recommended Posts

client/UserInterface/PythonItem.cpp

Add this after the other includes:

#include "PythonSkill.h"
#include "PythonNonPlayer.h"

Look for:

void CPythonItem::CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop)

Replace with:

#ifdef __BOOK_NAME__
void CPythonItem::CreateItem(DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, long lSocket0, bool bDrop)
#else
void CPythonItem::CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop)
#endif

Look for:

	rkTextTail.RegisterItemTextTail (
		dwVirtualID,
		pItemData->GetName(),
		&pGroundItemInstance->ThingInstance);

Replace with:

#ifdef __BOOK_NAME__
	std::string sItemName = pItemData->GetName();
	switch (pItemData->GetType()) {
		case CItemData::ITEM_TYPE_SKILLBOOK:
		case CItemData::ITEM_TYPE_SKILLFORGET:
			if (lSocket0 > 0) {
					CPythonSkill::SSkillData * c_pSkillData;
					if (CPythonSkill::Instance().GetSkillData(lSocket0, &c_pSkillData)){
						sItemName = c_pSkillData->GradeData[0].strName.c_str();
						sItemName += " ";}

					sItemName += pItemData->GetName();}
			break;
		case CItemData::ITEM_TYPE_POLYMORPH:
			if (lSocket0 > 0) {
				sItemName = CPythonNonPlayer::Instance().GetMonsterName(lSocket0);
				sItemName += " ";
				sItemName += pItemData->GetName();}
			break;
	}
	const char * cItemName = sItemName.c_str();
	rkTextTail.RegisterItemTextTail(
		dwVirtualID,
		cItemName,
		&pGroundItemInstance->ThingInstance);
#else
	rkTextTail.RegisterItemTextTail (
		dwVirtualID,
		pItemData->GetName(),
		&pGroundItemInstance->ThingInstance);
#endif

 

client/UserInterface/PythonItem.h

Look for:

void	CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop = true);

Replace with:

#ifdef __BOOK_NAME__
		void	CreateItem(DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, long lSocket0 = 0, bool bDrop = true);
#else
		void	CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop = true);
#endif

client/UserInterface/Packet.h

Look for:

typedef struct packet_ground_add_item {
	BYTE        bHeader;
	long        lX;
	long		lY;
	long		lZ;

	DWORD       dwVID;
	DWORD       dwVnum;
} TPacketGCItemGroundAdd;

Replace with:

typedef struct packet_ground_add_item {
	BYTE        bHeader;
	long        lX;
	long		lY;
	long		lZ;

	DWORD       dwVID;
	DWORD       dwVnum;
#ifdef __BOOK_NAME__
	long    lSocket0;
#endif
} TPacketGCItemGroundAdd;

 

client/UserInterface/PythonNetworkStreamPhaseGameItem.cpp

Inside

bool CPythonNetworkStream::RecvItemGroundAddPacket()

Look for:

	CPythonItem::Instance().CreateItem(packet_item_ground_add.dwVID,
		packet_item_ground_add.dwVnum,
		packet_item_ground_add.lX,
		packet_item_ground_add.lY,
		packet_item_ground_add.lZ);

Replace with:

#ifdef __BOOK_NAME__
	CPythonItem::Instance().CreateItem (packet_item_ground_add.dwVID,
										packet_item_ground_add.dwVnum,
										packet_item_ground_add.lX,
										packet_item_ground_add.lY,
										packet_item_ground_add.lZ,
										packet_item_ground_add.lSocket0);
#else
	CPythonItem::Instance().CreateItem(packet_item_ground_add.dwVID,
		packet_item_ground_add.dwVnum,
		packet_item_ground_add.lX,
		packet_item_ground_add.lY,
		packet_item_ground_add.lZ);
#endif

 

client/UserInterface/Locale_inc.h

Add the following:

#define __BOOK_NAME__

 

 

Server

game/src/Packet.h

Look for:

typedef struct packet_item_ground_add {
	BYTE	bHeader;
	long 	x, y, z;
	DWORD	dwVID;
	DWORD	dwVnum;
} TPacketGCItemGroundAdd;

Replace with:

typedef struct packet_item_ground_add {
	BYTE	bHeader;
	long 	x, y, z;
	DWORD	dwVID;
	DWORD	dwVnum;
#ifdef __BOOK_NAME__
	long	lSocket0;
#endif
} TPacketGCItemGroundAdd;

game/src/item.cpp

Inside

void CItem::EncodeInsertPacket (LPENTITY ent)

Look for:

pack.dwVID		= m_dwVID;

Add this AFTER:

#ifdef __BOOK_NAME__
	pack.lSocket0 = ((GetType() == ITEM_SKILLBOOK || GetType() == ITEM_SKILLFORGET || GetType() == ITEM_POLYMORPH) ? GetSocket(0) : 0);
#endif

 

common/service.h

Add the following:

#define __BOOK_NAME__

 

metin2client_2017-11-23_01-19-54.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...