Update backporting helper to normal tbc-master branch
[z2355]  Add some safety to rare case of target-selection for unreachable target

Thanks to Atari for reporting and researching this problem

(based on commit [12478] - ae2a837)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s1998] - 6c0eeac)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2356]  Enable using table creature_linking with empty table creature_linking_template

Note: Guids are evil!
Close cmangos/issues#148

(based on commit [12479] - 4e65ae9)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s1999] - a13db5c)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2357] Fix a stupid mistake from me introduced in [s1990]

Thanks to boxa for pointing

(based on commit [12484] - bffff06)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2001] - a996b83)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2358] Improve WaypointMMGen

* Add correct Reset position (Npc will evade now to the last reached waypoint, and not to the next waypoint)
* Add proper return value for the CONDITION_LAST_WAYPOINT

* Let WaypointMMGen behave better after evading (keep PAUSED state, keep waittimer

(based on commit [12485] - 3d41af5)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2002] - 93bbb2c)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2359] Change Debug Output to EventAIError output if no target is found

(based on commit c698466)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2003] - f0468ee)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2360] Stop movement of dead npcs

Close cmangos/issues#213
Also thanks to pyromaniac for posting this bug on the forums (and a few users for confirming)

(based on commit [12489] - 204838e)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2004] - b3a2f66)

Also close cmangos/issues#216

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2361] Keep CombatMovement, Running and Waypoint-Paused states after evade

(based on commit [12490] - 40d014a)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2005] - 65e6465)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2362] Add additional miscValue to AIEvent throwing

(based on commit [12491] - dfb0b55)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2006] - ed7d508)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2363] Rearrange code for Aura::HandleAuraModIncreaseHealth

* Also fix some behaviour with SetHealth/SetPower if set to max health/power

(based on commit [12492] - dd0633c)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [s2007] - a276b60)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2364] Add some doxygen documentation

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [12496] - 300f9d7)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2012] - 5ffa589)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2365] Convert some files to markdown

[ci skip]

(based on commit [12497] - f6e6e9d)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2013] - c5da71b)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2366] Add some safety to some preprocessor defines

(based on commit [12499] - b16927a)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2015] - f96b218)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2367] Remove a few empty lines
[z2368] DBScripts Engine: Support buddy search by guid

* Add new `data_flags` flag SCRIPT_FLAG_BUDDY_BY_GUID (0x10)
If this flag is set, the content of `search_distance` is interpreted as db-guid of the requested buddy

* Also switch most error log output to DB-error log output (though this will include false positives)

(based on commit [12501] - f2ee8c0)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2017] - d5211bf)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2369] DBScripts Engine: Allow pets as buddy

Add new flag SCRIPT_FLAG_BUDDY_IS_PET (0x20) that will search not for a normal npc with buddy-search, but also for pets

(based on commit [12502] - 112908b)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2018] - afd5299)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
DBScripts Engine: Change behaviour to search for a different npc when using buddy-search

With this an npc buddy will be interpreted as "another npc with entry"

Also toggle command 31 - TERMINATE_SCRIPT to also look only for other npcs of entry

(based on commit [12503] - 5eff81f)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2019] - 4a46877)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2370] EventAI: Improve TargetSelection related ErrorLog output

(based on commit [12504] - 17879f2)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2020] - 9d135ac)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2371] Fix SpellDamage modifier of SPELL_AURA_MOD_DAMAGE_DONE_CREATURE

This aura modifies a flat value, not a percent value.

Close cmangos/cmangos-classic#26

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [12508] - 17a4097)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2021] - ca7044a)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[z2372] Fix take ammo for most ranged spells

Fix spells like Arcane Shot not taking ammo while they should

Signed-off-by: cala <calaftp@free.fr>
Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>

(based on commit [12510] - c8b2a94)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>

(based on commit [s2022] - 39a6a47)

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>