From 890792004063f3754be3a1ed0e36c6787f0c9351 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Thu, 15 Apr 2021 12:04:34 +0200 Subject: refactor(guide): Refactor installation guide (#427) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Spell_system.md * refactor(guide): Refactor installation guide * Update Requirements.md * Update Requirements.md * da * Update windows-requirements.md * d * test * test * windows * windows * help * note to self: next windows * core and server installation * db * finally * Update client-setup.md * Update final-server-steps.md * Update windows-core-installation.md * Update core-installation.md * last * Update database-installation.md * Update database-installation.md * Update server-setup.md * Rename Requirements.md to requirements.md * Y * f * ad * Update windows-core-installation.md * d * Update installation-guide.md * Update linux-requirements.md Ubuntu installation with seperate MariaDB and Oracle MySQL * Remove account * Update installation-guide.md * Update installation-guide.md * Update installation-guide.md Co-authored-by: Nolt Co-authored-by: Francesco Borzì --- _includes/azerothcore/sidebar.html | 13 +- docs/Database-Setup.md | 48 ---- docs/Database-client.md | 23 -- docs/Extract-Client-Data.md | 92 ------- docs/Install-with-AC-Dashboard.md | 241 ------------------ docs/Installation.md | 331 ------------------------- docs/Requirements.md | 211 ---------------- docs/Spell_system.md | 270 ++------------------ docs/Syncing-your-fork.md | 21 -- docs/ac-dashboard-core-installation.md | 241 ++++++++++++++++++ docs/client-setup.md | 33 +++ docs/core-installation.md | 27 ++ docs/database-installation.md | 65 +++++ docs/database-keeping-the-server-up-to-date.md | 31 +++ docs/final-server-steps.md | 60 +++++ docs/installation-guide.md | 55 ++++ docs/installation_0.x.md | 171 ------------- docs/installation_1.x.md | 158 ------------ docs/keeping-the-server-up-to-date.md | 31 +++ docs/linux-core-installation.md | 98 ++++++++ docs/linux-keeping-the-server-up-to-date.md | 39 +++ docs/linux-requirements.md | 174 +++++++++++++ docs/linux-server-setup.md | 92 +++++++ docs/macos-core-installation.md | 92 +++++++ docs/macos-keeping-the-server-up-to-date.md | 39 +++ docs/macos-requirements.md | 64 +++++ docs/macos-server-setup.md | 92 +++++++ docs/networking.md | 47 ++++ docs/requirements.md | 27 ++ docs/requirements_0.x.md | 56 ----- docs/requirements_1.x.md | 52 ---- docs/server-setup.md | 122 +++++++++ docs/windows-core-installation.md | 166 +++++++++++++ docs/windows-keeping-the-server-up-to-date.md | 37 +++ docs/windows-requirements.md | 89 +++++++ docs/windows-server-setup.md | 74 ++++++ 36 files changed, 1824 insertions(+), 1658 deletions(-) delete mode 100644 docs/Database-Setup.md delete mode 100644 docs/Database-client.md delete mode 100644 docs/Extract-Client-Data.md delete mode 100644 docs/Install-with-AC-Dashboard.md delete mode 100644 docs/Installation.md delete mode 100644 docs/Requirements.md delete mode 100644 docs/Syncing-your-fork.md create mode 100644 docs/ac-dashboard-core-installation.md create mode 100644 docs/client-setup.md create mode 100644 docs/core-installation.md create mode 100644 docs/database-installation.md create mode 100644 docs/database-keeping-the-server-up-to-date.md create mode 100644 docs/final-server-steps.md create mode 100644 docs/installation-guide.md delete mode 100644 docs/installation_0.x.md delete mode 100644 docs/installation_1.x.md create mode 100644 docs/keeping-the-server-up-to-date.md create mode 100644 docs/linux-core-installation.md create mode 100644 docs/linux-keeping-the-server-up-to-date.md create mode 100644 docs/linux-requirements.md create mode 100644 docs/linux-server-setup.md create mode 100644 docs/macos-core-installation.md create mode 100644 docs/macos-keeping-the-server-up-to-date.md create mode 100644 docs/macos-requirements.md create mode 100644 docs/macos-server-setup.md create mode 100644 docs/networking.md create mode 100644 docs/requirements.md delete mode 100644 docs/requirements_0.x.md delete mode 100644 docs/requirements_1.x.md create mode 100644 docs/server-setup.md create mode 100644 docs/windows-core-installation.md create mode 100644 docs/windows-keeping-the-server-up-to-date.md create mode 100644 docs/windows-requirements.md create mode 100644 docs/windows-server-setup.md diff --git a/_includes/azerothcore/sidebar.html b/_includes/azerothcore/sidebar.html index 2ec668a..e979c13 100644 --- a/_includes/azerothcore/sidebar.html +++ b/_includes/azerothcore/sidebar.html @@ -3,10 +3,15 @@ How-To ( branch master ) Edit Install: Contribute: diff --git a/docs/Database-Setup.md b/docs/Database-Setup.md deleted file mode 100644 index 92953c7..0000000 --- a/docs/Database-Setup.md +++ /dev/null @@ -1,48 +0,0 @@ -You can setup the database manually or using the automated script. - -## Get a Database client - -We recommend to get a database client to operate to your DB easily, see [this page](Database-client.md). - -## How to setup the AzerothCore DB using the automated script - -### Use the default configurations: - -The `db_assembler` script and the `acore.sh` dashboard both use by default the **acore** db user for the database connection. Running for the first time the assembler command should create the user for you, however, if you're having permissions error or any other issue with that user, please open your MySQL client with the root user and run the following queries: - -```sql -DROP USER IF EXISTS 'acore'@'localhost'; -DROP USER IF EXISTS 'acore'@'127.0.0.1'; -CREATE USER 'acore'@'localhost' IDENTIFIED BY 'acore'; -CREATE USER 'acore'@'127.0.0.1' IDENTIFIED BY 'acore'; -GRANT ALL PRIVILEGES ON * . * TO 'acore'@'localhost' WITH GRANT OPTION; -GRANT ALL PRIVILEGES ON * . * TO 'acore'@'127.0.0.1' WITH GRANT OPTION; -FLUSH PRIVILEGES; -exit; -``` - -It will setup the acore user properly to be used by the db_assembler script - -### [ALTERNATIVE] Edit script configuration - -If you don't want to use the default acore user, then you can change the configuration of the script with the following steps: - -- Copy the file `conf/dist/config.sh` to `conf/config.sh` -- Open the `conf/config.sh` with any text editor -- Go to the secion `DB EXPORTER/IMPORTER CONFIGURATIONS` -- Edit the variables accordingly, e.g. you most likely need to edit `MYSQL_USER` and `MYSQL_PASS` variables putting your mysql server settings. - -### Run the script - -**Note**: if you're using MySQL 5.7, first run `mysql -e "SET GLOBAL sql_mode = '';" -u root -p` first (replace `root` with your mysql user). - -**Note**: if you're using Windows you must set-up MySQL as an Environment Variable using [this tutorial](http://www.azerothcore.org/wiki/Environment-Variable) and run the commands using **git bash** - -- Make sure you are currently located in the `azerothcore-wotlk` directory -- Run `bash apps/db_assembler/db_assembler.sh` -- Select `import-all: Assemble & Import all` -- Once the process is finished, you can exit the script. - -## How to setup the AzerothCore DB manually - -Alternatively, you could also [set up your DB manually](Database-Manual-Setup.md) but this process is harder and not recommended for beginners. diff --git a/docs/Database-client.md b/docs/Database-client.md deleted file mode 100644 index a99470e..0000000 --- a/docs/Database-client.md +++ /dev/null @@ -1,23 +0,0 @@ -## Generic MySQL clients - -We recommend to use a generic client to access and manage your MySQL/MariaDB databases. - -With a MySQL client you can easily create/view/edit/delete your database/tables and their contents. - -Here's a list of free and open source clients (feel free to edit this page to suggest your favourite): - -- [HeidiSQL](http://www.heidisql.com) - works on Windows as well as on Linux using [wine](https://www.winehq.org/) -- [DBeaver](https://dbeaver.io/) - cross-platform -- [SequelAce](https://sequel-ace.com/) - for macOS, you can install it with `brew cask install sequel-ace` -- [phpMyAdmin](https://www.phpmyadmin.net/) - web app written in PHP (cross-platform) - - -## Official AzerothCore DB Editor: Keira3 - -[Keira3](https://www.azerothcore.org/Keira3) is the official Database Editor of AzerothCore. - -It allows you to view and edit your world DB contents by automatically generating the SQL code that you need. - -Note that Keira3 is **not** meant to be used as a generic MySQL client, -so we recommend to download Keira3 **and** one of the MySQL clients listed above. They serve different purposes. - diff --git a/docs/Extract-Client-Data.md b/docs/Extract-Client-Data.md deleted file mode 100644 index 5fb5a07..0000000 --- a/docs/Extract-Client-Data.md +++ /dev/null @@ -1,92 +0,0 @@ -# Extracting DBC, Maps, VMaps & MMaps - -## Windows - -AzerothCore requires certain files obtained from World of Warcraft client. - -1. First of all we need to do a small modification in CMake: check **Grouped** and **Advanced** boxes. Then drop down **Ungrouped Entries** and check **TOOLS** box. (like shown in the image below) - -![](https://i.ibb.co/9ZFsCtH/azeroth-cmake-tools.png) - -Next press Configue and then Generate. - -2. Open **AzerothCore.sln** and Build the solution (Ctrl+Shift+B) - -### Now that you have the source compiled, you can proceed to the next step. - -3. Go to your AzerothCore build directory (E.g. AzerothCore\build\bin\Release) and copy the following files to your World of Warcraft directory (E.g. D:\World of Warcraft 3.3.5a (no install)) -* **mapextractor.exe** -* **mmaps_generator.exe** -* **vmap4assembler.exe** -* **vmap4extractor.exe** -* **[extract_vmaps.bat](https://pastebin.com/KKMurZ4D)** : You can whether create an **extract_vmap.bat** file and edit it with the linked script or you can create a text file, write on it with the linked text, save it and then rename the file as **extract_vmaps.bat** - -4. First, you must extract **dbc** and **maps**. Go ahead and click on **mapextractor.exe**. You must wait until this process is completed. - -5. Next, we need to extract **Buildings**. Go ahead and click on **vmap4extractor.exe**. You must wait until this process is completed. - -6. Now we need to assembly **vmaps**. Click on **extract_vmaps.bat**. You must wait until this process is completed and press any button when done. - -7. Next, we need to extract **mmaps**. In case you do not have the folder **mmaps** then create it manually. Go ahead and click on **mmaps_generator.exe**. -**NOTE: This process will take up to a few hours, depending on your computer specs.** - -Now that everything is completed, you need to copy **dbc**, **maps**, **vmaps** and **mmaps** folders to your AzerothCore build directory (E.g. AzerothCore\build\bin\Release). -Note: Keep in mind [this config line at worldserver.conf](https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/worldserver/worldserver.conf.dist#L61) when you place your dbc and maps into your build. - -Written by [mindsear](https://github.com/mindsear) -Updated by [Silker](https://github.com/Si1ker) - -*** - - -## Linux & Mac - -1. To extract the client data we need to build the tools, so change the cmake parameter -DTOOLS=0 into -DTOOLS=1 and launch the build of the core. -Type the following commands (replacing 4 with the number of threads that you want to execute): - -**Linux** -``` -cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/azeroth-server/ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DTOOLS=1 -DSCRIPTS=0 -make -j 6 -make install -``` - -**Mac** -``` -cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/azeroth-server/ -DTOOLS=1 -DSCRIPTS=0 -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient_r.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl/lib/libcrypto.dylib -make -j 6 -make install -``` - -### Now that you have the source compiled, you can proceed to the next step. -2. Go to your AzerothCore build directory (e.g. $HOME/azeroth-server/bin/) and copy the following files to your World of Warcraft directory (where there is also the Wow.exe file etc.) -* **mapextractor** -* **mmaps_generator** -* **vmap4assembler** -* **vmap4extractor** - -3. First, you must extract **dbc** and **maps**, so open the terminal and go to your WoW/ directory and rune the file **mapextractor**. You must wait until this process is completed. -``` -./mapextractor -``` -4. Next, we need to extract **Buildings** through the **vmap4extractor**, so type in your terminal the follows command. You must wait until this process is completed. -``` -./vmap4extractor -``` -5. Next, we need to assembly **vmaps** through the **vmap4assembler**, so type in your terminal the follows command. Same thing, you must wait until this process is completed.. -``` -mkdir vmaps; -./vmap4assembler Buildings vmaps -``` - -6. Next, we need to extract **mmaps** with the **mmaps_generator**, so run: -**NOTE: This process will take up to a few hours, depending on your computer specs.** - -``` -mkdir mmaps; -./mmaps_generator -``` - -Now that everything is completed, you need to copy **dbc**, **maps**, **vmaps** and **mmaps** folders to your AzerothCore build directory (e.g. *$HOME/azeroth-server/data/*). - -This guide was written by [Helias](https://github.com/Helias). diff --git a/docs/Install-with-AC-Dashboard.md b/docs/Install-with-AC-Dashboard.md deleted file mode 100644 index 0cd2042..0000000 --- a/docs/Install-with-AC-Dashboard.md +++ /dev/null @@ -1,241 +0,0 @@ -## Introduction - -The AzerothCore bash dashboard is a collection of scripts that help with the installation and maintenance of an AzerothCore server. -It allows to easily install, update and execute AzerothCore on your machine in a tremendously small amount of steps. - -Installing a development or production private server has never been so easy before. -If you need any help just [ask a question](https://www.azerothcore.org/wiki/How-to-ask-for-help). - - -## Requirements - -You need to have [git](https://git-scm.com/) installed in your machine. -No other software is required to be installed manually. - -- debian/ubuntu-based: `apt update && apt install git` -- macOS: `brew install git` - -### Notes -- For macOS users: install and use the latest version of bash to run the commands of the dashboard (`brew install bash`) -- For Windows users: the commands need to be executed within the "git bash" shell or a bash-compatible shell such as WSL, cygwin etc.. - However, git bash is suggested because is preinstalled with git for windows (one of our requirements) - - -## Setup - -### Get the AC sources - -``` -git clone https://github.com/azerothcore/azerothcore-wotlk.git; cd azerothcore-wotlk -``` - -### Configuration - -There is a [conf/dist/config.sh](https://github.com/azerothcore/azerothcore-wotlk/blob/master/conf/dist/config.sh) -file containing a default configuration. Have a look at it. -Most of the configuration defaults will probably work for your case, -but you can copy it under `conf/config.sh` and change values as you please. - - -### Install all AC dependencies - -``` -./acore.sh install-deps -``` - -### Build everything from scratch - -``` -./acore.sh compiler all -``` - -### Set-up the database - -- Either connect to your MySQL database and manually create the `acore` MySQL user: - -``` -DROP USER IF EXISTS 'acore'@'localhost'; -DROP USER IF EXISTS 'acore'@'127.0.0.1'; -CREATE USER 'acore'@'localhost' IDENTIFIED BY 'acore'; -CREATE USER 'acore'@'127.0.0.1' IDENTIFIED BY 'acore'; -GRANT ALL PRIVILEGES ON * . * TO 'acore'@'localhost' WITH GRANT OPTION; -GRANT ALL PRIVILEGES ON * . * TO 'acore'@'127.0.0.1' WITH GRANT OPTION; -FLUSH PRIVILEGES; -exit; -``` - -*Note: even though the `acore` user is only accessible from localhost, -it is a good practice to change its password to something more secure.* - -- Or change the `config.sh` to use another MySQL user. - -Then run: - -``` -./acore.sh db-assembler import-all -``` - -this will install a full AzerothCore Database. No need to import any DB update at this point. - -### Download the latest client data - -Get the latest client data: - -``` -./acore.sh client-data -``` - -### Server config files - -``` -cp env/dist/etc/authserver.conf.dist env/dist/etc/authserver.conf -``` -``` -cp env/dist/etc/worldserver.conf.dist env/dist/etc/worldserver.conf -``` - -### Result - -If you followed the above, you'll get your server inside the `env/dist` directory. - -The `worldserver` and `authserver` binaries are located in `azerothcore-wotlk/env/dist/bin`. - -You can either run them directly or use the restarter (see below). - -### Restarter - -The AzerothCore dashboard comes with a bundled restarter suite: - -``` -./acore.sh run-worldserver -``` - -``` -./acore.sh run-authserver -``` - -For dedicated servers, -you may want to run them inside terminal multiplexer sessions using tools like `tmux` (see below). - - -## How to update your server - -Update the sources: - -``` -git pull -``` - -Rebuild: -``` -./acore.sh compiler build -``` - -Update the database: - -``` -./acore.sh db-assembler import-updates -``` - -That's it. - - -## Tips for dedicated (production) servers - -### Daily backups of your databases via Telegram - -Getting daily backups of your private server databases directly to your phone/computer -via [Telegram](https://telegram.org/) messages? - -Yes, that's possible. Just use: [azerothcore/telegram-automated-db-backup](https://github.com/azerothcore/telegram-automated-db-backup) - -### Visual Studio Code SSH - -You can easily install AzerothCore in a linux server without any kind of GUI, -simply connecting remotely via ssh using [Visual Studio Code](https://code.visualstudio.com/) -and the [SSH](https://code.visualstudio.com/docs/remote/ssh) -and the [SSH: Editing Configuration Files](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh-edit) extensions so you'll feel just like at home. - -### Run AzerothCore inside Tmux sessions - -You can use [tmux](https://github.com/tmux/tmux) as terminal multiplexer, -it will allow you to easily manage your processes inside a server with no GUI. - -You can create 2 sessions and run the `worldserver` and `authserver` processes inside them: - -- `tmux new -s world-session` -- now run the `./acore.sh run-worldserver` inside it, then detach from it - - -- `tmux new -s auth-session` -- now run the `./acore.sh run-authserver` inside it, then detach from it - -You can detach using `CTRL+B+D` to exit the session without killing the process. -If connected using VSCode SSH, you can just close the terminal session. - -You can attach again to the `world-session` session using: - -- `tmux attach -t world-session` - -Other useful commands: - -- create a new session: `tmux new -s my_session` -- list all sessions: `tmux ls` -- kill a session: `tmux kill my_session` (or just attach to it and type `exit`) -- kill ALL sessions: `tmux kill-server` -- ...more details available at the [tmux wiki](https://github.com/tmux/tmux/wiki) - - -### Automatically start the tmux sessions at system startup - -You can automatically create the tmux sessions and execute the `authserver` and `worldserver` using this simple script: - -```sh -#!/usr/bin/env bash - -# CHANGE THESE WITH THE CORRECT PATHS -authserver="/path/to/azerothcore-wotlk/acore.sh run-authserver" -worldserver="/path/to/azerothcore-wotlk/acore.sh run-worldserver" - -authserver_session="auth-session" -worldserver_session="world-session" - -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 - -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 - -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 - -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 -``` - -On unix systems, you can then use [crontab](https://en.wikipedia.org/wiki/Cron) -to run the script automatically at system startup: - -``` -crontab -e -``` - -then add this line (replace `/path/to/startup.sh` with the path of where you placed the above script): - -``` -@reboot /bin/bash /path/to/startup.sh -``` diff --git a/docs/Installation.md b/docs/Installation.md deleted file mode 100644 index 2d2d0ab..0000000 --- a/docs/Installation.md +++ /dev/null @@ -1,331 +0,0 @@ -# AzerothCore Installation - -There are several ways to install AzerothCore, you need to pick **one**. - -- **Azerothcore Classic setup** - the traditional way of installing AzerothCore. - Battle-tested, recommended for all operating systems for any purposes. - This process gives more awareness of how AzerothCore is structured. **See below in this page**. - - -- **AzerothCore Docker setup** - a simplified installation process based on Docker. - - See [Install AzerothCore with Docker](Install-with-Docker.md). - - -- **[NEW] AzerothCore Bash Dashboard setup** - simplest way of installing AzerothCore, - recommended for **Linux** systems for both local development and production. - Currently not recommended for Windows or macOS. - - See [Install AzerothCore using the AC bash dashboard](Install-with-AC-Dashboard.md). - - **Disclaimer**: These scripts are supposed to be cross-platform, however we are not quite there yet. - It's not currently recommended to use the installation process described in this page on Windows or macOS. - You can of course try them anyway and [let us know](https://github.com/azerothcore/azerothcore-wotlk/issues/new/choose) in case you encounter any issue. - That does not mean that you cannot use this in production. - We tested this procedure on a dedicated server machine running Ubuntu 20.04 and it worked quite nicely, - we'll include here some extra tips for production environments as well. - - -Other tutorials from the community for specific platforms: - -- [Install AzerothCore on Amazon Web Services](aws-tutorial.md) -- [Install AzerothCore on a Digital Ocean droplet](digital-ocean-video-tutorial.md) -- [Install AzerothCore with ArchLinux](arch-linux.md) - -## CLASSIC INSTALLATION - -### 1) Requirements - -Make sure your system fits the [Requirements](Requirements.md). - -**Note for Windows users**: use **git bash** as terminal to run commands (see Requirements). - -### 2) Getting the source files - -Choose **ONE** of the following method, run one of the below `git ...` commands in your terminal. - -This will create an `azerothcore-wotlk` directory containing the AC source files. - -A) Clone only the master branch + full history (smaller size - recommended): - -```sh -git clone https://github.com/azerothcore/azerothcore-wotlk.git --branch master --single-branch azerothcore -``` - -B) Clone only the master branch + no previous history (smallest size): - -```sh -git clone https://github.com/azerothcore/azerothcore-wotlk.git --branch master --single-branch azerothcore --depth 1 -``` - -C) Clone all branches and all history: - -```sh -git clone https://github.com/azerothcore/azerothcore-wotlk.git azerothcore -``` - -Note: If you want to get the full history back, use `git fetch --unshallow` (if you chose option B). - - -### 3) Compiling - -#### Compiling on GNU/Linux or Mac OS X - -```sh -cd azerothcore -mkdir build -cd build -``` - -or - -```sh -cd azerothcore && mkdir build && cd build -``` - -Before running the CMake command, replace `$HOME/azeroth-server/` with the path of the server installation (where you want to place the compiled binaries). - -**CMAKE OPTIONS** - -Check the options here if you know what you're doing: [CMake options](CMake-options.md) - - -**CMake on Linux:** - -At this point, you must be in your "build/" directory. - -**Note**: in the following command the variable `$HOME` is the path of the **current user**, so if you are logged as root, $HOME will be "/root". You can check the state of the environment variable, as follows: - -```sh -echo $HOME -``` - -**Note2**: in case you use a non-default package for `clang`, you need to replace it accordingly. For example, if you installed `clang-6.0` then you have to replace `clang` with `clang-6.0` and `clang++` with `clang++-6.0` - -```sh -cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/azeroth-server/ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_WARNINGS=1 -DTOOLS=0 -DSCRIPTS=1 -``` - -To know the amount of cores available. -You can use the following command - -```sh -nproc --all -``` - -Then, replacing `6` with the number of threads that you want to execute, type: - -```sh -make -j 6 -make install -``` - -or - -```sh -make -j 6 && make install -``` - -**CMake on Mac OS X:** - -**Note**: in the follows command the variable `$HOME` is the path of the **current user**, so if you are logged as root, $HOME will be "/root". - -```sh -cmake ../ -DCMAKE_INSTALL_PREFIX=$HOME/azeroth-server/ -DTOOLS=0 -DSCRIPTS=1 -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl/lib/libcrypto.dylib -``` - -To know the amount of cores available. -You can use the following command - -```sh -nproc --all -``` - -Then, replacing `4` with the number of threads that you want to execute, type: - -```sh -make -j 4 -make install -``` -or - -```sh -make -j 4 && make install -``` - -#### Compiling on Windows - -Open CMake, press `Browse Source...` button and select the folder that you cloned earlier then press `Browse Build...` and select a folder where the CMake will generate the build files. Press the `Configure` button. - -CMake will ask you to select what compiler to use. For example you'll want to select `Visual Studio 16 2019` to compile binaries using Visual Studio 2019. If you want to build using x64 set `Optional platform for generator` to x64. Do not change the `Use default native compilers` option. Press `Finish` and wait until CMake is done checking for requires files. - -Change `CMAKE_INSTALL_PREFIX` to the location where you will run your server from. -Press `Configure` once again and then press `Generate`. If no error occurred you can close CMake. -Go to the location where the build files have been generated and open AzerothCore.sln - -_Note: If MySQL is not found by CMake it is required to set MYSQL_INCLUDE_DIR = C:/mysql_libs/include and MYSQL_LIBRARY= C:/mysql_libs/lib_XX/libmysql.lib._ -_XX depends if you are compiling in 32 or 64 bits mode. ( See [Windows Requirements article](Requirements.md#windows) )_ - -Press `BUILD` then select `Build solution` or press Ctrl+Shift+B on VS 2019 / F6 on VS 2017. -Wait until the Build has been finished (It should take between 10-40 minutes depending on your hardware). - -You will find your freshly compiled binaries in the Build\bin\Release or Build\bin\Debug folder. These are all used to run your server at the end of this instruction. - -You will need the following files in order for the core to function properly: - -``` -libeay32.dll / libcrypto-1_1.dll / libcrypto-1_1-x64.dll -libmySQL.dll -ssleay32.dll / libssl-1_1.dll / libssl-1_1-x64.dll -authserver.conf.dist -authserver.exe -worldserver.conf.dist -worldserver.exe -``` - -The `.dll` files needs to be copied manually from their install folder into your compiled folder. - -`libmysql.dll` (C:\Program Files\MySQL\MySQL Server 8.0\lib\) - -For OpenSSL 1.0.x: - -* (C:\OpenSSL-Win32\ or C:\OpenSSL-Win64\) - * `libeay32.dll` - * `ssleay32.dll` - -For OpenSSL 1.1.x: - -* Win32 (C:\OpenSSL-Win32\bin) - * `libcrypto-1_1.dll` - * `libssl-1_1.dll` - -* Win64 (C:\OpenSSL-Win64\bin) - * `libcrypto-1_1-x64.dll` - * `libssl-1_1-x64.dll` - - -**Note:** Do not use ARM architecture as azerothcore requires SSE2 and ARM doesn't support it. - - -### 4) Setting the configuration files - -Inside the directory where you installed the binaries (e.g. `/home/youruser/azeroth-server/`), open the directory where configuration files has been installed ( `etc/` on linux ) , then: - -- copy the file `authserver.conf.dist` and rename it to `authserver.conf` ( DO NOT REMOVE THE .dist FILE ) -- copy the file `worldserver.conf.dist` and rename it to `worldserver.conf` ( DO NOT REMOVE THE .dist FILE ) - -_Please Read [How to edit .conf files](how-to-work-with-conf-files.md) article to understand how configuration files work, and why you need the .dist file too_ - -Open both `authserver.conf` and `worldserver.conf` files and go to the `MYSQL SETTINGS` section, then set the variables: - -``` -LoginDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_auth" -WorldDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_world" -CharacterDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_characters" -``` - -The default user is `acore` with password `acore`. If you would like to use another MySQL user, change the credentials here. -(the `authserver.conf` has the `LoginDatabaseInfo` variable only). - -In the worldserver.conf file, also set: - -`DataDir = "/home/youruser/azeroth-server/data"` - -replacing `/home/youruser/azeroth-server` with `CMAKE_INSTALL_PREFIX`. - - -### 5) Download the data files - -Go to `CMAKE_INSTALL_PREFIX` and create a new directory named `data` - -Two options to choose from: - -##### A) [Extract Client Data](http://www.azerothcore.org/wiki/Extract-Client-Data) from your own WOW client using the AzerothCore extractors (required for custom maps) - -##### B) (Easier) Download directly using one of the links below: - -Github links: - - -**RECOMMENDED**: [Full data (v10) - from 05/04/2021 to now](https://github.com/wowgaming/client-data/releases/download/v10/data.zip) (Used in the automatic downloader script in `/apps/`) - -Old versions links (<= v9): -- [From 1/12/2020 to 05/04/2021](https://github.com/wowgaming/client-data/releases/download/v9/data.zip) (Used in the automatic downloader script in `/apps/`) -- [From 13/08/19 to 1/12/2020](https://github.com/wowgaming/client-data/releases/tag/v7) [Vmaps & mmaps only (v8) - from 13/08/19 to 1/12/2020](https://mega.nz/#F!xqYxDQ5K!PesmFvXRSqiCRcknVxBn5g) -- [From 03/01/19 to 13/08/19](https://mega.nz/#F!Am4DBKCR!o9Qj_xFLfsg4sczqg0xq2A) -- [From 07/18/18 to 03/01/19](https://mega.nz/#!utg3hKJL!TtSzcWxVkvxF4HJvor8LFWhrBwwpH2pHpI-xHGr-HZo) (before commit [59d4e1d3a806a4f2f48f535be366bde1b24d737e](https://github.com/azerothcore/azerothcore-wotlk/commit/59d4e1d3a806a4f2f48f535be366bde1b24d737e)) -- For older versions, check out this page's history. - -Other links: -- [DBC & maps ONLY for all versions](https://mega.nz/#F!pyYlkK6b!pNz-zhThXQIg0_rO5L_RsQ) - - -Then, extract all the archives and place the extracted `dbc`, `maps`, `mmaps`, `vmaps` directories inside the `data` directory. - - -### 6) Setting up the database - -#### Base DB setup -Follow these instructions: [Database Setup](Database-Setup). - -**Note**: by default, database names are configured to be named: - -- `acore_characters` -- `acore_auth` -- `acore_world` - - if, for some reasons, you decide to name them differently, remember to edit your `authserver.conf` and `worldserver.conf` accordingly. - -#### Configure your auth.realmlist table - -In the `acore_auth` database, you must fill the `realmlist` table with your connection info. -It must correspond with the values in `worldserver.conf` (for realmid, flag and realmzone). - - Address: 127.0.0.1 OR OR - Port : worldserver port - - -### 7) Starting the servers - -#### GNU/Linux and Mac OS X - -Open 2 terminal windows (or terminal tabs) and move to the `bin` directory of your azeroth server (for example `/home/youruser/azeroth-server/bin`), - -then in one window/tab type: - -`./authserver` - -in the other one: - -`./worldserver` - - -#### Windows - -Run `worldserver.exe` and `authserver.exe` from `CMAKE_INSTALL_PREFIX`. - - -### 8) Connecting to the server - -Edit your `realmlist.wtf` and add the IP you set in the realmlist table (and the port if needed). Then you can connect with a newly made account or the test accounts (`test1` to `test10`, with password `a`). - -You can change all the passwords at once by pasting this into the worldserver console: -``` -.account set password test1 new_pass new_pass -.account set password test2 new_pass new_pass -.account set password test3 new_pass new_pass -.account set password test4 new_pass new_pass -.account set password test5 new_pass new_pass -.account set password test6 new_pass new_pass -.account set password test7 new_pass new_pass -.account set password test8 new_pass new_pass -.account set password test9 new_pass new_pass -.account set password test10 new_pass new_pass -``` - -### Optional: Creating a regular user to work with on Linux -Start with logging in to your Linux machine and create an account for the server itself on most recent distributions this can easily be done with the following command : - -```sudo adduser ``` Note: Change `` to the preferred username of your going to use on your server. - -```sudo su - ``` Note: Switch user to newly created `` so everything will run and compile with the user you just have created. diff --git a/docs/Requirements.md b/docs/Requirements.md deleted file mode 100644 index 4c10f64..0000000 --- a/docs/Requirements.md +++ /dev/null @@ -1,211 +0,0 @@ -# AzerothCore Requirements - -## GNU/Linux - -### Debian-based requirements - -#### Ubuntu - -```sh -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 libace-6.* libace-dev -``` - -Remember that if you are using the `root` user, it is not necessary to use `sudo`. - -To configure MySQL in Ubuntu 18.04 and similar (set `root` password and other settings) read [this guide](https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04). - -**Note**: in older versions of Ubuntu like **18.04** you need to install gcc 10: - -``` -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt install gcc-10 g++-10 -``` - - ---- - -#### Debian 8 - -```sh -sudo apt-get update && sudo apt-get install git make gcc g++ clang libmysqlclient-dev libssl1.0-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libace-6.* libace-dev -``` - -Remember that if you are using the `root` user, it is not necessary to use `sudo`. - -#### Install last cmake version on Debian 8 - -To install last version of cmake use: - -```sh -sudo apt install python3-pip -pip3 install --upgrade cmake -``` - -If you are using the `root` user - -```sh -apt install python3-pip -pip3 install --upgrade cmake -``` - -Than **reboot** to sync the bash and use cmake from the terminal, than type the followings commands to check the cmake version: - -```sh -cmake --version -``` - -You should have a version **>= 3.16**. - -Continue below the guide to install the other installation requirements. - -**Troubleshooting (cmake install)**: if you get any errors like: `No module named 'skbuild'`, you can solve with this: - -```sh -apt install python3-pip -pip3 install scikit-build -pip3 install --upgrade pip -pip3 install cmake -``` - ---- - -#### Debian 9 - -```sh -sudo apt-get update && sudo apt-get install git cmake make gcc g++ clang default-libmysqlclient-dev libssl1.0-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libace-6.* libace-dev -``` - -Remember that if you are using the `root` user, it is not necessary to use `sudo`. - -You might need to add the stretch-backports repositories to APT in order to install clang-6.x+ and cmake v3.8+. -If you do not succeed installing cmake you can use the package manager of python3 (pip3) - ---- - -#### Debian 10 - -```sh -sudo apt-get update && sudo apt-get install git cmake make gcc g++ clang default-libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mariadb-server libace-6.* libace-dev -``` - -Remember that if you are using the `root` user, it is not necessary to use `sudo`. - -**Note:** If you add the option `-y` and at the end of the list, it will start installing them without the need for you to confirm. - -**Example:** - -```sh -apt-get update && apt-get install git cmake make gcc g++ clang default-libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mariadb-server libace-6.* libace-dev -y -``` - ---- - - -#### Check your clang version - -```sh -clang --version -``` - -Your `clang` version **MUST** be `6` or higher ([here](https://github.com/azerothcore/azerothcore-wotlk/actions?query=workflow%3Acore-build) you can check the versions that run in our Github Actions pipeline, we recommend to use one of those versions). - -For example, if you are using an older version of Ubuntu like 16.04, you need to install clang using: - -```sh -sudo apt-get install clang-6.0 -``` - -If you use another distro or version, search on google for how to install the right clang version for your system. - -#### Check your cmake version - -```sh -cmake --version -``` - -Your `cmake` version **MUST** be `3.16` or higher. - -On an older version of Ubuntu (example: 16.04), you can follow the instructions here in order to install the latest cmake version. On debian you would need to use the backports sources or build Cmake manually. - -#### Ensure that the gcc-7 headers are installed - -This is an issue if for example using an older version of Ubuntu like 16.04. There you have to add the PPA "Toolchain test builds": -https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test - -After - -```sh -sudo apt-get update -``` - -you can install gcc-7: - -```sh -sudo apt-get install g++-7 gcc-7 -``` - ---- - -## Mac OS X - -- Install XCode using the App Store, then open the terminal and type: - -```sh -xcode-select --install -``` - -- Install the package manager [Homebrew](http://brew.sh/) - -Use brew it to install the required packages: - -```sh -brew update -``` - -```sh -brew install openssl readline cmake ace coreutils bash bash-completion coreutils -``` - -This will install bash 5+, you might need to restart your terminal. -Make sure you are using bash 5 or newer by typing `bash --version`. - -Now install mysql: - -```sh -brew install mysql -``` - -You will be prompted some instructions to complete the `mysql` installation, for example to properly set a password. Just follow the instructions and properly configure mysql. **This step is important, do not skip it.** - -To verify that mysql has been properly installed, try accessing it using either the command line (e.g. `mysql -u root -p`) or using DB client managers with a UI like Sequel Ace. - -You can install Sequel Ace with: - -```sh -brew cask install sequel-ace -``` - - -## Windows - -* Install [Visual Studio](https://visualstudio.microsoft.com/downloads/) VS 2019 Community - -* Install [CMake](https://cmake.org/) version 3.16 or higher - -* Install latest version of [Git Extensions](https://git-scm.com/download/win) - -* [MySQL Server Community Edition](https://dev.mysql.com/downloads/mysql/) (version 8.0 or 5.7, older versions are not supported) - -* Install [OpenSSL](http://www.slproweb.com/products/Win32OpenSSL.html) version 1.0.x or 1.1.x (Do not install the Light version) - - Download the 64bit version. Or you can get both if you plan to compile both 32 and 64bit, they can coexist side by side. - -1. Find the 64bit version by finding the _latest _ **Win64 OpenSSL** that is **NOT** the "light" version. - 1. Example: **Win64 OpenSSL v1.0.1p** - -2. Find the 32bit version by finding the _latest _ **Win32 OpenSSL** that is **NOT** the "light" version. - 1. Example: **Win32 OpenSSL v1.0.1p** - -3. _Note #1: If you get a "Missing Microsoft Visual C++ 2008 Redistributables" error message while installing OpenSSL, download the ** [Microsoft Visual C++ 2008 Redistributable Package (x64)](http://www.microsoft.com/en-us/download/details.aspx?id=29) ** (1.7MB Installer) and install it. If you need 32bit support, download and install the [ **Microsoft Visual C++ 2008 Redistributable Package (x86)** ](http://www.microsoft.com/en-us/download/details.aspx?id=15336)._ -4. _Note #2: While installing OpenSSL, choose **The OpenSSL binaries (/bin) directory** (NOT "The Windows system directory") when given the choice on where to copy the OpenSSL DLLs. These DLLs will need to be located easily for Core Installation._ diff --git a/docs/Spell_system.md b/docs/Spell_system.md index cd5f00c..5aaa00f 100644 --- a/docs/Spell_system.md +++ b/docs/Spell_system.md @@ -1,260 +1,30 @@ -# Spell system +##### This article was created and ported from Trinity core's wiki since their system is identical +# *Introduction: How do spells work in Azerothcore?* +This article is meant to introduce you to the concept of a spellcast. It's an important thing for every scripter to know in brief how this works because spells are one of the main "channel of interaction" between objects ingame. Whenever you pick someone's pocket as a rouge, init a trade with other player, use an item or simply hurt someone's ass using magic - a spell is involved. Each spell is identified by it's spellId entry in spell.dbc. SpellInfo class is a C++ interface to that table (among other related dbc and sql tables). Most of the cast process is handled inside a Spell class representing dynamic state of each cast. Behavior of that class can be affected using SpellScript class objects. A mechanism with such big impact on everything is complex, so to simplify our view of what's going on, let's split it into several phases. Ingame, they occur in the same order as in this article. -### How do spells work? +# *Spell prepare phase* +This phase is responsible for **handling the "request"** from a spell caster - object which has initiated the cast. A request can be made from **player** client (see SpellHandler.cpp), or from the **gameobjects** themselves. (GameObject::CastSpell, Unit::CastSpell, etc). Here, the worldserver validates and prepares an **explicit target** for whom the spell is targeting. -Behavior of each spell is defined in 3 places: database, spell scripts, and spell system code interpreting that database. Mortals should care mostly about first two which are discussed in this article. +### **What is an explicit spell target?** +Simply put, an explicit spell target is the target affected by a spell. For example, the explicit spell target of a Warrior's Heroic Strike is the current selected unit, be it a player or a non-playable character. -### Database +Server side explicit target is selected by the first parameter of Unit::CastSpell function. -The database part includes data extracted from client loaded from dbc files:  +However, not all spells require explicit targets! An example can be an area of effect spell, which no matter what you select ingame, targets around you are affected. Therefore, explicit spell target can be **null**, and that's natural. -[Spell](Spell).dbc, ... +In case of many other spells, an explicit target can be also a position on the ground, which is the case for *blizzard* mage spell. -As this data is extracted from client. It doesn't contain spells needed only serverside, those need to be added inside supplementary db tables in core which are emulating dbcs and have the same structure:  +### **What decides whether spell needs explicit target?** +As you may have read in Spell system , database decides about most of the spell's behavior, so is in this case. Spell.dbc's target, implicitTargetA, implicitTargetB decide about that, briefly - flag in target field or implicitTargetX set to one of TARGET_XXX_TARGET (TARGET_UNIT_TARGET for example) target modes mean spell requires an explicit target. The most important consequence of this is that you CANNOT cast anything you want on anything you wish, it's all precisely decided by client database and only thing you can do is to follow those rules. Besides explicit spell target validation and preparation there are also done some premature checks for correctness of cast request - a Spell::CheckCast funcion is called (which uses db data for checks), there are also some checks done in cast request functions unfortunately spread all over the core. On failure, error is sent, otherwise spell is enqueued for execution on next object update, or handled immediately in case of triggered spells. Triggered is a kind of "system" cast, it's not precisely defined what that means exactly as the term is overused too much to have any specific meaning, but setting the triggered cast flag alters a lot of spell's behavior and db data interpretation. As an example, spells cast with triggered flag (a parameter of CastSpell()) will ignore item requirements set in dbc, some caster state requirements and so on. After spell is prepared successfully casting begins, you see castbar ingame. You can follow the code of this phase by searching for Spell::Prepare function occurrences in core. -[spell\_dbc](spell_dbc) ****Note: ****Not longer used since Warlords of Draenor Expansion (see [Hotfixes](https://trinitycore.atlassian.net/wiki/display/tc/Hotfixes), at least spell, spell\_misc & spell\_effect)  +# *Spell prepare phase* +Once castbar is full (in case of instant spells immediately) the cast phase begins. During that phase there are done several things, one of the most important is: spell implicit target selection. Spell implicit targets are ingame objects which will be affected by your spell. Their selection is based on implicitTargetX columns of Spell.dbc, conditions table and OnObject(Area)TargetSelect hooks of SpellScript. There's nothing done to the targets at this point (please don't break that rule while using scripts - it's unblizzlike), they're just selected for future processing. At the beginning of this phase another important thing is done: second call of Spell::CheckCast (which you can affect by using OnCheckCast spell script hook and conditions db table). Also, required items and power is taken in this phase from the caster. You can hook on this phase using BeforeCast, OnCast, AfterCast hooks. the whole phase is handled in Spell::cast. -[spelldifficulty\_dbc](spelldifficulty_dbc) - -Data stored in dbcs is extracted from client, ergo it may not be interpreted by TC properly, so it's meaning is a subject of changes and fixing, as dbcs contain most of the data needed by spell system to work. - -Data not needed by client for all spells is stored in following tables of world db: - -[conditions](conditions)  - --CONDITION\_SOURCE\_TYPE\_SPELL\_IMPLICIT\_TARGET - allows you to define requirements for implicit area targets of the spell, only matching targets will be added to spell target list - --CONDITION\_SOURCE\_TYPE\_SPELL - allows you to define requirements for caster/explicit target of the spell, if not met cast will fail - --CONDITION\_SOURCE\_TYPE\_SPELL\_PROC - allows you to define requirements for actor and actionTarget, if not met proc will fail - --CONDITION\_SOURCE\_TYPE\_SPELL\_CLICK\_EVENT - --CONDITION\_SOURCE\_TYPE\_SPELL\_LOOT\_TEMPLATE - --CONDITION\_SOURCE\_TYPE\_VEHICLE\_SPELL - -[spell\_area](spell_area) - defines if aura should be applied to an object in given area - -[spell\_enchant\_proc\_data](spell_enchant_proc_data) - defines behavior of item enchant procs - -[spell\_group\_stack\_rules](spell_group_stack_rules) - defines stacking rules for each group - -[spell\_group](spell_group) - allows grouping spells for convenient handling - -[spell\_learn\_spell](spell_learn_spell) - defines that learning a given spell should learn you other spell, if not provided in dbcs - -[spell\_linked\_spell](spell_linked_spell) - allows simple triggering spell casts on certain spell events - -[spell\_pet\_auras](spell_pet_auras) - defines if a certain aura on pet owner should be linked to other aura on pet - -spell\_proc\_event - defines a requirement which needs to be passed for proc event to occur - -[spell\_proc](spell_proc) - same as spell\_proc\_event, table in development - -[spell\_required](spell_required) - defines requirements for learning a spell - -[spell\_ranks](spell_ranks) - implements a concept of spell rank ingame - -[spell\_script\_names](spell_script_names) - binds spells to their spell scripts - -[spell\_target\_position](spell_target_position) - allows setting target location for certain spells - -[spell\_threat](spell_threat) - contains threat data for spells - -Developers are expected to fill those tables correctly to make spells work correctly. Please follow links for more details about each table. - -### Spell scripts - -Spell scripts are a way to provide a means of implementing more complicated behavior, which couldn't be placed in db. - -#### Generic structure - -``` cpp -// naming scheme: spell_[of who]_[spell name], for example spell_warl_banish, spell_deathwhisper_mana_barrier -class spell_class_your_name_here : public SpellScriptLoader -{ - public: - // should be the same as class name - name in "" is the one used by db in SpellScriptNames table - spell_class_your_name_here () : SpellScriptLoader("spell_class_your_name_here ") { } -  - // SpellScript object - alters behavior of Spell object ingame - class spell_class_your_name_here_SpellScript : public SpellScript - { - PrepareSpellScript(spell_class_your_name_here_SpellScript); - // bool Load() {return true;} - optional - allows loading script only in specific circumstances - see Optional loading below -  // bool Validate(SpellInfo const* /*spellInfo*/) - optional - allows checking data integrity - see Validation tests below - /* hooks here - described below*/ - - void Register() {/*hook registration here*/} - }; - // function creating script object - must be exactly like this one, but with your class name - SpellScript* GetSpellScript() const - { - return new spell_class_your_name_here_SpellScript(); - } -  - // AuraScript object - alters behavior of Aura object ingame - class spell_class_your_name_here_AuraScript : public AuraScript - { - PrepareAuraScript(spell_class_your_name_here_AuraScript); - - // bool Load() {return true;} - optional - allows loading script only in specific circumstances - see Optional loading below -  // bool Validate(SpellInfo const* /*spellInfo*/) - optional - allows checking data integrity - see Validation tests below - /* hooks here - described below*/ - void Register() {/*hook registration here*/} - }; - // function creating script object - must be exactly like this one, but with your class name - AuraScript* GetAuraScript() const - { - return new spell_class_your_name_here_AuraScript(); - } -}; -// this function call creates script loader object for us - seek that function at the end of the script file you're adding to -// if there's no such function see How-to_CustomScript -void AddSC_class_spell_scripts() -{ - // an entry for our spell script loader, there may be other entries aswell - /* ... */ - new spell_class_your_name_here(); -} -``` - -As you see, there are 2 kinds of scripts: SpellScript and AuraScript. You may define both or just one of them in a single script. - -#### Binding your script to a spell/spells - -To make sure your script is executed you have to do two things (these are c++ requirements, I wish this was simpler). - -- create [spell\_script\_names](spell_script_names) entry - As you've seen above each SpellScript/AuraScript is put inside of SpellScriptLoader class. Constructor of that class contains single parameter, that parameter is the value of ScriptName column inside spell\_script\_names table. The table consists of pairs (spellIdToWhichYouBindTheScript, "spell\_script\_you\_re\_binding"). You can bind one script to many spells or many scripts to one spell. The latter is needed for example when you want to logically separate scripts of a spell when spell is affected by different talents. -- properly override AuraScript\* GetAuraScript() const or SpellScript\* GetSpellScript() const to create objects of your script -- make sure SpellScriptLoader of your script is created - add a call in AddSC\_XXXXX function. For more details on that, see [CustomScript](CustomScript) - -``` cpp -class spell_warl_unstable_affliction : public SpellScriptLoader -{ - public: - spell_warl_unstable_affliction() : SpellScriptLoader("spell_warl_unstable_affliction") { } -  - class spell_warl_unstable_affliction_AuraScript : public AuraScript - { - // required PrepareAuraScript macro - PrepareAuraScript(spell_warl_unstable_affliction_AuraScript); - /*...*/ - }; - AuraScript* GetAuraScript() const - { - return new spell_warl_unstable_affliction_AuraScript(); - } - /*...*/ -}; -/*...*/ -void AddSC_warlock_spell_scripts() -{ - new spell_warl_unstable_affliction(); -/*...*/ -} -``` - -#### Validation tests - -Overriding validate function allows you to check if data you're using in your script is present on core load. It's often used to check if spell used in script is still in database, as spells are often removed from client database when client version changes. - -When this function will return false, a "Spell \`%u\` did not pass Validate() function of script \`%s\` - script will be not added to the spell" error will appear in log. - -You don't need to check for presence of effects you bind hooks to - it's checked automatically and reported on startup by core for your convenience. - -##### Example - checks for existence of spells the script is using later: - -``` cpp - bool Validate(SpellInfo const* /*spellInfo*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2)) - return false; - return true; - } -``` - -#### Optional loading - -Sometimes you may decide that you want your script only be present in some cases, bool Load() provides you a way to do so. When the function returns false your script will not be loaded to the object (Aura or Spell) - it will have no effect - -##### Example - we want to script only player casts: - -``` cpp - bool Load() - { - return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; - } -``` - -#### AuraScript hooks - -TODO![(smile)](images/icons/emoticons/smile.png "(smile)"){.emoticon .emoticon-smile} - -#### SpellScript hooks - -TODO![(smile)](images/icons/emoticons/smile.png "(smile)"){.emoticon .emoticon-smile} - -#### Good practices: - --always use Validate(SpellInfo const\*) function to check all data you use in script for presence - --check for runtime errors, they often signal bad script behaviors - --put full spell name in comment before the script - this helps finding the script by spell name - -``` cpp -// 781 - Disengage -class spell_hun_disengage : public SpellScriptLoader -``` - -#### Practical example on spell scripts - -``` cpp -// 781 - Disengage -class spell_hun_disengage : public SpellScriptLoader -{ - public: - spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { } - class spell_hun_disengage_SpellScript : public SpellScript - { - PrepareSpellScript(spell_hun_disengage_SpellScript); - SpellCastResult CheckCast() - { - Unit* caster = GetCaster(); - if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; - } - void Register() - { - OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast); - } - }; - SpellScript* GetSpellScript() const - { - return new spell_hun_disengage_SpellScript(); - } -}; -``` - -Going through line to line: - -TODO![(smile)](images/icons/emoticons/smile.png "(smile)"){.emoticon .emoticon-smile} - -- [How do spells work?](#Spellsystem-Howdospellswork?) -- [Database](#Spellsystem-Database) -- [Spell scripts](#Spellsystem-Spellscripts) - - [Generic structure](#Spellsystem-Genericstructure) - - [Binding your script to a spell/spells](#Spellsystem-Bindingyourscripttoaspell/spells) - - [Validation tests](#Spellsystem-Validationtests) - - [Example - checks for existence of spells the script is using later:](#Spellsystem-Example-checksforexistenceofspellsthescriptisusinglater:) - - [Optional loading](#Spellsystem-Optionalloading) - - [Example - we want to script only player casts:](#Spellsystem-Example-wewanttoscriptonlyplayercasts:) - - [AuraScript hooks](#Spellsystem-AuraScripthooks) - - [SpellScript hooks](#Spellsystem-SpellScripthooks) - - [Good practices:](#Spellsystem-Goodpractices:) - - [Practical example on spell scripts](#Spellsystem-Practicalexampleonspellscripts) +# *Spell launch phase* +Launch comes immediately after cast is finished, it's the moment when spell "leaves hands of the caster", you can notice that for spells which are flying for some amount of time before they reach targets. Some spell effects are handled during this phase, for example damage from caster must be calculated at the moment spell is being launched instead of the moment of hit, charge must begin at launch, etc. When (and if) your spell reaches it's target (immediately for spells with no delay) the next (hit) phase begins. Launch is handled in Spell::HandleLaunchPhase. You can affect execution of spell effects during this phase by using OnEffectLaunch and OnEffectLaunchTarget hooks. The difference between those two is that OnEffectLaunch is called once for each spell effect the spell has, regardless of it's targets; while OnEffectLaunchTarget is called once for every available implicit target of the spell (selected in cast phase before). +# *Spell hit phase* +Hit is the phase where most of effects of the spell are handled. Spell effects are small operations affecting either caster of the spell or implicit spell targets. Each spell entry has EffectX columns (in dbc) which contain id of effects that spell applies to it's target. Each effect has it's own separate target list, so a single spell can operate on many different objects at once. For example, a spell may apply heal effect to your friends and give you a buff aura at once. Similarly to launch phase, you can override behavior of spell effects in this phase by OnEffectHit and OnEffectHitTarget SpellScript hooks. You can also use: BeforeHit, OnHit and AfterHit hooks. Important thing during this phase is spell proc - special event trigger system which does things accordingly to what auras are applied to caster and implicit target of the spell. Some parts of proc system should be handled by the proc system in other spell cast phases, but that's not implemented atm. +# *Spell finish phase* +The finish phase occurs after all spell targets are processed, it's just a cleanup, just a few relevant events happen in this phase. diff --git a/docs/Syncing-your-fork.md b/docs/Syncing-your-fork.md deleted file mode 100644 index c15bdc1..0000000 --- a/docs/Syncing-your-fork.md +++ /dev/null @@ -1,21 +0,0 @@ -Syncing your fork is always a good idea when you create a Pull Request. - -# How to sync your AzerothCore fork - -Open your terminal and move to the local clone of your AzerothCore fork. - -Switch to your _master_ branch (or whatever branch you need to sync): - -`git checkout master` - -Then type: - -`git remote add upstream https://github.com/azerothcore/azerothcore-wotlk.git` - -`git fetch upstream` - -`git merge upstream/master` - -Then when you are ready to push the changes (e.g. after resolving merge conflicts, if any): - -`git push` \ No newline at end of file diff --git a/docs/ac-dashboard-core-installation.md b/docs/ac-dashboard-core-installation.md new file mode 100644 index 0000000..0cd2042 --- /dev/null +++ b/docs/ac-dashboard-core-installation.md @@ -0,0 +1,241 @@ +## Introduction + +The AzerothCore bash dashboard is a collection of scripts that help with the installation and maintenance of an AzerothCore server. +It allows to easily install, update and execute AzerothCore on your machine in a tremendously small amount of steps. + +Installing a development or production private server has never been so easy before. +If you need any help just [ask a question](https://www.azerothcore.org/wiki/How-to-ask-for-help). + + +## Requirements + +You need to have [git](https://git-scm.com/) installed in your machine. +No other software is required to be installed manually. + +- debian/ubuntu-based: `apt update && apt install git` +- macOS: `brew install git` + +### Notes +- For macOS users: install and use the latest version of bash to run the commands of the dashboard (`brew install bash`) +- For Windows users: the commands need to be executed within the "git bash" shell or a bash-compatible shell such as WSL, cygwin etc.. + However, git bash is suggested because is preinstalled with git for windows (one of our requirements) + + +## Setup + +### Get the AC sources + +``` +git clone https://github.com/azerothcore/azerothcore-wotlk.git; cd azerothcore-wotlk +``` + +### Configuration + +There is a [conf/dist/config.sh](https://github.com/azerothcore/azerothcore-wotlk/blob/master/conf/dist/config.sh) +file containing a default configuration. Have a look at it. +Most of the configuration defaults will probably work for your case, +but you can copy it under `conf/config.sh` and change values as you ple