Advertisement
Guest User

Untitled

a guest
Sep 13th, 2018
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. ## find:
  2. def UseItemSlot(self, slotIndex):
  3. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  4. return
  5.  
  6. slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
  7.  
  8. self.__UseItem(slotIndex)
  9. mouseModule.mouseController.DeattachObject()
  10. self.OverOutItem()
  11.  
  12.  
  13. ## add bellow:
  14. if app.ENABLE_FAST_CHEST_OPEN:
  15. def IsTreasureBox(self, slotIndex):
  16. itemVnum = player.GetItemIndex(slotIndex)
  17. item.SelectItem(itemVnum)
  18.  
  19. if item.GetItemType() == item.ITEM_TYPE_GIFTBOX:
  20. return True
  21.  
  22.  
  23. ## you can set own treasures which not have item giftbox type, simply add vnums here
  24. treasures = {
  25. 0: 50011,
  26. 1: 50024,
  27. 2: 50025,
  28. 3: 50031,
  29. 4: 50032,
  30. }
  31.  
  32. if itemVnum in treasures.values():
  33. return True
  34.  
  35. return False
  36.  
  37. def SendMultipleUseItemPacket(self, slotIndex):
  38. for i in xrange(player.GetItemCount(slotIndex)):
  39. self.__SendUseItemPacket(slotIndex)
  40.  
  41.  
  42.  
  43. ## find:
  44. def __UseItem(self, slotIndex):
  45. ItemVNum = player.GetItemIndex(slotIndex)
  46. item.SelectItem(ItemVNum)
  47.  
  48. ## add bellow:
  49. if app.ENABLE_FAST_CHEST_OPEN:
  50. if app.IsPressed(app.DIK_LCONTROL) and self.IsTreasureBox(slotIndex):
  51. self.SendMultipleUseItemPacket(slotIndex)
  52. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement