Commit graph

268 commits

Author SHA1 Message Date
VladimirMangos
852c4ddf32 [11122] Create InstanceSave for non-instanceable maps.
This preparation for use structure for store another map persistance data like respawn times.
2011-02-09 04:00:14 +03:00
VladimirMangos
cd867eadef [11121] Really create records in world table for non-instanceable maps. 2011-02-09 01:01:34 +03:00
VladimirMangos
8354de4927 [11119] Fixed whitspaces line. 2011-02-08 05:01:24 +03:00
VladimirMangos
f73868a703 [11117] Allow for non-instancable maps have InstanceData and instance scripts.
* New table added for non-instanced maps (except BG/arena):
    - `mangos`.`world_template` (script mapping to non instanced data)
    - `characters`.`world` (saved script data string storage)

* InstancedData created for any map types including BGs/arenas, that allow have scripts
  state for any maps, but BG/arena instance data not saved.

Note: Possible structures will renamed later for clarify apply to any type maps,
but avoid for now for simplify changes and hard affect to script library sources.
2011-02-08 04:15:13 +03:00
Skirnir
75b4f75f4d [11066] Remove tail whitespaces.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-25 00:22:29 +03:00
XTZGZoReX
2d87d68b4e [10626] CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY -> CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATELY 2011-01-16 18:47:52 +01:00
VladimirMangos
784c0ca781 [11017] Finaly restore non-crashing non-in-world logout.
For example at close client with far teleport loading screen.
2011-01-16 20:38:48 +03:00
Kid10
b206e5ddd0 [10962] Fixed wrong spell cast code call with missing bool arg.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also added trap code for like wrong cases
2011-01-05 00:54:38 +03:00
VladimirMangos
fda171d6bd [10961] Avoid use scripting support wrappers for internal server code. 2011-01-04 22:48:04 +03:00
Schmoozerd
883e88fad5 [10956] Implement support triggered spells in SCRIPT_COMMAND_CAST_SPELL
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-04 04:15:47 +03:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +03:00
zergtmn
ec6089bbd8 [10935] Move script calls to ScriptMgr
- Script library presence is now optional.
- Some script hooks have new names. Scripting libraries need to be adjusted accordingly.

Signed-off-by: zergtmn <zerg@myisp.com>
2010-12-29 21:48:06 +05:00
Ambal
b11820593c [10924] Send time diff between Update() calls for object - should help with mob respawn on inactive grids etc. Based on patches by VladimirMangos and cipherCOM. All issues from previous patches should be finally fixed now.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-12-27 22:27:20 +02:00
Ambal
f56e13966f [10914] Remove ObjectLevelLockable inheritance in Map class + cleanup locks in Map code. Restore build after recent commits.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-12-24 01:23:02 +02:00
zergtmn
0d6f990e4e [10912] Move scripting related functions from ObjectMgr to ScriptMgr 2010-12-24 00:23:37 +05:00
Ambal
5f539117a4 [10848] New system for parallelizing client packet processing. Handle WorldSession updates in Map::Update() where we are safe to proceed. Thank you for all your feedback!
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-12-09 20:21:41 +02:00
VladimirMangos
c6d3c5e0d6 [10810] More ObjectGuids specially in petition code.
Some uint64<->uin32 bugs fixed at read guids from DB in petition code.

Still exist 29 GUID_LOPART uses in code.
2010-12-02 05:17:00 +03:00
VladimirMangos
ce7b98c45e [10799] Add GetGuidStr() short call for GetObjectGuid().GetString() and use it. 2010-12-01 09:56:13 +03:00
Schmoozerd
16cd545df8 [10761] Basic support for target-name in MonsterSay/etc
Change MonsterSay's target to pointer.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-20 21:27:21 +03:00
VladimirMangos
c2096380cf [10752] Convert to objetguids map scripts and finally drop IS_PLAYER_GUID. 2010-11-20 02:38:56 +03:00
VladimirMangos
2601022b9f [10751] Use objectguids in item code.
Also
* Fixed unexpected container updated state after inventory load
* Make .debug getitemstate command more friendly by args.
2010-11-20 01:59:48 +03:00
Ambal
f67d89f109 [10727] Map system re-engineered. Special thanks to Blueboy for tests.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-11-16 21:08:28 +02:00
VladimirMangos
3b0e926788 [10717] Revert "[10716][10688] New version of patch for send real diff from last update."
This reverts commit 8398a55fa274471daae115e00c627b299a3fdbbd.
This reverts commit 06e2d6859ba3d7fd47be72c23a64e68ae039701f.
2010-11-10 06:29:49 +03:00
VladimirMangos
c1427f7d83 [10716] Typo show commit before revet all realddiff one more time.
Typos show that in fact "working" has been result typos diabled state for relamd.
Cell-based way have not avoidable problems with case when object added to not active
long time Cell. If someone find more working sollution it can be readded ofc.
2010-11-10 06:13:27 +03:00
VladimirMangos
9c96949da9 [10713] player/group instance binding fixes.
* Use anum instead raw uint8 type in args
* Fixed crash when gm at continent invite to group gm in instance
  and then teleport to instance using .goname.
  When group leader teleport to instance it must get group bind instead solo bind.
* In other semilar cases detection report error as before but replace solo by group bind instead
  assert crash at enter to map.
2010-11-10 04:36:01 +03:00
SilverIce
b825c33cdf [10705] Simplify CellArea calculation 2010-11-09 00:56:49 +02:00
SilverIce
b6695d5279 [10698] Compute cell area bounds for active objects in the same way like it done for players 2010-11-08 02:23:43 +02:00
VladimirMangos
10d3d3ce24 [10692] Fixed some GCC warnings and code errors.
Thanks to freghar for provide cleaned list of warning messages.
2010-11-07 21:30:55 +03:00
VladimirMangos
2b98f699b7 [10690] Fixed *nix build problem after recent commits. 2010-11-07 03:04:35 +03:00
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