[Sync] Build system and docs proj sync

This commit is contained in:
Antz 2016-03-20 22:28:29 +00:00 committed by Antz
parent 6e2552ce33
commit b6c6eaebab
20 changed files with 1131 additions and 277 deletions

View file

@ -1,7 +1,7 @@
language: cpp language: cpp
before_install: # use docker in travis
- bash .travis.sh sudo: false
# reduce clone time by only getting the latest commit and not the whole history (default for travis is 100) # reduce clone time by only getting the latest commit and not the whole history (default for travis is 100)
git: git:
@ -10,23 +10,30 @@ git:
# send notifications to stack as well as email # send notifications to stack as well as email
notifications: notifications:
slack: getmangos:yRgNBSgRQVh8WdfGEbT08Hit slack: getmangos:yRgNBSgRQVh8WdfGEbT08Hit
# only run travis on the master branch
branches:
only:
- master
- develop21
# build on both Linux and OSX (finally) # build on both Linux and OSX (finally)
os: os:
- linux - linux
- osx - osx
# build with both gcc and clang to ensure compatibility # build with both gcc and clang to ensure compatibility
compiler: compiler:
- gcc - gcc
- clang - clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
before_install:
- bash .travis.sh
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "gcc" ] ; then export CC=gcc-4.8 CXX=g++-4.8 ; fi
script: script:
- test -d _build || mkdir _build - test -d _build || mkdir _build
- test -d _install || mkdir _install - test -d _install || mkdir _install

View file

