Jump to content

Increase Safebox / Warehouse


Recommended Posts

  • Premium

Lets do ex: 16x9. I dont know if i something forgot, but its little tutorial how do it, im tired af so sorry for errors THANKS ❤️

// tables.h
#define SAFEBOX_MAX_NUM	135
to
#define SAFEBOX_MAX_NUM	432
// Packet.h
typedef struct command_safebox_checkout
{
	BYTE	bHeader;
	BYTE	bSafePos;
	TItemPos	ItemPos;
} TPacketCGSafeboxCheckout;

typedef struct command_safebox_checkin
{
	BYTE	bHeader;
	BYTE	bSafePos;
	TItemPos	ItemPos;
} TPacketCGSafeboxCheckin;
// Like that

typedef struct command_safebox_checkout
{
	BYTE	bHeader;
	UINT	bSafePos;
	TItemPos	ItemPos;
} TPacketCGSafeboxCheckout;

typedef struct command_safebox_checkin
{
	BYTE	bHeader;
	UINT	bSafePos;
	TItemPos	ItemPos;
} TPacketCGSafeboxCheckin;
// Safebox.cpp

	if (m_iSize)
		m_pkGrid = M2_NEW CGrid(5, m_iSize);
	else
		m_pkGrid = NULL;

//
	if (m_iSize)
		m_pkGrid = M2_NEW CGrid(16, m_iSize);
	else
		m_pkGrid = NULL;
// ------------------------------
	if (pkOldGrid)
		m_pkGrid = M2_NEW CGrid(pkOldGrid, 5, m_iSize);
	else
		m_pkGrid = M2_NEW CGrid(5, m_iSize);
// 
	if (pkOldGrid)
		m_pkGrid = M2_NEW CGrid(pkOldGrid, 16, m_iSize);
	else
		m_pkGrid = M2_NEW CGrid(16, m_iSize);

// ----------------------------------
if (bCell >= 5 * m_iSize)
//
if (bCell >= 16 * m_iSize)
// ----------------------------
int max_position = 5 * m_iSize; 
//
int max_position = 16 * m_iSize;

//Search for:
LPITEM CSafebox::GetItem(BYTE bCell)

//Replace with:
LPITEM CSafebox::GetItem(UINT bCell)


//Search for:
bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count)


//Replace with
bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, DWORD count)
// Safebox.h
//Search for:
LPITEM CSafebox::GetItem(BYTE bCell)

//Replace with:
LPITEM CSafebox::GetItem(UINT bCell)

//Search for:
bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count)

//Replace with
bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, DWORD count)

Client/

// Packet.h
typedef struct command_safebox_checkout
{
	uint8_t bHeader;
	BYTE bSafePos;
	TItemPos ItemPos;
} TPacketCGSafeboxCheckout;

typedef struct command_safebox_checkin
{
	uint8_t bHeader;
	BYTE bSafePos;
	TItemPos ItemPos;
} TPacketCGSafeboxCheckin;

// --------------
typedef struct command_safebox_checkout
{
	uint8_t bHeader;
	UINT bSafePos;
	TItemPos ItemPos;
} TPacketCGSafeboxCheckout;

typedef struct command_safebox_checkin
{
	uint8_t bHeader;
	UINT bSafePos;
	TItemPos ItemPos;
} TPacketCGSafeboxCheckin;

// PythonNetworkStream.h
//Search for:
bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos);

//edit:
bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos);

//Search for:
bool SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos);

//edit:
bool SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos);

// search for:
bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, uint8_t byCount);
//edit:
bool SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount);

// Python****PhaseGameItem.cpp

//Search for:

bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos)

//edit

bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos)

//Search for:
bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos)

//edit
bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos)

//   
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, uint8_t byCount)
// edit
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount)
  
// PythonSafebox.h

	enum
	{
		SAFEBOX_SLOT_X_COUNT = 5,
		SAFEBOX_SLOT_Y_COUNT = 9,
		SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT
	}; 

// edit

	enum
	{
		SAFEBOX_SLOT_X_COUNT = 16,
		SAFEBOX_SLOT_Y_COUNT = 9,
		SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT
	};
 


 



Update:
[C++] Change maximum number of inventory slots and more
 

Spoiler


1.1) common/tables.h

