= Legends of the Balkans - Database Documentation = == Entity Relationship Diagram == [[Image(lotb_erd.png)]] == Data Requirements == === Entities === Below are the core entities in the database, their descriptions, and attributes: - **Player**: Represents a game user with login credentials. - `PlayerID` (Primary Key) - `Username` - `Password` - `Email` - **Character**: A player-controlled entity in the game. - `CharacterID` (Primary Key) - `PlayerID` (Foreign Key → Player) - `Name` - `Health` - `EXP` - `Gold` - **Faction**: Represents a faction that characters can join. - `FactionID` (Primary Key) - `Name` - `Description` - **Quest**: Missions that characters can complete. - `QuestID` (Primary Key) - `Name` - `EXP_Required` - `EXP_Reward` - `Gold_Reward` - **Item**: Objects that characters can own, craft, or trade. - `ItemID` (Primary Key) - `Name` - `Type` - `Rarity` - `Craftable` - **Enemy**: Represents hostile NPCs in the game. - `EnemyID` (Primary Key) - `Name` - `Health` - `Damage` - `LootDrop` - **Trader**: NPC merchants selling items. - `TraderID` (Primary Key) - `Name` - `Type` - **Market**: A system where players can list items for sale. - `MarketID` (Primary Key) - `ItemID` (Foreign Key → Item) - `SellerID` (Foreign Key → Player) - `Price` - **Guild**: Player-created groups for collaboration. - `GuildID` (Primary Key) - `Name` - `LeaderID` (Foreign Key → Player) === Relations === Below are the key relationships between entities: - **Lists** (Market, Character, Item): The Market entity represents a listing relationship where a Character lists an Item for sale. *Cardinality*: One Character may list many Items via Market; each Market listing is associated with one Item. - **Drops** (Enemy, Item): An Enemy drops one or more Items. *Cardinality*: An Enemy can drop multiple Items; an Item may be dropped by multiple Enemies. - **Sells** (Trader, Item): A Trader sells one or more Items. *Cardinality*: A Trader can sell many Items; an Item can be sold by multiple Traders. - **ReputationIn** (Faction, Character): This relationship captures a Character’s reputation within a Faction, with attributes such as `ReputationPoints` and `Rank`. *Cardinality*: A Character can have reputation in multiple Factions; a Faction can record reputation for multiple Characters. - **Completes** (Quest, Character): A Character can complete one or more Quests. *Cardinality*: A Character may complete many Quests; a Quest can be completed by multiple Characters. - **Owns** (Player, Character): A Player owns one or more Characters. *Cardinality*: One Player may own many Characters, while each Character is owned by a single Player. - **IsMember** (Guild, Character): This membership relationship indicates that a Character is a member of a Guild. *Cardinality*: A Character can be a member of multiple Guilds; a Guild can have many Characters as members.