Jump to content

Extended Equipment Viewer


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

Hi devs!

The original equipment viewer is not updated for the new equipments I am thinking of costumes + rings + belt
Here is the extended version.

Here are my modified files to root and uiscript package, the .py files:

uiEquipDialog.py
Pastebin ~ MEGA

UIScriptEquipmentDialog.py
Pastebin ~ MEGA

UIScriptCostumeEquipmentDialog.py
Pastebin ~ MEGA

Ehm yeah this was the easiest part of this, now comin' the serverside and binary parts.
Server:
1.) Open gamepacket.h than search for: "typedef struct pakcet_view_equip" and replace all structure with this:

 

typedef struct pakcet_view_equip
{
	BYTE	header;
	DWORD	vid;
	struct {
		DWORD	vnum;
		BYTE	count;
		long	alSockets[ITEM_SOCKET_MAX_NUM];
		TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
	} equips[16];
} TPacketViewEquip;

PS: lel "pakcet" xD nevermind Save&Close

2.) Open char.cpp and search for this: "void CHARACTER::SendEquipment(LPCHARACTER ch)" and replace the event with this(Thanks ATAG):

void CHARACTER::SendEquipment(LPCHARACTER ch)
{
	TPacketViewEquip p;
	p.header = HEADER_GC_VIEW_EQUIP;
	p.vid    = GetVID();
	int pos[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23 };
	for (int i = 0; i < 16; i++)
	{
		LPITEM item = GetWear(pos[i]);
		if (item)
		{
			p.equips[i].vnum = item->GetVnum();
			p.equips[i].count = item->GetCount();

			thecore_memcpy(p.equips[i].alSockets, item->GetSockets(), sizeof(p.equips[i].alSockets));
			thecore_memcpy(p.equips[i].aAttr, item->GetAttributes(), sizeof(p.equips[i].aAttr));
		}
		else
		{
			p.equips[i].vnum = 0;
		}
	}
	ch->GetDesc()->Packet(&p, sizeof(p));
}

Serverside done! - Build!


Binary:
1.) Open UserInterfacePacket.h than search for this: "typedef struct pakcet_view_equip" and replace with this:

 

typedef struct pakcet_view_equip
{
	BYTE	header;
	DWORD	dwVID;
	TEquipmentItemSet equips[16];
} TPacketGCViewEquip;

PS: we met again with pakcet xD, Save&Close.

2.) Open UserInterfacePythonNetworkStreamPhaseGame.cpp than search for this: "bool CPythonNetworkStream::RecvViewEquipPacket()" and replace with this:

bool CPythonNetworkStream::RecvViewEquipPacket()
{
	TPacketGCViewEquip kViewEquipPacket;
	if (!Recv(sizeof(kViewEquipPacket), &kViewEquipPacket))
		return false;

	PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OpenEquipmentDialog", Py_BuildValue("(i)", kViewEquipPacket.dwVID));
	for (int i = 0; i < 16; ++i)
	{
		TEquipmentItemSet & rItemSet = kViewEquipPacket.equips[i];
		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogItem", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, rItemSet.vnum, rItemSet.count));

		for (int j = 0; j < ITEM_SOCKET_SLOT_MAX_NUM; ++j)
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogSocket", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, j, rItemSet.alSockets[j]));

		for (int k = 0; k < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++k)
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogAttr", Py_BuildValue("(iiiii)", kViewEquipPacket.dwVID, i, k, rItemSet.aAttr[k].bType, rItemSet.aAttr[k].sValue));
	}

	return true;
}

Binaryside done! - Build!

---Edit----
Multiple opening bugfix:
Open interFaceModule.py and search for this: "def OpenEquipmentDialog(self, vid):" if you found it replace that function with this:

 

	def OpenEquipmentDialog(self, vid):
		if self.equipmentDialogDict.has_key(vid):
			self.equipmentDialogDict[vid].Destroy()
			self.CloseEquipmentDialog(vid)

		dlg = uiEquipmentDialog.EquipmentDialog()
		dlg.SetItemToolTip(self.tooltipItem)
		dlg.SetCloseEvent(ui.__mem_func__(self.CloseEquipmentDialog))
		dlg.Open(vid)

		self.equipmentDialogDict[vid] = dlg

