Jump to content

Extended Equipment Viewer


Recommended Posts

  • 1 month later...
  • 8 months later...
  • 1 month later...
  • Bronze
La 10.09.2014 la 8:34, xP3NG3Rx a spus:

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:

 

Conținut ascuns




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... :')

I tried to install this and it works,somehow.After i put the "system" only GM can use mount system i have 2 accounts side by side and when i use the white lion on GM it works when i use the lion on the player account the lion doesn't appear.sum help? (no error sysser client/server)

Link to comment
Share on other sites

  • 1 month later...
On 9/10/2014 at 5:34 PM, xP3NG3Rx said:

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:

 

Hidden Content




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... :')

hello i have poblem 

JKW3N7QOS9mG6GCz11oSmA.png

the another window to view CostumeEquipment not here

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

  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 11 months later...
On 9/10/2014 at 6:27 PM, TheSLZ said:

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!!!!
 
 



Tab hiba....
@TheSLZ

 exceptions.SyntaxError:invalid syntax (line 240)
  • Love 1

787292068_Nvtelen.png.6faa7b0bbb3398fd29

Link to comment
Share on other sites

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

2059694820_vieredqued.jpg.8b7114d8f3561192f6ff51d7e6c62ca2.jpg1034238489_-1.thumb.jpg.9725076803f621d9caf177b88937ee2d.jpg@xP3NG3Rx,Thank you very much for your sharing and help!You are such a good person!I have some materials of Oriental style. If you are interested, please PM me and I will send them to you to express my thanks.

@noisa ,Thanks for your advice, which made me change from gm-player to player-player. Although my metin2 technology is not good, I am very good at materials and materials of eastern culture. If I can do something, please tell me PM, in return for your advice.

Anyone who has helped me can PM me and do what I can。

Link to comment
Share on other sites

  • 10 months later...
  • 7 months later...
  • 9 months later...
  • 1 month later...
On 9/10/2014 at 6:34 PM, xP3NG3Rx said:

M2 Download Center

 

Hidden Content

  • Give reaction to this post to see the hidden content.
( 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

Hidden Content

  • Give reaction to this post to see the hidden content.

~

Hidden Content

  • Give reaction to this post to see the hidden content.

 


UIScriptEquipmentDialog.py

 

 

Hidden Content

  • Give reaction to this post to see the hidden content.

~

 

Hidden Content

  • Give reaction to this post to see the hidden content.

 


UIScriptCostumeEquipmentDialog.py

 

 

Hidden Content

  • Give reaction to this post to see the hidden content.

~

 

Hidden Content

  • Give reaction to this post to see the hidden content.

 


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:

Hidden Content

  • Give reaction to this post to see the hidden content.

 

(
----EndEdit----

Ohh I almost forgot, here are the bgs ^^->

Hidden Content

  • Give reaction to this post to see the hidden content.


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

 

thx 

 

  • Dislove 1
Link to comment
Share on other sites

  • 1 year 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.