Module:ShipCreatureData

From UO Outlands Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:ShipCreatureData/doc

local p = {
    ["Blood Daemon"] = {
        ["location"] = "Ships",
        ["difficulty"] = 157.7,
        ["goldvalue"] = 1577,
        ["hits"] = 8000,
        ["minmeleedmg"] = 50,
        ["maxmeleedmg"] = 60,
        ["wrestling"] = 110,
        ["armor"] = 25,
        ["magicresist"] = 100,
        ["magery"] = 100,
        ["minspelldmg"] = 20,
        ["maxspelldmg"] = 30,
        ["slayer"] = "Daemonic",
        ["ai"] = "MeleeMage",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.2,
    },
    ["Blood Feaster"] = {
        ["location"] = "Ships",
        ["difficulty"] = 92.7,
        ["goldvalue"] = 927,
        ["hits"] = 4500,
        ["minmeleedmg"] = 40,
        ["maxmeleedmg"] = 50,
        ["wrestling"] = 90,
        ["armor"] = 50,
        ["magicresist"] = 25,
        ["slayer"] = "Daemonic",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.4,
    },
    ["Bloody Hornbeast"] = {
        ["location"] = "Ships",
        ["difficulty"] = 60.1,
        ["goldvalue"] = 602,
        ["hits"] = 3500,
        ["minmeleedmg"] = 30,
        ["maxmeleedmg"] = 40,
        ["wrestling"] = 90,
        ["armor"] = 50,
        ["magicresist"] = 100,
        ["slayer"] = "Daemonic",
        ["ai"] = "Melee",
        ["speed"] = "VeryFast",
        ["uniquescalar"] = 1.2,
    },
    ["Drowned Dragon"] = {
        ["location"] = "Ships",
        ["difficulty"] = 66.2,
        ["goldvalue"] = 662,
        ["hits"] = 4000,
        ["minmeleedmg"] = 30,
        ["maxmeleedmg"] = 40,
        ["wrestling"] = 80,
        ["armor"] = 50,
        ["magicresist"] = 25,
        ["poisonresist"] = 0.6,
        ["slayer"] = "Undead",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.3,
    },
    ["Fungaloid"] = {
        ["location"] = "Ships",
        ["difficulty"] = 42.3,
        ["goldvalue"] = 423,
        ["hits"] = 3000,
        ["minmeleedmg"] = 20,
        ["maxmeleedmg"] = 30,
        ["wrestling"] = 80,
        ["armor"] = 25,
        ["magicresist"] = 25,
        ["poisonresist"] = 0.4,
        ["slayer"] = "Nature",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.25,
    },
    ["Hierarch"] = {
        ["location"] = "Ships",
        ["difficulty"] = 64.1,
        ["goldvalue"] = 641,
        ["hits"] = 2500,
        ["minmeleedmg"] = 20,
        ["maxmeleedmg"] = 30,
        ["wrestling"] = 90,
        ["armor"] = 25,
        ["magicresist"] = 150,
        ["magery"] = 100,
        ["minspelldmg"] = 20,
        ["maxspelldmg"] = 30,
        ["slayer"] = "Humanoid",
        ["ai"] = "Mage",
        ["speed"] = "Slow",
        ["uniquescalar"] = 1.3,
    },
    ["Jackal Spirit"] = {
        ["location"] = "Ships",
        ["difficulty"] = 59.3,
        ["goldvalue"] = 594,
        ["hits"] = 3500,
        ["minmeleedmg"] = 30,
        ["maxmeleedmg"] = 40,
        ["wrestling"] = 90,
        ["armor"] = 25,
        ["magicresist"] = 25,
        ["parry"] = 50,
        ["poisonresist"] = 0.6,
        ["slayer"] = "Undead",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.25,
    },
    ["Lichenid"] = {
        ["location"] = "Ships",
        ["difficulty"] = 81.7,
        ["goldvalue"] = 817,
        ["hits"] = 4000,
        ["minmeleedmg"] = 40,
        ["maxmeleedmg"] = 50,
        ["wrestling"] = 90,
        ["armor"] = 75,
        ["magicresist"] = 25,
        ["poisonresist"] = 0.4,
        ["slayer"] = "Nature",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.35,
    },
    ["Lizardman Elite Hunter"] = {
        ["location"] = "Ships",
        ["difficulty"] = 64.7,
        ["goldvalue"] = 647,
        ["hits"] = 4000,
        ["minmeleedmg"] = 35,
        ["maxmeleedmg"] = 45,
        ["wrestling"] = 90,
        ["armor"] = 50,
        ["magicresist"] = 25,
        ["slayer"] = "Monstrous",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.14,
    },
    ["Lizardman Elite Warrior"] = {
        ["location"] = "Ships",
        ["difficulty"] = 86.1,
        ["goldvalue"] = 861,
        ["hits"] = 4500,
        ["minmeleedmg"] = 40,
        ["maxmeleedmg"] = 50,
        ["wrestling"] = 90,
        ["armor"] = 50,
        ["magicresist"] = 25,
        ["slayer"] = "Monstrous",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.3,
    },
    ["Lizardman Warchief"] = {
        ["location"] = "Ships",
        ["difficulty"] = 160.7,
        ["goldvalue"] = 1607,
        ["hits"] = 8000,
        ["minmeleedmg"] = 50,
        ["maxmeleedmg"] = 60,
        ["wrestling"] = 100,
        ["armor"] = 50,
        ["magicresist"] = 25,
        ["slayer"] = "Monstrous",
        ["ai"] = "Melee",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.3,
    },
    ["Murkvine"] = {
        ["location"] = "Ships",
        ["difficulty"] = 47.1,
        ["hits"] = 5000,
        ["minmeleedmg"] = 20,
        ["maxmeleedmg"] = 30,
        ["wrestling"] = 150,
        ["armor"] = 25,
        ["magicresist"] = 25,
        ["slayer"] = "Monstrous",
        ["ai"] = "Melee",
        ["speed"] = "Slow",
        ["uniquescalar"] = 1,
    },
    ["Ossuarian Sightless Seer"] = {
        ["location"] = "Ships",
        ["difficulty"] = 138.8,
        ["goldvalue"] = 1388,
        ["hits"] = 5000,
        ["minmeleedmg"] = 20,
        ["maxmeleedmg"] = 30,
        ["wrestling"] = 90,
        ["armor"] = 25,
        ["magicresist"] = 100,
        ["magery"] = 125,
        ["minspelldmg"] = 25,
        ["maxspelldmg"] = 35,
        ["slayer"] = "Humanoid",
        ["ai"] = "Mage",
        ["speed"] = "Medium",
        ["uniquescalar"] = 1.35,
    },
    ["Sunken Sorcerer"] = {
        ["location"] = "Ships",
        ["difficulty"] = 123.6,
        ["goldvalue"] = 1236,
        ["hits"] = 5000,
        ["minmeleedmg"] = 20,
        ["maxmeleedmg"] = 30,
        ["wrestling"] = 100,
        ["armor"] = 25,
        ["magicresist"] = 100,
        ["magery"] = 125,
        ["minspelldmg"] = 25,
        ["maxspelldmg"] = 35,
        ["slayer"] = "Monstrous",
        ["ai"] = "Mage",
        ["speed"] = "Slow",
        ["uniquescalar"] = 1.2,
    },
}