@ -19,7 +19,8 @@
project(MaNGOS) project(MaNGOS)
set(MANGOS_VERSION 0.21) set(MANGOS_VERSION 0.21)
set(MANGOS_EXP "CATA")
add_definitions(-DCATA)
# CMake policies # CMake policies
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
# Until CMake 3.0 is the standard # Until CMake 3.0 is the standard
@ -50,7 +51,7 @@ option(SCRIPT_LIB_ELUNA "Compile with support for Eluna scripts" OFF)
option(SCRIPT_LIB_SD2 "Compile with support for ScriptDev2 scripts" ON) option(SCRIPT_LIB_SD2 "Compile with support for ScriptDev2 scripts" ON)
#option(SCRIPT_LIB_SD3 "Compile with support for ScriptDev3 scripts" OFF) #option(SCRIPT_LIB_SD3 "Compile with support for ScriptDev3 scripts" OFF)
option(PLAYERBOTS "Enable Player Bots" OFF) option(PLAYERBOTS "Enable Player Bots" OFF)
option(SOAP "Enable remote access via SOAP" ON) option(SOAP "Enable remote access via SOAP" OFF)
# Hidden option to enable/disable PCH. DEV ONLY! # Hidden option to enable/disable PCH. DEV ONLY!
set(PCH ON) set(PCH ON)
set(USE_STORMLIB ON) set(USE_STORMLIB ON)
@ -107,6 +108,9 @@ if(ACE_USE_EXTERNAL)
endif() endif()
else() else()
include(cmake/ImportACE.cmake) include(cmake/ImportACE.cmake)
if(NOT(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD"))
add_definitions(-DHAVE_ACE_STACK_TRACE_H)
endif()
endif() endif()
if(POSTGRESQL) if(POSTGRESQL)
@ -144,6 +148,8 @@ else()
set(GIT_REVISION "Git not found") set(GIT_REVISION "Git not found")
endif() endif()
set(DEFINITIONS ${DEFINITIONS} CATA)
message(STATUS "MaNGOS-Core revision : ${GIT_REVISION}") message(STATUS "MaNGOS-Core revision : ${GIT_REVISION}")
message(STATUS "Install server to : ${CMAKE_INSTALL_PREFIX}") message(STATUS "Install server to : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Install configs to : ${CONF_INSTALL_DIR}") message(STATUS "Install configs to : ${CONF_INSTALL_DIR}")

View file

@ -150,10 +150,10 @@ respects for all of the code used other than [OpenSSL][48].
[7]: http://www.cppreference.com/ "C / C++ reference" [7]: http://www.cppreference.com/ "C / C++ reference"
[10]: https://getmangos.eu/ "mangos · project site" [10]: https://getmangos.eu/ "mangos · project site"
[12]: http://github.com/mangosthree "mangos-three· github organization" [12]: http://github.com/mangosthree "MaNGOS Three· github organization"
[13]: http://github.com/mangosthree/server "mangos three · server repository" [13]: http://github.com/mangosthree/server "MaNGOS Three · server repository"
[15]: http://github.com/mangosthree/database "mangos three · content database repository" [15]: http://github.com/mangosthree/database "MaNGOS Three · content database repository"
[16]: https://travis-ci.org/mangosthree/server "Travis CI · mangos-three build status" [16]: https://travis-ci.org/mangosthree/server "Travis CI · MaNGOS Three build status"
[17]: https://scan.coverity.com/ "Coverity Scan · Static Code Analysis" [17]: https://scan.coverity.com/ "Coverity Scan · Static Code Analysis"
[19]: http://www.cmake.org/ "CMake · Cross Platform Make" [19]: http://www.cmake.org/ "CMake · Cross Platform Make"

View file

@ -1,15 +0,0 @@
ROADMAP and goals for 0.21.0 release
------------
* Completely synchronize fixes between mangos repositories (zero, one, two)
* Implement void storage
* Implement archaelogy
* warden system
* Implement passive anticheat (warden system is not enough to stop jockers...).
* Phasing system port from trinitycore
* Add missing opcodes.
* Implement linked_spell_trigger database table implementation (this will accessible in all mangos) for simple spells implementation.
* Implement new gossip script wrapper in scriptmgr to make code style better.
* Implement new event in EVENTAI which would let better integrate gossips
* Rework/retest all classes spells

41
appveyor.yml Normal file
View file

@ -0,0 +1,41 @@
version: 0.21.{build}
# Branches to build
branches:
only:
- develop21
# Specify platform for MySQL check
platform:
- Win32
# By default, AppVeyor only comes with 64bit MySQL, but 32 bit compiler.
# Download standalone MySQL libraries for compilation.
# Probably not the best solution, but it works for now.
install:
- ps: |
if ($env:platform -eq "Win32")
{
Invoke-WebRequest "http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.28-win32.zip" -OutFile mysql-5.6.28-win32.zip
7z e -y mysql-5.6.28-win32.zip mysql-5.6.28-win32/lib -o"C:\Program Files (x86)\MySql\MySQL Server 5.6\lib"
7z e -y mysql-5.6.28-win32.zip mysql-5.6.28-win32/include -o"C:\Program Files (x86)\MySql\MySQL Server 5.6\include"
}
# Clone to the specified folder below, and only clone the latest commit without history.
clone_folder: c:\mzero\server
clone_depth: 1
# Enable parallel builds to speed up the compilation process.
build:
parallel: true
# Initialize submodules.
before_build:
- git submodule update --init --recursive
# Build core.
build_script:
- cd c:\mzero\server
- cmake -DCMAKE_INSTALL_PREFIX="c:\mzero\build\bin" -DCMAKE_SIZEOF_VOID_P=8
- msbuild /m MaNGOS.sln

View file

@ -1,10 +0,0 @@
#ifndef HAVE_CONFIG_H
#define HAVE_CONFIG_H
#cmakedefine HAVE_ACE_STACK_TRACE_H
#cmakedefine USE_MULTI_THREAD_MAP
#define VERSION "${MANGOS_VERSION}"
#endif /* HAVE_CONFIG_H */

View file

@ -1,6 +1,6 @@
Auction house bot Auction house bot
----------------- -----------------
For testing purposes and low population home servers, *mangos-zero* provides an For testing purposes and low population home servers, *mangos* provides an
auction house bot, which will provide a set of items on the auction houses based auction house bot, which will provide a set of items on the auction houses based
on various configuration settings. on various configuration settings.

View file

@ -4,7 +4,7 @@ find_package(Doxygen)
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
set(TOP_SRCDIR ${CMAKE_SOURCE_DIR}) set(TOP_SRCDIR ${CMAKE_SOURCE_DIR})
set(PACKAGE "MaNGOS Two") set(PACKAGE "MaNGOS Three")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc add_custom_target(doc

View file

@ -1,4 +1,16 @@
MaNGOS 0.18 (?? ??? 20??) MaNGOS Three Changelog
======================
This change log references the relevant changes (bug and security fixes) done
in recent versions.
0.21 (2016-xx-01) - "The Battle for the Elemental Planes"
---------------------------------------------------------
Many Thanks to all the groups and individuals who contributed to this release.
- xxx+ Commits since the previous release.
* TODO: Add full list of fixes from Rel18 to 21 for both Server, Scripts and Database
MaNGOS 0.18 (?? ??? 20??)
MaNGOS 0.18 - adds further improvements to the MaNGOS 0.18 - adds further improvements to the
server core as well as to the majority of game classes and the game content server core as well as to the majority of game classes and the game content

149
doc/CodingStandard.md Normal file
View file

@ -0,0 +1,149 @@
Coding standards
================
It is highly recommended to use a single *coding style* for the whole project
source code. Exceptions are allowed for external libraries used in the project,
but it is generally advisable all contributors to use this style.
Tab Size
--------
First of all, we use spaces. Tabs are four-character width. That is, no 8-space
tabs, no 2-space tabs. Four. Unfortunately there's no such thing as 'standard
tab width', and 4-space indenting looks best from our point of view, besides MSVC'
editor has this setting by default.
Line length
-----------
Then, please use 80-character wide lines. If your line is way longer than that,
please split it. If it's just a little longer, so be it. The continuation text,
if you're splitting text inside the brackets, should be indented to the position
after the opening bracket:
printf("This is a example of how we split lines longer than %d characters\n"
"into several so that they won't exceed this limit.\n",
max_sourcecode_width);
If you have long strings, you can split them as shown above, just remember that
C/C++ compilers will glue together several strings that come without any special
characters between them into one.
Brackets
--------
Now we use symmetric bracket placement, closing bracket under the opening bracket:
if (something)
{
...;
}
else
{
...;
}
switch (x)
{
case 1:
printf("X is one!\n");
break;
case 2:
{
printf("X is two!\n");
break;
}
}
for (int i = 1; i < 3; ++i)
{
printf("I is %i!\n", i);
}
Every bracketed block moves its contents by one tab to right. Labels (but not case
selectors or 'public:/private:/protected' C++ keywords) are placed at the leftmost
indention position for the current block, that is, in the same position where
enclosing brackets are.
Also please don't use brackets around a single statement because it clutters the
code with unneeded stuff; use brackets only when using non-obvious constructs,
like:
if (...)
{
if (...)
...;
}
else
...;
Also, please place one space before opening parenthesis. Before, but not after
(the `if ( blah )` style is a no-no!).
Class declaration and constructors
----------------------------------
Here is an example:
class Class : public Parent
{
public:
Class() : Parent(0),
m_field(1)
{
func();
}
void func() {}
private:
int m_field;
};
Please follow the following rules for classes:
* space before and after : in class parents list and constructor body
* next line and indent for class field initialization list
* indent for public:/private:/protected: section with additional indent
for section content
* empty or short function body can be at same line with declaration in
in-class definition case
Code documentation with Doxygen
-------------------------------
Now, please use DoxyGen-type comments. This is a bit similar to JavaDoc comments
and to other automatic code documentation generation tools. One-line documentation
should be placed in `///` (three slashes) comments if the comment is above the
function/member, if you want the comment on the same line you should use `///<`
instead, multi-line comments should be put in a `/** ... */` block (slash-two-stars).
Here's a example that shows most useful keywords that you can use in a comment block:
/**
* This function does something very useful. If used with care, this function
* has the potential to make your programs really really useful.
*
* \arg \c x
* The x argument specifies a integer that is transformed into something useful.
* \arg \c y
* This argument, if not NULL, is a pointer to a free memory area where this
* function will put something really really useful.
* \return
* A useful value, or NULL if error.
*
* Here is a example that you can paste into your code so that it saves you a
* lot of typing:
*
* \verb atim (Remove the space)
* for (int x = 0; x < 100; ++x)
* printf("DoSomethingUseful%d = %s\n", i,
* DoSomethingUseful(i, &ScratchPad));
* \endve rbatim (Remove the space)
*
* Paragraphs are split from each other by inserting a empty line. Also some HTML
* tags are supported, like <ol> [<li>...] </ol> and <ul> [<li>...] </ul> for
* ordered (numbered) and unordered (dotted) lists respectively.
*/
char *DoSomethingUseful(int x, void *y);
/// This is a one-line comment
void Something();
Use normal comments like `//` and `/* ... */` only if you want to make a comment
that should not go into the automatically annotated code (like:
`/* shit ... this does not work */`).

File diff suppressed because it is too large Load diff

View file

@ -2,8 +2,8 @@ mangos EventAI scripting
======================== ========================
**Last Updated**: September 25, 2013 **Last Updated**: September 25, 2013
*mangos-zero* provides a simple scripting feature through a set of event-based *mangos* provides a simple scripting feature through a set of event-based
commands from with the database. commands from within the database.
Introduction Introduction
------------ ------------

View file

@ -1,6 +1,6 @@
Database script processing Database script processing
========================== ==========================
In addition to *EventAI*, *mangos-zero* provides script processing for various In addition to *EventAI*, *mangos* provides script processing for various
types of game content. These scripts can be executed when creatures move or die, types of game content. These scripts can be executed when creatures move or die,
when events are executed, and game object spawns/templates are used, on gossip when events are executed, and game object spawns/templates are used, on gossip
menu selections, when starting and completing quests, and when casting spells. menu selections, when starting and completing quests, and when casting spells.
@ -61,8 +61,10 @@ Value | Name | Notes
----------------- -----------------
4 multipurpose fields, storing raw data as signed integer values. 4 multipurpose fields, storing raw data as signed integer values.
*Note*: currently used only for text ids for the command `SCRIPT_COMMAND_TALK`, *Note*: used for text ids SCRIPT_COMMAND_TALK (0),
and in relation with the command `SCRIPT_COMMAND_TERMINATE_SCRIPT`. for emote ids in SCRIPT_COMMAND_EMOTE (1),
for spell ids in SCRIPT_COMMAND_CAST_SPELL (15)
and as waittime with SCRIPT_COMMAND_TERMINATE_SCRIPT (31)
`x`, `y`, `z` and `o` columns `x`, `y`, `z` and `o` columns
----------------------------- -----------------------------
@ -127,45 +129,51 @@ where `A -> B` means that the command is executed from A with B as target.
Commands and their parameters Commands and their parameters
----------------------------- -----------------------------
ID | Name | Parameters <table border='1' cellspacing='1' cellpadding='3' bgcolor='#f0f0f0'>
-- | -------------------------------------- | ------------------------------------- <tr bgcolor='#f0f0ff'>
0 | SCRIPT_COMMAND_TALK | resultingSource = WorldObject, resultingTarget = Unit/none, `dataint` = text entry from db_script_string -table. `dataint2`-`dataint4` optionally, for random selection of text <th><b>ID</b></th>
1 | SCRIPT_COMMAND_EMOTE | resultingSource = Unit, resultingTarget = Unit/none, `datalong` = emote_id, dataint1-dataint4 = optionally for random selection of emote <th align='left'><b>Name</b></th>
2 | SCRIPT_COMMAND_FIELD_SET | source = any, `datalong` = field_id, `datalong2` = field value <th align='left'><b>Parameters</b></th>
3 | SCRIPT_COMMAND_MOVE_TO | resultingSource = Creature. If position is very near to current position, or x=y=z=0, then only orientation is changed. `datalong2` = travel_speed*100 (use 0 for creature default movement). `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position `x`/`y`/`z`/`o` <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>0</td><td align='left' valign='middle'>SCRIPT_COMMAND_TALK</td><td align='left' valign='middle'>resultingSource = WorldObject, resultingTarget = Unit/none, `dataint` = text entry from db_script_string -table. `dataint2`-`dataint4` optionally, for random selection of text</td></tr>
4 | SCRIPT_COMMAND_FLAG_SET | source = any. `datalong` = field_id, `datalong2` = bit mask <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>1</td><td align='left' valign='middle'>SCRIPT_COMMAND_EMOTE</td><td align='left' valign='middle'>resultingSource = Unit, resultingTarget = Unit/none, `datalong` = emote_id, dataint1-dataint4 = optionally for random selection of emote</td></tr>
5 | SCRIPT_COMMAND_FLAG_REMOVE | source = any. `datalong` = field_id, `datalong2` = bit mask <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>2</td><td align='left' valign='middle'>SCRIPT_COMMAND_FIELD_SET</td><td align='left' valign='middle'>source = any, `datalong` = field_id, `datalong2` = field value</td></tr>
6 | SCRIPT_COMMAND_TELEPORT_TO | source or target with Player. `datalong` = map_id, x/y/z <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>3</td><td align='left' valign='middle'>SCRIPT_COMMAND_MOVE_TO</td><td align='left' valign='middle'>resultingSource = Creature. If position is very near to current position, or x=y=z=0, then only orientation is changed. `datalong2` = travel_speed*100 (use 0 for creature default movement). `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position `x`/`y`/`z`/`o`</td></tr>
7 | SCRIPT_COMMAND_QUEST_EXPLORED | one from source or target must be Player, another GO/Creature. `datalong` = quest_id, `datalong2` = distance or 0 <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>4</td><td align='left' valign='middle'>SCRIPT_COMMAND_FLAG_SET</td><td align='left' valign='middle'>source = any. `datalong` = field_id, `datalong2` = bit mask</td></tr>
8 | SCRIPT_COMMAND_KILL_CREDIT | source or target with Player. `datalong` = creature entry, or 0; If 0 the entry of the creature source or target is used, `datalong2` = bool (0=personal credit, 1=group credit) <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>5</td><td align='left' valign='middle'>SCRIPT_COMMAND_FLAG_REMOVE</td><td align='left' valign='middle'>source = any. `datalong` = field_id, `datalong2` = bit mask</td></tr>
9 | SCRIPT_COMMAND_RESPAWN_GAMEOBJECT | source = any, target = any. `datalong`=db_guid (can be skipped for buddy), `datalong2` = despawn_delay <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>6</td><td align='left' valign='middle'>SCRIPT_COMMAND_TELEPORT_TO</td><td align='left' valign='middle'>source or target with Player. `datalong` = map_id, x/y/z</td></tr>
10 | SCRIPT_COMMAND_TEMP_SUMMON_CREATURE | source = any, target = any. `datalong` = creature entry, `datalong2` = despawn_delay, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: summon as active object <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>7</td><td align='left' valign='middle'>SCRIPT_COMMAND_QUEST_EXPLORED</td><td align='left' valign='middle'>one from source or target must be Player, another GO/Creature. `datalong` = quest_id, `datalong2` = distance or 0</td></tr>
11 | SCRIPT_COMMAND_OPEN_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>8</td><td align='left' valign='middle'>SCRIPT_COMMAND_KILL_CREDIT</td><td align='left' valign='middle'>source or target with Player. `datalong` = creature entry, or 0; If 0 the entry of the creature source or target is used, `datalong2` = bool (0=personal credit, 1=group credit)</td></tr>
12 | SCRIPT_COMMAND_CLOSE_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>9</td><td align='left' valign='middle'>SCRIPT_COMMAND_RESPAWN_GAMEOBJECT</td><td align='left' valign='middle'>source = any, target = any. `datalong`=db_guid (can be skipped for buddy), `datalong2` = despawn_delay</td></tr>
13 | SCRIPT_COMMAND_ACTIVATE_OBJECT | source = unit, target=GO. <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>10</td><td align='left' valign='middle'>SCRIPT_COMMAND_TEMP_SUMMON_CREATURE</td><td align='left' valign='middle'>source = any, target = any. `datalong` = creature entry, `datalong2` = despawn_delay, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: summon as active object</td></tr>
14 | SCRIPT_COMMAND_REMOVE_AURA | resultingSource = Unit. `datalong` = spell_id <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>11</td><td align='left' valign='middle'>SCRIPT_COMMAND_OPEN_DOOR</td><td align='left' valign='middle'>source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay</td></tr>
15 | SCRIPT_COMMAND_CAST_SPELL | resultingSource = Unit, cast spell at resultingTarget = Unit. `datalong` = spell id, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: cast triggered <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>12</td><td align='left' valign='middle'>SCRIPT_COMMAND_CLOSE_DOOR</td><td align='left' valign='middle'>source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay</td></tr>
16 | SCRIPT_COMMAND_PLAY_SOUND | source = any object, target=any/player. `datalong` = sound_id, `datalong2` (bit mask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide; so 1|2 = 3 is target with distance dependent) <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>13</td><td align='left' valign='middle'>SCRIPT_COMMAND_ACTIVATE_OBJECT</td><td align='left' valign='middle'>source = unit, target=GO.</td></tr>
17 | SCRIPT_COMMAND_CREATE_ITEM | source or target must be player. `datalong` = item entry, `datalong2` = amount <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>14</td><td align='left' valign='middle'>SCRIPT_COMMAND_REMOVE_AURA</td><td align='left' valign='middle'>resultingSource = Unit. `datalong` = spell_id</td></tr>
18 | SCRIPT_COMMAND_DESPAWN_SELF | resultingSource = Creature. `datalong` = despawn delay <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>15</td><td align='left' valign='middle'>SCRIPT_COMMAND_CAST_SPELL</td><td align='left' valign='middle'>resultingSource = Unit, cast spell at resultingTarget = Unit. `datalong` = spell id, `dataint1`-`dataint4` optional. If some of these are set to a spell id, a random spell out of datalong, datint1, ..,dataintX is cast., `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: cast triggered</td></tr>
19 | SCRIPT_COMMAND_PLAY_MOVIE | target can only be a player. `datalong` = movie id <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>16</td><td align='left' valign='middle'>SCRIPT_COMMAND_PLAY_SOUND</td><td align='left' valign='middle'>source = any object, target=any/player. `datalong` = sound_id, `datalong2` (bit mask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide; so 1 + 2 = 3 is target with distance dependent)</td></tr>
20 | SCRIPT_COMMAND_MOVEMENT | resultingSource = Creature. `datalong` = MovementType (0:idle, 1:random or 2:waypoint), `datalong2` = wanderDistance (for random movement), `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: RandomMovement around current position <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>17</td><td align='left' valign='middle'>SCRIPT_COMMAND_CREATE_ITEM</td><td align='left' valign='middle'>source or target must be player. `datalong` = item entry, `datalong2` = amount</td></tr>
21 | SCRIPT_COMMAND_SET_ACTIVEOBJECT | resultingSource = Creature. `datalong` = bool 0=off, 1=on <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>18</td><td align='left' valign='middle'>SCRIPT_COMMAND_DESPAWN_SELF</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = despawn delay</td></tr>
22 | SCRIPT_COMMAND_SET_FACTION | resultingSource = Creature. `datalong` = factionId OR 0 to restore original faction from creature_template, `datalong2` = enum TemporaryFactionFlags <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>19</td><td align='left' valign='middle'>SCRIPT_COMMAND_PLAY_MOVIE</td><td align='left' valign='middle'>target can only be a player. `datalong` = movie id</td></tr>
23 | SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to demorph, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>20</td><td align='left' valign='middle'>SCRIPT_COMMAND_MOVEMENT</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = MovementType (0:idle, 1:random or 2:waypoint), `datalong2` = wanderDistance (for random movement), `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: RandomMovement around current position</td></tr>
24 | SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to dismount, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>21</td><td align='left' valign='middle'>SCRIPT_COMMAND_SET_ACTIVEOBJECT</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = bool 0=off, 1=on</td></tr>
25 | SCRIPT_COMMAND_SET_RUN | resultingSource = Creature. `datalong` = bool 0=off, 1=on <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>22</td><td align='left' valign='middle'>SCRIPT_COMMAND_SET_FACTION</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = factionId OR 0 to restore original faction from creature_template, `datalong2` = enum TemporaryFactionFlags</td></tr>
26 | SCRIPT_COMMAND_ATTACK_START | resultingSource = Creature, resultingTarget = Unit. <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>23</td><td align='left' valign='middle'>SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to demorph, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit</td></tr>
27 | SCRIPT_COMMAND_GO_LOCK_STATE | resultingSource = GO. `datalong` = flag_go_lock = 0x01, flag_go_unlock = 0x02, flag_go_nonInteract = 0x04, flag_go_interact = 0x08 <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>24</td><td align='left' valign='middle'>SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to dismount, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit</td></tr>
28 | SCRIPT_COMMAND_STAND_STATE | resultingSource = Creature. `datalong` = stand state (enum UnitStandStateType) <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>25</td><td align='left' valign='middle'>SCRIPT_COMMAND_SET_RUN</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = bool 0=off, 1=on</td></tr>
29 | SCRIPT_COMMAND_MODIFY_NPC_FLAGS | resultingSource = Creature. `datalong` = NPCFlags, `datalong2` = 0x00=toggle, 0x01=add, 0x02=remove <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>26</td><td align='left' valign='middle'>SCRIPT_COMMAND_ATTACK_START</td><td align='left' valign='middle'>resultingSource = Creature, resultingTarget = Unit.</td></tr>
30 | SCRIPT_COMMAND_SEND_TAXI_PATH | resultingTarget or Source must be Player. `datalong` = taxi path id <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>27</td><td align='left' valign='middle'>SCRIPT_COMMAND_GO_LOCK_STATE</td><td align='left' valign='middle'>resultingSource = GO. `datalong` = flag_go_lock = 0x01, flag_go_unlock = 0x02, flag_go_nonInteract = 0x04, flag_go_interact = 0x08</td></tr>
31 | SCRIPT_COMMAND_TERMINATE_SCRIPT | `datalong` = search for npc entry if provided, `datalong2` = search distance, `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: if npc not alive found, terminate script, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`: if npc alive found, terminate script, `dataint` = change of waittime (MILLISECONDS) of a current waypoint movement type (negative values will decrease time) <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>28</td><td align='left' valign='middle'>SCRIPT_COMMAND_STAND_STATE</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = stand state (enum UnitStandStateType)</td></tr>
32 | SCRIPT_COMMAND_PAUSE_WAYPOINTS | resultingSource must be Creature. `datalong` = 0/1 unpause/pause waypoint movement <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>29</td><td align='left' valign='middle'>SCRIPT_COMMAND_MODIFY_NPC_FLAGS</td><td align='left' valign='middle'>resultingSource = Creature. `datalong` = NPCFlags, `datalong2` = 0x00=toggle, 0x01=add, 0x02=remove</td></tr>
33 | SCRIPT_COMMAND_RESERVED_1 | reserved for 3.x and later. Do not use! <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>30</td><td align='left' valign='middle'>SCRIPT_COMMAND_SEND_TAXI_PATH</td><td align='left' valign='middle'>resultingTarget or Source must be Player. `datalong` = taxi path id</td></tr>
34 | SCRIPT_COMMAND_TERMINATE_COND | `datalong` = condition_id, `datalong2` = fail-quest (if provided this quest will be failed for a player), `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: terminate when condition is true, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`: terminate when condition is false <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>31</td><td align='left' valign='middle'>SCRIPT_COMMAND_TERMINATE_SCRIPT</td><td align='left' valign='middle'>`datalong` = search for npc entry if provided, `datalong2` = search distance, `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: if npc not alive found, terminate script, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`:if npc alive found, terminate script, `dataint` = change of waittime (MILLISECONDS) of a current waypoint movement type (negative values will decrease time)</td></tr>
35 | SCRIPT_COMMAND_SEND_AI_EVENT_AROUND | resultingSource = Creature, resultingTarget = Unit, datalong = AIEventType - limited only to EventAI supported events, datalong2 = radius <tr bgcolor='#FFFFEE'><td align='center' valign='middle'>32</td><td align='left' valign='middle'>SCRIPT_COMMAND_PAUSE_WAYPOINTS</td><td align='left' valign='middle'>resultingSource must be Creature. `datalong` = 0/1 unpause/pause waypoint movement</td></tr>
36 | SCRIPT_COMMAND_TURN_TO | resultingSource = Creature, resultingTarget = Unit/none. <tr bgcolor='#FEFEFF'><td align='center' valign='middle'>33</td><td align='left' valign='middle'>SCRIPT_COMMAND_RESERVED_1</td><td align='left' valign='middle'>reserved for 3.x and later. Do not use!</td></tr>
<tr bgcolor='#FFFFEE'><td align='center' valign='middle'>34</td><td align='left' valign='middle'>SCRIPT_COMMAND_TERMINATE_COND</td><td align='left' valign='middle'>`datalong` = condition_id, `datalong2` = fail-quest (if provided this quest will be failed for a player), `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: terminate when condition is true, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`:terminate when condition is false</td></tr>
<tr bgcolor='#FEFEFF'><td align='center' valign='middle'>35</td><td align='left' valign='middle'>SCRIPT_COMMAND_SEND_AI_EVENT_AROUND</td><td align='left' valign='middle'>resultingSource = Creature, resultingTarget = Unit, datalong = AIEventType - limited only to EventAI supported events, datalong2 = radius</td></tr>
<tr bgcolor='#FFFFEE'><td align='center' valign='middle'>36</td><td align='left' valign='middle'>SCRIPT_COMMAND_TURN_TO</td><td align='left' valign='middle'>resultingSource = Creature, resultingTarget = Unit/none.</td></tr>
<tr bgcolor='#FEFEFF'><td align='center' valign='middle'>37</td><td align='left' valign='middle'>SCRIPT_COMMAND_MOVE_DYNAMIC</td><td align='left' valign='middle'>Move resultingSource to a random point around resultingTarget or to resultingTarget. `resultingSource` = Creature, resultingTarget Worldobject. `datalong` = 0:Move resultingSource towards resultingTarget, `datalong` != 0: Move resultingSource to a random point between datalong2..datalong around resultingTarget. `orientation` != 0: Obtain a random point around resultingTarget in direction of orientation, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL Obtain a point in direction of resTarget->GetOrientation + orientation for resTarget == resSource and orientation == 0 this will mean resSource moving forward.</td></tr>
<tr bgcolor='#FFFFEE'><td align='center' valign='middle'>38</td><td align='left' valign='middle'>SCRIPT_COMMAND_SEND_MAIL</td><td align='left' valign='middle'>Send a mail from resSource to resTarget. `resultingSource` = Creature OR NULL, resTarget must be Player, `datalong` = mailTemplateId, `datalong2`: AlternativeSenderEntry. Use as sender-Entry of the sent mail, `dataint1`: Delay (>= 0) in Seconds</td></tr>
</table>
TemporaryFactionFlags TemporaryFactionFlags
--------------------- ---------------------
@ -174,8 +182,10 @@ TemporaryFactionFlags
* `TEMPFACTION_RESTORE_COMBAT_STOP`: 0x02, ... at CombatStop() (happens at creature death, at evade or custom script among others) * `TEMPFACTION_RESTORE_COMBAT_STOP`: 0x02, ... at CombatStop() (happens at creature death, at evade or custom script among others)
* `TEMPFACTION_RESTORE_REACH_HOME`: 0x04, ... at reaching home in home movement (evade), if not already done at CombatStop() * `TEMPFACTION_RESTORE_REACH_HOME`: 0x04, ... at reaching home in home movement (evade), if not already done at CombatStop()
The next three allow to remove unit_flags combined with a faction change (also these flags will be reapplied when the faction is changed back) The next flags allow to remove unit_flags combined with a faction change (also these flags will be reapplied when the faction is changed back)
* `TEMPFACTION_TOGGLE_NON_ATTACKABLE`: 0x08, remove UNIT_FLAG_NON_ATTACKABLE(0x02) when faction is changed (reapply when temp-faction is removed) * `TEMPFACTION_TOGGLE_NON_ATTACKABLE`: 0x08, remove UNIT_FLAG_NON_ATTACKABLE(0x02) when faction is changed (reapply when temp-faction is removed)
* `TEMPFACTION_TOGGLE_OOC_NOT_ATTACK`: 0x10, remove UNIT_FLAG_OOC_NOT_ATTACKABLE(0x100) when faction is changed (reapply when temp-faction is removed) * `TEMPFACTION_TOGGLE_OOC_NOT_ATTACK`: 0x10, remove UNIT_FLAG_OOC_NOT_ATTACKABLE(0x100) when faction is changed (reapply when temp-faction is removed)
* `TEMPFACTION_TOGGLE_PASSIVE`: 0x20, remove UNIT_FLAG_PASSIVE(0x200) * `TEMPFACTION_TOGGLE_PASSIVE` : 0x20, remove UNIT_FLAG_PASSIVE(0x200)
* `TEMPFACTION_TOGGLE_PACIFIED` : 0x40, remove UNIT_FLAG_PACIFIED(0x20000) when faction is changed (reapply when temp-faction is removed)
* `TEMPFACTION_TOGGLE_NOT_SELECTABLE`: 0x80, remove UNIT_FLAG_NOT_SELECTABLE(0x2000000) when faction is changed (reapply when temp-faction is removed)

22
doc/Spell.md Normal file
View file

@ -0,0 +1,22 @@
# Spells {#spells} #
Spells consist of a whole lot of information, the most usual way to access them is via their ID. A good
tool to use when examining spells and looking into what they will do is [QSW](https://bitbucket.org/sidsukana/qsw) which will show you alot of the information available about a spell.
A spell is made up of a lot of parts, on of these are the effects that a spell has, without them spells
wouldn't do much at all since the effects apply different kinds of `Aura`s that do different things
to the target or something else, in the most common scenario that would be to deal damage. If we take
a look at the Frostbolt spell (id 116) in QSW for 1.12.x and scroll down to the Effects heading we will
see that there are 2 effects. The maximum amount of effects on spell can have is 3, these three indexes
are referenced via the `EFFECT_INDEX_0`, `EFFECT_INDEX_1` and `EFFECT_INDEX_2` macros.
Lets take a closer look at Effect 0, it has an id of 6 which QSW tells us is named `SPELL_EFFECT_APPLY_AURA` which tells us that we will apply an `Aura` with this effect, if we look a few lines down we see that
the Aura Id is 33 which corresponds to `SPELL_AURA_MOD_DECREASE_SPEED` which is the slowing effect of
our Frostbolt spell. If we look to the right on the same line we see that `value=-40` which would mean
that we should decrease the speed by 40%. Knowing what this value means depends on what Aura Id we are
applying, all of them have different meanings for the `value` and `misc` values. The `periodic` variable
tells us whether or not this effect is periodic as in coming back over and over again, this is usual
for some healing spells or DOTs.
The part in the server that handles this is mostly the `Aura` class and the `AuraModifier` struct which
is the part we talked about most recently, the one which keeps track of the Aura Id, value, misc and if it's periodic or not.

28
doc/Thanks.md Normal file
View file

@ -0,0 +1,28 @@
THANKS
------
MaNGOS has originally been written by *TeamPython*, *Wow Python* and *WoWd* teams.
Many people further contributed to MaNGOS by reporting problems, suggesting various
improvements or submitting actual code.
Special thanks should also go out to the WowwoW team. We have gained help from
them many times in the creation of this project. Keep up the good work guys.
Thanks should also go out to the Ludmilla team, who are also providing the
community with a great server. We have not gained too much help from them,
but we have received some.
Thanks to WCell team (especially Ralek) for research on realm reconnect sequence,
item scaling stats algorithm, game object rotation issues.
We would also like to acknowledge the contributions made by the following
teams, those input and code has from time to time been included in the MaNGOS
code.
Each of the commits will have a prefix indicating the source team :
* **t**: TrinityCore
* **p**: Project SilverPine
* **r**: MangosR2
* **s**: ScriptDev
* **c**: cMangos
* **m**: mangos

View file

@ -2,8 +2,8 @@
############################################################################### ###############################################################################
# MaNGOS Build Automation Script # # MaNGOS Build Automation Script #
# Written By: Ryan Ashley Modified By: Antz # # Written By: Ryan Ashley Modified By: Antz #
# Copyright (c) 2014 MaNGOS Project # # Copyright (c) 2014-2016 MaNGOS Project #
# https://getmangos.eu/ # # https://getmangos.eu/ #
# # # #
# This program is free software; you can redistribute it and/or modify # # This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by # # it under the terms of the GNU General Public License as published by #
@ -22,10 +22,10 @@
# Global variables # Global variables
DLGAPP="whiptail" DLGAPP="whiptail"
VERSION="2" VERSION="3"
SRCPATH="$HOME/mangos/src" SRCPATH="$HOME/mangos/src"
INSTPATH="$HOME/mangos" INSTPATH="$HOME/mangos"
DB_PREFIX="two" DB_PREFIX="three"
P_DEBUG="0" P_DEBUG="0"
P_STD_MALLOC="1" P_STD_MALLOC="1"
P_ACE_EXTERNAL="1" P_ACE_EXTERNAL="1"

View file

@ -31,7 +31,6 @@
#ifndef MANGOS #ifndef MANGOS
#define MANGOS #define MANGOS
#endif /* MANGOS */ #endif /* MANGOS */
#define CATA
enum Gender enum Gender
{ {

View file

@ -185,14 +185,14 @@ extern int main(int argc, char** argv)
sLog.outString("%s [world-daemon]", REVISION_NR); sLog.outString("%s [world-daemon]", REVISION_NR);
sLog.outString("<Ctrl-C> to stop.\n" sLog.outString("<Ctrl-C> to stop.\n"
" __ __ _ _ ___ ___ ___ \n" " __ __ _ _ ___ ___ ___ \n"
" | \\/ |__ _| \\| |/ __|/ _ \\/ __| \n" " | \\/ |__ _| \\| |/ __|/ _ \\/ __| \n"
" | |\\/| / _` | .` | (_ | (_) \\__ \\ \n" " | |\\/| / _` | .` | (_ | (_) \\__ \\ \n"
" |_| |_\\__,_|_|\\_|\\___|\\___/|___/ \n" " |_| |_\\__,_|_|\\_|\\___|\\___/|___/ \n"
" _____ _ \n" " _____ _ \n"
" For help and support please visit: |_ _| |_ _ _ ___ ___ \n" " For help and support please visit: |_ _| |_ _ _ ___ ___ \n"
" Website: https://getmangos.eu | | | ' \\| '_/ -_) -_) \n" " Website: https://getmangos.eu | | | ' \\| '_/ -_) -_) \n"
" Wiki: http://github.com/mangoswiki |_| |_||_|_| \\___\\___| \n" " Forum / Wiki: https://getmangos.eu |_| |_||_|_| \\___\\___| \n"
); );
sLog.outString("Using configuration file %s.", cfg_file); sLog.outString("Using configuration file %s.", cfg_file);