Active Member ReFresh 2339 Posted November 30, 2018 Active Member Share Posted November 30, 2018 Hey guys, someone know how to extend this function to block use of items when shop window is opened which are in slots like experience ring? Spoiler bool CPythonNetworkStream::SendItemUsePacket(TItemPos pos) { if (!__CanActMainInstance()) return true; if (__IsEquipItemInSlot(pos)) { if (CPythonExchange::Instance().isTrading()) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AppendNotifyMessage", Py_BuildValue("(s)", "CANNOT_EQUIP_EXCHANGE")); return true; } if (CPythonShop::Instance().IsOpen()) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AppendNotifyMessage", Py_BuildValue("(s)", "CANNOT_EQUIP_SHOP")); return true; } if (__IsPlayerAttacking()) return true; } __PlayInventoryItemUseSound(pos); TPacketCGItemUse itemUsePacket; itemUsePacket.header = HEADER_CG_ITEM_USE; itemUsePacket.pos = pos; if (!Send(sizeof(TPacketCGItemUse), &itemUsePacket)) { Tracen("SendItemUsePacket Error"); return false; } return SendSequence(); } Thanks for answers! Sincerely, ReFresh I'll be always helpful! Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted December 8, 2018 Author Active Member Share Posted December 8, 2018 ref I'll be always helpful! Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted December 12, 2018 Author Active Member Share Posted December 12, 2018 ref I'll be always helpful! Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted December 20, 2018 Author Active Member Share Posted December 20, 2018 ref I'll be always helpful! Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted December 22, 2018 Author Active Member Share Posted December 22, 2018 ref I'll be always helpful! Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted February 14, 2019 Author Active Member Share Posted February 14, 2019 ref I'll be always helpful! Link to comment Share on other sites More sharing options...
LordZiege 279 Posted February 16, 2019 Share Posted February 16, 2019 Search in itemData.cpp for BOOL CItemData::IsEquipment() const and extend the cases like this: BOOL CItemData::IsEquipment() const { switch (GetType()) { case ITEM_TYPE_WEAPON: case ITEM_TYPE_ARMOR: case ITEM_TYPE_UNIQUE: return TRUE; break; } return FALSE; } This should work. You can extend for as much as you want. just add the item type for the items you want to block. 1 Link to comment Share on other sites More sharing options...
Pisti95 134 Posted December 26, 2023 Share Posted December 26, 2023 Fast Fix: uiinventory.py Search for: def __UseItem(self, slotIndex): Add it below: if shop.IsOpen(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_EQUIP_IN_SHOP) return What you showed should work, but it doesn't. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now