typedef struct SQuickslot
 {
     BYTE    type;
     BYTE    pos;
 } TQuickslot;


BYTE  pos;
// Replace / edit:

UINT    pos;

1.x) length.h paste

MAX_QUICKSLOT = 500 // You can adjust to the UINT limit

1.2) game/char.h

BYTE            bItemGrid[INVENTORY_AND_EQUIP_SLOT_MAX];

// Replace / edit:

UINT            bItemGrid[INVENTORY_AND_EQUIP_SLOT_MAX];

void SyncQuickslot(BYTE bType, BYTE bOldPos, BYTE bNewPos);

// Replace / edit:

void SyncQuickslot(BYTE bType, UINT bOldPos, UINT bNewPos);

bool GetQuickslot(BYTE pos, TQuickslot ** ppSlot);

// Replace / edit:

bool GetQuickslot(UINT pos, TQuickslot ** ppSlot);

bool SetQuickslot(BYTE pos, TQuickslot & rSlot);

// Replace / edit:

bool SetQuickslot(UINT pos, TQuickslot & rSlot);

bool DelQuickslot(BYTE pos);

// Replace / edit:

bool DelQuickslot(UINT pos);

bool SwapQuickslot(BYTE a, BYTE b);

// Replace / edit:

bool SwapQuickslot(UINT a, UINT b);

void ChainQuickslotItem(LPITEM pItem, BYTE bType, BYTE bOldPos);

// Replace / edit:

void ChainQuickslotItem(LPITEM pItem, BYTE bType, UINT bOldPos);

void SetWear(BYTE bCell, LPITEM item);

// Replace / edit:

void SetWear(UINT bCell, LPITEM item);

LPITEM GetWear(BYTE bCell) const;

// Replace / edit:

LPITEM GetWear(UINT bCell) const;

bool            RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell = -1);

// Replace / edit:

bool            RefineInformation(UINT bCell, BYTE bType, int iAdditionalCell = -1);

bool            SwapItem(BYTE bCell, BYTE bDestCell);

// Replace / edit:

bool            SwapItem(UINT bCell, UINT bDestCell);

1.3) game/char_battle.cpp

SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots, 255);

// Replace / edit:

SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots, MAX_QUICKSLOT);

SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots, 255);

// Replace / edit:

SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots, MAX_QUICKSLOT);

SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, 255);

// Replace / edit:

SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, MAX_QUICKSLOT);

SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, 255);

// Replace / edit:

SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, MAX_QUICKSLOT);

1.3) game/char_item.cpp

LPITEM CHARACTER::GetWear(BYTE bCell) const

// Replace / edit:

LPITEM CHARACTER::GetWear(UINT bCell) const

void CHARACTER::SetWear(BYTE bCell, LPITEM item)

// Replace / edit:

void CHARACTER::SetWear(UINT bCell, LPITEM item)

SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);

// Replace / edit:

SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, MAX_QUICKSLOT);

BYTE bCell = Cell.cell;

// Replace / edit:

UINT bCell = Cell.cell;

if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)

// Replace / edit:

if (m_pointsInstant.bItemGrid[bCell] == (UINT)iExceptionCell)

if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)

// Replace / edit:

if (m_pointsInstant.bItemGrid[bCell] == (UINT)iExceptionCell)

BYTE bPage = bCell / (INVENTORY_MAX_NUM / 2);

// Replace / edit:

UINT bPage = bCell / (INVENTORY_MAX_NUM / 2);

BYTE bPage = bCell / (INVENTORY_MAX_NUM / 2);

// Replace / edit:

UINT bPage = bCell / (INVENTORY_MAX_NUM / 2);

BYTE p = bCell + (5 * j);

// Replace / edit:

UINT p = bCell + (5 * j);

BYTE p = bCell + (5 * j);

// Replace / edit:

UINT p = bCell + (5 * j);

BYTE bCell = item->GetCell();

// Replace / edit:

UINT bCell = item->GetCell();

BYTE bCell = item->GetCell();

// Replace / edit:

UINT bCell = item->GetCell();

BYTE bCell = item->GetCell();

// Replace / edit:

UINT bCell = item->GetCell();

bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)

// Replace / edit:

bool CHARACTER::RefineInformation(UINT bCell, BYTE bType, int iAdditionalCell)

SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 255);