-- Helper function to add comma's between numbers
function FormatInt(int)
    int = string.reverse(int)

    if string.len(int) > 3 and string.len(int) < 6 then
        int = string.gsub(int, "(%d%d%d)", "%1,")
    elseif string.len(int) == 6 then
        int = string.gsub(int, "(%d%d%d)(%d%d%d)", "%1,%2")
    elseif string.len(int) > 6 and string.len(int) < 9 then
        int = string.gsub(int, "(%d%d%d)(%d%d%d)", "%1,%2,")
    end

    int = string.reverse(int)

    return int
end

-- Fill out or format values
for index, creature in pairs(p) do
    local defaultStatArray = {
        ["location"] = "Ships",
        ["difficulty"] = "?",
        ["goldvalue"] = "?",
        ["hits"] = "?",
        ["minmeleedmg"] = "",
        ["maxmeleedmg"] = "",
        ["wrestling"] = "",
        ["armor"] = "",
        ["magicresist"] = "",
        ["parry"] = "",
        ["atkspd"] = "?",
        ["magery"] = "",
        ["minspelldmg"] = "",
        ["maxspelldmg"] = "",
        ["poisontype"] = "",
        ["poisoning"] = "",
        ["poisonresist"] = "",
        ["stealth"] = "",
        ["slayer"] = "?",
        ["ai"] = "?",
        ["speed"] = "?",
        ["uniquescalar"] = "?",
        ["bosstype"] = "",
        ["armormin"] = "",
        ["magicresistmin"] = "",
        ["poisonresistmin"] = "",
    }

    if type(creature.location) == "table" then
        local locations = ""
        for i, spawnLocation in pairs(creature.location) do
            if locations ~= "" then
                locations = locations .. "<br>"
            end

            locations = locations .. "[[" .. spawnLocation .. "]]"
        end
        creature.location = locations
    elseif type(creature.location) == "string" and creature.location ~= "?" then
        creature.location = "[[" .. creature.location .. "]]"
    end

    if type(creature.goldvalue) == "number" then
        creature.goldvalue = FormatInt(creature.goldvalue)
    end

    if type(creature.hits) == "number" then
        creature.unformattedhits = creature.hits
        creature.hits = FormatInt(creature.hits)
    end

    if creature.armormin then
        creature.armormin = "<br>(" .. creature.armormin .. " min)"
    end

    if creature.magicresistmin then
        creature.magicresistmin = "<br>(" .. creature.magicresistmin .. " min)"
    end

    if creature.poisonresistmin then
        creature.poisonresistmin = "<br>(" .. creature.poisonresistmin .. " min)"
    end

    if creature.poisonresist then
        creature.poisonresist = (creature.poisonresist * 100) .. "%"
    end

    if creature.specialresist then
        creature.specialresist = (creature.specialresist * 100) .. "%"
    end

    if creature.minmeleedmg and creature.minmeleedmg ~= creature.maxmeleedmg then
        creature.minmeleedmg = creature.minmeleedmg .. " - "
    elseif creature.minmeleedmg == creature.maxmeleedmg then
        creature.maxmeleedmg = ""
    end

    if creature.minspelldmg and creature.minspelldmg ~= creature.maxspelldmg then
        creature.minspelldmg = creature.minspelldmg .. " - "
    elseif creature.minspelldmg == creature.maxspelldmg then
        creature.maxspelldmg = ""
    end

    for stat, defaultValue in pairs(defaultStatArray) do
        if creature[stat] == nil then
            creature[stat] = defaultValue
        end
    end
end

return p