[mr2816] Fix some visibility problems related to broken PhaseMask.
[12504] EventAI: Improve TargetSelection related ErrorLog output

Conflicts:
	src/game/CreatureEventAI.cpp
[12505] Add and implement server-side spell 23770

Conflicts:
	src/game/SQLStorages.cpp
	src/game/SpellEffects.cpp
	src/shared/revision_sql.h
[12507] Implement proc effect of spells 67712, 67758

related to items 47316, 47477.

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

Conflicts:
	src/game/SpellMgr.cpp
	src/game/UnitAuraProcHandler.cpp
	src/shared/revision_nr.h
	src/shared/revision_sql.h
[12508] Fix SpellDamage modifier of SPELL_AURA_MOD_DAMAGE_DONE_CREATURE

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

Related cmangos/cmangos-classic#26

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[12509] Check cast spell 51690

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

Fix spells like Arcane Shot not taking ammo while they should

Close cmangos/mangos-tbc#19

Signed-off-by: cala <calaftp@free.fr>
Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[12511] Fix invisible spirit healers & such on death near them

This fixes an issue that occurs if you die close to a spirit healer/guide.
Close cmangos/mangos-tbc#18

Signed-off-by: Schmoozerd <schmoozerd@cmangos.net>
[12512] Implement some spells for Felmyst encounter

Spell entries: 45714, 45717 and 45918. Limit targets of spell 45391
Also add stacking exception for auras 45068 and 45582
[12513] Fixup commit 12511 Thanks to Zakamurite for pointing

Also thanks to him for giving a helping hand in correcting the commit
[12514] Forward original caster GUID to script library

Conflicts:
	src/game/ScriptMgr.h
	src/game/SpellAuras.cpp
[12515] EventAI: Implement ACTION_T_SET_THROW_MASK (46)

This Action can be used to set which AIEvents should be thrown automatically, if you need more flexibility, you can always use the manual ACTION_TH_THROW_AI_EVENT version.

* Also clean some error-log output a bit.
[12516] EventAI: Improve code

* Drop rather pointless bool to check if the number of assigned events is empty
* Before the phase was resetted on death if and only if the npc has Events defined
* DoMeleeAttackIfReady could have been called even though combat state could have changed while processing events

Conflicts:
	src/game/CreatureEventAI.cpp
[mr2817] usable expression from 12517
[12520] Allow spell effect 86 - Activate Object to use the misc value

Close cmangos/issues#220
SD2 update
[mr2818] Fix MGens bugs and some improvement for Confused MGen

BUG: if player sheeped or blinded and use f.e. Medallion of the Horde (item 42122) or Every Man for Himself (spell 59752), his movement will not stop until it reaches the end point.
[mr2819] Do not add MOVEFLAG_WALK_MODE to creatures that did not have it but called SetWalk() for their movement

picked from TC, author Shauren.
seems logical

TESTING
[mr2820] Fix ranged combat for mobs, close #1359

need more research for dbc fields.
[mr2821] Implement wrapper for frequently used DealDamage to death for self unit

often used in SD2, i tired of copy/paste the same things.
the "suicide" commit =)