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 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 __RefreshSkillPage(self, name, slotCount): global SHOW_LIMIT_SUPPORT_SKILL_LIST skillPage = self.skillPageDict[name] startSlotIndex = skillPage.GetStartIndex() if "ACTIVE" == name: if self.PAGE_HORSE == self.curSelectedSkillGroup: startSlotIndex += slotCount getSkillType = skill.GetSkillType getSkillIndex = player.GetSkillIndex getSkillGrade = player.GetSkillGrade getSkillLevel = player.GetSkillLevel getSkillLevelUpPoint = skill.GetSkillLevelUpPoint getSkillMaxLevel = skill.GetSkillMaxLevel for i in xrange(slotCount + 1): slotIndex = i + startSlotIndex skillIndex = getSkillIndex(slotIndex) for j in xrange(skill.SKILL_GRADE_COUNT): skillPage.ClearSlot(self.__GetRealSkillSlot(j, i)) if 0 == skillIndex: continue skillGrade = getSkillGrade(slotIndex) skillLevel = getSkillLevel(slotIndex) skillType = getSkillType(skillIndex) ## 승마 스킬 예외 처리 if player.SKILL_INDEX_RIDING == skillIndex: if 1 == skillGrade: skillLevel += 19 elif 2 == skillGrade: skillLevel += 29 elif 3 == skillGrade: skillLevel = 40 skillPage.SetSkillSlotNew(slotIndex, skillIndex, max(skillLevel - 1, 0), skillLevel) skillPage.SetSlotCount(slotIndex, skillLevel) ## ACTIVE elif skill.SKILL_TYPE_ACTIVE == skillType: for j in xrange(skill.SKILL_GRADE_COUNT): realSlotIndex = self.__GetRealSkillSlot(j, slotIndex) skillPage.SetSkillSlotNew(realSlotIndex, skillIndex, j, skillLevel) skillPage.SetCoverButton(realSlotIndex) if (skillGrade == skill.SKILL_GRADE_COUNT) and j == ( skill.SKILL_GRADE_COUNT - 1): skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel) elif (not self.__CanUseSkillNow()) or (skillGrade != j): skillPage.SetSlotCount(realSlotIndex, 0) skillPage.DisableCoverButton(realSlotIndex) skillPage.DeactivateSlot(realSlotIndex) else: skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel) if player.IsSkillActive(slotIndex) and (skillGrade == j): # fix001 skillPage.ActivateSlot(realSlotIndex) ## 그외 else: if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST: realSlotIndex = self.__GetETCSkillRealSlotIndex(slotIndex) skillPage.SetSkillSlot(realSlotIndex, skillIndex, skillLevel) skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel) if skill.CanUseSkill(skillIndex): skillPage.SetCoverButton(realSlotIndex) skillPage.RefreshSlot() self.__RestoreSlotCoolTime(skillPage)
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