Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## find:
- def UseItemSlot(self, slotIndex):
- if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
- return
- slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
- self.__UseItem(slotIndex)
- mouseModule.mouseController.DeattachObject()
- self.OverOutItem()
- ## add bellow:
- if app.ENABLE_FAST_CHEST_OPEN:
- def IsTreasureBox(self, slotIndex):
- itemVnum = player.GetItemIndex(slotIndex)
- item.SelectItem(itemVnum)
- if item.GetItemType() == item.ITEM_TYPE_GIFTBOX:
- return True
- ## you can set own treasures which not have item giftbox type, simply add vnums here
- treasures = {
- 0: 50011,
- 1: 50024,
- 2: 50025,
- 3: 50031,
- 4: 50032,
- }
- if itemVnum in treasures.values():
- return True
- return False
- def SendMultipleUseItemPacket(self, slotIndex):
- for i in xrange(player.GetItemCount(slotIndex)):
- self.__SendUseItemPacket(slotIndex)
- ## find:
- def __UseItem(self, slotIndex):
- ItemVNum = player.GetItemIndex(slotIndex)
- item.SelectItem(ItemVNum)
- ## add bellow:
- if app.ENABLE_FAST_CHEST_OPEN:
- if app.IsPressed(app.DIK_LCONTROL) and self.IsTreasureBox(slotIndex):
- self.SendMultipleUseItemPacket(slotIndex)
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement