def RefreshEquipSlotWindow(self):
		for i in xrange(6):
			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i)
			itemVnum = player.GetItemIndex(slotNumber)
			self.wndEquip.SetItemSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i, itemVnum, 0)
			self.wndEquip.EnableSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i)
			
			if itemVnum != 0:
				item.SelectItem(itemVnum)
				for j in xrange(item.LIMIT_MAX_NUM):
					(limitType, limitValue) = item.GetLimit(j)
					
					# 밑에서 remain_time이 0이하인지 체크 하기 때문에 임의의 양수로 초기화
					remain_time = 999
					# 일단 현재 타이머는 이 세개 뿐이다.
					if item.LIMIT_REAL_TIME == limitType:
						remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) - app.GetGlobalTimeStamp()
					elif item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
						remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) - app.GetGlobalTimeStamp()
					elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
						remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0)
						
					if remain_time <= 0:
						self.wndEquip.DisableSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i)
						break
					
		self.wndEquip.RefreshSlot()
예제 #2
0
    def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
        dstItemVNum = player.GetItemIndex(dstSlotPos)
        if dstItemVNum == 0:
            return FALSE

        item.SelectItem(dstItemVNum)

        if item.GetItemType() != item.ITEM_TYPE_ARMOR:
            return FALSE

        if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK,
                                         item.ARMOR_EAR):
            return FALSE

        curCount = player.GetItemMetinSocket(dstSlotPos, 0)
        maxCount = player.GetItemMetinSocket(dstSlotPos, 1)

        if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(
                dstItemVNum, item.GetItemSubType()):
            return FALSE

        if curCount >= maxCount:
            return FALSE

        return TRUE
예제 #3
0
        def __SetCoolTimePetItemSlot(self, slot, Position, slotNumber,
                                     itemVnum):

            item.SelectItem(itemVnum)
            itemSubType = item.GetItemSubType()

            if itemSubType not in [item.PET_UPBRINGING, item.PET_BAG]:
                return

            if itemSubType == item.PET_BAG:
                id = player.GetItemMetinSocket(Position, 2)
                if id == 0:
                    return

            (limitType, limitValue) = item.GetLimit(0)

            if itemSubType == item.PET_UPBRINGING:
                limitValue = player.GetItemMetinSocket(Position, 1)

            if limitType in [
                    item.LIMIT_REAL_TIME, item.LIMIT_REAL_TIME_START_FIRST_USE
            ]:
                sock_time = player.GetItemMetinSocket(Position, 0)
                remain_time = max(0, sock_time - app.GetGlobalTimeStamp())

                slot.SetSlotCoolTimeInverse(slotNumber, limitValue,
                                            limitValue - remain_time)
	def SelectEmptyEquipSlot(self, selectedSlot):
		if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
			return

		selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, selectedSlot)

		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
			attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()

			if player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
				if 0 == player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, attachedSlotPos, 0):
					self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_EXPIRED)
					self.wndPopupDialog.Open()
					return
			
				item.SelectItem(attachedItemIndex)
				subType = item.GetItemSubType()
				if subType != (selectedSlot - player.DRAGON_SOUL_EQUIPMENT_SLOT_START):
					self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNMATCHED_SLOT)
					self.wndPopupDialog.Open()
				else:
					srcItemPos = (player.DRAGON_SOUL_INVENTORY, attachedSlotPos)
					dstItemPos = (player.INVENTORY, selectedSlotPos)
					self.__OpenQuestionDialog(TRUE, srcItemPos, dstItemPos)

			mouseModule.mouseController.DeattachObject()
