Jump to content

6 Stone Add Items


Recommended Posts

Hi,

 

Now open common/item_length.h and search for this:

ITEM_SOCKET_MAX_NUM			= 3,

edit:

ITEM_SOCKET_MAX_NUM			= 6,

Now open db/cache.cpp and search for this:

if (isSocket)
		{
			iLen += snprintf(szColumns + iLen, sizeof(szColumns) - iLen, ", socket0, socket1, socket2");
			iValueLen += snprintf(szValues + iValueLen, sizeof(szValues) - iValueLen,
					", %lu, %lu, %lu", p->alSockets[0], p->alSockets[1], p->alSockets[2]);
			iUpdateLen += snprintf(szUpdate + iUpdateLen, sizeof(szUpdate) - iUpdateLen,
					", socket0=%lu, socket1=%lu, socket2=%lu", p->alSockets[0], p->alSockets[1], p->alSockets[2]);
		}

edit:

if (isSocket)
		{
			iLen += snprintf(szColumns + iLen, sizeof(szColumns) - iLen, ", socket0, socket1, socket2, socket3, socket4, socket5");
			iValueLen += snprintf(szValues + iValueLen, sizeof(szValues) - iValueLen,
					", %lu, %lu, %lu, %lu, %lu, %lu", p->alSockets[0], p->alSockets[1], p->alSockets[2], p->alSockets[3], p->alSockets[4], p->alSockets[5]);
			iUpdateLen += snprintf(szUpdate + iUpdateLen, sizeof(szUpdate) - iUpdateLen,
					", socket0=%lu, socket1=%lu, socket2=%lu, socket3=%lu, socket4=%lu, socket5=%lu", p->alSockets[0], p->alSockets[1], p->alSockets[2], p->alSockets[3], p->alSockets[4], p->alSockets[5]);
		}

Now open db/clientmanagerplayer.cpp and search for this:

str_to_number(item.alSockets[2], row[cur++]);

Add this under that:

str_to_number(item.alSockets[3], row[cur++]);
		str_to_number(item.alSockets[4], row[cur++]);
		str_to_number(item.alSockets[5], row[cur++]);

search:

"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

edit:

"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,socket3,socket4,socket5,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

search:

"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

edit:

"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,socket3,socket4,socket5,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

Now open game/constants.cpp and search for this:

	3, // WEAPON_SWORD,
	3, // WEAPON_DAGGER,
	3, // WEAPON_BOW,
	3, // WEAPON_TWO_HANDED,
	3, // WEAPON_BELL,
	3, // WEAPON_FAN,
	3, // WEAPON_CLAW
	0, // WEAPON_ARROW,
	0, // WEAPON_MOUNT_SPEAR

edit:

	6, // WEAPON_SWORD,
	6, // WEAPON_DAGGER,
	6, // WEAPON_BOW,
	6, // WEAPON_TWO_HANDED,
	6, // WEAPON_BELL,
	6, // WEAPON_FAN,
	6, // WEAPON_CLAW
	0, // WEAPON_ARROW,
	0, // WEAPON_MOUNT_SPEAR

search:

3, // ARMOR_BODY,

edit:

6, // ARMOR_BODY,

Binary:

 

Now open userinterface/gametype.h and search for this:

ITEM_SOCKET_SLOT_MAX_NUM = 3,

edit:

ITEM_SOCKET_SLOT_MAX_NUM = 6,

If you have any questions, please contact us.

 

 

Kind Regards,

Noszferat001

  • Metin2 Dev 1
  • Love 11
Link to comment
Share on other sites

db/src/ClientManager open;

 

Code Search:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2 "

Code Replace:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5  "

launcher source/gamelib/itemdata.h search 

ITEM_SOCKET_SLOT_MAX_NUM = 3,
and replace
 
ITEM_SOCKET_SLOT_MAX_NUM = 6,
Link to comment
Share on other sites

 

db/src/ClientManager open;

 

Code Search:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2 "

Code Replace:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5  "

launcher source/gamelib/itemdata.h search 

ITEM_SOCKET_SLOT_MAX_NUM = 3,
and replace
 
ITEM_SOCKET_SLOT_MAX_NUM = 6,

 

UserInterfaceGameType.h

Link to comment
Share on other sites

db/src/ClientManager open;

 

Code Search:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2 "

Code Replace:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5  "

Code Replace:

 

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5,  "

 

Link to comment
Share on other sites

  • Premium

help 

 

0330 19:32:08612 :: invalid idx 0
0330 19:33:32666 :: Traceback (most recent call last):
 
0330 19:33:32666 ::   File "game.py", line 1500, in OnMouseLeftButtonUp
 
0330 19:33:32666 ::   File "interfaceModule.py", line 345, in MakeHyperlinkTooltip
 
0330 19:33:32667 ::   File "uiToolTip.py", line 1850, in SetHyperlinkItem
 
0330 19:33:32667 ::   File "uiToolTip.py", line 889, in AddItemData
 
