X-Git-Url: https://git.xangelo.ca/?p=sketchy-heroes.git;a=blobdiff_plain;f=prisma%2Fseed%2Fequipment.ts;fp=prisma%2Fseed%2Fequipment.ts;h=15c00917bcce430f068c51b9020a1473bcf053ac;hp=0000000000000000000000000000000000000000;hb=b5d3cc37fddebff8dcdf1ef0cdd3a626811f14d3;hpb=20dc560a75cfd6ddc8a66956315a30001779ec24 diff --git a/prisma/seed/equipment.ts b/prisma/seed/equipment.ts new file mode 100644 index 0000000..15c0091 --- /dev/null +++ b/prisma/seed/equipment.ts @@ -0,0 +1,147 @@ +import { InventoryType, Rarity } from '@prisma/client'; +import {prisma} from '../../src/lib/db'; + +const equipmentDef = [ + { + name: 'Rusty Sword', + type: [InventoryType.R_ARM, InventoryType.L_ARM, InventoryType.WEAPON], + durability: 30, + minLevelDrop: 1, + rarityDropRates: [ + { + rarity: Rarity.COMMON, + weight: 0.9, + }, + { + rarity: Rarity.UNCOMMON, + weight: 0.1 + } + ], + statModifiers: { + stats: [ + { + name: 'pow', + min: 2, + max :5 + } + ], + required: ['pow'] + } + }, + { + name: 'Shortsword', + type: [InventoryType.L_ARM, InventoryType.R_ARM, InventoryType.WEAPON], + durability: 50, + minLevelDrop: 2, + rarityDropRates: [ + { + rarity: Rarity.COMMON, + weight: 0.8 + }, + { + rarity: Rarity.UNCOMMON, + weight: 0.2 + } + ], + statModifiers: { + stats: [ + { + name: 'pow', + min: 3, + max: 8 + } + ], + required: ['pow'] + } + }, + { + name: 'Polearm', + type: [InventoryType.BOTH_ARMS, InventoryType.WEAPON], + durability: 45, + minLevelDrop: 2, + rarityDropRates: [ + { + rarity: Rarity.COMMON, + weight: 0.8 + }, + { + rarity: Rarity.COMMON, + weight: 0.2 + } + ], + statModifiers: { + stats: [ + { + name: 'pow', + min: 3, + max: 5 + } + ], + required: ['pow'] + } + }, + { + name: 'Old Shirt', + type: [InventoryType.ARMOUR, InventoryType.TORSO], + durability: 20, + minLevelDrop: 1, + rarityDropRates: [ + { + rarity: Rarity.COMMON, + weight: 0.8, + }, + { + rarity: Rarity.UNCOMMON, + weight: 0.1 + } + ], + statModifiers: { + stats: [ + { + name: 'zest', + min: 1, + max: 3 + } + ], + required: ['zest'] + } + }, + { + name: 'Gloves', + type: [InventoryType.L_ARM, InventoryType.R_ARM, InventoryType.ARMOUR], + durability: 20, + minLevelDrop: 1, + rarityDropRates: [ + { + rarity: Rarity.COMMON, + weight: 0.8 + }, + { + rarity: Rarity.UNCOMMON, + weight: 0.1 + } + ], + statModifiers: { + stats: [ + { + name: 'zest', + min: 1, + max: 2 + } + ], + required: ['zest'] + } + } +]; + +export async function down() { + await prisma.inventory.deleteMany(); + await prisma.lootTable.deleteMany(); + await prisma.item.deleteMany(); +} + +export async function up() { + await prisma.item.createMany({ + data: equipmentDef + }); +}