Show the "View equip" button on the targetbar:
Open uitarget.py and check this diff to fix it for yourself:
https://www.diffchecker.com/lqi9xdb7

(
----EndEdit----

Ohh I almost forgot, here are the bgs ^^-> ui.7z - MEGA
All done, press escape to exit... :')

  • Metin2 Dev 94
  • Eyes 1
  • Angry 1
  • Think 2
  • Confused 1
  • Scream 2
  • Good 26
  • Love 6
  • Love 82
Link to comment
Share on other sites

Hi devs!

 

The original equipment viewer is not updated for the new equipments I am thinking of costumes + rings + belt

Here is the extended version.

 

Images:

view_equip_new.jpg


view_equip_new2.jpg

 

 

Here are my modified files to root and uiscript package, the .py files:

uiEquipDialog.py

Pastebin ~ FTP

 

UIScriptEquipmentDialog.py

Pastebin ~ FTP

 

UIScriptCostumeEquipmentDialog.py

Pastebin ~ FTP

 

Ehm yeah this was the easiest part of this, now comin' the serverside and binary parts.

Server:

1.) Open gamepacket.h than search for: "typedef struct pakcet_view_equip" and replace all structure with this:

typedef struct pakcet_view_equip
{
	BYTE	header;
	DWORD	vid;
	struct {
		DWORD	vnum;
		BYTE	count;
		long	alSockets[ITEM_SOCKET_MAX_NUM];
		TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
	} equips[16];
} TPacketViewEquip;

PS: lel "pakcet" xD nevermind Save&Close

 

2.) Open char.cpp and search for this: "void CHARACTER::SendEquipment(LPCHARACTER ch)" and replace the event with this(Thanks ATAG):

void CHARACTER::SendEquipment(LPCHARACTER ch)
{
	TPacketViewEquip p;
	p.header = HEADER_GC_VIEW_EQUIP;
	p.vid    = GetVID();
	int pos[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23 };
	for (int i = 0; i < 16; i++)
	{
		LPITEM item = GetWear(pos[i]);
		if (item)
		{
			p.equips[i].vnum = item->GetVnum();
			p.equips[i].count = item->GetCount();

			thecore_memcpy(p.equips[i].alSockets, item->GetSockets(), sizeof(p.equips[i].alSockets));
			thecore_memcpy(p.equips[i].aAttr, item->GetAttributes(), sizeof(p.equips[i].aAttr));
		}
		else
		{
			p.equips[i].vnum = 0;
		}
	}
	ch->GetDesc()->Packet(&p, sizeof(p));
}

Serverside done! - Build!

 

 

Binary:

1.) Open UserInterfacePacket.h than search for this: "typedef struct pakcet_view_equip" and replace with this:

typedef struct pakcet_view_equip
{
	BYTE	header;
	DWORD	dwVID;
	TEquipmentItemSet equips[16];
} TPacketGCViewEquip;

PS: we met again with pakcet xD, Save&Close.

 

2.) Open UserInterfacePythonNetworkStreamPhaseGame.cpp than search for this: "bool CPythonNetworkStream::RecvViewEquipPacket()" and replace with this:

bool CPythonNetworkStream::RecvViewEquipPacket()
{
	TPacketGCViewEquip kViewEquipPacket;
	if (!Recv(sizeof(kViewEquipPacket), &kViewEquipPacket))
		return false;

	PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OpenEquipmentDialog", Py_BuildValue("(i)", kViewEquipPacket.dwVID));
	for (int i = 0; i < 16; ++i)
	{
		TEquipmentItemSet & rItemSet = kViewEquipPacket.equips[i];
		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogItem", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, rItemSet.vnum, rItemSet.count));

		for (int j = 0; j < ITEM_SOCKET_SLOT_MAX_NUM; ++j)
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogSocket", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, j, rItemSet.alSockets[j]));

		for (int k = 0; k < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++k)
			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogAttr", Py_BuildValue("(iiiii)", kViewEquipPacket.dwVID, i, k, rItemSet.aAttr[k].bType, rItemSet.aAttr[k].sValue));
	}

	return true;
}

