def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos): if srcItemSlotPos == dstItemSlotPos: return if item.IsRefineScroll(srcItemVID): self.RefineItem(srcItemSlotPos, dstItemSlotPos) self.wndItem.SetUseMode(FALSE) elif item.IsMetin(srcItemVID): self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos) elif item.IsDetachScroll(srcItemVID): self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos) elif item.IsKey(srcItemVID): self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) else: #snd.PlaySound("sound/ui/drop.wav") ## 이동시킨 곳이 장착 슬롯일 경우 아이템을 사용해서 장착 시킨다 - [levites] if player.IsEquipmentSlot(dstItemSlotPos): ## 들고 있는 아이템이 장비일때만 if item.IsEquipmentVID(srcItemVID): self.__UseItem(srcItemSlotPos) else: self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos): "대상 아이템에 사용할 수 있는가?" if srcSlotPos == dstSlotPos: return FALSE if item.IsRefineScroll(srcItemVNum): if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos): return TRUE elif item.IsMetin(srcItemVNum): if player.ATTACH_METIN_OK == player.CanAttachMetin( srcItemVNum, dstSlotPos): return TRUE elif item.IsDetachScroll(srcItemVNum): if player.DETACH_METIN_OK == player.CanDetach( srcItemVNum, dstSlotPos): return TRUE elif item.IsKey(srcItemVNum): if player.CanUnlock(srcItemVNum, dstSlotPos): return TRUE elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: return TRUE else: useType = item.GetUseType(srcItemVNum) if "USE_CLEAN_SOCKET" == useType: if self.__CanCleanBrokenMetinStone(dstSlotPos): return TRUE elif "USE_CHANGE_ATTRIBUTE" == useType: if self.__CanChangeItemAttrList(dstSlotPos): return TRUE elif "USE_ADD_ATTRIBUTE" == useType: if self.__CanAddItemAttr(dstSlotPos): return TRUE elif "USE_ADD_ATTRIBUTE2" == useType: if self.__CanAddItemAttr(dstSlotPos): return TRUE elif "USE_ADD_ACCESSORY_SOCKET" == useType: if self.__CanAddAccessorySocket(dstSlotPos): return TRUE elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType: if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum): return TRUE elif "USE_PUT_INTO_BELT_SOCKET" == useType: dstItemVNum = player.GetItemIndex(dstSlotPos) print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum item.SelectItem(dstItemVNum) if item.ITEM_TYPE_BELT == item.GetItemType(): return TRUE return FALSE
def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos): "다른 아이템에 사용할 수 있는 아이템인가?" if item.IsRefineScroll(srcItemVNum): return TRUE elif item.IsMetin(srcItemVNum): return TRUE elif item.IsDetachScroll(srcItemVNum): return TRUE elif item.IsKey(srcItemVNum): return TRUE elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: return TRUE else: if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE: return TRUE return FALSE
def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos): "다른 아이템에 사용할 수 있는 아이템인가?" if app.ENABLE_ACHIEVEMENT: if item.IsAchievementColor(srcItemVNum): return True if item.IsRefineScroll(srcItemVNum): return True elif item.IsMetin(srcItemVNum): return True elif item.IsDetachScroll(srcItemVNum): return True elif item.IsKey(srcItemVNum): return True elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: return True else: if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE: return True return False