// Replace / edit:

SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, MAX_QUICKSLOT);

bool CHARACTER::SwapItem(BYTE bCell, BYTE bDestCell)

// Replace / edit:

bool CHARACTER::SwapItem(UINT bCell, UINT bDestCell)

BYTE bEquipCell = item2->GetCell() - INVENTORY_MAX_NUM;

// Replace / edit:

UINT bEquipCell = item2->GetCell() - INVENTORY_MAX_NUM;

BYTE bInvenCell = item1->GetCell()

// Replace / edit:

UINT bInvenCell = item1->GetCell();

BYTE bCell1 = item1->GetCell();

// Replace / edit:

UINT bCell1 = item1->GetCell();

BYTE bCell2 = item2->GetCell();

// Replace / edit:

UINT bCell2 = item2->GetCell();

BYTE bOldCell = item->GetCell();

// Replace / edit:

UINT bOldCell = item->GetCell();

1.4) game/char_quickslot.cpp

void CHARACTER::SyncQuickslot(BYTE bType, BYTE bOldPos, BYTE bNewPos)

// Replace / edit:

void CHARACTER::SyncQuickslot(BYTE bType, UINT bOldPos, UINT bNewPos)

if (bNewPos == 255)

// Replace / edit:

if (bNewPos == MAX_QUICKSLOT)

bool CHARACTER::GetQuickslot(BYTE pos, TQuickslot ** ppSlot)

// Replace / edit:

bool CHARACTER::GetQuickslot(UINT pos, TQuickslot ** ppSlot)

bool CHARACTER::SetQuickslot(BYTE pos, TQuickslot & rSlot)

// Replace / edit:

bool CHARACTER::SetQuickslot(UINT pos, TQuickslot & rSlot)

bool CHARACTER::DelQuickslot(BYTE pos)

// Replace / edit:

bool CHARACTER::DelQuickslot(UINT pos)

bool CHARACTER::SwapQuickslot(BYTE a, BYTE b)

// Replace / edit:

bool CHARACTER::SwapQuickslot(UINT a, UINT b)

void CHARACTER::ChainQuickslotItem(LPITEM pItem, BYTE bType, BYTE bOldPos)

// Replace / edit:

void CHARACTER::ChainQuickslotItem(LPITEM pItem, BYTE bType, UINT bOldPos)

1.5) game/cmd_general.cpp

for (BYTE i=0; i<INVENTORY_MAX_NUM; ++i)

// Replace / edit:

for (UINT i=0; i<INVENTORY_MAX_NUM; ++i)

1.6) game/cmd_gm.cpp

ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);

// Replace / edit:

ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, MAX_QUICKSLOT);

BYTE cell = 0;

// Replace / edit:

UINT cell = 0;

BYTE cell = 0;

// Replace / edit:

UINT cell = 0;

BYTE cell = 0;

// Replace / edit:

UINT cell = 0;

1.7) game/exchange.cpp

m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

// Replace / edit:

m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), MAX_QUICKSLOT);

BYTE bCell = rod->GetCell();

// Replace / edit:

UINT bCell = rod->GetCell();

1.8) game/input_main.cpp
case SHOP_SUBHEADER_CG_SELL2:
{

if (uiBytes < sizeof(BYTE) + sizeof(BYTE))

// Replace / edit:

if (uiBytes < sizeof(UINT) + sizeof(BYTE))

BYTE pos = *(c_pData++);

// Replace / edit:

UINT pos = *reinterpret_cast<const UINT*>(c_pData++);
                 BYTE count = *(c_pData);


sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, pos, count);

return sizeof(BYTE) + sizeof(BYTE);

// Replace / edit:

return sizeof(UINT) + sizeof(BYTE);
             }

ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, p->ItemPos.cell, 255);

// Replace / edit:

ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, p->ItemPos.cell, MAX_QUICKSLOT);

2.0) game/item.cpp

pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, wCell, 255);

// Replace / edit:

pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, wCell, MAX_QUICKSLOT);

m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, m_wCell, 255);

// Replace / edit:

m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, m_wCell, MAX_QUICKSLOT);

bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)

// Replace / edit:

bool CItem::EquipTo(LPCHARACTER ch, UINT bWearCell)

2.1) game/item.h

bool        EquipTo(LPCHARACTER ch, BYTE bWearCell);

// Replace / edit:

bool        EquipTo(LPCHARACTER ch, UINT bWearCell);

2.2) game/item_manager.cpp

o->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

// Replace / edit:

o->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), MAX_QUICKSLOT);

2.3) game/mining.cpp

BYTE bCell = rkOldPick.GetCell();

// Replace / edit:

UINT bCell = rkOldPick.GetCell();

BYTE bCell = rkOldPick.GetCell();

// Replace / edit:

UINT bCell = rkOldPick.GetCell();

2.4) game/packet.h

 typedef struct command_quickslot_add
 {
     BYTE    header;
     BYTE    pos;
     TQuickslot    slot;
 } TPacketCGQuickslotAdd;

// Replace / edit:

 typedef struct command_quickslot_add
 {
     BYTE    header;
     UINT    pos;
     TQuickslot    slot;
 } TPacketCGQuickslotAdd;

 typedef struct command_quickslot_del
 {
     BYTE    header;
     BYTE    pos;
 } TPacketCGQuickslotDel;

// Replace / edit:

 typedef struct command_quickslot_del
 {
     BYTE    header;
     UINT    pos;
 } TPacketCGQuickslotDel;

 typedef struct command_quickslot_swap
 {
     BYTE    header;
     BYTE    pos;
     BYTE    change_pos;
 } TPacketCGQuickslotSwap;

// Replace / edit:

 typedef struct command_quickslot_swap
 {
     BYTE    header;
     UINT    pos;
     UINT    change_pos;
 } TPacketCGQuickslotSwap;

 typedef struct packet_item_del
 {
     BYTE    header;
     BYTE    pos;
 } TPacketGCItemDel;

// Replace / edit:

 typedef struct packet_item_del
 {
     BYTE    header;
     UINT    pos;
 } TPacketGCItemDel;

 struct packet_quickslot_add
 {
     BYTE    header;
     BYTE    pos;
     TQuickslot    slot;
 };

// Replace / edit:

 struct packet_quickslot_add
 {
     BYTE    header;
     UINT    pos;
     TQuickslot    slot;
 };

 struct packet_quickslot_del
 {
     BYTE    header;
     BYTE    pos;
 };

// Replace / edit:

 struct packet_quickslot_del
 {
     BYTE    header;
     UINT    pos;
 };

 struct packet_quickslot_swap
 {
     BYTE    header;
     BYTE    pos;
     BYTE    pos_to;
 };

// Replace / edit:

 struct packet_quickslot_swap
 {
     BYTE    header;
     UINT    pos;
     UINT    pos_to;
 };

 typedef struct SPacketCGRefine
 {
     BYTE    header;
     BYTE    pos;
     BYTE    type;
 } TPacketCGRefine;

// Replace / edit:

 typedef struct SPacketCGRefine
 {
     BYTE    header;
     UINT    pos;
     BYTE    type;
 } TPacketCGRefine;

 typedef struct SPacketCGRequestRefineInfo
 {
     BYTE    header;
     BYTE    pos;
 } TPacketCGRequestRefineInfo;

// Replace / edit:

 typedef struct SPacketCGRequestRefineInfo
 {
     BYTE    header;
     UINT    pos;
 } TPacketCGRequestRefineInfo;

 typedef struct SPacketGCRefineInformaion
 {
     BYTE    header;
     BYTE    type;
     BYTE    pos;
     DWORD    src_vnum;
     DWORD    result_vnum;
     BYTE    material_count;

// Replace / edit:

 typedef struct SPacketGCRefineInformaion
 {
     BYTE    header;
     BYTE    type;
     UINT    pos;
     DWORD    src_vnum;
     DWORD    result_vnum;
     BYTE    material_count;

2.x) game/fishing.cpp
   
// 2x times 
BYTE bCell = rod->GetCell();

// Replace / edit:
UINT bCell = rod->GetCell();
  
2.5) game/questlua_global.cpp

BYTE bCell = (BYTE) lua_tonumber(L,-1);

// Replace / edit:

UINT bCell = lua_tonumber(L, -1);

BYTE bCell = (BYTE) lua_tonumber(L,-1);

// Replace / edit:

UINT bCell = lua_tonumber(L, -1);

2.6) game/questlua_item.cpp

BYTE bCell = pItem->GetCell();

// Replace / edit:

UINT bCell = pItem->GetCell();

2.7) game/questlua_pc.cpp

BYTE bCell = (BYTE)lua_tonumber(L, 1);

// Replace / edit:

UINT bCell = lua_tonumber(L, 1);

2.8) game/safebox.cpp

LPITEM CSafebox::GetItem(BYTE bCell)

// Replace / edit:

LPITEM CSafebox::GetItem(UINT bCell)

bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count)

// Replace / edit:

bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, BYTE count)

2.9) game/safebox.h

bool        MoveItem(BYTE bCell, BYTE bDestCell, BYTE count);

// Replace / edit:

bool        MoveItem(UINT bCell, UINT bDestCell, BYTE count);

LPITEM        GetItem(BYTE bCell);

// Replace / edit:

LPITEM        GetItem(UINT bCell);

3.0) game/shop.cpp

m_pkPC->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

// Replace / edit:

m_pkPC->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), MAX_QUICKSLOT);

3.1) game/shop_manager.cpp

void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount)

// Replace / edit:

void CShopManager::Sell(LPCHARACTER ch, UINT bCell, BYTE bCount)

3.2) game/shop_manager.h

void    Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount=0);

// Replace / edit:

void    Sell(LPCHARACTER ch, UINT bCell, BYTE bCount = 0);

3.3) UserInterface/AbstractPlayer.h

virtual void    AddQuickSlot(int QuickslotIndex, char IconType, char IconPosition) = 0;

// Replace / edit:

virtual void    AddQuickSlot(int QuickslotIndex, char IconType, UINT IconPosition) = 0;

3.4) UserInterface/GameType.h

 typedef struct SQuickSlot
 {
     BYTE Type;
     BYTE Position;
 } TQuickSlot;

// Replace / edit:

 typedef struct SQuickSlot
 {
     BYTE Type;
     UINT Position;
 } TQuickSlot;

3.5) UserInterface/Packet.h

typedef struct command_quickslot_add
 {
     BYTE        header;
     BYTE        pos;
     TQuickSlot    slot;
 }TPacketCGQuickSlotAdd;

// Replace / edit:

typedef struct command_quickslot_add
 {
     BYTE        header;
     UINT        pos;
     TQuickSlot    slot;
 }TPacketCGQuickSlotAdd;

 typedef struct command_quickslot_del
 {
     BYTE        header;
     BYTE        pos;
 }TPacketCGQuickSlotDel;

// Replace / edit:

 typedef struct command_quickslot_del
 {
     BYTE        header;
     UINT        pos;
 }TPacketCGQuickSlotDel;

 typedef struct command_quickslot_swap
 {
     BYTE        header;
     BYTE        pos;
     BYTE        change_pos;
 }TPacketCGQuickSlotSwap;

// Replace / edit:

 typedef struct command_quickslot_swap
 {
     BYTE        header;
     UINT        pos;
     UINT        change_pos;
 }TPacketCGQuickSlotSwap;

 typedef struct SPacketCGRefine
 {
     BYTE        header;
     BYTE        pos;
     BYTE        type;
 } TPacketCGRefine;

// Replace / edit:

 typedef struct SPacketCGRefine
 {
     BYTE        header;
     UINT        pos;
     BYTE        type;
 } TPacketCGRefine;

 typedef struct packet_item_del
 {
     BYTE        header;
     BYTE        pos;
 } TPacketGCItemDel;

// Replace / edit:

 typedef struct packet_item_del
 {
     BYTE        header;
     UINT        pos;
 } TPacketGCItemDel;

 typedef struct packet_quickslot_add
 {
     BYTE        header;
     BYTE        pos;
     TQuickSlot    slot;
 } TPacketGCQuickSlotAdd;

// Replace / edit:

 typedef struct packet_quickslot_add
 {
     BYTE        header;
     UINT        pos;
     TQuickSlot    slot;
 } TPacketGCQuickSlotAdd;

typedef struct packet_quickslot_del
 {
     BYTE        header;
     BYTE        pos;
 } TPacketGCQuickSlotDel;

// Replace / edit:

typedef struct packet_quickslot_del
 {
     BYTE        header;
     UINT        pos;
 } TPacketGCQuickSlotDel;

 typedef struct packet_quickslot_swap
 {
     BYTE        header;
     BYTE        pos;
     BYTE        change_pos;
 } TPacketGCQuickSlotSwap;