예제 #5
0
    def RefreshBagSlotWindow(self):
        getItemVNum = player.GetItemIndex
        getItemCount = player.GetItemCount
        setItemVNum = self.wndItem.SetItemSlot

        for i in xrange(player.INVENTORY_PAGE_SIZE):
            slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)

            itemCount = getItemCount(slotNumber)
            # itemCount == 0이면 소켓을 비운다.
            if 0 == itemCount:
                self.wndItem.ClearSlot(i)
                continue
            elif 1 == itemCount:
                itemCount = 0

            itemVnum = getItemVNum(slotNumber)
            setItemVNum(i, itemVnum, itemCount)

            ## 자동물약 (HP: #72723 ~ #72726, SP: #72727 ~ #72730) 특수처리 - 아이템인데도 슬롯에 활성화/비활성화 표시를 위한 작업임 - [hyo]
            if constInfo.IS_AUTO_POTION(itemVnum):
                # metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
                metinSocket = [
                    player.GetItemMetinSocket(slotNumber, j)
                    for j in xrange(player.METIN_SOCKET_MAX_NUM)
                ]

                if slotNumber >= player.INVENTORY_PAGE_SIZE:
                    slotNumber -= player.INVENTORY_PAGE_SIZE

                isActivated = 0 != metinSocket[0]

                if isActivated:
                    self.wndItem.ActivateSlot(slotNumber)
                    potionType = 0
                    if constInfo.IS_AUTO_POTION_HP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_HP
                    elif constInfo.IS_AUTO_POTION_SP(itemVnum):
                        potionType = player.AUTO_POTION_TYPE_SP

                    usedAmount = int(metinSocket[1])
                    totalAmount = int(metinSocket[2])
                    player.SetAutoPotionInfo(
                        potionType, isActivated, (totalAmount - usedAmount),
                        totalAmount,
                        self.__InventoryLocalSlotPosToGlobalSlotPos(i))

                else:
                    self.wndItem.DeactivateSlot(slotNumber)

            if app.WJ_ENABLE_TRADABLE_ICON:
                self.RefreshMarkSlots(i)

        self.wndItem.RefreshSlot()

        if self.wndBelt:
            self.wndBelt.RefreshSlot()

        if app.WJ_ENABLE_TRADABLE_ICON:
            map(lambda wnd: wnd.RefreshLockedSlot(), self.bindWnds)
	def __CanActivateDeck(self):
		canActiveNum = 0
		for i in xrange(6):
			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i)
			itemVnum = player.GetItemIndex(slotNumber)
			
			if itemVnum != 0:
				item.SelectItem(itemVnum)
				isNoLimit = TRUE
				for i in xrange(item.LIMIT_MAX_NUM):
					(limitType, limitValue) = item.GetLimit(i)
					
					# LIMIT_TIMER_BASED_ON_WEAR는 소켓0에 남은 시간을 박는다.
					# LIMIT_REAL_TIME은 시간 다 되면 아이템이 사라지므로 할 필요가 없다.
					# LIMIT_REAL_TIME_START_FIRST_USE는 서버에 제대로 정의되지 않아 일단 냅둔다.
					if item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
						isNoLimit = FALSE
						remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0)
						if 0 != remain_time:
							canActiveNum += 1
							break
				# 타이머가 없다면 Activate할 수 있는 용혼석.
				if isNoLimit:
					canActiveNum += 1
		
		return canActiveNum > 0
	def __UseItem(self, slotIndex):
		ItemVNum = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, slotIndex)
		if 0 == player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotIndex, 0):
			self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_EXPIRED)
			self.wndPopupDialog.Open()
			return
 
		self.__EquipItem(slotIndex)
예제 #8
0
    def Open(self, metinItemPos, targetItemPos):
        self.metinItemPos = metinItemPos
        self.targetItemPos = targetItemPos

        metinIndex = player.GetItemIndex(metinItemPos)
        itemIndex = player.GetItemIndex(targetItemPos)
        self.oldToolTip.ClearToolTip()
        self.newToolTip.ClearToolTip()

        item.SelectItem(metinIndex)

        ## Metin Image
        try:
            self.metinImage.LoadImage(item.GetIconImageFileName())
        except:
            dbg.TraceError(
                "AttachMetinDialog.Open.LoadImage - Failed to find item data")

        ## Old Item ToolTip
        metinSlot = []
        for i in xrange(player.METIN_SOCKET_MAX_NUM):
            metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
        self.oldToolTip.AddItemData(itemIndex, metinSlot)

        ## New Item ToolTip
        item.SelectItem(metinIndex)
        metinSubType = item.GetItemSubType()

        metinSlot = []
        for i in xrange(player.METIN_SOCKET_MAX_NUM):
            metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
        for i in xrange(player.METIN_SOCKET_MAX_NUM):
            slotData = metinSlot[i]
            if self.CanAttachMetin(slotData, metinSubType):
                metinSlot[i] = metinIndex
                break
        self.newToolTip.AddItemData(itemIndex, metinSlot)

        self.UpdateDialog()
        self.SetTop()
        self.Show()

        if app.ENABLE_SLOT_MARKING_SYSTEM:
            self.SetCantMouseEventSlot(0, self.metinItemPos)
            self.SetCantMouseEventSlot(1, self.targetItemPos)
