Jump to content

Guild Building Melt with Sanii's Special Inventory


Recommended Posts

  • Premium

Hey guys,

Today I was facing with a guild melting problem, the problem was that the stones which are in the special inventory is not shown in the SelectItemWindow. I managed to solve this by adding a new check for special inventory size && special inventory slot end.

In this tutorial the codes may be different from yours, if you have Sanii Special Inventory you have to check your GameType.h how is page size calculated and your PythonPlayerModule.cpp to see how it's defined.

For example:

PythonPlayerModule.cpp->
PyModule_AddIntConstant(poModule, "SPECIAL_INVENTORY_PAGE_SIZE", SPECIAL_INVENTORY_PAGE_SIZE);
PyModule_AddIntConstant(poModule, "SPECIAL_INVENTORY_SLOT_END", c_Special_Inventory_Slot_End);

GameType.h->
SPECIAL_INVENTORY_WIDTH = 5,
SPECIAL_INVENTORY_HEIGHT = 9,
SPECIAL_INVENTORY_PAGE_SIZE = SPECIAL_INVENTORY_WIDTH * SPECIAL_INVENTORY_HEIGHT,

const DWORD c_Special_Inventory_Slot_Start = c_Belt_Inventory_Slot_End;
const DWORD c_Special_Inventory_Skillbook_Slot_Start = c_Special_Inventory_Slot_Start;
const DWORD c_Special_Inventory_Skillbook_Slot_End = c_Special_Inventory_Skillbook_Slot_Start +SPECIAL_INVENTORY_PAGE_SIZE * c_Inventory_Page_Count;
const DWORD c_Special_Inventory_Stone_Slot_Start = c_Special_Inventory_Skillbook_Slot_End;
const DWORD c_Special_Inventory_Stone_Slot_End = c_Special_Inventory_Stone_Slot_Start + SPECIAL_INVENTORY_PAGE_SIZE * c_Inventory_Page_Count;
const DWORD c_Special_Inventory_Material_Slot_Start = c_Special_Inventory_Stone_Slot_End;
const DWORD c_Special_Inventory_Material_Slot_End = c_Special_Inventory_Material_Slot_Start + SPECIAL_INVENTORY_PAGE_SIZE * c_Inventory_Page_Count;
const DWORD c_Special_Inventory_Slot_End = c_Special_Inventory_Material_Slot_End;

const DWORD c_Inventory_Count = c_Special_Inventory_Slot_End;

 

Solution:

root/uiselect.py

In def RefreshSlot(self): search for:
	for i in xrange(player.INVENTORY_PAGE_SIZE*player.INVENTORY_PAGE_COUNT):
      
After for loop add a new for loop for the special inventory:
		for i in xrange(player.SPECIAL_INVENTORY_PAGE_SIZE*player.SPECIAL_INVENTORY_SLOT_END):
			slotNumber = i

			itemVNum = getItemVNum(slotNumber)
			if 0 == itemVNum:
				continue

			if not item.IsMetin(itemVNum):
				continue

			itemGrade = player.GetItemGrade(slotNumber)
			if itemGrade > 2:
				continue

			self.inventorySlotPosDict[slotPos] = i

			slotPos += 1

			if slotPos > 54:
				break

 

Another problem is that if you select 100 stack of stone in the SelectItemWindow, they all disappear from the inventory, so instead of one piece, all of them disappear. 

Solution:

mining.cpp

Search for:
ITEM_MANAGER::instance().RemoveItem(metinstone_item, "REMOVE (MELT)");

Replace with:
metinstone_item->SetCount(metinstone_item->GetCount() - 1);

I hope it will be useful for you 🙂  Author of special inventory: @Sanii.

@LordZiege approved me to share this fix.

Edited by piktorvik
  • Metin2 Dev 1
  • Love 2
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.