0330 19:33:32667 ::   File "uiToolTip.py", line 1650, in __AppendMetinSlotInfo
 
0330 19:33:32667 :: IndexError
0330 19:33:32667 :: : 
0330 19:33:32667 :: list index out of range
0330 19:33:32667 :: 
Link to comment
Share on other sites

0330 19:33:32667 ::   File "uiToolTip.py", line 1650, in __AppendMetinSlotInfo
 
0330 19:33:32667 :: IndexError
0330 19:33:32667 :: : 
0330 19:33:32667 :: list index out of range
0330 19:33:32667 :: 
 
 
The error appears when you call an array with an index that's out of it's array bound. For example your array has size of 3 and you're calling it with index 10.
I've looked up for the function where this happens:
 
		for i in xrange(player.METIN_SOCKET_MAX_NUM):
			self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])

These are most likely the lines that cause the error. Note that our for loop goes until it hits METIN_SOCKET_MAX_NUM, which is increased to fit the new sockets. metinSlot is called with the current loop value - so that could be the culprit. metinSlot is extracted from the item data. So if the item data is still constructed with the old socket size, it could be the reason your code isn't running. Hope this helps :)

Link to comment
Share on other sites

  • 4 weeks later...

 

db/src/ClientManager open;

 

Code Search:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2 "

Code Replace:

"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2, socket3, socket4, socket5  "

launcher source/gamelib/itemdata.h search 

ITEM_SOCKET_SLOT_MAX_NUM = 3,
and replace
 
ITEM_SOCKET_SLOT_MAX_NUM = 6,

 

Hi Bro

Not

ITEM_SOCKET_SLOT_MAX_NUM = x,

 

that

 

ITEM_SOCKET_MAX_NUM = x,

Link to comment
Share on other sites

  • 2 weeks later...
  • Premium

 

help 

 

0330 19:32:08612 :: invalid idx 0
0330 19:33:32666 :: Traceback (most recent call last):
 
0330 19:33:32666 ::   File "game.py", line 1500, in OnMouseLeftButtonUp
 
0330 19:33:32666 ::   File "interfaceModule.py", line 345, in MakeHyperlinkTooltip
 
0330 19:33:32667 ::   File "uiToolTip.py", line 1850, in SetHyperlinkItem
 
0330 19:33:32667 ::   File "uiToolTip.py", line 889, in AddItemData
 
0330 19:33:32667 ::   File "uiToolTip.py", line 1650, in __AppendMetinSlotInfo
 
0330 19:33:32667 :: IndexError
0330 19:33:32667 :: : 
0330 19:33:32667 :: list index out of range
0330 19:33:32667 :: 

 

 

Open the binary source and search for:

chatGetLinkFromHyperlink

And make it look like this:

PyObject * chatGetLinkFromHyperlink(PyObject * poSelf, PyObject * poArgs)
{
	char * szHyperlink;
	
	if (!PyTuple_GetString(poArgs, 0, &szHyperlink))
		return Py_BuildException();

	std::string stHyperlink(szHyperlink);
	std::vector<std::string> results;

	split_string(stHyperlink, ":", results, false);

	// item:vnum:flag:socket0:socket1:socket2:socket3:socket4:socket5
	if (0 == results[0].compare("item"))
	{
		if (results.size() < 9)
			return Py_BuildValue("s", "");

		CItemData * pItemData = NULL;

		if (CItemManager::Instance().GetItemDataPointer(htoi(results[1].c_str()), &pItemData))
		{
			char buf[1024] = { 0 };
			char itemlink[256];
			int len;
			bool isAttr = false;

			len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x:%x:%x:%x", 
					htoi(results[1].c_str()),
					htoi(results[2].c_str()),
					htoi(results[3].c_str()),
					htoi(results[4].c_str()),
					htoi(results[5].c_str()),
					htoi(results[6].c_str()),
					htoi(results[7].c_str()),
					htoi(results[8].c_str()));

			if (results.size() >= 11)
			{
				for (int i = 9; i < results.size(); i += 2)
				{
					len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d", 
							htoi(results[i].c_str()),
							atoi(results[i+1].c_str()));
					isAttr = true;
				}
			}

			if (isAttr)
				//"item:¹øÈ£:Ç÷¡±×:¼ÒÄÏ0:¼ÒÄÏ1:¼ÒÄÏ2"
				snprintf(buf, sizeof(buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
			else
				snprintf(buf, sizeof(buf), "|cfff1e6c0|H%s|h[%s]|h|r", itemlink, pItemData->GetName());

			return Py_BuildValue("s", buf);
		}
	}

	return Py_BuildValue("s", "");
}

Search for

playerGetItemLink

And make it look like this

