def __LoadInformation_Default(self, race): self.AppendSeperator() self.AppendTextLine(locale.TARGET_INFO_MAX_HP % str(nonplayer.GetMonsterMaxHP(race))) # calc att damage monsterLevel = nonplayer.GetMonsterLevel(race) fHitRate = self.__LoadInformation_Default_GetHitRate(race) iDamMin, iDamMax = nonplayer.GetMonsterDamage(race) iDamMin = int((iDamMin + nonplayer.GetMonsterST(race)) * 2 * fHitRate) + monsterLevel * 2 iDamMax = int((iDamMax + nonplayer.GetMonsterST(race)) * 2 * fHitRate) + monsterLevel * 2 iDef = player.GetStatus(player.DEF_GRADE) * ( 100 + player.GetStatus(player.DEF_BONUS)) / 100 fDamMulti = nonplayer.GetMonsterDamageMultiply(race) iDamMin = int(max(0, iDamMin - iDef) * fDamMulti) iDamMax = int(max(0, iDamMax - iDef) * fDamMulti) if iDamMin < 1: iDamMin = 1 if iDamMax < 5: iDamMax = 5 self.AppendTextLine(locale.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax))) idx = min( len(self.EXP_BASE_LVDELTA) - 1, max(0, (monsterLevel + 15) - player.GetStatus(player.LEVEL))) iExp = nonplayer.GetMonsterExp( race) * self.EXP_BASE_LVDELTA[idx] / 100 self.AppendTextLine(locale.TARGET_INFO_EXP % str(iExp))
def __GetTotalMagAtkText(self): minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP) maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP) if minMagAtk==maxMagAtk: return "%d" % (minMagAtk) else: return "%d-%d" % (minMagAtk, maxMagAtk)
def __GetTotalAtkText(self): minAtk=player.GetStatus(player.ATT_MIN) maxAtk=player.GetStatus(player.ATT_MAX) atkBonus=player.GetStatus(player.ATT_BONUS) attackerBonus=player.GetStatus(player.ATTACKER_BONUS) if minAtk==maxAtk: return "%d" % (minAtk+atkBonus+attackerBonus) else: return "%d-%d" % (minAtk+atkBonus+attackerBonus, maxAtk+atkBonus+attackerBonus)
def CheckUsePotions(self): val, self.timerPots = OpenLib.timeSleep(self.timerPots, self.TIME_POTS) if val: if self.redPotions and (float(player.GetStatus(player.HP)) / (float(player.GetStatus(player.MAX_HP))) * 100) < int(self.minHealth): OpenLib.UseAnyItemByID(self.RED_POTIONS_IDS) if self.bluePotions and (float(player.GetStatus(player.SP)) / (float(player.GetStatus(player.MAX_SP))) * 100) < int(self.minMana): OpenLib.UseAnyItemByID(self.BLUE_POTIONS_IDS)
def __LoadInformation_Default_GetHitRate(self, race): attacker_dx = nonplayer.GetMonsterDX(race) attacker_level = nonplayer.GetMonsterLevel(race) self_dx = player.GetStatus(player.DX) self_level = player.GetStatus(player.LEVEL) iARSrc = min(90, (attacker_dx * 4 + attacker_level * 2) / 6) iERSrc = min(90, (self_dx * 4 + self_level * 2) / 6) fAR = (float(iARSrc) + 210.0) / 300.0 fER = (float(iERSrc) * 2 + 5) / (float(iERSrc) + 95) * 3.0 / 10.0 return fAR - fER
def RefreshSkillPlusPointLabel(self): if self.isLoaded==0: return if self.PAGE_HORSE == self.curSelectedSkillGroup: activeStatPoint = player.GetStatus(player.SKILL_HORSE) self.activeSkillPointValue.SetText(str(activeStatPoint)) else: activeStatPoint = player.GetStatus(player.SKILL_ACTIVE) self.activeSkillPointValue.SetText(str(activeStatPoint)) supportStatPoint = max(0, player.GetStatus(player.SKILL_SUPPORT)) self.supportSkillPointValue.SetText(str(supportStatPoint))
def __CheckPvPProtectedLevelPlayer(self): if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL: self.__SetPeacePKMode() chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL)) return 1 return 0
def CheckChangeLocation(self): currLevel = player.GetStatus(player.LEVEL) resultLoc = 0 for loc in self.locations: if loc.level > currLevel: continue if resultLoc == 0: resultLoc = loc continue if loc.level > resultLoc.level: resultLoc = loc if resultLoc != 0 and ( int(resultLoc.locationX) != int(self.startPosition[0]) or int(resultLoc.locationY) != int(self.startPosition[1]) or background.GetCurrentMapName() != resultLoc.map): chat.AppendChat( 3, "Going to " + str(resultLoc.map) + " X:" + str(resultLoc.locationX) + " Y:" + str(resultLoc.locationY)) self.SetStateWait() Movement.GoToPositionAvoidingObjects( resultLoc.locationX, resultLoc.locationY, callback=self._PositionArriveCallback, mapName=resultLoc.map) self.startPosition = (resultLoc.locationX, resultLoc.locationY) return True return False
def RefreshLabel(self): self.ScollPos = int(self.ScrollBar.GetPos() * self.Diff) self.LabelLineCount = 0 self.startline_endlinecount = 0 for i in xrange(self.UI_MAX_COUNT): idx = i + self.ScollPos if idx < len(self.InfoList): text = self.InfoList[idx][self.INFO_TEXT] type = self.InfoList[idx][self.INFO_VALUE] if type == self.CATEGORY_STARTLINE: self.__LabelTitleLine(i + self.LabelLineCount, text) self.startline_endlinecount += 1 elif type == self.CATEGORY_ENDLINE: self.__EmptyLine(i + self.LabelLineCount) self.startline_endlinecount += 1 else: value = player.GetStatus(type) self.__LabelLine(i + self.LabelLineCount, text, value) if i + self.LabelLineCount < self.UI_MAX_COUNT: self.labelTextList[i + self.LabelLineCount].SetOverEvent( ui.__mem_func__( self.__ButtonOverIn), self.LabelLineCount + self.startline_endlinecount) self.labelTextList[ i + self.LabelLineCount].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), self.LabelLineCount + self.startline_endlinecount) self.LabelLineCount += 1 else: self.__EmptyLine(i + self.LabelLineCount)
def RefreshRankingBoard(self): self.AllClear() self.PageControl() for line, ResultSlotList in self.ResultSlotList.items(): linewpage = line + self.NowStartLineNumber + ( self.Page - 1) * ranking.RANK_SHOW_COUNT if linewpage >= ranking.GetRankCount(): break (name, level, job, empire, guild) = ranking.GetRankByLine(linewpage) ResultSlotList[self.SLOT_RANKING].SetText(str(linewpage + 1)) ResultSlotList[self.SLOT_NAME].SetText(name) ResultSlotList[self.SLOT_LEVEL].SetText(str(level)) ResultSlotList[self.SLOT_GUILD_NAME].SetText(guild) self.ResultButtonList[line].Show() if player.GetName() == name: self.ResultButtonList[line].Down() self.MyResultSlotList[self.SLOT_NAME].SetText(player.GetName()) self.MyResultSlotList[self.SLOT_LEVEL].SetText( str(player.GetStatus(player.LEVEL))) if player.GetGuildID(): self.MyResultSlotList[self.SLOT_GUILD_NAME].SetText( player.GetGuildName()) MyRank = ranking.GetRankMyLine() if MyRank: self.MyResultSlotList[self.SLOT_RANKING].SetText(str(MyRank)) self.ScrollBar.SetMiddleBarSize( float(self.MAX_LINE_COUNT) / float(self.CheckNowItemCount()))
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 GhostMod(self): if player.GetStatus(player.HP) < 1: chr.Revive() else: chat.AppendChat( 7, "[OpenBot-Mod] You have to die and than you can restart in the Ghost-Mod!" )
def RefreshGauge(self): self.curHP = player.GetStatus(player.HP) self.maxHP = player.GetStatus(player.MAX_HP) self.SetPercentage(self.curHP, self.maxHP) if self.showAlways: self.Show() else: if self.IsShow(): if self.curHP > self.maxHP / 2: self.Hide() else: if self.curHP < self.maxHP / 2: self.OnUpdate() self.Show()
def checkReviveAndLogin(self): val, self.timerDead = OpenLib.timeSleep(self.timerDead, self.TIME_DEAD) if not val: return if self.restartHere and player.GetStatus(player.HP) <= 0: OpenLib.Revive() if self.autoLogin and OpenLib.GetCurrentPhase() == OpenLib.PHASE_LOGIN: net.DirectEnter(0, 0)
def RefreshStatus(self): curHP = player.GetStatus(player.HP) maxHP = player.GetStatus(player.MAX_HP) curSP = player.GetStatus(player.SP) maxSP = player.GetStatus(player.MAX_SP) curEXP = unsigned32(player.GetStatus(player.EXP)) nextEXP = unsigned32(player.GetStatus(player.NEXT_EXP)) recoveryHP = player.GetStatus(player.HP_RECOVERY) recoverySP = player.GetStatus(player.SP_RECOVERY) self.RefreshStamina() self.SetHP(curHP, recoveryHP, maxHP) self.SetSP(curSP, recoverySP, maxSP) self.SetExperience(curEXP, nextEXP)
def __RefreshStatusPlusButtonList(self): if self.isLoaded==0: return statusPlusPoint=player.GetStatus(player.STAT) if statusPlusPoint>0: self.statusPlusValue.SetText(str(statusPlusPoint)) self.statusPlusLabel.Show() self.ShowStatusPlusButtonList() else: self.statusPlusValue.SetText(str(0)) self.statusPlusLabel.Hide() self.HideStatusPlusButtonList()
def __SetJobText(self, mainJob, subJob): if player.GetStatus(player.LEVEL)<5: subJob=0 if 949 == app.GetDefaultCodePage(): self.toolTipJob.ClearToolTip() try: jobInfoTitle=localeInfo.JOBINFO_TITLE[mainJob][subJob] jobInfoData=localeInfo.JOBINFO_DATA_LIST[mainJob][subJob] except IndexError: print "uiCharacter.CharacterWindow.__SetJobText(mainJob=%d, subJob=%d)" % (mainJob, subJob) return self.toolTipJob.AutoAppendTextLine(jobInfoTitle) self.toolTipJob.AppendSpace(5) for jobInfoDataLine in jobInfoData: self.toolTipJob.AutoAppendTextLine(jobInfoDataLine) self.toolTipJob.AlignHorizonalCenter()
def CheckGameButton(self): if not self.IsShow(): return statusPlusButton = self.gameButtonDict["STATUS"] skillPlusButton = self.gameButtonDict["SKILL"] helpButton = self.gameButtonDict["HELP"] if player.GetStatus(player.STAT) > 0: statusPlusButton.Show() else: statusPlusButton.Hide() if self.__IsSkillStat(): skillPlusButton.Show() else: skillPlusButton.Hide() if 0 == player.GetPlayTime(): helpButton.Show() else: helpButton.Hide()
def __IsSkillStat(self): if player.GetStatus(player.SKILL_ACTIVE) > 0: return True return False
def __GetStatMinusPoint(self): POINT_STAT_RESET_COUNT = 112 return player.GetStatus(POINT_STAT_RESET_COUNT)
def RefreshStatus(self): if self.isLoaded==0: return try: self.GetChild("Level_Value").SetText(str(player.GetStatus(player.LEVEL))) self.GetChild("Exp_Value").SetText(str(unsigned32(player.GetEXP()))) self.GetChild("RestExp_Value").SetText(str(unsigned32(player.GetStatus(player.NEXT_EXP)) - unsigned32(player.GetStatus(player.EXP)))) self.GetChild("HP_Value").SetText(str(player.GetStatus(player.HP)) + '/' + str(player.GetStatus(player.MAX_HP))) self.GetChild("SP_Value").SetText(str(player.GetStatus(player.SP)) + '/' + str(player.GetStatus(player.MAX_SP))) self.GetChild("STR_Value").SetText(str(player.GetStatus(player.ST))) self.GetChild("DEX_Value").SetText(str(player.GetStatus(player.DX))) self.GetChild("HTH_Value").SetText(str(player.GetStatus(player.HT))) self.GetChild("INT_Value").SetText(str(player.GetStatus(player.IQ))) self.GetChild("ATT_Value").SetText(self.__GetTotalAtkText()) self.GetChild("DEF_Value").SetText(self.__GetTotalDefText()) self.GetChild("MATT_Value").SetText(self.__GetTotalMagAtkText()) #self.GetChild("MATT_Value").SetText(str(player.GetStatus(player.MAG_ATT))) self.GetChild("MDEF_Value").SetText(str(player.GetStatus(player.MAG_DEF))) self.GetChild("ASPD_Value").SetText(str(player.GetStatus(player.ATT_SPEED))) self.GetChild("MSPD_Value").SetText(str(player.GetStatus(player.MOVING_SPEED))) self.GetChild("CSPD_Value").SetText(str(player.GetStatus(player.CASTING_SPEED))) self.GetChild("ER_Value").SetText(str(player.GetStatus(player.EVADE_RATE))) except: #import exception #exception.Abort("CharacterWindow.RefreshStatus.BindObject") ## 게임이 튕겨 버림 pass self.__RefreshStatusPlusButtonList() self.__RefreshStatusMinusButtonList() self.RefreshAlignment() if self.refreshToolTip: self.refreshToolTip()
def __GetTotalDefText(self): defValue=player.GetStatus(player.DEF_GRADE) if constInfo.ADD_DEF_BONUS_ENABLE: defValue+=player.GetStatus(player.DEF_BONUS) return "%d" % (defValue)
def __IsSkillStat(self): if player.GetStatus(player.SKILL_ACTIVE) > 0: return TRUE return FALSE
def RefreshStamina(self): curST = player.GetStatus(player.STAMINA) maxST = player.GetStatus(player.MAX_STAMINA) self.SetST(curST, maxST)
########################################################### # WikiBoard by .Kori # ########################################################### import player import app lastupdate = 0 Funkton = 0 VIP = 0 Wiki1 = [] Wiki1.append("Name:" + " " + player.GetName() + "#") Wiki1.append("Level:" + str(player.GetStatus(player.LEVEL)) + "#") Wiki1.append("Aktuelle Spielzeit:" + " " + str(player.GetPlayTime()) + "" + "Minuten#") News = [] News.append("Last Update: 24.06.2014#") News.append("Login-Interface Fertiggestellt#") News.append("Character-Select Fertiggestellt#") News.append("Neue Items Eingefügt: Biologen Items#") News.append(" Waffen & Rüstungen#") News.append("#") News.append("#") News.append("Mit Freundlichen Grüßen das Age of Platon Team.#")
def RefreshStatus(self): pointEnergy = player.GetStatus (player.ENERGY) leftTimeEnergy = player.GetStatus (player.ENERGY_END_TIME) - app.GetGlobalTimeStamp() # 충기환 지속 시간 = 2시간. self.SetEnergy (pointEnergy, leftTimeEnergy, 7200)