예제 #9
0
	def __CanAddAccessorySocket(self, dstSlotPos):
		dstItemVNum = player.GetItemIndex(dstSlotPos)
		if dstItemVNum == 0:
			return FALSE

		item.SelectItem(dstItemVNum)

		if item.GetItemType() != item.ITEM_TYPE_ARMOR:
			return FALSE

		if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
			return FALSE

		curCount = player.GetItemMetinSocket(dstSlotPos, 0)
		maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
		
		ACCESSORY_SOCKET_MAX_SIZE = 3
		if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
			return FALSE

		return TRUE
	def RefreshBagSlotWindow(self):
		getItemVNum=player.GetItemIndex
		getItemCount=player.GetItemCount
		setItemVnum=self.wndItem.SetItemSlot
		for i in xrange(player.DRAGON_SOUL_PAGE_SIZE):
			self.wndItem.EnableSlot(i)
			#<- dragon soul kind
			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(player.DRAGON_SOUL_INVENTORY, i)

			itemCount = getItemCount(player.DRAGON_SOUL_INVENTORY, slotNumber)
			if 0 == itemCount:
				self.wndItem.ClearSlot(i)
				continue
			elif 1 == itemCount:
				itemCount = 0
			itemVnum = getItemVNum(player.DRAGON_SOUL_INVENTORY, slotNumber)

			setItemVnum(i, itemVnum, itemCount)

			if itemVnum != 0:
				item.SelectItem(itemVnum)
				for j in xrange(item.LIMIT_MAX_NUM):
					(limitType, limitValue) = item.GetLimit(j)

					# 밑에서 remain_time이 음수인지 체크 하기 때문에 임의의 양수로 초기화
					remain_time = 999
					if item.LIMIT_REAL_TIME == limitType:
						remain_time = player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotNumber, 0)
					elif item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
						remain_time = player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotNumber, 0)
					elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
						remain_time = player.GetItemMetinSocket(player.DRAGON_SOUL_INVENTORY, slotNumber, 0)
				
					if remain_time <= 0:
						self.wndItem.DisableSlot(i)
						break

		self.__HighlightSlot_RefreshCurrentPage()
		self.wndItem.RefreshSlot()
예제 #11
0
	def __CanCleanBrokenMetinStone(self, dstSlotPos):
		dstItemVNum = player.GetItemIndex(dstSlotPos)
		if dstItemVNum == 0:
			return FALSE

		item.SelectItem(dstItemVNum)
		
		if item.ITEM_TYPE_WEAPON != item.GetItemType():
			return FALSE

		for i in xrange(player.METIN_SOCKET_MAX_NUM):
			if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
				return TRUE

		return FALSE
예제 #12
0
    def isRodAbleToLevelUp(self):
        idx = player.GetItemIndex(player.EQUIPMENT, item.EQUIPMENT_WEAPON)
        if (idx == 0):
            return False
        item.SelectItem(idx)

        currPoints = player.GetItemMetinSocket(player.EQUIPMENT,
                                               item.EQUIPMENT_WEAPON, 0)
        maxPoints = item.GetValue(2)

        if currPoints == maxPoints and item.GetItemType(
        ) == item.ITEM_TYPE_ROD:
            chat.AppendChat(3, "[Fishing-Bot] Rod is ready to be upgraded.")
            return True
        return False