PyObject * playerGetItemLink(PyObject * poSelf, PyObject * poArgs)
{
	TItemPos Cell;

	switch (PyTuple_Size(poArgs))
	{
	case 1:	
		if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
			return Py_BuildException();
		break;
	case 2:
		if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
			return Py_BuildException();
		if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
			return Py_BuildException();
		break;
	default:
		return Py_BuildException();
	}
	const TItemData * pPlayerItem = CPythonPlayer::Instance().GetItemData(Cell);
	CItemData * pItemData = NULL;
	char buf[1024];

	if (pPlayerItem && CItemManager::Instance().GetItemDataPointer(pPlayerItem->vnum, &pItemData))
	{
		char itemlink[256];
		int len;
		bool isAttr = false;

		len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x:%x:%x:%x", 
				pPlayerItem->vnum, pPlayerItem->flags,
				pPlayerItem->alSockets[0], pPlayerItem->alSockets[1], pPlayerItem->alSockets[2] , pPlayerItem->alSockets[3],  pPlayerItem->alSockets[4],  pPlayerItem->alSockets[5]);

		for (int i = 0; i < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++i)
			if (pPlayerItem->aAttr[i].bType != 0)
			{
				len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d", 
						pPlayerItem->aAttr[i].bType, pPlayerItem->aAttr[i].sValue);
				isAttr = true;
			}


		if( GetDefaultCodePage() == CP_ARABIC ) {
			if (isAttr)
				//"item:¹øÈ£:Ç÷¡±×:¼ÒÄÏ0:¼ÒÄÏ1:¼ÒÄÏ2"
				snprintf(buf, sizeof(buf), " |h|r[%s]|cffffc700|H%s|h", pItemData->GetName(), itemlink);
			else
				snprintf(buf, sizeof(buf), " |h|r[%s]|cfff1e6c0|H%s|h", pItemData->GetName(), itemlink);
		} else {
			if (isAttr)
				//"item:¹øÈ£:Ç÷¡±×:¼ÒÄÏ0:¼ÒÄÏ1:¼ÒÄÏ2"
				snprintf(buf, sizeof(buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
			else
				snprintf(buf, sizeof(buf), "|cfff1e6c0|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
		}
	}
	else
		buf[0] = '0';

	return Py_BuildValue("s", buf);
}

Open uitooltip.py and search for

def SetHyperlinkItem(self, tokens):

It has to look like this

def SetHyperlinkItem(self, tokens):
		minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
		maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
		if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
			head, vnum, flag = tokens[:3]
			itemVnum = int(vnum, 16)
			metinSlot = [int(metin, 16) for metin in tokens[3:9]]

			rests = tokens[9:]
			if rests:
				attrSlot = []

				rests.reverse()
				while rests:
					key = int(rests.pop(), 16)
					if rests:
						val = int(rests.pop())
						attrSlot.append((key, val))

				attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
			else:
				attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM

			self.ClearToolTip()
			self.AddItemData(itemVnum, metinSlot, attrSlot)

			ItemToolTip.OnUpdate(self)
  • Love 4
Link to comment
Share on other sites

  • 1 month later...

Hi, I installed 6 slot stone craftsmen only gives the following error local_t is item_proto what should I do ???

 

 

 

Merhaba ustalar 6 slot taş yükledim yalnızca şu hatayı veriyor local_tr item_proto ne yapmam gerekli ???

 

 

 

 

 

0608 20:18:17801 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11512
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11714
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11715
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11716
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11717
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11718
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11719
 
0608 20:18:17806 :: CPythonItem::LoadItemTable: invalid item_proto[locale/tr/item_proto] STRIDE[156] != sizeof(SItemTable)
0608 20:18:17807 :: LoadLocaleData - LoadItemProto(locale/tr/item_proto) Error
0608 20:18:18922 :: Hair number 16385 is not exist.
0608 20:18:33154 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
0608 20:18:33709 :: TPacketGCCharacterAdditionalInfo name= vid=83886353 race=0 Error
0608 20:18:33709 :: Unknown packet header: 173, last: 21 136
 
Link to comment
Share on other sites

  • 3 weeks later...

Hi, I installed 6 slot stone craftsmen only gives the following error local_t is item_proto what should I do ???

 

 

 

Merhaba ustalar 6 slot taş yükledim yalnızca şu hatayı veriyor local_tr item_proto ne yapmam gerekli ???

 

 

 

 

 

0608 20:18:17801 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11512
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11714
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11715
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11716
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11717
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11718
 
0608 20:18:17802 ::  CItemManager::LoadItemList(locale/tr/item_list.txt) - StrangeLine in 11719
 
0608 20:18:17806 :: CPythonItem::LoadItemTable: invalid item_proto[locale/tr/item_proto] STRIDE[156] != sizeof(SItemTable)
0608 20:18:17807 :: LoadLocaleData - LoadItemProto(locale/tr/item_proto) Error
0608 20:18:18922 :: Hair number 16385 is not exist.
0608 20:18:33154 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
0608 20:18:33709 :: TPacketGCCharacterAdditionalInfo name= vid=83886353 race=0 Error
0608 20:18:33709 :: Unknown packet header: 173, last: 21 136
 

​help !!!

 

Link to comment
Share on other sites

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