def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
		scrollIndex = player.GetItemIndex(scrollSlotPos)
		targetIndex = player.GetItemIndex(targetSlotPos)
		if app.ENABLE_SASH_SYSTEM:
			if not player.CanDetach(scrollIndex, targetSlotPos):
				item.SelectItem(scrollIndex)
				if item.GetValue(0) == sash.CLEAN_ATTR_VALUE0:
					chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SASH_FAILURE_CLEAN)
				else:
					chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
				
				return
		elif app.ENABLE_CHANGELOOK_SYSTEM:
			if not player.CanDetach(scrollIndex, targetSlotPos):
				item.SelectItem(scrollIndex)
				if item.GetValue(0) == changelook.CLEAN_ATTR_VALUE0:
					chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHANGE_LOOK_FAILURE_CLEAN)
				else:
					chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
				
				return
		else:
			if not player.CanDetach(scrollIndex, targetSlotPos):
				chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
				return
		
		self.questionDialog = uiCommon.QuestionDialog()
		self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
		if app.ENABLE_SASH_SYSTEM:
			item.SelectItem(targetIndex)
			if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_SASH:
				item.SelectItem(scrollIndex)
				if item.GetValue(0) == sash.CLEAN_ATTR_VALUE0:
					self.questionDialog.SetText(localeInfo.SASH_DO_YOU_CLEAN)
		if app.ENABLE_CHANGELOOK_SYSTEM:
			item.SelectItem(targetIndex)
			if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR or item.GetItemType() == item.ITEM_TYPE_COSTUME:
				item.SelectItem(scrollIndex)
				if item.GetValue(0) == changelook.CLEAN_ATTR_VALUE0:
					self.questionDialog.SetText(localeInfo.CHANGE_LOOK_DO_YOU_CLEAN)
		self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
		self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
		self.questionDialog.Open()
		self.questionDialog.sourcePos = scrollSlotPos
		self.questionDialog.targetPos = targetSlotPos
Пример #2
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
Пример #3
0
	def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
		scrollIndex = player.GetItemIndex(scrollSlotPos)
		targetIndex = player.GetItemIndex(targetSlotPos)

		if not player.CanDetach(scrollIndex, targetSlotPos):
			chat.AppendChat(chat.CHAT_TYPE_INFO, locale.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
			return

		self.questionDialog = uiCommon.QuestionDialog()
		self.questionDialog.SetText(locale.REFINE_DO_YOU_SEPARATE_METIN)
		self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
		self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
		self.questionDialog.Open()
		self.questionDialog.sourcePos = scrollSlotPos
		self.questionDialog.targetPos = targetSlotPos