Пример #1
0
def readTitletool(file):
    data = []
    with open(file, "rb") as f:
        br = BinaryReader(f)
        dataCount = br.ReadInt()

        for i in range(dataCount):
            data.append({
                "id": br.ReadInt(),
                "enable": br.ByteToInt(br.ReadByte()),
                "effect": {
                    "normal": br.ReadBytesToString(64, 'latin1'),
                    "attack": br.ReadBytesToString(64, 'latin1'),
                    "damage": br.ReadBytesToString(64, 'latin1')
                },
                "color": {
                    "text": "{:08x}".format(br.ReadInt()),
                    "background": "{:08x}".format(br.ReadInt()),
                },
                "option": {
                    "id":
                    br.ReadIntToList(5),
                    "level": [
                        br.ByteToInt(br.ReadByte()),
                        br.ByteToInt(br.ReadByte()),
                        br.ByteToInt(br.ReadByte()),
                        br.ByteToInt(br.ReadByte()),
                        br.ByteToInt(br.ReadByte())
                    ]
                },
                "itemId": br.ReadInt()
            })

    return data
Пример #2
0
def readNotice(file):
    data = []
    with open(file, "rb") as f:
        br = BinaryReader(f)
        dataCount = br.ReadInt()

        for i in range(dataCount):
            data.append({
                "id":
                br.ReadInt(),
                "enabled":
                br.ReadInt(),
                "title":
                br.ReadString('latin1'),
                "message":
                br.ReadString('latin1'),
                "time": {
                    "start": br.ReadString('latin1'),
                    "end": br.ReadString('latin1')
                },
                "cycle":
                br.ReadInt(),
                "color": [
                    br.ByteToInt(br.ReadByte()),
                    br.ByteToInt(br.ReadByte()),
                    br.ByteToInt(br.ReadByte()),
                    br.ByteToInt(br.ReadByte())
                ]
            })

    return data
Пример #3
0
def readAction(file):
    data = []
    with open(file, "rb") as f:
        br = BinaryReader(f)
        dataCount = br.ReadInt()

        for i in range(dataCount):
            data.append({
                "id": br.ReadInt(),
                "type": br.ByteToInt(br.ReadByte()),
                "job": br.ReadInt(),
                "iconPosition": br.ReadIntToList(3)
            })

    return data
Пример #4
0
def readCombo(file):
    data = []
    with open(file, "rb") as f:
        br = BinaryReader(f)
        dataCount = br.ReadInt()

        for i in range(dataCount):
            data.append({
                "id": br.ReadInt(),
                "gold": br.ReadInt(),
                "iconPosition": br.ReadIntToList(3),
                "skill": br.ByteToInt(br.ReadByte()),
                "point": br.ReadInt()
            })

    return data