예제 #13
0
    def Open(self, targetItemPos, nextGradeItemVnum, cost, prob, type):

        if FALSE == self.isLoaded:
            self.__LoadScript()

        self.__Initialize()

        self.targetItemPos = targetItemPos
        self.vnum = nextGradeItemVnum
        self.cost = cost
        self.percentage = prob
        self.type = type

        self.probText.SetText(locale.REFINE_SUCCESS_PROBALITY %
                              (self.percentage))
        self.costText.SetText(locale.REFINE_COST % (self.cost))

        if app.WJ_ENABLE_TRADABLE_ICON:
            self.SetCantMouseEventSlot(targetItemPos)

        self.toolTip.ClearToolTip()
        metinSlot = []
        for i in xrange(player.METIN_SOCKET_MAX_NUM):
            metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))

        attrSlot = []
        for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
            attrSlot.append(player.GetItemAttribute(targetItemPos, i))
        self.toolTip.AddRefineItemData(nextGradeItemVnum, metinSlot, attrSlot)

        item.SelectItem(nextGradeItemVnum)
        self.itemImage.LoadImage(item.GetIconImageFileName())
        xSlotCount, ySlotCount = item.GetItemSize()
        for slot in self.slotList:
            slot.Hide()
        for i in xrange(min(3, ySlotCount)):
            self.slotList[i].SetPosition(-35, i * 32 - (ySlotCount - 1) * 16)
            self.slotList[i].Show()

        self.dialogHeight = self.toolTip.GetHeight() + 46
        self.UpdateDialog()

        self.SetTop()
        self.Show()
예제 #14
0
    def Open(self, scrollItemPos, targetItemPos):
        self.scrollItemPos = scrollItemPos
        self.targetItemPos = targetItemPos

        percentage = self.GetRefineSuccessPercentage(scrollItemPos,
                                                     targetItemPos)
        if 0 == percentage:
            return
        self.successPercentage.SetText(localeInfo.REFINE_SUCCESS_PROBALITY %
                                       (percentage))

        itemIndex = player.GetItemIndex(targetItemPos)
        self.toolTip.ClearToolTip()
        metinSlot = []
        for i in xrange(player.METIN_SOCKET_MAX_NUM):
            metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
        self.toolTip.AddItemData(itemIndex, metinSlot)

        self.UpdateDialog()
        self.SetTop()
        self.Show()
예제 #15
0
    def GetRefineSuccessPercentage(self, scrollSlotIndex, itemSlotIndex):

        if -1 != scrollSlotIndex:
            if player.IsRefineGradeScroll(scrollSlotIndex):
                curGrade = player.GetItemGrade(itemSlotIndex)
                itemIndex = player.GetItemIndex(itemSlotIndex)

                item.SelectItem(itemIndex)
                itemType = item.GetItemType()
                itemSubType = item.GetItemSubType()

                if item.ITEM_TYPE_METIN == itemType:

                    if curGrade >= len(self.upgradeStoneSuccessPercentage):
                        return 0
                    return self.upgradeStoneSuccessPercentage[curGrade]

                elif item.ITEM_TYPE_ARMOR == itemType:

                    if item.ARMOR_BODY == itemSubType:
                        if curGrade >= len(self.upgradeArmorSuccessPercentage):
                            return 0
                        return self.upgradeArmorSuccessPercentage[curGrade]
                    else:
                        if curGrade >= len(
                                self.upgradeAccessorySuccessPercentage):
                            return 0
                        return self.upgradeAccessorySuccessPercentage[curGrade]

                else:

                    if curGrade >= len(self.upgradeSuccessPercentage):
                        return 0
                    return self.upgradeSuccessPercentage[curGrade]

        for i in xrange(player.METIN_SOCKET_MAX_NUM + 1):
            if 0 == player.GetItemMetinSocket(itemSlotIndex, i):
                break

        return self.makeSocketSuccessPercentage[i]
예제 #16
0
    def RefreshQuickSlot(self):

        pageNum = player.GetQuickPage()

        try:
            self.quickPageNumImageBox.LoadImage(
                TaskBar.QUICKPAGE_NUMBER_FILENAME[pageNum])
        except:
            pass

        startNumber = 0
        for slot in self.quickslot:

            for i in xrange(4):

                slotNumber = i + startNumber

                (Type, Position) = player.GetLocalQuickSlot(slotNumber)

                if player.SLOT_TYPE_NONE == Type:
                    slot.ClearSlot(slotNumber)
                    continue

                if player.SLOT_TYPE_INVENTORY == Type:

                    itemIndex = player.GetItemIndex(Position)
                    itemCount = player.GetItemCount(Position)
                    if itemCount <= 1:
                        itemCount = 0

                    if constInfo.IS_AUTO_POTION(itemIndex):
                        metinSocket = [
                            player.GetItemMetinSocket(Position, j)
                            for j in xrange(player.METIN_SOCKET_MAX_NUM)
                        ]

                        if 0 != int(metinSocket[0]):
                            slot.ActivateSlot(slotNumber)
                        else:
                            slot.DeactivateSlot(slotNumber)

                    if app.ENABLE_GROWTH_PET_SYSTEM:
                        if constInfo.IS_PET_ITEM(itemIndex):
                            self.__SetCoolTimePetItemSlot(
                                slot, Position, slotNumber, itemIndex)

                            slot.DeactivateSlot(slotNumber)

                            active_id = player.GetActivePetItemId()
                            if active_id and active_id == player.GetItemMetinSocket(
                                    Position, 2):
                                slot.ActivateSlot(slotNumber)

                    slot.SetItemSlot(slotNumber, itemIndex, itemCount)

                elif player.SLOT_TYPE_SKILL == Type:

                    skillIndex = player.GetSkillIndex(Position)
                    if 0 == skillIndex:
                        slot.ClearSlot(slotNumber)
                        continue

                    skillType = skill.GetSkillType(skillIndex)
                    if skill.SKILL_TYPE_GUILD == skillType:
                        import guild
                        skillGrade = 0
                        skillLevel = guild.GetSkillLevel(Position)

                    else:
                        skillGrade = player.GetSkillGrade(Position)
                        skillLevel = player.GetSkillLevel(Position)

                    slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade,
                                         skillLevel)
                    slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
                    slot.SetCoverButton(slotNumber)

                    if player.IsSkillCoolTime(Position):
                        (coolTime,
                         elapsedTime) = player.GetSkillCoolTime(Position)
                        slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)

                    if player.IsSkillActive(Position):
                        slot.ActivateSlot(slotNumber)

                elif player.SLOT_TYPE_EMOTION == Type:

                    emotionIndex = Position
                    slot.SetEmotionSlot(slotNumber, emotionIndex)
                    slot.SetCoverButton(slotNumber)
                    slot.SetSlotCount(slotNumber, 0)

            slot.RefreshSlot()
            startNumber += 4
	def RefreshBagSlotWindow(self):
		getItemVNum=player.GetItemIndex
		getItemCount=player.GetItemCount
		setItemVNum=self.wndItem.SetItemSlot
		for i in xrange(player.INVENTORY_PAGE_SIZE*4):
			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
			itemCount = getItemCount(slotNumber)
			if 0 == itemCount:
				self.wndItem.ClearSlot(i)
				continue
			elif 1 == itemCount:
				itemCount = 0
				
			itemVnum = getItemVNum(slotNumber)
			setItemVNum(i, itemVnum, itemCount)
			if app.ENABLE_CHANGELOOK_SYSTEM:
				itemTransmutedVnum = player.GetItemTransmutation(slotNumber)
				if itemTransmutedVnum:
					self.wndItem.DisableCoverButton(i)
				else:
					self.wndItem.EnableCoverButton(i)
			if constInfo.IS_AUTO_POTION(itemVnum):
				metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]	
				if slotNumber >= player.INVENTORY_PAGE_SIZE:
					slotNumber -= player.INVENTORY_PAGE_SIZE
				isActivated = 0 != metinSocket[0]
				if isActivated:
					self.wndItem.ActivateSlot(slotNumber)
					potionType = 0;
					if constInfo.IS_AUTO_POTION_HP(itemVnum):
						potionType = player.AUTO_POTION_TYPE_HP
					elif constInfo.IS_AUTO_POTION_SP(itemVnum):
						potionType = player.AUTO_POTION_TYPE_SP						
					
					usedAmount = int(metinSocket[1])
					totalAmount = int(metinSocket[2])					
					player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
				else:
					self.wndItem.DeactivateSlot(i)
			if app.ENABLE_SASH_SYSTEM:
				slotNumberChecked = 0
				if not constInfo.IS_AUTO_POTION(itemVnum):
					self.wndItem.DeactivateSlot(i)
				
				for j in xrange(sash.WINDOW_MAX_MATERIALS):
					(isHere, iCell) = sash.GetAttachedItem(j)
					if isHere:
						if iCell == slotNumber:
							self.wndItem.ActivateSlot(i, (238.00 / 255.0), (11.00 / 255.0), (11.00 / 255.0), 1.0)
							if not slotNumber in self.listAttachedSashs:
								self.listAttachedSashs.append(slotNumber)
							
							slotNumberChecked = 1
					else:
						if slotNumber in self.listAttachedSashs and not slotNumberChecked:
							self.wndItem.DeactivateSlot(i)
							self.listAttachedSashs.remove(slotNumber)
			if app.ENABLE_CHANGELOOK_SYSTEM:
				slotClNumberChecked = 0
				if not constInfo.IS_AUTO_POTION(itemVnum):
					self.wndItem.DeactivateSlot(i)
				
				for q in xrange(changelook.WINDOW_MAX_MATERIALS):
					(isHere, iCell) = changelook.GetAttachedItem(q)
					if isHere:
						if iCell == slotNumber:
							self.wndItem.ActivateSlot(i, (238.00 / 255.0), (11.00 / 255.0), (11.00 / 255.0), 1.0)
							if not slotNumber in self.listAttachedCl:
								self.listAttachedCl.append(slotNumber)
							
							slotClNumberChecked = 1
					else:
						if slotNumber in self.listAttachedCl and not slotClNumberChecked:
							self.wndItem.DeactivateSlot(i)
							self.listAttachedCl.remove(slotNumber)		
			else:
				self.wndItem.DeactivateSlot(slotNumber)			
		
		self.wndItem.RefreshSlot()
		if self.wndBelt:
			self.wndBelt.RefreshSlot()
