Add NPC interaction system with memory and quest generation

- Introduced a new NPC system with dynamic NPCs and conversation handling.
- Implemented NPC memory using SQLite to log conversations and manage relationships.
- Added commands for talking to NPCs, listing available NPCs, and generating quests.
- Updated database schema to support NPC conversations and relationships.
- Refactored code structure to separate concerns into cogs and handlers.
This commit is contained in:
2025-09-30 14:12:22 +02:00
parent c8980f785f
commit 7e76353c6a
24 changed files with 7468 additions and 14 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+8 -3
View File
@@ -203,6 +203,8 @@ class DatabaseManager:
query = f"{query} ({', '.join(keys)}) VALUES ({placeholders})"
values = [tuple(data.values()) for data in params]
connection = None
cursor = None
try:
connection = self.get_connection()
cursor = connection.cursor()
@@ -213,10 +215,13 @@ class DatabaseManager:
)
except mysql.connector.Error as err:
logger.error(f"Bulk insert failed: {err}")
connection.rollback() # Roll back on error
if connection:
connection.rollback() # Roll back on error
finally:
cursor.close()
connection.close()
if cursor:
cursor.close()
if connection:
connection.close()
def delete(self, table_name: str, condition: dict) -> None:
"""Deletes a record from the specified table based on the condition provided."""