[z0827] Add some missing class/struct forward declarations and includes.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(based on master commit 9eb3b0c)

(based on commit a426887)
[z0828] Constantify some functions in InstanceSave.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(based on master commit 577a5e0)

(based on commit 33fc703)
[z0829] Rename some auras

Signed-off-by: DiSlord <dislord@nomail.com>

(based on master commit 60d6202)

In fact auras 46/48 not used in 1.12.1 also, and used in totaly diff way from old names in 3.x

(based on commit 63cbcf8)
[z0830] Check redundant single rank spell data in `spell_chain`.

(based on master commit 5598af9)

(based on commit 13f44b8)
[z0831] Load most spell chains data from SkillLineAbility.dbc

* Output error for redundent data in table
* Drop detected data from `spell_chain`

(based on master commit 3cd7ef7)
(based on master commit 1fc52ea)
(based on master commit 5aac34b)

(based on commit 2686a20)

SQL part redone for MaNGOSZero
[z0832] some format string fixes

(backported from commit d40352c)
(based on master commit 712d1d2)

Signed-off-by: arrai <array.of.intellect@gmail.com>

(based on commit 6abc1a3)
(based on commit d8e84a9)
[z0833] Implement EVENT_T_MISSING_BUFF for self buff check

Also added amount spell stack checks at loading
for EVENT_T_BUFFED and EVENT_T_TARGET_BUFFED.

(based on master commit d4379bb)

(based on commit 5ef7b4c)
[z0834] Sort `spell_chain` by associated skills as done in master branch.

No functional changes.

(based on commit 39b7e2e)
(based on commit c03ede3)
[z0835] Fixed build after backporting EVENT_T_MISSING_BUFF.

(based on commit 1398daf)
[z0836] Fixed build after recent backports.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(based on commit de6e66a)
[z0837] Re-implement in more safe way single cast spell targets system.

(based on master commit 81022d5)

Re-re-implement compatible with old aura system. Changes will need re-backported after new aura system backport.

(based on commit 24df6db)
[z0838] Certain compilers refuse to erase const_iterator...

(based on master commit 8c4c650)

(based on commit 5788606)
[z0839] Avoid send stop packet in PointMovementGenerator when unit is not moving

Also never send stop packet when destinationHolder hasArrived, it's expected that unit is already not moving.

Signed-off-by: NoFantasy <nofantasy@nf.no>

(based on master commit 6d80364)

(based on commit 6ac5968)
[z0840] Correct typo in function name.

Signed-off-by: NoFantasy <nofantasy@nf.no>

(based on master commit a28a3ce)

(based on commit 60f872f)
[z0841] Improvements in getheight calculation

Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly.

This finally prevents flying creatures from falling to infinity (basically instantly diappearing) in several instances,
aswell as prevent creatures from falling inside larger solid object around the world.

Default height search is untouched, needs more research on how creature AI etc. will be affected.

(based on commit f2141dc) -- backported manually for old vmap code, so need reapply after new vmap backorting in future.

Correcting issues with flying creatures falling to ground at death.

Simplified the way FallGround works and death states are set in a more logical way when a mob is in fact DEAD_FALLING.
Visual will in some cases not be correct. Notes in code for details.

Thanks to Lynx fixing Map::GetHeight
It now return mapHeight as last resort, making FallGround work as expected.
This fix reveal one (known) bug, and therefore a temp hack is added in TargetedMovegen, to be sure Z is not the ground Z for a creature that are able to fly.
Other creatures will follow by the ground level Z (in other words, they will no longer follow in the air).

(based on master commit 1a35175)
(based on master commit cc1843b)
(based on master commit d8a9cad)
(based on master commit 1dd3b14)

(based on commit 4369446)
(based on commit 97dcb82)
[z0842] Rename ASSERT -> MANGOS_ASSERT and related fixes

ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code

(based on master commit 383cbc7)

(based on commit 9a82d30)
[z0843] Fixed expected packet size for SMSG_SET_PROFICIENCY

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(based on master commit 6df5d1c)

(based on commit 2ba836a)
[z0844] Fixed scripted AI init for TemporarySummon/Totem summon code

Call AIM_Initialize before adding to map instead after calling.
This make this call order similar other cases.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(based on master commit 4afad5a)

(based on commit 2bd1415)
[z0845] Fixed warlock summon confirmation.

Client 1.12.1 not have agree boolean field and send packet only for Yes case.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
[z0846] Typos in enum names and comments

Also typos find by darkstalker and Neo2003

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

(based on commit 6fa2052)

(based on commit 4428768)