Jump to content

Extended Equipment Viewer


Recommended Posts

  • Honorable Member

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

  • Metin2 Dev 6
  • Love 39
  • Love 2
  • Good 1
Link to comment

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

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!

 

 

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

Hidden Content

    Give reaction to this post to see the hidden content.

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

Thanks!

:)

  • Metin2 Dev 1
  • Love 3
  • Good 1
Link to comment

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

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? 

Hidden Content

    Give reaction to this post to see the hidden content.

 

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.

  • Love 1
Link to comment
  • 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? 

Hidden Content

    Give reaction to this post to see the hidden content.

 

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

Link to comment
  • VIP

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
  • VIP

LoadLocaleData - LoadMobProto(locale/fr/mob_proto) Error

:lol:

 

You failed your mob_proto.

 

It's strange because my mob proto stay the same since the last connection xD

 

I will try to change it, thanks

Link to comment
  • VIP
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
  • 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

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


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