// Replace / edit:

 typedef struct packet_quickslot_swap
 {
     BYTE        header;
     UINT        pos;
     UINT        change_pos;
 } TPacketGCQuickSlotSwap;

 typedef struct SPacketGCRefineInformation
 {
     BYTE            header;
     BYTE            pos;
     TRefineTable    refine_table;
 } TPacketGCRefineInformation;

// Replace / edit:

 typedef struct SPacketGCRefineInformation
 {
     BYTE            header;
     UINT            pos;
     TRefineTable    refine_table;
 } TPacketGCRefineInformation;

 typedef struct SPacketGCRefineInformationNew
 {
     BYTE            header;
     BYTE            type;
     BYTE            pos;
     TRefineTable    refine_table;
 } TPacketGCRefineInformationNew;

// Replace / edit:

 typedef struct SPacketGCRefineInformationNew
 {
     BYTE            header;
     BYTE            type;
     UINT            pos;
     TRefineTable    refine_table;
 } TPacketGCRefineInformationNew;

3.6) UserInterface/PythonNetworkStream.h

bool SendQuickSlotAddPacket(BYTE wpos, BYTE type, BYTE pos);

// Replace / edit:

bool SendQuickSlotAddPacket(UINT wpos, BYTE type, UINT pos);

bool SendQuickSlotDelPacket(BYTE wpos);

// Replace / edit:

bool SendQuickSlotDelPacket(UINT wpos);

bool SendQuickSlotMovePacket(BYTE wpos, BYTE change_pos);

// Replace / edit:

bool SendQuickSlotMovePacket(UINT wpos, UINT change_pos);

bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount);

// Replace / edit:

bool SendShopSellPacketNew(UINT bySlot, BYTE byCount);

bool SendRefinePacket(BYTE byPos, BYTE byType);

// Replace / edit:

bool SendRefinePacket(UINT byPos, BYTE byType);

3.7) UserInterface/PythonNetworkStreamPhaseGame.cpp

bool CPythonNetworkStream::SendRefinePacket(BYTE byPos, BYTE byType)

// Replace / edit:

bool CPythonNetworkStream::SendRefinePacket(UINT byPos, BYTE byType)

3.8) UserInterface/PythonNetworkStreamPhaseGameItem.cpp

bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, BYTE byCount)

// Replace / edit:

bool CPythonNetworkStream::SendShopSellPacketNew(UINT bySlot, BYTE byCount)
 {
     if (!__CanActMainInstance())
         return true;

     TPacketCGShop PacketShop;
     PacketShop.header = HEADER_CG_SHOP;
     PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;

     if (!Send(sizeof(TPacketCGShop), &PacketShop))
     {
         Tracef("SendShopSellPacket Error\n");
         return false;
     }
     if (!Send(sizeof(UINT), &bySlot))
     {
         Tracef("SendShopAddSellPacket Error\n");
         return false;
     }
     if (!Send(sizeof(BYTE), &byCount))
     {
         Tracef("SendShopAddSellPacket Error\n");
         return false;
     }

     Tracef(" SendShopSellPacketNew(bySlot=%d, byCount=%d)\n", bySlot, byCount);

     return SendSequence();
 }

bool CPythonNetworkStream::SendQuickSlotAddPacket(BYTE wpos, BYTE type, BYTE pos)

// Replace / edit:

bool CPythonNetworkStream::SendQuickSlotAddPacket(UINT wpos, BYTE type, UINT pos)

bool CPythonNetworkStream::SendQuickSlotDelPacket(BYTE pos)

// Replace / edit:

bool CPythonNetworkStream::SendQuickSlotDelPacket(UINT pos)

bool CPythonNetworkStream::SendQuickSlotMovePacket(BYTE pos, BYTE change_pos)

// Replace / edit:

bool CPythonNetworkStream::SendQuickSlotMovePacket(UINT pos, UINT change_pos)

3.9) UserInterface/PythonPlayer.cpp

for (BYTE i = 0; i < QUICKSLOT_MAX_NUM; ++i)

// Replace / edit:

for (UINT i = 0; i < QUICKSLOT_MAX_NUM; ++i)

