def OverInItem(self, slotNumber): if mouseModule.mouseController.isAttached(): return if 0 == self.toolTipSkill: return srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber) skillIndex = player.GetSkillIndex(srcSlotIndex) skillLevel = player.GetSkillLevel(srcSlotIndex) skillGrade = player.GetSkillGrade(srcSlotIndex) skillType = skill.GetSkillType(skillIndex) ## ACTIVE if skill.SKILL_TYPE_ACTIVE == skillType: overInSkillGrade = self.__GetSkillGradeFromSlot(slotNumber) if overInSkillGrade == skill.SKILL_GRADE_COUNT-1 and skillGrade == skill.SKILL_GRADE_COUNT: self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel) elif overInSkillGrade == skillGrade: self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, overInSkillGrade, skillLevel) else: self.toolTipSkill.SetSkillOnlyName(srcSlotIndex, skillIndex, overInSkillGrade) else: self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel)
def SetSkill(self, skillSlotNumber): slotNumber = 0 skillIndex = player.GetSkillIndex(skillSlotNumber) skillGrade = player.GetSkillGrade(skillSlotNumber) skillLevel = player.GetSkillLevel(skillSlotNumber) skillType = skill.GetSkillType(skillIndex) self.skillIndex = skillIndex if 0 == self.skillIndex: self.ClearSlot(slotNumber) return self.slotIndex = skillSlotNumber self.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel) self.SetSlotCountNew(slotNumber, skillGrade, skillLevel) ## NOTE : CoolTime 체크 if player.IsSkillCoolTime(skillSlotNumber): (coolTime, elapsedTime) = player.GetSkillCoolTime(skillSlotNumber) self.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) ## NOTE : Activate 되어 있다면 아이콘도 업데이트 if player.IsSkillActive(skillSlotNumber): self.ActivateSlot(slotNumber)
def OverInItem(self, slotNumber): if mouseModule.mouseController.isAttached(): return (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.SLOT_TYPE_INVENTORY == Type: self.tooltipItem.SetInventoryItem(Position) self.tooltipSkill.HideToolTip() elif player.SLOT_TYPE_SKILL == Type: skillIndex = player.GetSkillIndex(Position) 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) self.tooltipSkill.SetSkillNew(Position, skillIndex, skillGrade, skillLevel) self.tooltipItem.HideToolTip()
def OnDeactivateSkill(self, slotIndex): skillGrade = player.GetSkillGrade(slotIndex) slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex) for slotWindow in self.skillPageDict.values(): if slotWindow.HasSlot(slotIndex): slotWindow.DeactivateSlot(slotIndex) return
def OnDeactivateSkill(self, slotIndex): skillGrade = player.GetSkillGrade(slotIndex) slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex) for slotWindow in self.skillPageDict.values(): if slotWindow.HasSlot(slotIndex): if app.ENABLE_SASH_SYSTEM: slotWindow.DeactivateSlotOld(slotIndex) else: slotWindow.DeactivateSlot(slotIndex) return
def __CanUseHorseSkill(self): slotIndex = player.GetSkillSlotIndex(player.SKILL_INDEX_RIDING) if not slotIndex: return False grade = player.GetSkillGrade(slotIndex) level = player.GetSkillLevel(slotIndex) if level < 0: level *= -1 if grade >= 1 and level >= 1: return True return False
def __RefreshSkillPlusButton(self, name): global HIDE_SUPPORT_SKILL_POINT if HIDE_SUPPORT_SKILL_POINT and "SUPPORT" == name: return slotWindow = self.skillPageDict[name] slotWindow.HideAllSlotButton() slotStatType = self.skillPageStatDict[name] if 0 == slotStatType: return statPoint = player.GetStatus(slotStatType) startSlotIndex = slotWindow.GetStartIndex() if "HORSE" == name: startSlotIndex += self.ACTIVE_PAGE_SLOT_COUNT if statPoint > 0: for i in xrange(self.PAGE_SLOT_COUNT): slotIndex = i + startSlotIndex skillIndex = player.GetSkillIndex(slotIndex) skillGrade = player.GetSkillGrade(slotIndex) skillLevel = player.GetSkillLevel(slotIndex) if skillIndex == 0: continue if skillGrade != 0: continue if name == "HORSE": if player.GetStatus( player.LEVEL) >= skill.GetSkillLevelLimit( skillIndex): if skillLevel < 20: slotWindow.ShowSlotButton( self.__GetETCSkillRealSlotIndex(slotIndex)) else: if "SUPPORT" == name: if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST: if self.CanShowPlusButton(skillIndex, skillLevel, statPoint): slotWindow.ShowSlotButton(slotIndex) else: if self.CanShowPlusButton(skillIndex, skillLevel, statPoint): slotWindow.ShowSlotButton(slotIndex)
def OnUseSkill(self, slotIndex, coolTime): skillIndex = player.GetSkillIndex(slotIndex) skillType = skill.GetSkillType(skillIndex) ## ACTIVE if skill.SKILL_TYPE_ACTIVE == skillType: skillGrade = player.GetSkillGrade(slotIndex) slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex) ## ETC else: slotIndex = self.__GetETCSkillRealSlotIndex(slotIndex) for slotWindow in self.skillPageDict.values(): if slotWindow.HasSlot(slotIndex): slotWindow.SetSlotCoolTime(slotIndex, coolTime) return
def __GetPartySkillLevel(self): slotIndex = player.GetSkillSlotIndex(player.SKILL_INDEX_TONGSOL) skillGrade = player.GetSkillGrade(slotIndex) skillLevel = player.GetSkillLevel(slotIndex) return skillLevel + skillGrade*20
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
def AttachObject(self, Owner, Type, SlotNumber, ItemIndex, count=0): self.LastAttachedSlotNumber = self.AttachedSlotNumber self.AttachedFlag = True self.AttachedOwner = Owner self.AttachedType = Type self.AttachedSlotNumber = SlotNumber self.AttachedItemIndex = ItemIndex self.AttachedCount = count self.countNumberLine.SetNumber("") self.countNumberLine.Hide() if count > 1: self.countNumberLine.SetNumber(str(count)) self.countNumberLine.Show() try: width = 1 height = 1 if Type == player.SLOT_TYPE_INVENTORY or\ Type == player.SLOT_TYPE_PRIVATE_SHOP or\ Type == player.SLOT_TYPE_SHOP or\ Type == player.SLOT_TYPE_SAFEBOX or\ Type == player.SLOT_TYPE_MALL or\ Type == player.SLOT_TYPE_DRAGON_SOUL_INVENTORY: item.SelectItem(self.AttachedItemIndex) self.AttachedIconHandle = item.GetIconInstance() if not self.AttachedIconHandle: self.AttachedIconHandle = 0 self.DeattachObject() return (width, height) = item.GetItemSize() elif Type == player.SLOT_TYPE_SKILL: skillGrade = player.GetSkillGrade(SlotNumber) self.AttachedIconHandle = skill.GetIconInstanceNew( self.AttachedItemIndex, skillGrade) elif Type == player.SLOT_TYPE_EMOTION: image = player.GetEmotionIconImage(ItemIndex) self.AttachedIconHandle = grpImage.GenerateFromHandle(image) elif Type == player.SLOT_TYPE_QUICK_SLOT: (quickSlotType, position) = player.GetGlobalQuickSlot(SlotNumber) if quickSlotType == player.SLOT_TYPE_INVENTORY: itemIndex = player.GetItemIndex(position) item.SelectItem(itemIndex) self.AttachedIconHandle = item.GetIconInstance() (width, height) = item.GetItemSize() elif quickSlotType == player.SLOT_TYPE_SKILL: skillIndex = player.GetSkillIndex(position) skillGrade = player.GetSkillGrade(position) self.AttachedIconHandle = skill.GetIconInstanceNew( skillIndex, skillGrade) elif quickSlotType == player.SLOT_TYPE_EMOTION: image = player.GetEmotionIconImage(position) self.AttachedIconHandle = grpImage.GenerateFromHandle( image) if not self.AttachedIconHandle: self.DeattachObject() return self.AttachedIconHalfWidth = grpImage.GetWidth( self.AttachedIconHandle) / 2 self.AttachedIconHalfHeight = grpImage.GetHeight( self.AttachedIconHandle) / 2 self.AttachedIconHalfWidth = grpImage.GetWidth( self.AttachedIconHandle) / 2 self.AttachedIconHalfHeight = grpImage.GetHeight( self.AttachedIconHandle) / 2 wndMgr.AttachIcon(self.AttachedType, self.AttachedItemIndex, self.AttachedSlotNumber, width, height) except Exception, e: dbg.TraceError("mouseModule.py: AttachObject : " + str(e)) self.AttachedIconHandle = 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