Пример #5
0
def readMob(file):
    DEF_SMC_LENGTH = 128
    DEF_ANI_LENGTH = 64

    data = []
    with open(file, "rb") as f:
        br = BinaryReader(f)
        dataCount = br.ReadInt()

        for i in range(dataCount):
            data.append({
                "npcId": br.ReadInt(),
                "level": br.ReadInt(),
                "health": br.ReadInt(),
                "mana": br.ReadInt(),
                "flag": br.ReadInt(),
                "flag1": br.ReadInt(),
                "speed": {
                    "attack": br.ReadInt(),
                    "walk": br.ReadFloat(),
                    "run": br.ReadFloat(),
                },
                "scale": br.ReadFloat(),
                "attackArea": br.ReadFloat(),
                "size": br.ReadFloat(),
                "master": {
                    "skill": br.ByteToInt(br.ReadByte()),
                    "specialSkill": br.ByteToInt(br.ReadByte())
                },
                "skillEffect": br.ReadIntToList(5),
                "attackType": br.ByteToInt(br.ReadByte()),
                "fire": {
                    "delayCount": br.ByteToInt(br.ReadByte()),
                    "delay": br.ReadFloatToList(4),
                    "object": br.ByteToInt(br.ReadByte()),
                    "speed": br.ReadFloat()
                },
                "skill": {
                    "skill0": [br.ReadInt(),
                               br.ByteToInt(br.ReadByte())],
                    "skill1": [br.ReadInt(),
                               br.ByteToInt(br.ReadByte())]
                },
                "rvr": {
                    "grade": br.ReadInt(),
                    "value": br.ReadInt()
                },
                "bound": br.ReadFloat(),
                "model": {
                    "smc": br.ReadBytesToString(DEF_SMC_LENGTH, 'latin1'),
                    "animation": {
                        "idle": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                        "walk": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                        "damage": br.ReadBytesToString(DEF_ANI_LENGTH,
                                                       'latin1'),
                        "attack": br.ReadBytesToString(DEF_ANI_LENGTH,
                                                       'latin1'),
                        "die": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                        "run": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                        "idle2": br.ReadBytesToString(DEF_ANI_LENGTH,
                                                      'latin1'),
                        "attack2":
                        br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                    },
                },
                "fireEffect": {
                    "0": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                    "1": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1'),
                    "2": br.ReadBytesToString(DEF_ANI_LENGTH, 'latin1')
                }
            })

    return data
Пример #6
0
def readItem(file, isGamigo):
    MAX_MAKE_ITEM_MATERIAL = 10
    DEF_SMC_DEFAULT_LENGTH = 64
    DEF_MAX_ORIGIN_OPTION = 10
    DEF_EFFECT_DEFAULT_LENGTH = 32

    data = []
    with open(file, "rb") as f:
        br = BinaryReader(f)
        dataCount = br.ReadInt()

        for i in range(dataCount):
            data.append({
                "itemId":
                br.ReadInt(),
                "jobFlag":
                br.ReadInt(),
                "stack":
                br.ReadInt(),
                "fame/maxuse":
                br.ReadInt(),
                "level":
                br.ReadInt(),
                "flag":
                br.ReadInt64(),
                "wearing":
                br.ReadInt(),
                "type":
                br.ReadInt(),
                "subtype":
                br.ReadInt(),
                "crafting": {
                    "needItemId": br.ReadIntToList(MAX_MAKE_ITEM_MATERIAL),
                    "needItemCount": br.ReadIntToList(MAX_MAKE_ITEM_MATERIAL)
                },
                "specialSkill": {
                    "needSpecialSkill1": br.ReadIntToList(2),
                    "needSpecialSkill2": br.ReadIntToList(2),
                },
                "iconPosition":
                br.ReadIntToList(3),
                "num":
                br.ReadIntToList(4),
                "price":
                br.ReadInt(),
                "set":
                br.ReadIntToList(7 if isGamigo else 5),
                "smc":
                br.ReadBytesToString(DEF_SMC_DEFAULT_LENGTH, 'latin1'),
                "effect": {
                    "normal":
                    br.ReadBytesToString(DEF_EFFECT_DEFAULT_LENGTH, 'latin1'),
                    "attack":
                    br.ReadBytesToString(DEF_EFFECT_DEFAULT_LENGTH, 'latin1'),
                    "damage":
                    br.ReadBytesToString(DEF_EFFECT_DEFAULT_LENGTH, 'latin1')
                },
                "rareOption": {
                    "id": br.ReadInt(),
                    "chance": br.ReadInt(),
                    "optionIds": br.ReadIntToList(DEF_MAX_ORIGIN_OPTION),
                    "optionLevels": br.ReadIntToList(DEF_MAX_ORIGIN_OPTION)
                },
                "rvr": {
                    "type": br.ReadInt(),
                    "grade": br.ReadInt()
                },
                "fortuneId":
                br.ByteToInt(br.ReadByte()),
                "castleWar":
                br.ReadInt()
            })

    return data