Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Also pet/controlled unit global cooldown code replaced by new placed in charmInfo structure.
Thanks to nos4r2zod for testing and gcd range check implement.
* Check class considered have all info select object in world from suggested but grid walker list in some grid.
This also meaning that Check must always have focus object around that (and in same phase) fit objects must be.
* Searcher only must ask Check and know how from all objects fiting to Check select result object(s).
For this reason and for better compatibility removed first arg (searcher) form all Searcher classes.
Instead expected used Check::GetFocusObject() object if need ( by always need check and simolify Check classes
phase checked in Search classes). This also restore source code compatibilty in related lines with prev.client
version branches code.
* While focus object adding fixed possible wrong phase object selection at stealth detection and at corpse searches.
* Some spells expect this.
* Check SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE just for similarity,
currently no spels with aura 310 with special school masks.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
In fact it general problem possible with area auras if it re-casted
non-standard way from code. But known only test case for mangos-0.12 branch.
Thanks to ciphercom for reportand original research of problem source.
*CORPSE_DECAY values adjusted (Rare/RareElite values are guessed) with more proper.
*RATE_CORPSE_DECAY_LOOTED is now 0.0 as default and a modifier of the creatures spawntimesecs are used for corpse decay.
Respawn time for creature is now set at death (result: database spawntimesecs are in most cases the time it takes from kill to respawn)
Overall, this will affect four things:
* corpse will stay visible longer before looted
* corpse will stay visible longer after looted, when creature has long respawn time
* creature without loot will "skip" the default decay times and then fix a "should respawn almost instant" -problem
* creature with loot and very short respawn time may respawn instantly after looted
Signed-off-by: NoFantasy <nofantasy@nf.no>
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
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).
OnCreature Evade/Death/EnterCombat and in addition OnPlayerLeave
The functions are intended to help doing instance related tasks (in other words, not for the general AI of creatures).
Signed-off-by: NoFantasy <nofantasy@nf.no>
Also
* Fixed some amount wrong uses low guids as full player guids.
* Add private without body ObjectGuid(uint32 const&) for catch wrong assigns low guids to ObjectGuid.
In some cases need assign "0" guid, then use ObjectGuid() instead.
* Fixed .pdump commands work.
Interrupt casting non combat spell spell at neter to combat
and prevent it casting in combat (last checked by client
but better recheck at server for prevent cheating).
Pre-aura holder code always remove auras from diff lists before un-apply aura affect call.
Restore this way work for new aura holder code. This prevent different strange affects
when aura find by search when it already expected to be removed from target, including case when in
result som un-apply called code aura deleted 2 times.