diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..10f5c4c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +_server/ +_data/ diff --git a/1_download.sh b/1_download.sh new file mode 100755 index 0000000..5064d49 --- /dev/null +++ b/1_download.sh @@ -0,0 +1,76 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +source ${ROOT_DIR}/variables.sh + + +read -p "This will DOWNLOAD and overwrite the current downloaded source code, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + + ########################################################################################## + # General dependencies + ########################################################################################## + sudo apt update && sudo apt install -y unzip git sudo git + + + ########################################################################################## + # Create download folder + ########################################################################################## + if [ ! -d "${ROOT_DIR}/_download" ]; + then + mkdir ${ROOT_DIR}/_download + fi + + + ########################################################################################## + # Clone azerothcore (playerbot fork) + ########################################################################################## + sudo rm -rf ${ROOT_DIR}/_download/azerothcore > /dev/null 2>&1 + git config --global --add safe.directory "${ROOT_DIR}/_download/azerothcore" + git clone https://github.com/liyunfan1223/azerothcore-wotlk.git --branch=Playerbot ${ROOT_DIR}/_download/azerothcore + + + ########################################################################################## + # Clone module playerbots + ########################################################################################## + sudo rm -rf ${ROOT_DIR}/_download/modules/mod-playerbots > /dev/null 2>&1 + git config --global --add safe.directory "${ROOT_DIR}/_download/modules/mod-playerbots" + git clone https://github.com/liyunfan1223/mod-playerbots.git ${ROOT_DIR}/_download/modules/mod-playerbots + + + ########################################################################################## + # Clone module ah-bot + ########################################################################################## + sudo rm -rf ${ROOT_DIR}/_download/modules/mod-ah-bot > /dev/null 2>&1 + git config --global --add safe.directory "${ROOT_DIR}/_download/modules/mod-ah-bot" + git clone https://github.com/azerothcore/mod-ah-bot.git ${ROOT_DIR}/_download/modules/mod-ah-bot + + + ########################################################################################## + # Clone module mod-progression-system + ########################################################################################## + sudo rm -rf ${ROOT_DIR}/_download/modules/mod-progression-system > /dev/null 2>&1 + git config --global --add safe.directory "${ROOT_DIR}/_download/modules/mod-progression-system" + git clone https://github.com/azerothcore/mod-progression-system.git ${ROOT_DIR}/_download/modules/mod-progression-system + + + ########################################################################################## + # Download client-data (only if file does not exist) + ########################################################################################## + if ! [ -f ${ROOT_DIR}/_data/data.zip ]; + then + mkdir -p ${ROOT_DIR}/_data > /dev/null 2>&1 + sudo curl -L https://github.com/wowgaming/client-data/releases/download/v16/data.zip --output ${ROOT_DIR}/_data/data.zip + fi + + + ########################################################################################## + # set azerothcore playerbot fork upstream with original azerothcore + ########################################################################################## + cd ${ROOT_DIR}/_download/azerothcore && git remote add upstream https://github.com/azerothcore/azerothcore-wotlk.git + + + echo "Executed..." + +fi diff --git a/2_update.sh b/2_update.sh new file mode 100755 index 0000000..1b7c88e --- /dev/null +++ b/2_update.sh @@ -0,0 +1,51 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +source ${ROOT_DIR}/variables.sh + + +read -p "This will UPDATE the current downloaded source code, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + + ########################################################################################## + # General dependencies + ########################################################################################## + sudo apt update && sudo apt install -y git + + + ########################################################################################## + # reset azerothcore to latest branch + ########################################################################################## + git -C ${ROOT_DIR}/_download/azerothcore fetch origin + git -C ${ROOT_DIR}/_download/azerothcore clean -fd + git -C ${ROOT_DIR}/_download/azerothcore reset --hard origin/Playerbot + + + ########################################################################################## + # reset mod-playerbots to latest branch + ########################################################################################## + git -C ${ROOT_DIR}/_download/modules/mod-playerbots fetch origin + git -C ${ROOT_DIR}/_download/modules/mod-playerbots clean -fd + git -C ${ROOT_DIR}/_download/modules/mod-playerbots reset --hard origin/master + + + ########################################################################################## + # reset mod-ah-bot to latest branch + ########################################################################################## + git -C ${ROOT_DIR}/_download/modules/mod-ah-bot fetch origin + git -C ${ROOT_DIR}/_download/modules/mod-ah-bot clean -fd + git -C ${ROOT_DIR}/_download/modules/mod-ah-bot reset --hard origin/master + + + ########################################################################################## + # reset mod-progression-system to latest branch + ########################################################################################## + git -C ${ROOT_DIR}/_download/modules/mod-progression-system fetch origin + git -C ${ROOT_DIR}/_download/modules/mod-progression-system clean -fd + git -C ${ROOT_DIR}/_download/modules/mod-progression-system reset --hard origin/main + + + echo "Executed..." + +fi diff --git a/3_build.sh b/3_build.sh new file mode 100755 index 0000000..2853fb4 --- /dev/null +++ b/3_build.sh @@ -0,0 +1,35 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +source ${ROOT_DIR}/variables.sh + + +read -p "This will (re)build the server with the downloaded resources, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + + ########################################################################################## + # General dependencies + ########################################################################################## + sudo apt update && sudo apt install -y unzip + + + ########################################################################################## + # Rebuild server folder based on downloaded source codes + ########################################################################################## + sudo rm -rf ${ROOT_DIR}/_server > /dev/null 2>&1 + mkdir -p ${ROOT_DIR}/_server/azerothcore/modules && \ + cp -r ${ROOT_DIR}/_download/azerothcore ${ROOT_DIR}/_server && \ + cp -r ${ROOT_DIR}/_download/modules ${ROOT_DIR}/_server/azerothcore || exit 1 + + + ########################################################################################## + # Copy client-data into server folder (instead of ./acore.sh client-data) + ########################################################################################## + unzip ${ROOT_DIR}/_data/data.zip -d ${DATAPATH} || exit 1 + + + + echo "Executed..." + +fi diff --git a/4_compile.sh b/4_compile.sh new file mode 100755 index 0000000..6071799 --- /dev/null +++ b/4_compile.sh @@ -0,0 +1,62 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +source ${ROOT_DIR}/variables.sh + + +read -p "This will (re)compile server, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + + ########################################################################################## + # General dependencies + ########################################################################################## + sudo apt update && \ + sudo apt full-upgrade -y && \ + sudo apt-get install -y \ + btop \ + tmux \ + sudo \ + curl \ + net-tools \ + locate \ + nano \ + software-properties-common + + + ########################################################################################## + # Install core dependencies (https://www.azerothcore.org/wiki/linux-requirements) + ########################################################################################## + sudo ${ROOT_DIR}/_server/azerothcore/acore.sh install-deps && \ + sudo apt-get update && \ + sudo apt-get install \ + git \ + cmake \ + make \ + gcc \ + g++ \ + clang \ + libmysqlclient-dev \ + libssl-dev \ + libbz2-dev libreadline-dev \ + libncurses-dev mysql-server \ + libboost-all-dev + + + ########################################################################################## + # Compile the code + # https://github.com/azerothcore/azerothcore-wotlk/blob/master/apps/compiler/compiler.sh + ########################################################################################## + sudo ${ROOT_DIR}/_server/azerothcore/acore.sh compiler clean + sudo ${ROOT_DIR}/_server/azerothcore/acore.sh compiler configure + sudo ${ROOT_DIR}/_server/azerothcore/acore.sh compiler compile + + + ########################################################################################## + # Ensure all folder and files are accesible for the current user + ########################################################################################## + sudo find ${ROOT_DIR}/_server/ -user root -exec sudo chown $USER: {} + + + echo "Executed..." + +fi diff --git a/5_config.sh b/5_config.sh new file mode 100755 index 0000000..c1a700c --- /dev/null +++ b/5_config.sh @@ -0,0 +1,93 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +source ${ROOT_DIR}/variables.sh + + +read -p "This will initialize and apply the config, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + + ########################################################################################## + # Enable mysql server + ########################################################################################## + sudo service mysql start + + + ########################################################################################## + # Create acore account + ########################################################################################## + sudo mysql -u root -e "CREATE DATABASE IF NOT EXISTS acore_auth;" + sudo mysql -u root -e "CREATE USER IF NOT EXISTS 'acore'@'%' IDENTIFIED BY 'acore';" + sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'acore'@'%';" + sudo mysql -u root -e "FLUSH PRIVILEGES;" + + + ########################################################################################## + # Recompile default conf files + ########################################################################################## + sudo ${ROOT_DIR}/_server/azerothcore/acore.sh compiler configure + + + ########################################################################################## + # Ensure all folder and files are accesible for the current user + ########################################################################################## + sudo find ${ROOT_DIR}/_server/ -user root -exec sudo chown $USER: {} + + + + ########################################################################################## + # Server config merge + ########################################################################################## + sudo cat ${ROOT_DIR}/config/authserver.conf \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/authserver.conf.dist > \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/authserver.conf | exit 1 + + sudo cat ${ROOT_DIR}/config/worldserver.conf \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/worldserver.conf.dist > \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/worldserver.conf | exit 1 + + + ########################################################################################### + ## Modules config merge + ########################################################################################### + sudo cat ${ROOT_DIR}/config/modules/playerbots.conf \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/modules/playerbots.conf.dist > \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/modules/playerbots.conf | exit 1 + + sudo cat ${ROOT_DIR}/config/modules/mod_ahbot.conf \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/modules/mod_ahbot.conf.dist > \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/modules/mod_ahbot.conf | exit 1 + + sudo cat ${ROOT_DIR}/config/modules/progression_system.conf \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/modules/progression_system.conf.dist > \ + ${ROOT_DIR}/_server/azerothcore/env/dist/etc/modules/progression_system.conf | exit 1 + + + ########################################################################################## + # Set alias to start, stop and open wow or auth tmux sessions + ########################################################################################## + echo "ROOT_DIR=${ROOT_DIR}" > ~/.bash_aliases + echo "DATAPATH=${DATAPATH}" >> ~/.bash_aliases + echo "alias update='${ROOT_DIR}/2_update.sh'" >> ~/.bash_aliases + echo "alias build='${ROOT_DIR}/3_build.sh'" >> ~/.bash_aliases + echo "alias compile='${ROOT_DIR}/4_compile.sh'" >> ~/.bash_aliases + echo "alias config='${ROOT_DIR}/5_config.sh'" >> ~/.bash_aliases + echo "alias start='${ROOT_DIR}/6_start.sh'" >> ~/.bash_aliases + echo "alias stop='tmux kill-server'" >> ~/.bash_aliases + echo "alias wow='cd ${ROOT_DIR}/_server/azerothcore;tmux attach -t ${WORLDSERVER_SESSION}'" >> ~/.bash_aliases + echo "alias auth='cd ${ROOT_DIR}/_server/azerothcore;tmux attach -t ${AUTHSERVER_SESSION}'" >> ~/.bash_aliases + echo " " + echo "###########################################################################################" + echo "## After the first install or changes either reboot or TYPE! 'source ~/.bashrc'" + echo "###########################################################################################" + echo "## After the above you can use the following commands:" + echo "### start - starts auth and world in tmux sessions server" + echo "### stop - starts all servers" + echo "### wow - logon world-server tmux session" + echo "### auth - logon auth-server tmux session" + echo "### update - updates the current downloaded source-code, after rerun: build, compile and config." + echo "### build - (re)builds the server based on the downloaded/updated source-codes" + echo "### compile - (re)compiles the server based on the build server" + echo "### config - applies configuration settings defined in the 'config' folder" + echo "###########################################################################################" +fi diff --git a/6_start.sh b/6_start.sh new file mode 100755 index 0000000..6c40bfc --- /dev/null +++ b/6_start.sh @@ -0,0 +1,73 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +source ${ROOT_DIR}/variables.sh + + +########################################################################################## +# Apply realm settings +########################################################################################## +sudo mysql -u root --database="acore_auth" -e "UPDATE realmlist SET address = '${REALM_IP}' WHERE id = 1;" +sudo mysql -u root --database="acore_auth" -e "UPDATE realmlist SET name = '${REALM_NAME}' WHERE id = 1;" +echo "Realm settings updated..." +echo " " + + +########################################################################################## +# Apply ah-modbot settings +########################################################################################## +sudo mysql -u root --database="acore_world" -e "UPDATE mod_auctionhousebot SET minitems = ${AH_BOT_MIN_ITEMS}, maxitems = ${AH_BOT_MAX_ITEMS};" +echo "Module ah-modbot updated..." +echo " " + + +########################################################################################## +# reset playerbots data (enforces performance and bot levels balance) +########################################################################################## +sudo mysql -u root --database="acore_characters" < ${ROOT_DIR}/lib/clear-bots.sql +echo "Module playerbots updated..." +echo " " + + +########################################################################################## +# handle the tmux sessions +########################################################################################## +if tmux new-session -d -s $AUTHSERVER_SESSION; then + echo "Created authserver session: $AUTHSERVER_SESSION" +else + echo "Error when trying to create authserver session: $AUTHSERVER_SESSION" +fi +echo " " + +if tmux new-session -d -s $WORLDSERVER_SESSION; then + echo "Created worldserver session: $WORLDSERVER_SESSION" +else + echo "Error when trying to create worldserver session: $WORLDSERVER_SESSION" +fi +echo " " + +if tmux send-keys -t $AUTHSERVER_SESSION "$AUTHSERVER" C-m; then + echo "Executed \"$AUTHSERVER\" inside $AUTHSERVER_SESSION" + #echo "You can attach to $AUTHSERVER_SESSION and check the result using \"tmux attach -t $AUTHSERVER_SESSION\"" +else + echo "Error when executing \"$AUTHSERVER\" inside $AUTHSERVER_SESSION" +fi +echo " " + +if tmux send-keys -t $WORLDSERVER_SESSION "$WORLDSERVER" C-m; then + echo "Executed \"$WORLDSERVER\" inside $WORLDSERVER_SESSION" + #echo "You can attach to $WORLDSERVER_SESSION and check the result using \"tmux attach -t $WORLDSERVER_SESSION\"" +else + echo "Error when executing \"$WORLDSERVER\" inside $WORLDSERVER_SESSION" +fi +echo " " + +echo "###########################################################################################" +echo "Word of advice:" +echo "## 1. -------------------------------------------------------------------------------------" +echo "After (re)starting the server and logging in with the client wait 5-10m so the bots can" +echo "settle abit; getting an assigned level and teleport to an area for that level" +echo "## 2. -------------------------------------------------------------------------------------" +echo "If you wanna type alot of commands in the world-server session you might want to disable" +echo "## the playerbots mod through the playerbot config, since the playerbots generates alot of" +echo "## output which disrupts the command line typing :) When done enable again ./config/module" +echo "###########################################################################################" diff --git a/README.md b/README.md index 6ea2fc2..d6de92d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,124 @@ -# azerothcore_installer -Simple classic installer with playerbots and ah-bot for solo / friends play +# azerothcore_installer [WIP] +A simple classic Azerothcore installer with playerbots and ahbot for solo / friends play. +For now a quick guide with a abit of common sense and experience i guess, this is just quick setup since i kinda made it for personal use. I prolly will test abit more and add some additional 'features' such as +auto character import/export. + +Why classic and not docker? Even though i love docker it does add some additional layer of complexity especially when playing around with modules and settings. Hence making this tiny wrapper instead of a +docker image. Obviously this can be translated into a container, but if you able to run a container you should be able to run the default wiki installation embedded in the azerothcore instead. + +It might contain some errors and whatnot, hopefully it will give you some guidance when you have trouble with the classic installation with playerbots and ah-bot. I havent covered every step with great detail +i might add a 'real' guide when i have the time. + +## Todo + - min/max bot amount, threads performance + - test MariaDB vs mySQL, mariaDB feels faster maybe i am seeing ghost though. (done and seeems equal) + - Integrate the player export/import + - Integrate database full backup + - Consider setting vmplayer on priority from 'normal' to 'high' + + +# Server setup + - vmware player + - ubuntu-24.04-live-server-amd64.iso + - minimal setup + - 70GB disksize (minimal 50GB) + - 16 GB memorysize + - 4 cores (amd 5700x) + - network (bridged mode) + +## Ubuntu server settings + +Update and install tooling +```bash +sudo apt update -y && sudo apt upgrade -y +sudo git net-tools +``` + +Find network IP, should be something like 192.168.x.x +```bash +ifconfig +``` + +###### Internet server +Use the above (ifconfig) IP for the following router poort-forwarding and/or firewall rules settings. +```` +# 3724 TCP AUTH-SERVER +# 8085 TCP WORLD-SERVER +```` +Go to e.g. [whatsmyip](https://whatismyip.com/) and use that IP as realm IP in the variables.sh +and the client 3.3.5a 'data/enUS/realmlist.wtf' files + +###### Local server +Use the above IP (ifconfig) as realm IP in the variables.sh and the client 3.3.5a +'data/enUS/realmlist.wtf' files. + + +# Installer +```bash +git clone https://github.com/hermensbas/azerothcore_installer.git +cd azerothcore_installer.git +chmod +x *.sh +``` +And simply follow the steps of the scripts. + +For the first install, make sure after 'start.sh' you logon on the tmux session of the world-server by typing 'wow' +and hit next, next, next when prompting for creating databases. + +###### ah-bot +Create normal account and use helper/find-character.sh 'charname' to find the accountId and characterId (GUID) +and update your ah-mod config in the ./config folder and reapply the config and start the server again. + +```tree +├── 1_download.sh (downloads the sources and client-data) +├── 2_update.sh (updates and resets the downloaded sources to latest) +├── 3_build.sh (builds the server structure and such) +├── 4_compile.sh (compiles the server code) +├── 5_config.sh (applies general configuration and that defined in ./config, restart required) +├── 6_start.sh (starts the client but can be done through alias created by config.sh) +├── _data (client-data v16) +│   └── data.zip +├── _download (downloaded core and modules) +│   ├── azerothcore +│   └── modules +├── _server (the build and compiled server code based on the downloaded code) +│   └── azerothcore +├── config (custom config which be merged on top of the generated .dist configs) +│   ├── authserver.conf +│   ├── modules +│   └── worldserver.conf +├── helper (simple helper scripts for ah-bot and clearing ah-bot) +│   ├── clear-ah.sh +│   └── find-character.sh +├── lib +│   ├── clear-bots.sql +│   ├── general-settings.sh +│   └── merge_core.sh (maybe when your abit more advanced with git and concepts like rebase and merge, but this merges the original azerothcore into the playerbot fork, if e.g. the u need a fix asap) +└── variables.sh (contains project variables such as realm IP and name, min-max items for ah-bot etc. +```` + +General info +The ah-bot and playerbots modules are integrated sort off, you will need to create an account for th ah-bot and complete the +ah-bot config by using the find-character.sh script. + +And every start all bots data will be deleted to maintai a clean database and remain the balance between the +levels of among the bots as they grow over time. + +# Client +3.3.5a (Can be found through chromiecraft or simply join that server hosted and developed y azerothcore + +Addons: +- Allstats +- QuestHelper +- UnBot (english version), used to control the playerbots +- AI_VoiceOver +- AI_VoiceOverData_Vanilla + +# Server stability +Obviously the more custom modules are installed the more risk of encountering problems, playerbot is still being developed. +If you experience random disconnects without 'any' reason playerbot might be the cause, you might wanna try to rebuild/recompile the code and/or lower the bot amount) + +# Changing config +After changing the config files in the /config folder, run the following commands: + - 1. config - by alias 'config' or running the 5_config.sh) + - 2. Server restart - by stop/start or simply a 'AC> server restart 1' command in the world-server session + diff --git a/_download/azerothcore b/_download/azerothcore new file mode 160000 index 0000000..22132ad --- /dev/null +++ b/_download/azerothcore @@ -0,0 +1 @@ +Subproject commit 22132addce11d898327c3a6368df783a90fe2df0 diff --git a/_download/modules/mod-ah-bot b/_download/modules/mod-ah-bot new file mode 160000 index 0000000..8b06eb4 --- /dev/null +++ b/_download/modules/mod-ah-bot @@ -0,0 +1 @@ +Subproject commit 8b06eb4906e8116b29c348cdad3108050cad8790 diff --git a/_download/modules/mod-playerbots b/_download/modules/mod-playerbots new file mode 160000 index 0000000..467633a --- /dev/null +++ b/_download/modules/mod-playerbots @@ -0,0 +1 @@ +Subproject commit 467633a86069840121b16c7105823329f546ee88 diff --git a/_download/modules/mod-progression-system b/_download/modules/mod-progression-system new file mode 160000 index 0000000..a174835 --- /dev/null +++ b/_download/modules/mod-progression-system @@ -0,0 +1 @@ +Subproject commit a17483568872939d6c10189f030cd04e548f53cd diff --git a/config/authserver.conf b/config/authserver.conf new file mode 100644 index 0000000..53072d8 --- /dev/null +++ b/config/authserver.conf @@ -0,0 +1,11 @@ +################################################################################################# +# START: custom authserver.conf settings +################################################################################################# + +LoginDatabase.WorkerThreads = 4 +LoginDatabase.SynchThreads = 4 + +################################################################################################# +# END: custom authserver.conf settings +################################################################################################# + diff --git a/config/modules/mod_ahbot.conf b/config/modules/mod_ahbot.conf new file mode 100644 index 0000000..5d14e14 --- /dev/null +++ b/config/modules/mod_ahbot.conf @@ -0,0 +1,40 @@ +################################################################################################# +# START: custom mod_ahbot.conf settings +################################################################################################# + +#----------------------------------------------------------------------------------------------- +# Use helper/find-character.sh to locate your newly created ah account and character GUID +#----------------------------------------------------------------------------------------------- + +AuctionHouseBot.Account = 0 +AuctionHouseBot.GUID = 0 + +AuctionHouseBot.EnableSeller = 0 +AuctionHouseBot.EnableBuyer = 0 +AuctionHouseBot.ItemsPerCycle = 5000 + +AuctionHouseBot.VendorItems = 1 +AuctionHouseBot.VendorTradeGoods = 1 +AuctionHouseBot.LootItems = 1 +AuctionHouseBot.LootTradeGoods = 1 +AuctionHouseBot.OtherItems = 0 +AuctionHouseBot.OtherTradeGoods = 0 +AuctionHouseBot.No_Bind = 1 +AuctionHouseBot.Bind_When_Picked_Up = 0 +AuctionHouseBot.Bind_When_Equipped = 1 +AuctionHouseBot.Bind_When_Use = 1 +AuctionHouseBot.Bind_Quest_Item = 0 +AuctionHouseBot.DisablePermEnchant = 0 +AuctionHouseBot.DisableConjured = 0 +AuctionHouseBot.DisableGems = 1 +AuctionHouseBot.DisableMoney = 0 +AuctionHouseBot.DisableMoneyLoot = 0 +AuctionHouseBot.DisableLootable = 0 +AuctionHouseBot.DisableKeys = 0 +AuctionHouseBot.DisableDuration = 0 +AuctionHouseBot.DisableBOP_Or_Quest_NoReqLevel = 0 + +################################################################################################# +# END: custom mod_ahbot.conf settings +################################################################################################# + diff --git a/config/modules/playerbots.conf b/config/modules/playerbots.conf new file mode 100644 index 0000000..2ea2f52 --- /dev/null +++ b/config/modules/playerbots.conf @@ -0,0 +1,35 @@ +################################################################################################# +# START: custom playerbots.conf settings +################################################################################################# + +AiPlayerbot.Enabled = 1 + +# world bots +AiPlayerbot.MinRandomBots = 2250 +AiPlayerbot.MaxRandomBots = 2300 +AiPlayerbot.RandomBotMinLevel = 1 +AiPlayerbot.RandomBotMaxLevel = 60 +AiPlayerbot.RandomBotMaxLevelChance = 0.05 +AiPlayerbot.RandomBotFixedLevel = 0 + +# world account bots and rotation +AiPlayerbot.EnableRotation = 1 +AiPlayerbot.RotationPoolSize = 2500 +AiPlayerbot.RandomBotAccountCount = 300 + +# bots gear level limits +AiPlayerbot.AutoGearQualityLimit = 3 +AiPlayerbot.LimitEnchantExpansion = 60 +AiPlayerbot.LimitGearExpansion = 60 + +# player summoned group/raid bots limits +AiPlayerbot.MaxAddedBots = 40 +AiPlayerbot.MaxAddedBotsPerClass = 10 + +# performance related +PlayerbotsDatabase.WorkerThreads = 1 +PlayerbotsDatabase.SynchThreads = 100 + +################################################################################################# +# END: custom playerbots.conf settings +################################################################################################# diff --git a/config/modules/progression_system.conf b/config/modules/progression_system.conf new file mode 100644 index 0000000..202a760 --- /dev/null +++ b/config/modules/progression_system.conf @@ -0,0 +1,7 @@ +################################################################################################# +# START: custom progression_system.conf settings +################################################################################################# + +################################################################################################# +# END: custom progression_system.conf settings +################################################################################################# diff --git a/config/worldserver.conf b/config/worldserver.conf new file mode 100644 index 0000000..ade070a --- /dev/null +++ b/config/worldserver.conf @@ -0,0 +1,37 @@ +################################################################################################# +# START: custom worldserver.conf settings +################################################################################################# + +# world server config (Expansion 0 = classic, 1 = bc, 2 = wotlk) +Expansion = 0 +MaxPlayerLevel = 60 +GameType = 1 +PlayerLimit = 0 + +# new player config +StartPlayerMoney = 50000 + +# server config +Instance.GMSummonPlayer = 1 +MailDeliveryDelay = 10 +LeaveGroupOnLogout.Enabled = 0 +InstantLogout = 0 +AllowTwoSide.Interaction.Auction = 1 +AllowTwoSide.WhoList = 1 + +# performance +LoginDatabase.WorkerThreads = 1 +WorldDatabase.WorkerThreads = 1 +CharacterDatabase.WorkerThreads = 1 + +LoginDatabase.SynchThreads = 1 +WorldDatabase.SynchThreads = 1 +CharacterDatabase.SynchThreads = 2 + +Network.Threads = 1 +ThreadPool = 2 +MapUpdate.Threads = 6 + +################################################################################################# +# END: custom worldserver.conf settings +################################################################################################# diff --git a/helper/clear-ah.sh b/helper/clear-ah.sh new file mode 100755 index 0000000..76094a0 --- /dev/null +++ b/helper/clear-ah.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +read -p "This will delete all items of the auction house, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + + sudo mysql -u root --database="acore_characters" -e "DELETE FROM auctionhouse;" + +fi + diff --git a/helper/find-character.sh b/helper/find-character.sh new file mode 100755 index 0000000..641d5ae --- /dev/null +++ b/helper/find-character.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -z "$1" ] +then + echo "Parameter is null, first paramter 'character name' should not be empty"; + exit 1; +fi + +# find character and account id by name, mainly used for configuring the ah-bot mod. +sudo mysql -u root --database="acore_auth" -e "select acc.id as accountId, ch.guid as characterId from acore_auth.account as acc inner join acore_characters.characters as ch where acc.id = ch.account and acc.username = '${1}';" diff --git a/lib/clear-bots.sql b/lib/clear-bots.sql new file mode 100644 index 0000000..390c57f --- /dev/null +++ b/lib/clear-bots.sql @@ -0,0 +1,30 @@ +DELETE FROM `acore_playerbots`.`playerbots_random_bots`; +UPDATE `acore_characters`.`playerbots_names` SET `in_use`=0; +DELETE FROM `acore_characters`.`characters` WHERE `account` IN (SELECT `id` FROM `acore_auth`.`account` WHERE `username` LIKE 'RNDBOT%') OR `account` NOT IN (SELECT `id` FROM `acore_auth`.`account`); +DELETE FROM `acore_characters`.`character_account_data` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_achievement` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_achievement_progress` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_action` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_aura` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_glyphs` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_homebind` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`item_instance` WHERE `owner_guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_inventory` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`pet_aura` WHERE `guid` IN (SELECT `id` FROM `acore_characters`.`character_pet` WHERE `owner` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`)); +DELETE FROM `acore_characters`.`pet_spell` WHERE `guid` IN (SELECT `id` FROM `acore_characters`.`character_pet` WHERE `owner` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`)); +DELETE FROM `acore_characters`.`pet_spell_cooldown` WHERE `guid` IN (SELECT `id` FROM `acore_characters`.`character_pet` WHERE `owner` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`)); +DELETE FROM `acore_characters`.`character_pet` WHERE `owner` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_queststatus` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_queststatus_rewarded` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_reputation` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_skills` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_social` WHERE `friend` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_spell` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_spell_cooldown` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`character_talent` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`corpse` WHERE `guid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`groups` WHERE `leaderGuid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`group_member` WHERE `memberGuid` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`mail` WHERE `receiver` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_characters`.`mail_items` WHERE `receiver` NOT IN (SELECT `guid` FROM `acore_characters`.`characters`); +DELETE FROM `acore_auth`.`account` WHERE `username` LIKE 'RNDBOT%'; diff --git a/lib/general-settings.sh b/lib/general-settings.sh new file mode 100755 index 0000000..d18bc56 --- /dev/null +++ b/lib/general-settings.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +########################################################################################## +# General settings +########################################################################################## +# Setting execute rights for the scripts +sudo chmod +x ${ROOT_DIR}/*.sh +sudo chmod +x ${ROOT_DIR}/lib/*.sh +sudo chmod +x ${ROOT_DIR}/helper/*.sh + +# Alias GIT (git lg for git commits, git ls for commits with changed files) +git config --global alias.lg 'log --graph --abbrev-commit --decorate --date=relative --all' +git config --global alias.ls 'log --stat --pretty=short --graph' diff --git a/lib/merge_core.sh b/lib/merge_core.sh new file mode 100755 index 0000000..6311f17 --- /dev/null +++ b/lib/merge_core.sh @@ -0,0 +1,28 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" + + +########################################################################################## +# General dependencies +########################################################################################## +sudo apt update && sudo apt install -y git + +read -p "Merge the orginal azerothcore code into the playerbot azerothcore, are you sure? (Y)es/(N)o: " -n 1 -r +echo " "; +if [[ $REPLY =~ ^[Yy]$ ]]; +then + ########################################################################################## + # Try to merge from the orginal azerothcore into the playerbot azerothcore fork branch + ########################################################################################## + cd ${ROOT_DIR}/../_download/azerothcore + git reset --hard origin/Playerbot + git fetch upstream + git merge upstream/master + echo " " + + echo "###########################################################################################" + echo "## If (conflict) error just run update (2_update.sh) again to restore to the latest" + echo "## version of the playerbot branch" + echo "###########################################################################################" + +fi diff --git a/variables.sh b/variables.sh new file mode 100755 index 0000000..345542c --- /dev/null +++ b/variables.sh @@ -0,0 +1,42 @@ +#!/bin/bash +ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" + + +########################################################################################## +# If you want remote players to connect use the following info e.g. +# router DMZ or poort-forwarding and possibly firewall settings. +########################################################################################## +# 3724 TCP AUTH-SERVER +# 8085 TCP WORLD-SERVER + + +########################################################################################## +# Variables # https://github.com/azerothcore/azerothcore-wotlk/blob/master/conf/dist/env.ac +########################################################################################## +AUTHSERVER="${ROOT_DIR}/_server/azerothcore/acore.sh run-authserver" +WORLDSERVER="${ROOT_DIR}/_server/azerothcore/acore.sh run-worldserver" +AUTHSERVER_SESSION="auth-session" +WORLDSERVER_SESSION="world-session" + +MYSQL_ROOT_PASSWORD=rootpassword +MYSQL_USER=acore +MYSQL_PASSWORD=acore +MYSQL_DATABASE=acore_auth + +DATAPATH=${ROOT_DIR}/_server/azerothcore/env/dist/bin + +# ---------------------------------------------------------------------------------------- +# if you want remore players to connects then this should the external IP/DNS +# which also should be placed in the 3.35a client Realm.wtf +# ---------------------------------------------------------------------------------------- +REALM_IP=192.168.178.186 +REALM_NAME="azerothcore.org" + +AH_BOT_MIN_ITEMS=25000 +AH_BOT_MAX_ITEMS=30000 + + +########################################################################################## +# General settings +########################################################################################## +source ${ROOT_DIR}/lib/general-settings.sh