Build a Private WoW WotLK Server with NPC Bots Using TrinityCore on Ubuntu 22.04
Build a Private WoW WotLK Server with NPC Bots Using TrinityCore on Ubuntu 22.04
This tutorial shows you how to build your own, private World of Warcraft server, running the Wrath of the Lich King expansion, that's powered by TrinityCore on a Ubuntu 22.04 server/VPS, with controllable NPC bots as a fun extra feature. I've put this tutorial together in such a way that anybody can follow it, even if you're clueless, you'll still be able to follow it to completion.
But First, a Personal Note
I've played a fair amount of World of Warcraft in my life. And when I say a fair amount, I actually mean to say that I've played a LOT of WoW. No seriously… A LOT! I started playing in 2006, and I played it for 10 or 11 years. At some point I looked into how much time I had invested in the game by typing /played on all of my characters, which displays how much time you've been playing. I put these numbers into a simple Excel sheet and added these numbers up.
The result was a playtime total of 618 days and 14 hours. So, I literally spent close to two years of my life in the virtual World of Warcraft, over a period of 10 years. Some people might say that this has been a complete waste of my time, but I disagree. It's not a waste of time if you love wasting time on something you enjoy.
One of the things I miss the most is the social aspect of the game. I used to talk to my fellow guildies almost on a daily basis using voice-chat apps. We did loads of fun stuff together in-game. Other times we did absolutely nothing together but just hang out. We didn't only talk about the game, far from it in fact, we talked about anything and everything. Good times, really good times.
About TrinityCore and NPC Bots
TrinityCore is one of the most popular and stable open-source projects for creating private World of Warcraft servers. It's a community-driven project that has been in development for years, reverse-engineering the original WoW server software to recreate the authentic experience we remember from the Wrath of the Lich King expansion.
World of Warcraft falls in the category MMORPG, or Massive Multiplayer Online Role-Playing Game for a good reason. Especially the multiplayer bit plays a key role for the game. So how can I play on my own private server when there's no other players online? Many aspects of the official game require you to form a group to go raiding or fight players of the opposite faction. So what can you do when you're in there all by your lonely self?
Well, there's lots of fun to be had with a very cool addition called NPC bots. Think of NPC bots as if they are other players that you can hire to group up with, and who will do what you instruct them to do. Here's how the developer describes NPC bots:
NPCBots are hirable pet-like minions (with some exceptions). You don't have full control over them, but you can tune their behavior in many ways. Bots will follow you around, buff you, defend you and help you in general. Their main purpose is to support players during their leveling although they can do dungeons and raids, but expect them being stupid in there.
You can "hire" these bots and give them certain instructions by talking to them. Decide on their role in group and pick their talent tree. You can even gear them with whatever gear you want. If you want to go nuts you can transmog the gear on your bots. Form a party of five, or a raid group of up to 40, and start fighting your way through Icecrown Citadel to eventually kill the Lich King.
Tutorial Chapters
- Setting up the server prerequisites
- Compile the TrinityCore server files
- Extract the game files from the client
- Setting up the databases
- Editing the config files
- Download the latest world database and import it
- Run the server briefly
- Importing the NPC bots data to our databases
- Run your server and create a GM account
- Setting up the WotLK game client
- Play the game
- Run the server under a different, non-sudo user
- Use Supervisor to simplify the start/stopping of the server
- Addons to perform GM tasks
- Wrapping it up
1. Setting up the Server Prerequisites
In case you need to connect to your server from a Windows machine, then I suggest using these tools to make your life a little bit easier:
- WinSCP
- Putty
I used a fresh installed Ubuntu 22.04.3 server. This can be a local Ubuntu server, or a desktop version of Ubuntu, or a remote VPS you are renting, or an instance at AWS. Just make sure it runs Ubuntu 22.04. Using this specific version will guarantee that you can follow this tutorial without running into any unforeseen issues.
First, we're going to install a handful of packages that we'll need for the TrinityCore compilation process:
sudo apt update
sudo apt upgrade -y
sudo apt install -y git cmake make build-essential libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mysql-server libmysqlclient-dev
Now we need to secure our MySQL installation and set up a root password:
sudo mysql_secure_installation
Follow the prompts and set a strong root password when asked. For the security questions, I recommend answering Y (yes) to all of them.
2. Compile the TrinityCore Server Files
Now we'll clone the TrinityCore repository with NPCBots already patched in. This saves us the trouble of patching it ourselves:
cd /opt
sudo git clone https://github.com/trickerer/TrinityCore-3.3.5-with-NPCBots.git --depth 1 trinitycore
cd trinitycore
sudo mkdir build
cd build
Now we'll configure the TrinityCore build with CMake:
sudo cmake ../ -DCMAKE_INSTALL_PREFIX=/opt/trinitycore/env -DSERVERS=ON -DTOOLS=ON -DSCRIPTS=ON -DWITH_SQL=ON
Now comes the TrinityCore compilation process. This will take a while depending on your server's CPU power:
sudo make -j$(nproc)
sudo make install
The compilation can take anywhere from 30 minutes to several hours. Once it's done, we'll have our TrinityCore server binaries installed in /opt/trinitycore/env
.
3. Extract the Game Files from the Client
We need to extract the game data files from a WoW WotLK client (version 3.3.5a). You'll need to have the client files available on your server or transfer them using WinSCP.
Create a directory for the data files:
sudo mkdir -p /opt/trinitycore/env/data
Navigate to the TrinityCore tools directory and extract the data files:
cd /opt/trinitycore/build/bin
sudo ./mapextractor
sudo ./vmap4extractor
sudo mkdir vmaps
sudo ./vmap4assembler Buildings vmaps
sudo ./mmaps_generator
Move the extracted files to the data directory:
sudo mv /opt/trinitycore/build/bin/{maps,vmaps,mmaps,dbc} /opt/trinitycore/env/data/
4. Setting Up the Databases
First, let's create the necessary databases and user for TrinityCore:
sudo mysql -u root -p
Once in MySQL, run these commands:
CREATE DATABASE auth CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE characters CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE world CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'trinity'@'localhost' IDENTIFIED BY 'trinity';
GRANT ALL PRIVILEGES ON auth.* TO 'trinity'@'localhost';
GRANT ALL PRIVILEGES ON characters.* TO 'trinity'@'localhost';
GRANT ALL PRIVILEGES ON world.* TO 'trinity'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Now let's import the base TrinityCore database structures:
cd /opt/trinitycore/env/etc
sudo mysql -u root -p auth < auth.sql
sudo mysql -u root -p characters < characters.sql
sudo mysql -u root -p world < world.sql
5. Editing the TrinityCore Config Files
We need to copy and edit the TrinityCore configuration files:
cd /opt/trinitycore/env/etc
sudo cp worldserver.conf.dist worldserver.conf
sudo cp authserver.conf.dist authserver.conf
Edit the TrinityCore worldserver.conf file:
sudo nano worldserver.conf
Find and update these settings:
LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
WorldDatabaseInfo = "127.0.0.1;3306;trinity;trinity;world"
CharacterDatabaseInfo = "127.0.0.1;3306;trinity;trinity;characters"
Also find and set the data directory:
DataDir = "/opt/trinitycore/env/data"
Edit the TrinityCore authserver.conf file:
sudo nano authserver.conf
Update the database settings:
LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
6. Download the Latest World Database and Import It
We'll use the TDB (Trinity Database) for our world database. Download the latest version:
cd /opt/trinitycore
sudo wget https://github.com/TrinityCore/TrinityCore/releases/latest/download/TDB_full_world_335.2023.sql
sudo mysql -u root -p world < TDB_full_world_335.2023.sql
7. Run the TrinityCore Server Briefly
Let's test if our TrinityCore server works by starting it briefly:
cd /opt/trinitycore/env/bin
sudo ./authserver &
sudo ./worldserver
Let the worldserver run until it finishes loading, then stop it with Ctrl+C. This ensures all the database updates are applied.
8. Importing the NPC Bots Data to Our Databases
Now we need to import the NPC bots data. The SQL files are located in the TrinityCore source:
cd /opt/trinitycore/sql/Bots
Import the world database files in order:
sudo mysql -u root -p world < 1_world_bot_appearance.sql
sudo mysql -u root -p world < 2_world_bot_extras.sql
sudo mysql -u root -p world < 3_world_bots.sql
sudo mysql -u root -p world < 4_world_generate_bot_equips.sql
sudo mysql -u root -p world < 5_world_botgiver.sql
Import the characters database file:
sudo mysql -u root -p characters < characters_bots.sql
Check for any updates in the updates directory and apply them:
cd /opt/trinitycore/sql/Bots/updates/world
for file in *.sql; do sudo mysql -u root -p world < "$file"; done
cd /opt/trinitycore/sql/Bots/updates/characters
for file in *.sql; do sudo mysql -u root -p characters < "$file"; done
9. Run Your TrinityCore Server and Create a GM Account
Start both TrinityCore servers:
cd /opt/trinitycore/env/bin
sudo ./authserver &
sudo ./worldserver
Once the TrinityCore worldserver is running, create an account:
account create yourusername yourpassword
account set gmlevel yourusername 3
This creates an account with GM (Game Master) level 3, which gives you full administrative access.
10. Setting Up the WotLK Game Client
On your Windows machine, install a clean World of Warcraft Wrath of the Lich King client (version 3.3.5a). Navigate to your WoW installation directory and find the realmlist.wtf
file.
Edit this file and replace its contents with:
SET realmlist "your_server_ip"
Replace "your_server_ip" with your server's IP address.
11. Play the Game
Launch World of Warcraft and use the account credentials you created earlier. You should see your custom realm in the realm list. Select it and create a character.
Once in-game, you can spawn NPC bots using GM commands. Here are some useful NPC bot commands:
.npcbot lookup <class>
- Lookup NPC bots by class.npcbot spawn <entry>
- Spawn a specific NPC bot.npcbot add
- Add a targeted NPC bot to your control.npcbot remove
- Remove an NPC bot from your control.npcbot list spawned
- List all spawned bots
To hire an NPC bot, simply target one and use the .npcbot add
command. The bot will then follow you and assist you in combat.
12. Run the TrinityCore Server Under a Different, Non-Sudo User
For security, it's better to run the TrinityCore server under a dedicated user account:
sudo useradd -m -s /bin/bash wow
sudo chown -R wow:wow /opt/trinitycore/env
sudo -u wow -H /opt/trinitycore/env/bin/authserver &
sudo -u wow -H /opt/trinitycore/env/bin/worldserver
13. Use Supervisor to Simplify the Start/Stopping of the TrinityCore Server
Install Supervisor:
sudo apt install supervisor
Create a configuration file for the TrinityCore authserver:
sudo nano /etc/supervisor/conf.d/authserver.conf
Add this content:
[program:authserver]
command=/opt/trinitycore/env/bin/authserver
directory=/opt/trinitycore/env/bin
user=wow
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/authserver.log
Create a configuration file for the TrinityCore worldserver:
sudo nano /etc/supervisor/conf.d/worldserver.conf
Add this content:
[program:worldserver]
command=/opt/trinitycore/env/bin/worldserver
directory=/opt/trinitycore/env/bin
user=wow
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/worldserver.log
Start Supervisor and enable it:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start all
sudo systemctl enable supervisor
14. Addons to Perform GM Tasks
There are several addons that can make GM tasks easier on your TrinityCore server:
- GM Helper - Provides various GM tools and commands
- Teleporter - Easy teleportation to various locations
- NPCBot Helper - Specifically designed to manage NPC bots
You can find these addons on various WoW addon websites. Install them in your WoW client's Interface/AddOns folder.
15. Wrapping It Up
Congratulations! You now have your own private World of Warcraft WotLK server with NPC bots running on TrinityCore and Ubuntu 22.04. You can hire NPC bots to accompany you on your adventures, form parties, and even tackle raids with your bot companions.
Remember that this setup is for educational purposes and personal enjoyment. The world of private server development offers endless opportunities for learning about game development, database management, and system administration.
Here are some tips for getting the most out of your NPC bots on your TrinityCore server:
- Experiment with different bot classes and combinations
- Use the
.npcbot
commands to fine-tune bot behavior - Consider creating multiple bot teams for different types of content
- Join the TrinityCore and NPCBots communities for support and updates
NPC Bot Features at a Glance
- Fighting (via spells, melee, ranged combat)
- Buffing and healing
- Resurrecting fallen party members
- Acting as a guard (when bot has no owner)
- Grouping for dungeons and raids
- PvP capabilities
- Providing consumables (mage, warlock)
- Equipment management and transmogrification
- Talent specialization
- Formation control
Why Choose TrinityCore?
- Stability: TrinityCore is known for its stability and performance
- Community: Large, active community with regular updates and support
- Documentation: Extensive documentation and guides available
- Customization: Highly customizable with many available mods and extensions
- NPCBots Integration: Excellent support for NPC bots with regular updates
Happy adventuring in your own personal Azeroth! 🎮✨
Document Version: 1.0 | Last Updated: 2024 | Compatible with: Ubuntu 22.04, TrinityCore 3.3.5, NPCBots
This guide is provided for educational purposes. Please respect Blizzard Entertainment's intellectual property rights.