def GetPercentMP(): MaxMP = CVecObject.FindPlayerAttributeNumberValue_By_Key("max_mana") if MaxMP == 0: return 0 MP = CVecObject.FindPlayerAttributeNumberValue_By_Key("mana") return MP * 100 / MaxMP
def PrintItem(): CVecObject.FindPlayerAttributeNumberValue_By_Key("*") Vec = [] CVecObject.GetVecItemObject(Vec) for itm in Vec: Item = CItemObject(itm) Item.PrintToLog()
def GetPercentHP(): MaxHP = CVecObject.FindPlayerAttributeNumberValue_By_Key("max_life") if MaxHP == 0: return 0 HP = CVecObject.FindPlayerAttributeNumberValue_By_Key("life") return HP * 100 / MaxHP
def GetPercentDurability(this): MaxDurability = int( CVecObject.FindAttributeValue_By_Key(this.GetAttributeTreeHead(), "durability")) if MaxDurability == 0: return 0 CurDurability = int( CVecObject.FindAttributeValue_By_Key(this.GetAttributeTreeHead(), "max_durability")) return CurDurability * 100 / MaxDurability
def GetItemObject(ItemName): Vec = [] CVecObject.GetVecItemObject(Vec) for itm in Vec: Item = CItemObject(itm) if Item.GetName() == ItemName: return Item return None
def GetTreasureMapTask(): Vec = [] CVecObject.GetVecTaskObject(Vec) for itm in Vec: Obj = CTaskObject(itm) if Obj.IsTreasureMapTask(): return Obj return None
def GetCurrentMapName(): return CVecObject.FindPlayerAttributeTextValue_By_Key("map_name")
def GetTotalScore(): return CVecObject.FindPlayerAttributeNumberValue_By_Key("total_score")
def GetRawType(this): return CVecObject.FindAttributeValue_By_Key( this.GetAttributeTreeHead(), "raw_type")
def GetTaskType(this): return CVecObject.FindAttributeValue_By_Key( this.GetAttributeTreeHead(), "task_type")
def PrintToLog(this): PrintLog( "------------Task[{0:x}, TreeHead[{1:x}]]----------------".format( this.GetBase(), this.GetAttributeTreeHead())) CVecObject.FindAttributeValue_By_Key(this.GetAttributeTreeHead(), "*")
def GetItemUnique(this): return int( CVecObject.FindAttributeValue_By_Key(this.GetAttributeTreeHead(), "item_unique"))
def GetPos(this): return int( CVecObject.FindAttributeValue_By_Key(this.GetAttributeTreeHead(), "pos"))
def GetName(this): return CVecObject.FindAttributeValue_By_Key( this.GetAttributeTreeHead(), "name")
def GetCurrentPoint(): return [ CVecObject.FindPlayerAttributeNumberValue_By_Key("x"), CVecObject.FindPlayerAttributeNumberValue_By_Key("y") ]
def GetTaskPrompt(this): return CVecObject.FindAttributeValue_By_Key( this.GetAttributeTreeHead(), "task_prompt")
def GetId(): return CVecObject.FindPlayerAttributeNumberValue_By_Key("id")
def PrintToLog(this): PrintLog( "------------Item[{0:x}, Obj=[{1:x}] TreeHead[{2:x}]]----------------" .format(this.GetBase(), ReadDWORD(this.GetBase() + 0x10), this.GetAttributeTreeHead())) CVecObject.FindAttributeValue_By_Key(this.GetAttributeTreeHead(), "*")