BtWQuestsDatabase:AddChain(BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_LIGHTFORGED_DRAENEI, {
    name = "Lightforged Draenei",
    category = BTWQUESTS_CATEGORY_LEGION_ALLIED_RACES,
    expansion = BTWQUESTS_EXPANSION_LEGION,
    restrictions = {
        {
            type = "faction",
            id = BTWQUESTS_FACTION_ID_ALLIANCE,
        },
    },
    prerequisites = {
        {
            type = "expansion",
            expansion = BTWQUESTS_EXPANSION_BATTLE_FOR_AZEROTH,
        },
        {
            type = "achievement",
            id = 12066,
            anyone = true,
        },
        {
            type = "achievement",
            id = 12081,
            name = {
                type = "reputation",
                id = 2165,
                standing = 8,
            },
            anyone = true,
        },
    },
    completed = {
        type = "achievement",
        id = 12243,
        anyone = true,
    },
    range = {110},
    items = {
        {
            type = "quest",
            id = 49698,
            x = 3,
            y = 0,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 49266,
            x = 3,
            y = 1,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 50071,
            x = 3,
            y = 2,
        },
    },
})
BtWQuestsDatabase:AddChain(BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_VOID_ELF, {
    name = "Void Elf",
    category = BTWQUESTS_CATEGORY_LEGION_ALLIED_RACES,
    expansion = BTWQUESTS_EXPANSION_LEGION,
    restrictions = {
        {
            type = "faction",
            id = BTWQUESTS_FACTION_ID_ALLIANCE,
        },
    },
    prerequisites = {
        {
            type = "expansion",
            expansion = BTWQUESTS_EXPANSION_BATTLE_FOR_AZEROTH,
        },
        {
            type = "achievement",
            id = 12066,
            anyone = true,
        },
        {
            type = "achievement",
            id = 12076,
            name = {
                type = "reputation",
                id = 2170,
                standing = 8,
            },
            anyone = true,
        },
    },
    completed = {
        type = "achievement",
        id = 12242,
        anyone = true,
    },
    range = {110},
    items = {
        {
            type = "quest",
            id = 49787,
            x = 3,
            y = 0,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48962,
            x = 3,
            y = 1,
        },
    },
})
BtWQuestsDatabase:AddChain(BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_NIGHTBORNE, {
    name = "Nightborne",
    category = BTWQUESTS_CATEGORY_LEGION_ALLIED_RACES,
    expansion = BTWQUESTS_EXPANSION_LEGION,
    restrictions = {
        {
            type = "faction",
            id = BTWQUESTS_FACTION_ID_HORDE,
        },
    },
    prerequisites = {
        {
            type = "expansion",
            expansion = BTWQUESTS_EXPANSION_BATTLE_FOR_AZEROTH,
        },
        {
            type = "achievement",
            id = 11340,
            anyone = true,
        },
        {
            type = "achievement",
            id = 10778,
            name = {
                type = "reputation",
                id = 1859,
                standing = 8,
            },
            anyone = true,
        },
    },
    completed = {
        type = "achievement",
        id = 12244,
        anyone = true,
    },
    range = {110},
    items = {
        {
            type = "quest",
            id = 49973,
            x = 3,
            y = 0,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 49613,
            x = 3,
            y = 1,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 49354,
            x = 3,
            y = 2,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 49614,
            x = 3,
            y = 3,
        },
    },
})
BtWQuestsDatabase:AddChain(BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_HIGHMOUNTAIN_TAUREN, {
    name = "Highmountain Tauren",
    category = BTWQUESTS_CATEGORY_LEGION_ALLIED_RACES,
    expansion = BTWQUESTS_EXPANSION_LEGION,
    restrictions = {
        {
            type = "faction",
            id = BTWQUESTS_FACTION_ID_HORDE,
        },
    },
    prerequisites = {
        {
            type = "expansion",
            expansion = BTWQUESTS_EXPANSION_BATTLE_FOR_AZEROTH,
        },
        {
            type = "achievement",
            id = 10059,
            anyone = true,
        },
        {
            type = "achievement",
            id = 12292,
            name = {
                type = "reputation",
                id = 1828,
                standing = 8,
            },
            anyone = true,
        },
    },
    completed = {
        type = "achievement",
        id = 12245,
        anyone = true,
    },
    range = {110},
    items = {
        {
            type = "quest",
            id = 48066,
            x = 3,
            y = 0,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48067,
            x = 3,
            y = 1,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 49756,
            x = 3,
            y = 2,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48079,
            x = 3,
            y = 3,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41884,
            x = 3,
            y = 4,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41764,
            x = 3,
            y = 5,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48185,
            x = 3,
            y = 6,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41799,
            x = 3,
            y = 7,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48190,
            x = 3,
            y = 8,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41800,
            x = 3,
            y = 9,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48434,
            x = 3,
            y = 10,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41815,
            x = 3,
            y = 11,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41840,
            x = 3,
            y = 12,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 41841,
            x = 3,
            y = 13,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48403,
            x = 3,
            y = 14,
            connections = {
                1
            },
        },
        {
            type = "quest",
            id = 48433,
            x = 3,
            y = 15,
        },
    },
})

BtWQuestsDatabase:AddCategory(BTWQUESTS_CATEGORY_LEGION_ALLIED_RACES, {
    name = "Allied Races",
    expansion = BTWQUESTS_EXPANSION_LEGION,
    items = {
        {
            type = "chain",
            id = BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_LIGHTFORGED_DRAENEI,
        },
        {
            type = "chain",
            id = BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_VOID_ELF,
        },
        {
            type = "chain",
            id = BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_NIGHTBORNE,
        },
        {
            type = "chain",
            id = BTWQUESTS_CHAIN_LEGION_ALLIED_RACES_HIGHMOUNTAIN_TAUREN,
        },
    },
})

BtWQuestsDatabase:AddExpansionItem(BTWQUESTS_EXPANSION_LEGION, {
    type = "category",
    id = BTWQUESTS_CATEGORY_LEGION_ALLIED_RACES,
})
