Jump to content

Extended Equipment Viewer


Recommended Posts

  • 1 month later...
  • Honorable Member

Everyone, but if you want to do it for GMs only, replace the ShowDefaultButton function with this:

	def ShowDefaultButton(self):
		self.isShowButton = True
		self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
		self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
		if chr.IsGameMaster(player.GetMainCharacterIndex()):
			self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT])
		self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
		self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
		for button in self.showingButtonList:
			button.Show()
  • Love 1
Link to comment
Share on other sites

  • 3 weeks later...

When I click on the button server is big lag (comment) and out of the loign 

 

syss (client)


0312 21:44:18883 :: Unknown packet header: 104, last: 63 99
0312 21:44:18900 :: Unknown packet header: 104, last: 63 99
0312 21:44:18917 :: Unknown packet header: 104, last: 63 99
0312 21:44:18933 :: Unknown packet header: 104, last: 63 99
0312 21:44:18950 :: Unknown packet header: 104, last: 63 99
0312 21:44:18966 :: Unknown packet header: 104, last: 63 99
0312 21:44:18984 :: Unknown packet header: 104, last: 63 99
0312 21:44:18999 :: Unknown packet header: 104, last: 63 99
0312 21:44:19015 :: Unknown packet header: 104, last: 63 99
0312 21:44:19033 :: Unknown packet header: 104, last: 63 99
0312 21:44:19047 :: Unknown packet header: 104, last: 63 99
0312 21:44:19064 :: Unknown packet header: 104, last: 63 99
0312 21:44:19081 :: Unknown packet header: 104, last: 63 99
0312 21:44:19109 :: Unknown packet header: 104, last: 63 99
0312 21:44:19128 :: Unknown packet header: 104, last: 63 99
0312 21:44:19130 :: Unknown packet header: 104, last: 63 99
0312 21:44:19145 :: Unknown packet header: 104, last: 63 99
0312 21:44:19162 :: Unknown packet header: 104, last: 63 99
0312 21:44:19178 :: Unknown packet header: 104, last: 63 99
0312 21:44:19195 :: Unknown packet header: 104, last: 63 99
0312 21:44:19212 :: Unknown packet header: 104, last: 63 99
0312 21:44:19230 :: Unknown packet header: 104, last: 63 99
0312 21:44:19244 :: Unknown packet header: 104, last: 63 99
0312 21:44:19260 :: Unknown packet header: 104, last: 63 99
0312 21:44:19279 :: Unknown packet header: 104, last: 63 99
0312 21:44:19296 :: Unknown packet header: 104, last: 63 99
0312 21:44:19312 :: Unknown packet header: 104, last: 63 99
0312 21:44:19329 :: Unknown packet header: 104, last: 63 99
0312 21:44:19345 :: Unknown packet header: 104, last: 63 99
0312 21:44:19362 :: Unknown packet header: 104, last: 63 99
0312 21:44:19379 :: Unknown packet header: 104, last: 63 99
0312 21:44:19395 :: Unknown packet header: 104, last: 63 99
0312 21:44:19412 :: Unknown packet header: 104, last: 63 99
0312 21:44:19430 :: Unknown packet header: 104, last: 63 99
0312 21:44:19446 :: Unknown packet header: 104, last: 63 99
0312 21:44:19465 :: Unknown packet header: 104, last: 63 99
0312 21:44:19480 :: Unknown packet header: 104, last: 63 99
0312 21:44:19497 :: Unknown packet header: 104, last: 63 99
0312 21:44:19514 :: Unknown packet header: 104, last: 63 99
0312 21:44:19532 :: Unknown packet header: 104, last: 63 99
0312 21:44:19549 :: Unknown packet header: 104, last: 63 99
0312 21:44:19566 :: Unknown packet header: 104, last: 63 99
0312 21:44:19583 :: Unknown packet header: 104, last: 63 99
0312 21:44:19599 :: Unknown packet header: 104, last: 63 99
0312 21:44:19616 :: Unknown packet header: 104, last: 63 99
0312 21:44:19633 :: Unknown packet header: 104, last: 63 99
0312 21:44:19649 :: Unknown packet header: 104, last: 63 99
0312 21:44:19667 :: Unknown packet header: 104, last: 63 99
0312 21:44:19681 :: Unknown packet header: 104, last: 63 99
0312 21:44:19699 :: Unknown packet header: 104, last: 63 99
0312 21:44:19716 :: Unknown packet header: 104, last: 63 99
0312 21:44:19733 :: Unknown packet header: 104, last: 63 99
0312 21:44:19749 :: Unknown packet header: 104, last: 63 99
0312 21:44:19764 :: Unknown packet header: 104, last: 63 99
0312 21:44:19783 :: Unknown packet header: 104, last: 63 99
0312 21:44:19799 :: Unknown packet header: 104, last: 63 99
0312 21:44:19815 :: Unknown packet header: 104, last: 63 99
0312 21:44:19832 :: Unknown packet header: 104, last: 63 99
0312 21:44:19848 :: Unknown packet header: 104, last: 63 99
0312 21:44:19865 :: Unknown packet header: 104, last: 63 99
0312 21:44:19883 :: Unknown packet header: 104, last: 63 99
0312 21:44:19898 :: Unknown packet header: 104, last: 63 99
0312 21:44:19916 :: Unknown packet header: 104, last: 63 99
0312 21:44:19931 :: Unknown packet header: 104, last: 63 99
0312 21:44:19948 :: Unknown packet header: 104, last: 63 99
0312 21:44:19966 :: Unknown packet header: 104, last: 63 99
0312 21:44:19982 :: Unknown packet header: 104, last: 63 99
0312 21:44:19999 :: Unknown packet header: 104, last: 63 99
0312 21:44:20014 :: Unknown packet header: 104, last: 63 99
0312 21:44:20031 :: Unknown packet header: 104, last: 63 99
0312 21:44:20048 :: Unknown packet header: 104, last: 63 99
0312 21:44:20064 :: Unknown packet header: 104, last: 63 99
0312 21:44:20080 :: Unknown packet header: 104, last: 63 99
0312 21:44:20097 :: Unknown packet header: 104, last: 63 99
0312 21:44:20113 :: Unknown packet header: 104, last: 63 99
0312 21:44:20131 :: Unknown packet header: 104, last: 63 99
0312 21:44:20148 :: Unknown packet header: 104, last: 63 99
0312 21:44:20166 :: Unknown packet header: 104, last: 63 99
0312 21:44:20182 :: Unknown packet header: 104, last: 63 99
0312 21:44:20198 :: Unknown packet header: 104, last: 63 99
0312 21:44:20215 :: Unknown packet header: 104, last: 63 99
0312 21:44:20233 :: Unknown packet header: 104, last: 63 99
0312 21:44:20234 :: Unknown packet header: 104, last: 63 99
0312 21:44:20249 :: Unknown packet header: 104, last: 63 99
0312 21:44:20267 :: Unknown packet header: 104, last: 63 99
0312 21:44:20282 :: Unknown packet header: 104, last: 63 99
0312 21:44:20300 :: Unknown packet header: 104, last: 63 99
0312 21:44:20316 :: Unknown packet header: 104, last: 63 99
0312 21:44:20332 :: Unknown packet header: 104, last: 63 99
0312 21:44:20349 :: Unknown packet header: 104, last: 63 99
0312 21:44:20365 :: Unknown packet header: 104, last: 63 99
0312 21:44:20383 :: Unknown packet header: 104, last: 63 99
0312 21:44:20399 :: Unknown packet header: 104, last: 63 99
0312 21:44:20428 :: Unknown packet header: 104, last: 63 99
0312 21:44:20445 :: Unknown packet header: 104, last: 63 99
0312 21:44:20461 :: Unknown packet header: 104, last: 63 99
0312 21:44:20478 :: Unknown packet header: 104, last: 63 99
0312 21:44:20495 :: Unknown packet header: 104, last: 63 99
0312 21:44:20511 :: Unknown packet header: 104, last: 63 99
0312 21:44:20527 :: Unknown packet header: 104, last: 63 99
0312 21:44:20545 :: Unknown packet header: 104, last: 63 99
0312 21:44:20561 :: Unknown packet header: 104, last: 63 99
0312 21:44:20578 :: Unknown packet header: 104, last: 63 99
0312 21:44:20580 :: Unknown packet header: 104, last: 63 99
0312 21:44:20597 :: Unknown packet header: 104, last: 63 99
0312 21:44:20612 :: Unknown packet header: 104, last: 63 99
0312 21:44:20630 :: Unknown packet header: 104, last: 63 99
0312 21:44:20646 :: Unknown packet header: 104, last: 63 99
0312 21:44:20663 :: Unknown packet header: 104, last: 63 99
0312 21:44:20680 :: Unknown packet header: 104, last: 63 99
0312 21:44:20697 :: Unknown packet header: 104, last: 63 99
0312 21:44:20714 :: Unknown packet header: 104, last: 63 99
0312 21:44:20731 :: Unknown packet header: 104, last: 63 99
0312 21:44:20748 :: Unknown packet header: 104, last: 63 99
0312 21:44:20765 :: Unknown packet header: 104, last: 63 99
0312 21:44:20782 :: Unknown packet header: 104, last: 63 99
0312 21:44:20800 :: Unknown packet header: 104, last: 63 99
0312 21:44:20815 :: Unknown packet header: 104, last: 63 99
0312 21:44:20831 :: Unknown packet header: 104, last: 63 99
0312 21:44:20849 :: Unknown packet header: 104, last: 63 99
0312 21:44:20865 :: Unknown packet header: 104, last: 63 99
0312 21:44:20894 :: Unknown packet header: 104, last: 63 99
0312 21:44:20895 :: Unknown packet header: 104, last: 63 99
0312 21:44:20911 :: Unknown packet header: 104, last: 63 99
0312 21:44:20928 :: Unknown packet header: 104, last: 63 99
0312 21:44:20944 :: Unknown packet header: 104, last: 63 99
0312 21:44:20962 :: Unknown packet header: 104, last: 63 99
0312 21:44:20978 :: Unknown packet header: 104, last: 63 99
0312 21:44:20994 :: Unknown packet header: 104, last: 63 99
0312 21:44:21011 :: Unknown packet header: 104, last: 63 99
0312 21:44:21027 :: Unknown packet header: 104, last: 63 99
0312 21:44:21044 :: Unknown packet header: 104, last: 63 99
0312 21:44:21061 :: Unknown packet header: 104, last: 63 99
0312 21:44:21093 :: Unknown packet header: 104, last: 63 99
0312 21:44:21095 :: Unknown packet header: 104, last: 63 99
0312 21:44:21111 :: Unknown packet header: 104, last: 63 99
0312 21:44:21128 :: Unknown packet header: 104, last: 63 99
0312 21:44:21145 :: Unknown packet header: 104, last: 63 99
0312 21:44:21161 :: Unknown packet header: 104, last: 63 99
0312 21:44:21179 :: Unknown packet header: 104, last: 63 99
0312 21:44:21195 :: Unknown packet header: 104, last: 63 99
0312 21:44:21211 :: Unknown packet header: 104, last: 63 99
0312 21:44:21231 :: Unknown packet header: 104, last: 63 99
0312 21:44:21245 :: Unknown packet header: 104, last: 63 99
0312 21:44:21263 :: Unknown packet header: 104, last: 63 99
0312 21:44:21279 :: Unknown packet header: 104, last: 63 99
0312 21:44:21296 :: Unknown packet header: 104, last: 63 99
0312 21:44:21312 :: Unknown packet header: 104, last: 63 99
0312 21:44:21330 :: Unknown packet header: 104, last: 63 99
0312 21:44:21346 :: Unknown packet header: 104, last: 63 99
0312 21:44:21364 :: Unknown packet header: 104, last: 63 99
0312 21:44:21382 :: Unknown packet header: 104, last: 63 99
0312 21:44:21397 :: Unknown packet header: 104, last: 63 99
0312 21:44:21414 :: Unknown packet header: 104, last: 63 99
0312 21:44:21432 :: Unknown packet header: 104, last: 63 99
0312 21:44:21448 :: Unknown packet header: 104, last: 63 99
0312 21:44:21464 :: Unknown packet header: 104, last: 63 99
0312 21:44:21483 :: Unknown packet header: 104, last: 63 99
0312 21:44:21498 :: Unknown packet header: 104, last: 63 99
0312 21:44:21514 :: Unknown packet header: 104, last: 63 99
0312 21:44:21532 :: Unknown packet header: 104, last: 63 99
0312 21:44:21548 :: Unknown packet header: 104, last: 63 99
0312 21:44:21565 :: Unknown packet header: 104, last: 63 99
0312 21:44:21581 :: Unknown packet header: 104, last: 63 99
0312 21:44:21598 :: Unknown packet header: 104, last: 63 99
0312 21:44:21617 :: Unknown packet header: 104, last: 63 99
0312 21:44:21631 :: Unknown packet header: 104, last: 63 99

