def Open(self, metinItemPos, targetItemPos): self.metinItemPos = metinItemPos self.targetItemPos = targetItemPos metinIndex = fgGHGjjFHJghjfFG1545gGG.GetItemIndex(metinItemPos) itemIndex = fgGHGjjFHJghjfFG1545gGG.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(fgGHGjjFHJghjfFG1545gGG.METIN_SOCKET_MAX_NUM): metinSlot.append(fgGHGjjFHJghjfFG1545gGG.GetItemMetinSocket(targetItemPos, i)) self.oldToolTip.AddItemData(itemIndex, metinSlot) ## New Item ToolTip item.SelectItem(metinIndex) metinSubType = item.GetItemSubType() metinSlot = [] for i in xrange(fgGHGjjFHJghjfFG1545gGG.METIN_SOCKET_MAX_NUM): metinSlot.append(fgGHGjjFHJghjfFG1545gGG.GetItemMetinSocket(targetItemPos, i)) for i in xrange(fgGHGjjFHJghjfFG1545gGG.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()
def Open(self, targetItemPos, nextGradeItemVnum, cost, prob, type): if False == self.isLoaded: self.__LoadScript() if app.ENABLE_REFINE_RENEWAL: self.__InitializeOpen() else: self.__Initialize() self.targetItemPos = targetItemPos self.vnum = nextGradeItemVnum self.cost = cost self.percentage = prob self.type = type self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage)) self.probText.SetFontColor(0.9607, 0.2392, 0.0) self.costText.SetText("Verbesserungskosten: " + constInfo.NumberToPointString(int(self.cost)) + " Yang") self.toolTip.ClearToolTip() metinSlot = [] for i in xrange(fgGHGjjFHJghjfFG1545gGG.METIN_SOCKET_MAX_NUM): metinSlot.append(fgGHGjjFHJghjfFG1545gGG.GetItemMetinSocket(targetItemPos, i)) attrSlot = [] for i in xrange(fgGHGjjFHJghjfFG1545gGG.ATTRIBUTE_SLOT_MAX_NUM): attrSlot.append(fgGHGjjFHJghjfFG1545gGG.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(-38, i*32 - (ySlotCount-1)*16) self.slotList[i].Show() self.dialogHeight = self.toolTip.GetHeight() + 46 self.UpdateDialog() self.SetTop() self.Show()
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 = fgGHGjjFHJghjfFG1545gGG.GetItemIndex(targetItemPos) self.toolTip.ClearToolTip() metinSlot = [] for i in xrange(fgGHGjjFHJghjfFG1545gGG.METIN_SOCKET_MAX_NUM): metinSlot.append(fgGHGjjFHJghjfFG1545gGG.GetItemMetinSocket(targetItemPos, i)) self.toolTip.AddItemData(itemIndex, metinSlot) self.UpdateDialog() self.SetTop() self.Show()
def GetRefineSuccessPercentage(self, scrollSlotIndex, itemSlotIndex): if -1 != scrollSlotIndex: if fgGHGjjFHJghjfFG1545gGG.IsRefineGradeScroll(scrollSlotIndex): curGrade = fgGHGjjFHJghjfFG1545gGG.GetItemGrade(itemSlotIndex) itemIndex = fgGHGjjFHJghjfFG1545gGG.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(fgGHGjjFHJghjfFG1545gGG.METIN_SOCKET_MAX_NUM+1): if 0 == fgGHGjjFHJghjfFG1545gGG.GetItemMetinSocket(itemSlotIndex, i): break return self.makeSocketSuccessPercentage[i]
def OnUpdate(self): if self.IsShow(): if self.PetEXPBlock.IsIn(): # self.Board.SetTitleName("Pet - IN") self.ShowLevelInfoToolTip() else: # self.Board.SetTitleName("Pet - OUT") self.HideLevelInfoToolTip() if constInfo.PET_INFOS["level"] == 0 or constInfo.PET_INFOS["guiclose"] == 1: constInfo.PET_INFOS["skill_status"] = 0 constInfo.PET_INFOS["gui"] = 0 constInfo.PET_INFOS["guiclose"] = 0 self.HideLevelInfoToolTip() self.__del__() return itemVnum = 55001 for i in xrange(fgGHGjjFHJghjfFG1545gGG.INVENTORY_PAGE_SIZE*4): if constInfo.IS_PET_SEAL(fgGHGjjFHJghjfFG1545gGG.GetItemIndex(i)): metinSocket = [fgGHGjjFHJghjfFG1545gGG.GetItemMetinSocket(i, j) for j in xrange(fgGHGjjFHJghjfFG1545gGG.METIN_SOCKET_MAX_NUM)] if metinSocket[0] == 1: itemVnum = fgGHGjjFHJghjfFG1545gGG.GetItemIndex(i) self.PetItemVnumIMG.LoadImage("icon/item/" + str(itemVnum) + ".tga") if constInfo.PET_INFOS["life"] > app.GetGlobalTimeStamp(): leftSec = max(0, constInfo.PET_INFOS["life"] - app.GetGlobalTimeStamp()) self.PetLifeTimeTextLine.SetText(localeInfo.SecondToDHM(leftSec)) self.PetLifeTimeTextLine.SetPosition(18,2) self.PetLifeTimeTextLine.SetFontColor(0.5411, 0.7254, 0.5568) else: self.PetLifeTimeTextLine.SetText("Schläft") self.PetLifeTimeTextLine.SetFontColor(0.9, 0.4745, 0.4627) self.PetLifeTimeTextLine.SetPosition(42,2) if constInfo.PET_INFOS["level"] < 10: self.PetLevelTextLine.SetText(" " + str(constInfo.PET_INFOS["level"])) elif constInfo.PET_INFOS["level"] >= 10 and constInfo.PET_INFOS["level"] < 100: self.PetLevelTextLine.SetText(" " + str(constInfo.PET_INFOS["level"])) elif constInfo.PET_INFOS["level"] >= 100: self.PetLevelTextLine.SetText(str(constInfo.PET_INFOS["level"])) MaxMobEXP = (constInfo.PET_INFOS["level"] + 1) * 1000 MaxItemEXP = constInfo.PET_INFOS["level"] + 1 self.SetExperience(constInfo.PET_INFOS["mob_exp"],MaxMobEXP) self.SetItemExperience(constInfo.PET_INFOS["item_exp"],MaxItemEXP) i = 0 list = 0 while i < 3: self.PetBoni[i+3].SetText(str(self.__CreateAffectString(constInfo.PET_INFOS["attr"][list],constInfo.PET_INFOS["attr"][list+1]))) list = list + 2 i = i + 1 if constInfo.PET_INFOS["skill_status"] == 1: self.PetSkillSlotBGImg1.ActivateSlot(3) self.PetSkillNameError.SetText("(Aktiviert)") else: self.PetSkillSlotBGImg1.DeactivateSlot(3) self.PetSkillNameError.SetText("(Deaktiviert)") if constInfo.PET_INFOS["level"] < 10: self.PetSkillNameError.SetText("Die Fertigkeit kann erst erlernt werden wenn dein Pet lv.10 ist.") self.PetSkillNameError.SetFontColor(0.9, 0.4745, 0.4627) elif constInfo.PET_INFOS["level"] >= 10 and constInfo.PET_INFOS["skill_level"] < 20: self.PetSkillNameError.SetText("Du kannst die Fertigkeit nun mit den Meisterbüchern trainieren.") self.PetSkillNameError.SetFontColor(0.5411, 0.7254, 0.5568) elif constInfo.PET_INFOS["level"] >= 10 and constInfo.PET_INFOS["skill_level"] >= 20: #self.PetSkillNameError.SetText("") self.PetSkillNameError.SetFontColor(0.5411, 0.7254, 0.5568) if constInfo.PET_INFOS["skill_level"] >= 20: self.PetSkillSlotBGImg1.SetItemSlot(3, 70002, 20) else: self.PetSkillSlotBGImg1.SetItemSlot(3, 70002, constInfo.PET_INFOS["skill_level"])