Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2024, 10:46 AM
Fridgecritter
Hill Giant
 
Join Date: Feb 2008
Posts: 189
Default AI and eqemulator?

This morning I was playing with AI and thought, I wonder if AI would be able to create a custom mob for someone to plug into their server? I have no idea about the format these days for the db, but it’s interesting that AI thought it could do this with no problem, and just started spitting out code. I only gave it two stats to use, just to see what it would do with it. Here are the results.

Code:
 import eqemu

# Configure your database connection
db = eqemu.connect('your_database')

def spawn_monster(zone, hitpoints, strength, db_id):
    # Define the SQL query to insert a new NPC into the database
    query = f"""
    INSERT INTO npc_types (id, name, level, hp, strength, zone)
    VALUES ({db_id}, 'Monster', 1, {hitpoints}, {strength}, '{zone}');
    """

    # Execute the SQL query
    db.execute(query)
    print(f"Monster spawned in zone {zone} with {hitpoints} hitpoints and {strength} strength.")

# Replace 'current_zone' with your current zone identifier
current_zone = 'forest'  # Example zone
monster_hp = 10000
monster_strength = 500
database_id = 2000

# Call the function to spawn the monster
spawn_monster(current_zone, monster_hp, monster_strength, database_id)
To get this, I typed:

I need a py script for eqemulator that spawns a monster in the current zone, with 10000 hitpoints and 500 strength, and the database id will be 2000

Obviously this needs a lot more input than I gave it, but the premise is still interesting. I wonder if you could use it for code for the server itself as well.

Last edited by Fridgecritter; 06-01-2024 at 10:48 AM.. Reason: Added input text
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:33 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3