sys ch1

SYSERR: Mar 12 06:07:48 :: Analyze: login phase does not handle this packet! header 3
SYSERR: Mar 12 06:21:43 :: locale_find: LOCALE_ERROR: "???? ?? %d ??? ?? ?? ???.";
SYSERR: Mar 12 06:23:41 :: locale_find: LOCALE_ERROR: "???? ?? %d ??? ?? ?? ???.";
SYSERR: Mar 12 06:29:54 :: hupsig: SIGHUP, SIGINT, SIGTERM signal has been received. shutting down.
SYSERR: Mar 12 06:38:40 :: socket_accept: accept: Software caused connection abort (fd 12)
SYSERR: Mar 12 06:33:49 :: pid_init: 
  • Love 1
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 ~ 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... :')

what this is release?i don`t understand.. this 4x slot for ring..?

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

  • Honorable Member
ACMD(do_view_equip)
{
#ifndef ENABLE_VIEW_EQUIP_FOR_PLAYERS
	if (ch->GetGMLevel() <= GM_PLAYER)
		return;
#endif
//[...]
ACMD(do_view_equip)
{
	if (ch->GetGMLevel() <= GM_PLAYER && 0 == quest::CQuestManager::instance().GetEventFlag("view_equip_for_players"))
		return;
//[...]

Or how do you think?

  • Love 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

player no have permission for view eq ....

only in gm work -.-

u have acmd for player ?

cmd_general.cpp

ACMD(do_view_equip)
{
	//if (ch->GetGMLevel() <= GM_PLAYER)
		//return;

	char arg1[256];
	one_argument(argument, arg1, sizeof(arg1));

	if (*arg1)
	{
		DWORD vid = 0;
		str_to_number(vid, arg1);
		LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);

		if (!tch)
			return;

		if (!tch->IsPC())
			return;
		/*
		   int iSPCost = ch->GetMaxSP() / 3;

		   if (ch->GetSP() < iSPCost)
		   {
		   ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("정신력이 부족하여 다른 사람의 장비를 볼 수 없습니다."));
		   return;
		   }
		   ch->PointChange(POINT_SP, -iSPCost);
		 */
		tch->SendEquipment(ch);
	}
}
  • Love 3
Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
  • 5 months later...

Hello ty for this dude, but i have 1 question how to add to this costume acce (SASH) and mount (COSTUME_ACCE, COSTUME_MOUNT) ( delate RING1 and RING2 and change for this:

int pos[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 25 };

AND  UIScript CostumeEquipmentDialog.py
i change size, add slot and change image.
like this: http://wklej.to/Jbj6l/text
But I see something like this:
12.jpg.4fe8784822f48c13f6908f848e6ed077.
And not like this:
13.jpg.d3eeda6649b8f814f218a264bd1307ce.

Maybe something in the file uiEquipDialog.py I wrong?

@EDIT: WORK
uiEquipDialog.py
just add on: for i in [11, 12]:
this: ,13, 14
like this: for i in [11, 12, 13, 14]:

1231.jpg.ecd985a5d6d70a0661d9620600f1fd8

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