rkNetStream.SendQuickSlotMovePacket((BYTE) dwGlobalSrcSlotIndex, (BYTE)dwGlobalDstSlotIndex);

// Replace / edit:

rkNetStream.SendQuickSlotMovePacket((UINT) dwGlobalSrcSlotIndex, (UINT)dwGlobalDstSlotIndex);

rkNetStream.SendQuickSlotAddPacket((BYTE)dwGlobalSlotIndex, (BYTE)dwWndType, (BYTE)dwWndItemPos);

// Replace / edit:

rkNetStream.SendQuickSlotAddPacket((UINT)dwGlobalSlotIndex, (BYTE)dwWndType, (UINT)dwWndItemPos);

rkNetStream.SendQuickSlotDelPacket((BYTE)dwGlobalSlotIndex);

// Replace / edit:

rkNetStream.SendQuickSlotDelPacket((UINT)dwGlobalSlotIndex);

void CPythonPlayer::AddQuickSlot(int QuickSlotIndex, char IconType, char IconPosition)

// Replace / edit:

void CPythonPlayer::AddQuickSlot(int QuickSlotIndex, char IconType, UINT IconPosition)

4.1) UserInterface/PythonPlayer.h

void    AddQuickSlot(int QuickslotIndex, char IconType, char IconPosition);

// Replace / edit:

void    AddQuickSlot(int QuickslotIndex, char IconType, UINT IconPosition);

 

 

  • Metin2 Dev 1
  • Sad 1
  • Love 11


 

Link to comment
Share on other sites

I made tutorial, but third page dont work very well. The slots are bugged. first and second page work normaly.

 

Edit: here a gif

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

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

  • Honorable Member
3 hours ago, LordZiege said:

I made tutorial, but third page dont work very well. The slots are bugged. first and second page work normaly.

 

Edit: here a gif

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

I think your fault at py and you are using 15*9

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1

 

Link to comment
Share on other sites

vor 2 Stunden schrieb Mali61:

I think your fault at py and you are using 15*9

EDIT: Fixxed thanks to T4UMP :) (it was NOT python problem)

 

yes i tried with 15*9 too but 16*9 same result

my uisafebox is untouched, only changed size of window. only thing in uisafebox i changed is this:

3d80352034.png

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

  • 2 months later...
  • Forum Moderator

Stop do to offtopic here..
@ReFresh If you have something useful to say, do it! Otherwise be quiet.
(Your statements are really inappropriate. - You are the guy who is asking thousands of questions)

@AlCapone you have to modify different datatypes.
T4UMP's  2nd Guide was deleted because our old board rules didn't allowed the release.
And right now it is not possible to reactivate the other guide.

Maybe T4UMP will post the solution again in this topic.


Best regards
Raylee 

Link to comment
Share on other sites

  • 4 years later...

Dear Devs,

I have a problem.

I can put the item in the warehouse, the first 2 pages work normally. On the last page, however, I can't take it out or put it away in the bottom two rows.

Also, I have a different safebox.h file. Did I do something wrong in this?

code:

#ifndef __INC_METIN_II_GAME_SAFEBOX_H__
#define __INC_METIN_II_GAME_SAFEBOX_H__

class CHARACTER;
class CItem;
class CGrid;

class CSafebox
{
	public:
		CSafebox(LPCHARACTER pkChrOwner, int iSize, DWORD dwGold);
		~CSafebox();

		bool		Add(DWORD dwPos, LPITEM pkItem);
		LPITEM		Get(DWORD dwPos);
		LPITEM		Remove(DWORD dwPos);
		void		ChangeSize(int iSize);

		bool		MoveItem(UINT bCell, UINT bDestCell, DWORD count);
		LPITEM		GetItem(UINT bCell);

		void		Save();

		bool		IsEmpty(DWORD dwPos, BYTE bSize);
		bool		IsValidPosition(DWORD dwPos);

		void		SetWindowMode(BYTE bWindowMode);

	protected:
		void		__Destroy();

		LPCHARACTER	m_pkChrOwner;
		LPITEM		m_pkItems[SAFEBOX_MAX_NUM];
		CGrid *		m_pkGrid;
		int		m_iSize;
		long		m_lGold;

		BYTE		m_bWindowMode;
};

#endif

 

Link to comment
Share on other sites

  • Premium
1 hour ago, Crow said:

