In new version last update time stopred for specific Cell that store all world objects
placed in it. All objects of Cell updated (or not updated) in same time.
Original version provided by ciphercom.
This reverts commit 10784a8c7cc81c468b5411e973d36ecf31de9603.
Main reason: impossibility for me as commiter test problem and fix all corner cases problems.
* This fixes possible problems with Spell::FillAreaTargets(center of search should be (x,y) position, not spell caster's position)
* Cleanup Cell class, removed old and unused code
Now in case when creature/etc some tices not updates in result stay
in not active (no near players or active objects) cell some important
timers (corpse decay, summon timers, group loot expire, aura durations, etc) will
updates at real diff time from last prev. update call.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
For some systems added exclude use real diff time because current limitations
like move generators. So its stay use last tick diff and considered freeze and
skip all time while creature in not active map part.
Also other classes have been affected, due to the use of search&replace.
This will probably break some patches and 3rd party libraries, so make sure to update them if required.
Thanks to Phille for the original idea and patch!
* Move selection allowed upper and lower heights for target point
into near point core function used for contact/close point selection.
Selection base at possibility target point searcher fly/swim(or walk by water bottom).
* Use vamp water level data so have proper water level in instances in movements.
* Use increased ground search distance for water level case.
* 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.
All commands can only have creature as the affected by command
*_SET_ACTIVEOBJECT - switch activeObject state on/off
*_SET_FACTION - changes faction
*_MORPH_TO_ENTRY_OR_MODEL - changes model to model from creature_template entry or model id explicit
*_MOUNT_TO_ENTRY_OR_MODEL - mounts on model from creature_template entry or model id explicit
*_SET_RUN - switch walkmode on/off
Signed-off-by: NoFantasy <nofantasy@nf.no>
In addition to adding fields for text id storage (in total 4 text id's), also added a comments field for developers notes in scripts (it may help those being old of age to remember what goes on in a script).
Signed-off-by: NoFantasy <nofantasy@nf.no>
datalong can be 0:idle, 2:random, 3:waypoint. In case 3, creature must have a existing creature_movement_template.
Command start movement for source of script. If source is not creature but target is, it will apply to target.
Optionally creature entry can be defined (datalong2) and start movement for this if found nearby (search radius defined in datalong3).
Signed-off-by: NoFantasy <nofantasy@nf.no>
When we know that point above .map ground search at least until ground level for vmap height.
Good news: Fishing bobber still fixed ;)
Good news: Mobs not follow into the air again
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.
* This let make map local way access for cases when player/all units
expected to be at same map (for scripts cases for example).
Ofc, still exist many places where code expect world wide player search.
Spell casting for support far target cases, groups/guilds/chat/etc packets
* Function Unit::GetUnit depricated and will removed soon.
* Function GetCreatureOrPetOrVehicle renamed to less horriable GetAnyTypeCreature name.
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.
Important:
* You have to re-extract and assemble vmaps
* Update your config file, new option 'vmap.enableIndoorCheck' added
New features:
* Include WMO+DBC area information for correct subarea identification and indoor check
* Support for WMO liquid (fishing/swimming in cities, instances and oterh WMO based environments)
Technical changes:
* New Bounding Interval Hierarchy (BIH) data structure for better performance
* Referenced model data for reduced memory usage,
needs more files, but reduces overall file size from ~1.9GB to ~550MB
Additional Authors:
arrai (DBC handling and indoor detection)
faramir118 (windows support and bug investigation)
And of course thanks Vladimir for a lot of patience and support!
also isActiveObject check moved to WorldObject - all worldobjects are inactive by default, excluding players
this is a final part of cameras implementation
(based on commit efc9623)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Also remove template-way code selection for object for Map::AddToActive/Map::RemoveFromActive.
This simplify function use from not Map code.
* Allow other than Creature to talk.
* Add "buddy-talk", using creature entry in datalong2 (the npc who will do the talk instead of the original source). Value in datalong3 is how far to look for the buddy.
* Add data_flags making it possible to have conversations between units, controlling who does the talking and to whom, including make player do the talking when player is not already the source.
Notes and details are added in the comments for SCRIPT_COMMAND_TALK
Signed-off-by: NoFantasy <nofantasy@nf.no>
Making data consistent with other, similar tables like EventAI's text tables.
This convert existing data and also adds support for all chat types.
Signed-off-by: NoFantasy <nofantasy@nf.no>
Note that script id can be id from different DB tables. It will however make it easier to find the source of any error.
More code cleanup and style corrections.
Signed-off-by: NoFantasy <nofantasy@nf.no>
* Make possible have debug output if build in release mode.
* But preserver current optimization in avoid debug output args
calculation if debug ouput disabled if done using DEBUG_LOG
* Implement in same way BASIC_LOG, DETAIL_LOG. Recommended use
its instead explicit access to sLog
* Use variadic macros for DEBUG_LOG and other new defines.
All supported VS/GCC have its support as C++ extension.
* Add DEBUG_FILTER_LOG and semilar defines for filered log output and use its.
* Also move recent added debug output for transport events under LOG_FILTER_TRANSPORT_MOVES