Binaryside done! - Build!

 

 

Ohh I almost forgot, here are the bg ^^-> bababba

All done, press escape to exit... :)

Thanks!

:)

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

Thx but done everything but client crash when i enter id & pass.
 

0910 22:22:07182 :: 
networkModule.py(line:200) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) ?
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:37) ?
system.py(line:130) __pack_import


networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 240)


0910 22:22:07182 :: ============================================================================================================
0910 22:22:07182 :: Abort!!!!
 
 
Link to comment
Share on other sites

I did check a lot, i didn't find any wrong thing.

I think your code doesn't compatibile with test client für 4250 maybe.

But pls can you see my files? 

This is the hidden content, please

 

Nem hinném hogy bármit is rosszul csináltam. A python rész csak 2 py tartalmának felülírásáról és 1 betételéről szól.

Nem lehet inkább hogy a kódod nem kompatibilis test client für 40250-el?

Amúgy kliens binben és game fájlban is módosítottam amit kellett, azzal se lehet baj.

Mellesleg ha visszateszem a módosítatlan py fájlokat akkor működik a leltár néző, csak persze a kosztüm rész nincs ott.

  • Metin2 Dev 17
  • Smile Tear 1
  • Good 1
  • Love 1
  • Love 5
Link to comment
Share on other sites

  • Honorable Member

I did check a lot, i didn't find any wrong thing.

I think your code doesn't compatibile with test client für 4250 maybe.

But pls can you see my files? 

This is the hidden content, please

 

Nem hinném hogy bármit is rosszul csináltam. A python rész csak 2 py tartalmának felülírásáról és 1 betételéről szól.

Nem lehet inkább hogy a kódod nem kompatibilis test client für 40250-el?

Amúgy kliens binben és game fájlban is módosítottam amit kellett, azzal se lehet baj.

Mellesleg ha visszateszem a módosítatlan py fájlokat akkor működik a leltár néző, csak persze a kosztüm rész nincs ott.

 

 

I checked the files and there is no fault in them.

Me works perfectly with Test Client für 40250 too:

view_equip_testclient.jpg

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

  • Premium

Doesn't work for me, all my character disappears and when I create a new one, my client return back to the beginning.

0920 10:53:12468 :: CPythonNonPlayer::LoadNonPlayerData: invalid size 339150 check data format.
0920 10:53:12468 :: LoadLocaleData - LoadMobProto(locale/fr/mob_proto) Error
0920 10:53:14255 :: invalid idx 0
0920 10:54:48140 :: CPythonNonPlayer::LoadNonPlayerData: invalid size 339150 check data format.
0920 10:54:48140 :: LoadLocaleData - LoadMobProto(locale/fr/mob_proto) Error
Link to comment
Share on other sites

  • Premium
0921 16:39:31026 :: invalid idx 0
0921 16:39:31557 :: Traceback (most recent call last):

0921 16:39:31557 ::   File "uiTarget.py", line 472, in OnUpdate

0921 16:39:31557 :: AttributeError
0921 16:39:31557 :: :
0921 16:39:31557 :: 'NoneType' object has no attribute 'IsShow'
0921 16:39:31557 ::

It's disconnect my char. :x

Link to comment
Share on other sites

  • 2 months later...
  • Honorable Member

I'm on it, just my inet is limited to 32kbps d/u ,_,

Before upload, I have to get back the files from my unrachable ftp server.

I will edit the first post when I'm done.

 

(I can reach my ftp from ftp.okhost.eu only, 'coz the free-service of host is not available anymore.)

 

  • Love 1
Link to comment
Share on other sites

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.