예제 #18
0
    def __OnOverInItem(self, slotIndex):
        if slotIndex == 2:
            if self.slot_index1 != 999:
                abs_chance = 0
                itemVnum = player.GetItemIndex(self.slot_index1)
                self.tooltipItem.SetItemToolTip(itemVnum)
                self.tooltipItem.SetInventoryItem(self.acceItemInfo[0])

                item.SelectItem(player.GetItemIndex(self.slot_index1))
                metinSlot = []
                for i in xrange(player.METIN_SOCKET_MAX_NUM):
                    metinSlot.append(
                        player.GetItemMetinSocket(self.slot_index1, i))

                abs_chance = int(metinSlot[1])

                item.SelectItem(player.GetItemIndex(self.slot_index2))
                itemType = item.GetItemType()
                if item.ITEM_TYPE_WEAPON == itemType:
                    a = int(item.GetValue(3) * abs_chance / 100)
                    b = int(item.GetValue(4) * abs_chance / 100)
                    c = int(item.GetValue(5) * abs_chance / 100)
                    d = int(item.GetValue(1) * abs_chance / 100)
                    e = int(item.GetValue(2) * abs_chance / 100)

                    min_power = a + c
                    max_power = b + c
                    min_magic_power = d + c
                    max_magic_power = e + c
                    if b > a:
                        if a > 0 or b > 0:
                            self.tooltipItem.AppendTextLine(
                                localeInfo.TOOLTIP_ITEM_ATT_POWER %
                                (max_power - min_power, max_power),
                                self.tooltipItem.POSITIVE_COLOR)
                    else:
                        if a > 0:
                            self.tooltipItem.AppendTextLine(
                                localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG %
                                (min_power), self.tooltipItem.POSITIVE_COLOR)

                    if e > d:
                        if e > 0 or d > 0:
                            self.tooltipItem.AppendTextLine(
                                localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER %
                                (max_magic_power - min_magic_power,
                                 max_magic_power),
                                self.tooltipItem.POSITIVE_COLOR)
                    else:
                        if e > 0:
                            self.tooltipItem.AppendTextLine(
                                localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG
                                % (min_magic_power),
                                self.tooltipItem.POSITIVE_COLOR)
                elif item.ITEM_TYPE_ARMOR == itemType:
                    defGradeCalc = item.GetValue(5) * 2 + item.GetValue(
                        1) * abs_chance / 100
                    defGrade = defGradeCalc * abs_chance / 100
                    if defGrade > 0:
                        self.tooltipItem.AppendTextLine(
                            localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade),
                            self.GetChangeTextLineColor(defGrade))

                for g in xrange(item.ITEM_APPLY_MAX_NUM):
                    item.SelectItem(player.GetItemIndex(self.slot_index2))
                    (affectType, affectValue) = item.GetAffect(g)
                    affectValue = affectValue * abs_chance / 100
                    if affectValue <= 0:
                        if affectType != 0:
                            affectValue = 1
                        else:
                            affectValue = 0

                    affectString = self.GetAffectString(
                        affectType, affectValue)
                    if affectString:
                        affectColor = self.GetChangeTextLineColor(affectValue)
                        self.tooltipItem.AppendTextLine(
                            affectString, affectColor)

                attrSlot = []
                for w in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
                    attrSlot.append(
                        player.GetItemAttribute(self.slot_index2, w))

                if 0 != attrSlot:
                    for q in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
                        if q >= 7:
                            continue
                        else:
                            type = attrSlot[q][0]
                            value = attrSlot[q][1]
                            if 0 == value:
                                continue

                            value = value * abs_chance / 100

                            if value <= 0:
                                if type != 0:
                                    value = 1
                                else:
                                    value = 0

                            affectString = self.GetAffectString(type, value)
                            if affectString:
                                affectColor = self.GetAttributeColor(q, value)
                                self.tooltipItem.AppendTextLine(
                                    affectString, affectColor)
            return

        if self.tooltipItem:
            if self.acceItemInfo.has_key(slotIndex):
                self.tooltipItem.SetInventoryItem(self.acceItemInfo[slotIndex])
