Commit graph

189 commits

Author SHA1 Message Date
VladimirMangos
e219ee99bb [10688] New version of patch for send real diff from last update.
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.
2010-11-06 22:59:54 +03:00
VladimirMangos
0847d4c8cd [10683] Revert "[10677] Send to creature/etc Update call real diff from last update and use it."
This reverts commit 10784a8c7cc81c468b5411e973d36ecf31de9603.

Main reason: impossibility for me as commiter test problem and fix all corner cases problems.
2010-11-05 19:54:31 +03:00
SilverIce
225b4db1ca [10681] Added new Cell::Visit* functions to visit grids with center in (x,y) coords
* 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
2010-11-04 21:45:49 +02:00
cipherCOM
555c1a9094 [10677] Send to creature/etc Update call real diff from last update and use it.
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.
2010-11-03 07:07:13 +03:00
VladimirMangos
fd7e86c79b [10647] Show die animation at totem destroy.
Or any creature type die with linked unsummon.

Original patch provided by Eggxp.
2010-10-26 16:49:29 +04:00
SilverIce
c4ddbead04 [10616] Simplified trade distance checks, GROUP_UPDATE_FLAG_POSITION flag handling moved out of Map
note: need avoid Map::PlayerRelocation calls now and use Player::SetPosition instead
2010-10-17 19:19:47 +03:00
DasBlub
61102e3b16 [10610] Renamed some functions from the Creature class
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!
2010-10-14 22:07:04 +02:00
SilverIce
4c5c6c46a1 [10605] Fixed infinity loop at grid loading
this also probably solves the problem that object tries to be loaded twice
2010-10-13 22:39:07 +03:00
NoFantasy
541098168d [10536] Extend SCRIPT_COMMAND_TEMP_SUMMON_CREATURE to set summoned as active object
Field data_flags 0x01 will enable active state

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-25 13:35:22 +02:00
VladimirMangos
2170c9c919 [10529] Water level in movement use fixes.
* 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.
2010-09-25 08:01:28 +04:00
VladimirMangos
b0edd807d7 [10513] Clear grid *Check/*Searcher clases use
* 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.
2010-09-22 06:25:21 +04:00
NoFantasy
29a723e41e [10507] Extend SCRIPT_COMMAND_TALK with option to set language for text
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-19 20:50:18 +02:00
NoFantasy
a1fd19b6b3 [10506] Implement 5 new SCRIPT_COMMAND_*
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>
2010-09-19 19:27:33 +02:00
NoFantasy
0245efecb7 [10500] Extend SCRIPT_COMMAND_TALK to support random selected text
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>
2010-09-18 01:55:29 +02:00
NoFantasy
d7216b0991 [10498] Arrange case SCRIPT_COMMAND_* so that they come in correct order.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-18 00:07:53 +02:00
NoFantasy
cb877e1281 [10496] Re-work struct ScriptInfo and use union for data fields.
Enumerate SCRIPT_COMMAND_* and move it away from world.h

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-17 23:33:22 +02:00
NoFantasy
8b10ac9474 [10487] Implement SCRIPT_COMMAND_MOVEMENT(20) to start/change movement
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>
2010-09-15 11:48:51 +02:00
VladimirMangos
94e6bb47e7 [10439] Increase search distance at height search if we know expected limit.
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
2010-09-04 06:34:20 +04:00
Lynx3d
8474b2cbb0 [10438] Fix GetHeight() to return height within actual search distance only.
Good news: Fixes fishing bobber
Bad news: Mobs follow into the air again unless larger search distance is used
2010-09-03 13:05:39 +02:00
VladimirMangos
acd0716297 [10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
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
2010-09-02 05:13:16 +04:00
NoFantasy
32e3e252fb [10431] Correcting issues with flying creatures falling to ground at death.
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).
2010-09-01 00:31:31 +02:00
NoFantasy
9c02f476ec [10390] Add several new script calls for InstanceData
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>
2010-08-20 20:26:06 +02:00
VladimirMangos
dcc9dc25ae Traditional post-commit typo fix. 2010-08-20 14:33:03 +04:00
VladimirMangos
920a36b3fd [10384] Fixed reset time calculation for some cases.
Most real fix suggested by Schmoozerd and  Toinan67
and some my code style part coding ;)
2010-08-20 14:32:11 +04:00
VladimirMangos
dbe9c6f190 [10371] More wide use ObjectGuid in group code.
Also drop some unused functions.
And fix some uint32 -> uint6 guid assigns.
2010-08-18 13:43:55 +04:00
VladimirMangos
5f44c4da21 [10363] More wide use ObjectGuid in way remove MAKE_NEW_GUID uses.
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.
2010-08-17 08:22:28 +04:00
VladimirMangos
a202b33702 [10339] Restore lines ends in Player.cpp :/ 2010-08-10 23:37:14 +04:00
VladimirMangos
45cdc67f58 [10338] Create Map version for GetPlayer/GetUnit fucntions
* 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.
2010-08-10 23:22:11 +04:00
Lynx3d
730b4deaaf [10272] Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly.
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.
2010-07-26 08:09:08 +02:00
VladimirMangos
0065693c4c [10231] Use VMAP::VMAPLoadResult instead raw int loadMap result. 2010-07-20 01:27:07 +04:00
Lynx3d
01d326b90d [10202] Rename isInFlight() to IsTaxiFlying() and UNIT_STAT_IN_FLIGHT to UNIT_STAT_TAXI_FLIGHT.
Also add IsFreeFlying() function to Player class.
2010-07-17 02:06:28 +02:00
TGM
e4495d4c2d Fixed typo in enum value name.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-07-15 21:59:03 +04:00
VladimirMangos
f72b8e60a5 [10196] Use enum for instance reset event types, some related cleanup code. 2010-07-15 18:31:38 +04:00
Lynx3d
5e89098a61 [10165] New collission system (vmap) implementation
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!
2010-07-08 23:17:26 +02:00
crackm
52e4c0ab17 [10146] Implement SCRIPT_COMMAND_PLAY_MOVIE (19)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-07-03 23:58:41 +04:00
VladimirMangos
67a7892075 [10114] Store associated InstanceSave for dungeon map in Map object 2010-06-27 21:11:26 +04:00
VladimirMangos
e88a718c5d [10094] Extract instance reset scheduler from InstanceSaveMgr
Reset scheduler code not need explicit access to instance saves,
and no reson mix it with instance save managment code in single class
2010-06-22 04:40:33 +04:00
VladimirMangos
1eed65d5ac [10082] Drop now unused dotconfpp lib code. 2010-06-20 02:20:51 +04:00
SilverIce
6ca609629c [10073] Make object active at applying view on it
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.
2010-06-18 00:19:12 +04:00
SilverIce
e427ce80cc [10052] Camera System
(based on SilverIce's repo commit 4f2f4ab + next 3 more)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-06-14 07:23:03 +04:00
XTZGZoReX
aa62225c68 [9996] Remove grid state debugging code and move state machine to MapManager. 2010-05-28 15:01:04 +02:00
XTZGZoReX
28c3de5093 [9995] Move GridMap class (and related structs/enums) to separate cpp/h.
Also rename some structs/enums and fix some code style.
2010-05-28 13:34:14 +02:00
NoFantasy
5a72466935 [9890] Add TYPEMASK_WORLDOBJECT to enum TypeMask
Check typemask and replace a few dynamic_cast with more simple casts.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-05-13 17:51:49 +02:00
NoFantasy
31ec245b68 [9889] Extend features available for SCRIPT_COMMAND_TALK
* 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>
2010-05-13 16:39:04 +02:00
NoFantasy
b208effca6 [9883] Change SCRIPT_COMMAND_TALK to support CHAT_TYPE_* using enum ChatType
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>
2010-05-12 14:09:38 +02:00
NoFantasy
3790084fb1 [9870] Add script id to all remaining SCRIPT_COMMAND_* error message outputs.
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>
2010-05-11 11:46:18 +02:00
NoFantasy
d02313d94c [9869] Extend SCRIPT_COMMAND_QUEST_EXPLORED to allow player<->player as source/target
Additional code cleanup and output script id in error messages.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-05-11 11:00:58 +02:00
hunuza
68abd76c97 [9844] Fix some whitespace errors.
Signed-off-by: hunuza <hunuza@gmail.com>
2010-05-07 12:25:12 +02:00
VladimirMangos
722135b326 [9838] More log filters and macro uses.
* LogFilter_Weather
* LogFilter_PeriodicAffects
* LogFilter_PlayerMoves
* LogFilter_SQLText
* LogFilter_AIAndMovegens
* LogFilter_PlayerStats
2010-05-05 18:46:10 +04:00
VladimirMangos
6dec6c8a9f [9836] Make log output code more consistent for diff build modes.
* 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
2010-05-04 22:29:11 +04:00