Dear Devs,

I have a problem.

I can put the item in the warehouse, the first 2 pages work normally. On the last page, however, I can't take it out or put it away in the bottom two rows.

Also, I have a different safebox.h file. Did I do something wrong in this?

code:

#ifndef __INC_METIN_II_GAME_SAFEBOX_H__
#define __INC_METIN_II_GAME_SAFEBOX_H__

class CHARACTER;
class CItem;
class CGrid;

class CSafebox
{
	public:
		CSafebox(LPCHARACTER pkChrOwner, int iSize, DWORD dwGold);
		~CSafebox();

		bool		Add(DWORD dwPos, LPITEM pkItem);
		LPITEM		Get(DWORD dwPos);
		LPITEM		Remove(DWORD dwPos);
		void		ChangeSize(int iSize);

		bool		MoveItem(UINT bCell, UINT bDestCell, DWORD count);
		LPITEM		GetItem(UINT bCell);

		void		Save();

		bool		IsEmpty(DWORD dwPos, BYTE bSize);
		bool		IsValidPosition(DWORD dwPos);

		void		SetWindowMode(BYTE bWindowMode);

	protected:
		void		__Destroy();

		LPCHARACTER	m_pkChrOwner;
		LPITEM		m_pkItems[SAFEBOX_MAX_NUM];
		CGrid *		m_pkGrid;
		int		m_iSize;
		long		m_lGold;

		BYTE		m_bWindowMode;
};

#endif

 

I did mistake 
bool        MoveItem(UINT bCell, UINT bDestCell, DWORD count);

DWORD count be BYTE count


 

Link to comment
Share on other sites

Thank you for your response. @ TAUMP

Now its better but still not good something.

On the picture the left sword is the last working space. I can move it. 

But the right sword it's not moving anywhere.

After i close the safebox, the left sword move to the first page but stays in the same place.

The right sword it's disappear and i can place a new sword in the same place.

But they are not truly disappear. I can see them in the database player/item table. 

spacer.png

What could be the problem?

tables.h:

#define SAFEBOX_MAX_NUM			270

packet.h:

typedef struct command_safebox_checkout
{
	BYTE	bHeader;
	UINT	bSafePos;
	TItemPos	ItemPos;
} TPacketCGSafeboxCheckout;

typedef struct command_safebox_checkin
{
	BYTE	bHeader;
	UINT	bSafePos;
	TItemPos	ItemPos;
} TPacketCGSafeboxCheckin;

safebox.cpp:

if (m_iSize)
		m_pkGrid = M2_NEW CGrid(10, m_iSize);
	else
		m_pkGrid = NULL;

if (pkOldGrid)
		m_pkGrid = M2_NEW CGrid(pkOldGrid, 10, m_iSize);
	else
		m_pkGrid = M2_NEW CGrid(10, m_iSize);

if (bCell >= 10 * m_iSize)
int max_position = 10 * m_iSize;

LPITEM CSafebox::GetItem(UINT bCell)
bool CSafebox::MoveItem(UINT bCell, UINT bDestCell, BYTE count)

safebox.h:

bool		MoveItem(UINT bCell, UINT bDestCell, BYTE count);
LPITEM		GetItem(UINT bCell);

packet.h:

typedef struct command_safebox_checkout
{
    BYTE        bHeader;
    UINT        bSafePos;
    TItemPos	ItemPos;
} TPacketCGSafeboxCheckout;

typedef struct command_safebox_checkin
{
    BYTE        bHeader;
    UINT        bSafePos;
    TItemPos	ItemPos;
} TPacketCGSafeboxCheckin;

PythonNetworkStream.h:

bool SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos);
bool SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos);
bool SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount);

but I tried it that way (That wasn't good either)
bool SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, BYTE byCount);

PythonNetworkStreamPhaseGameItem.cpp:

bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, UINT bySafeBoxPos)
bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(UINT bySafeBoxPos, TItemPos InventoryPos)
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount)

but I tried it that way (That wasn't good either)
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, BYTE byCount)

PythonSafeBox.h:

enum
{
	SAFEBOX_SLOT_X_COUNT = 10,
	SAFEBOX_SLOT_Y_COUNT = 9,
	SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT,
};

I don't understand what's wrong.

Everything looks fine.

Edited by Crow
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.