예제 #19
0
	def RefreshQuickSlot(self):

		pageNum = player.GetQuickPage()

		try:
			self.quickPageNumImageBox.LoadImage(TaskBar.QUICKPAGE_NUMBER_FILENAME[pageNum])
		except:
			pass

		startNumber = 0
		for slot in self.quickslot:

			for i in xrange(4):

				slotNumber = i+startNumber

				(Type, Position) = player.GetLocalQuickSlot(slotNumber)

				if player.SLOT_TYPE_NONE == Type:
					slot.ClearSlot(slotNumber)
					continue

				if player.SLOT_TYPE_INVENTORY == Type:

					itemIndex = player.GetItemIndex(Position)
					itemCount = player.GetItemCount(Position)
					if itemCount <= 1:
						itemCount = 0

					## 자동물약 (#72723, #72724) 특수처리 - 아이템인데도 슬롯에 활성화/비활성화 표시를 위한 작업임 - [hyo]
					if constInfo.IS_AUTO_POTION(itemIndex):
						# metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
						metinSocket = [player.GetItemMetinSocket(Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]

						if 0 != int(metinSocket[0]):
							slot.ActivateSlot(slotNumber)
						else:
							slot.DeactivateSlot(slotNumber)

					slot.SetItemSlot(slotNumber, itemIndex, itemCount)

				elif player.SLOT_TYPE_SKILL == Type:

					skillIndex = player.GetSkillIndex(Position)
					if 0 == skillIndex:
						slot.ClearSlot(slotNumber)
						continue

					skillType = skill.GetSkillType(skillIndex)
					if skill.SKILL_TYPE_GUILD == skillType:
						import guild
						skillGrade = 0
						skillLevel = guild.GetSkillLevel(Position)

					else:
						skillGrade = player.GetSkillGrade(Position)
						skillLevel = player.GetSkillLevel(Position)

					slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel)
					slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
					slot.SetCoverButton(slotNumber)

					## NOTE : CoolTime 체크
					if player.IsSkillCoolTime(Position):
						(coolTime, elapsedTime) = player.GetSkillCoolTime(Position)
						slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)

					## NOTE : Activate 되어 있다면 아이콘도 업데이트
					if player.IsSkillActive(Position):
						slot.ActivateSlot(slotNumber)

				elif player.SLOT_TYPE_EMOTION == Type:

					emotionIndex = Position
					slot.SetEmotionSlot(slotNumber, emotionIndex)
					slot.SetCoverButton(slotNumber)
					slot.SetSlotCount(slotNumber, 0)

			slot.RefreshSlot()
			startNumber += 4