[s2204] Implement Battleground scores storage system

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

(based on commit [12756] - 9b7bb67)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2205] Extend pvp team indexes to global use

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

(based on commit [12760] - 5c3b410)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2206] Reverse pvp team indexes for score statistics storage

This updates [s2204] and makes @ShinDarth happy

(based on commit [12769] - fab75fc)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2207] Fix winner team for bg scores storage

(based on commit [12770] - df8a125)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2208] Use shiny new function to play music with the spell

(based on commit [12761] - c37f181)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2209] Fix rooted player continue their movement while rooted for other clients.

http://cmangos.net/thread-6756.html
Thank to Moh for pointing.

(based on commit [12762] - c1af307)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2210] Improve EventAI code engine a little bit to be more effective with EVENT_T_RANGE

(based on commit [12765] - f676018)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2211] EventAI - CodeStyle

(based on commit [12766] - 1c1fb83)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2212] EventAI - SpeedUp OOC-LoS Event handling

Reorder checks such that range and LoS checks are handled after the faster faction checks.
Also introduce a bool variable to prevent iterating all events every MovementAction

(based on commit [12767] - 86fa6da)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2213] EventAI - Some random changes

(based on commit [12768] - 6525c80)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2214] Rewrite rest management.

Fix Rest when logged in not working in some case.
Also fix rest bonus according to wowwiki.

This need to be backported in all core.
Thank to @TheTrueAnimal for pointing.
Fix cmangos/issues#494

(based on commit [12771] - e804879)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2215] Fix logic bug in SelectAuraRankForLevel

(based on commit [12773] - bf80378)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2216] Fix bug that cause AreaAura reaply because the code doesn't search the correct rank of it.

(based on commit [12774] - 215b4b9)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2217] Fix AreaAura bug when low level grouped with high level Player. Thank to @tarwyn for his precious help and proposed patch.

http://cmangos.net/thread-6773.html

(based on commit [12776] - 43caf20)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2218] Fix issue with afk playerin duel logout request from client after 30 mins. We can logout during duel. Btw during duel we must be in combat for some timer without any action. Also change message from "duel cancel" to "duel  FLED"

(based on commit [12777] - cc542de)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2219] Fix skinning loot bug.

Thank to @TheTrueAnimal for pointing.

Fix cmangos/issues#472

(based on commit [12778] - d4cdfb5)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2220] Allow creating Non-Instance Maps without player

(based on commit [12780] - 06472b0)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2221] Move unused Map::LoadGrid function to function Map::ForceLoadGrid

(based on commit [12781] - d193f83)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2222] Add new config setting LoadAllGridsOnMaps

With this setting one can store a list of maps that are automatically
loaded with all grids and all creatures.
Continents will be loaded on server-startup, instances when a player
enters.

NOTE: Using maps with this setting will cost huge amount of cpu and ram
power, and hence it must only be used for development purposes

(based on commit [12782] - e5182a3)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
[s2223] Create function to load active entities.

Note this function is considered WIP, and will require further work pending more features

Ideas and loop to load all grids on a map by Neo2003.

(based on commit [12783] - aaf514c)

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