# Boon Handler Documentation ## Overview This document describes the database relationships and interactions for the `dbBoonHandler` class. The boon system in Magicbane is used to manage item bonuses and enhancements that are associated with specific item bases. ## Handler Class **File:** `src/engine/db/handlers/dbBoonHandler.java` **Class:** `dbBoonHandler` **Extends:** `dbHandlerBase` ## Database Tables ### Main Boon Table - **Table Name:** `static_item_boons` - **Description:** Contains information about boons (bonuses/enhancements) that can be applied to item bases - **Columns:** - UID (Primary Key) - itemBaseID (Foreign Key to obj_itembase) - boonType - boonValue - boonLevel ## Key Queries ### Get Boon Amounts for Item Base ```sql SELECT * FROM `static_item_boons` WHERE `itemBaseID` = ? ``` **File:** `dbBoonHandler.java`, Line ~28 ## Relationships 1. **Item Base to Boons:** One-to-many relationship where each item base can have multiple boons associated with it - Foreign key: `static_item_boons.itemBaseID` references `obj_itembase.UID` ## Java Field to Database Column Mappings | Java Field | Database Column | Notes | |------------|-----------------|-------| | `itemBaseID` | `static_item_boons.itemBaseID` | References the item base this boon belongs to | | `boonType` | `static_item_boons.boonType` | Type of boon (e.g., damage, defense) | | `boonValue` | `static_item_boons.boonValue` | Value of the boon | | `boonLevel` | `static_item_boons.boonLevel` | Level of the boon |