Looooot!
This commit is contained in:
+1599
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,135 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SystemRevivalServer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class LootTables : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "dungeon_loot_tables",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Description = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MinTier = table.Column<int>(type: "int", nullable: false),
|
||||
MaxTier = table.Column<int>(type: "int", nullable: false),
|
||||
DropChanceMultiplier = table.Column<float>(type: "float", nullable: false),
|
||||
MinDrops = table.Column<int>(type: "int", nullable: false),
|
||||
MaxDrops = table.Column<int>(type: "int", nullable: false),
|
||||
GuaranteedDrop = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_dungeon_loot_tables", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "dungeon_loot_table_entries",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
LootTableId = table.Column<int>(type: "int", nullable: false),
|
||||
ItemDefinitionId = table.Column<int>(type: "int", nullable: false),
|
||||
DropChance = table.Column<float>(type: "float", nullable: false),
|
||||
MinQuantity = table.Column<int>(type: "int", nullable: false),
|
||||
MaxQuantity = table.Column<int>(type: "int", nullable: false),
|
||||
Weight = table.Column<int>(type: "int", nullable: false),
|
||||
Guaranteed = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
DropChancePerTier = table.Column<float>(type: "float", nullable: false),
|
||||
MaxDropChance = table.Column<float>(type: "float", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_dungeon_loot_table_entries", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_dungeon_loot_table_entries_dungeon_item_definitions_ItemDefi~",
|
||||
column: x => x.ItemDefinitionId,
|
||||
principalTable: "dungeon_item_definitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_dungeon_loot_table_entries_dungeon_loot_tables_LootTableId",
|
||||
column: x => x.LootTableId,
|
||||
principalTable: "dungeon_loot_tables",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "dungeon_mob_loot_tables",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
MobDefinitionId = table.Column<int>(type: "int", nullable: false),
|
||||
LootTableId = table.Column<int>(type: "int", nullable: false),
|
||||
Priority = table.Column<int>(type: "int", nullable: false),
|
||||
RollChance = table.Column<float>(type: "float", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_dungeon_mob_loot_tables", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_dungeon_mob_loot_tables_dungeon_loot_tables_LootTableId",
|
||||
column: x => x.LootTableId,
|
||||
principalTable: "dungeon_loot_tables",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_dungeon_mob_loot_tables_dungeon_mob_definitions_MobDefinitio~",
|
||||
column: x => x.MobDefinitionId,
|
||||
principalTable: "dungeon_mob_definitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_dungeon_loot_table_entries_ItemDefinitionId",
|
||||
table: "dungeon_loot_table_entries",
|
||||
column: "ItemDefinitionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_dungeon_loot_table_entries_LootTableId",
|
||||
table: "dungeon_loot_table_entries",
|
||||
column: "LootTableId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_dungeon_mob_loot_tables_LootTableId",
|
||||
table: "dungeon_mob_loot_tables",
|
||||
column: "LootTableId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_dungeon_mob_loot_tables_MobDefinitionId",
|
||||
table: "dungeon_mob_loot_tables",
|
||||
column: "MobDefinitionId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "dungeon_loot_table_entries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "dungeon_mob_loot_tables");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "dungeon_loot_tables");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -362,6 +362,94 @@ namespace SystemRevivalServer.Migrations
|
||||
b.ToTable("dungeon_learned_spells");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonLootTable", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("varchar(256)");
|
||||
|
||||
b.Property<float>("DropChanceMultiplier")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("GuaranteedDrop")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("MaxDrops")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MaxTier")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MinDrops")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MinTier")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("dungeon_loot_tables");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonLootTableEntry", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<float>("DropChance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<float>("DropChancePerTier")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("Guaranteed")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("ItemDefinitionId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LootTableId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<float>("MaxDropChance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("MaxQuantity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MinQuantity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Weight")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ItemDefinitionId");
|
||||
|
||||
b.HasIndex("LootTableId");
|
||||
|
||||
b.ToTable("dungeon_loot_table_entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonMobDefinition", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -506,6 +594,35 @@ namespace SystemRevivalServer.Migrations
|
||||
b.ToTable("dungeon_mob_definitions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonMobLootTable", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("LootTableId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("MobDefinitionId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Priority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<float>("RollChance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LootTableId");
|
||||
|
||||
b.HasIndex("MobDefinitionId");
|
||||
|
||||
b.ToTable("dungeon_mob_loot_tables");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonSpellDefinition", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1297,6 +1414,44 @@ namespace SystemRevivalServer.Migrations
|
||||
b.Navigation("Definition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonLootTableEntry", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Entities.DungeonItemDefinition", "ItemDefinition")
|
||||
.WithMany()
|
||||
.HasForeignKey("ItemDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Server.Data.Entities.DungeonLootTable", "LootTable")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("LootTableId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ItemDefinition");
|
||||
|
||||
b.Navigation("LootTable");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonMobLootTable", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Entities.DungeonLootTable", "LootTable")
|
||||
.WithMany()
|
||||
.HasForeignKey("LootTableId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Server.Data.Entities.DungeonMobDefinition", "MobDefinition")
|
||||
.WithMany()
|
||||
.HasForeignKey("MobDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LootTable");
|
||||
|
||||
b.Navigation("MobDefinition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonStashItem", b =>
|
||||
{
|
||||
b.HasOne("Server.Data.Entities.DungeonCharacter", "Character")
|
||||
@@ -1430,6 +1585,11 @@ namespace SystemRevivalServer.Migrations
|
||||
|
||||
b.Navigation("Stash");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Server.Data.Entities.DungeonLootTable", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user