Commit graph

232 commits

Author SHA1 Message Date
NoFantasy
c93256e477 [11309] Extend SCRIPT_COMMAND_EMOTE, allow search for nearby creature to do the emote
Also allow play emote on Player when player is source.
Gameobject may be source of script but are only allowed as searcher for creature when defined.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-04-03 17:55:53 +02:00
crackm
cc24542aec [11294] corspe -> corpse typos fix.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-03-27 23:45:50 +04:00
zergtmn
a6d155fc54 [11259] Move scheduled scripts counter to ScriptMgr
Also cleanup forward declarations.
2011-03-16 20:01:10 +05:00
SilverIce
fcc09483ad [11202] Schedule AI notify at adding to world
This fixes the problem, that creatures, added at grid loading, do not start attack each other
More shedule -> schedule fixes added, removed unused Map::PlayerRelocationNotify function
2011-02-23 17:04:54 +02:00
kbz
09c5b49cc4 [11194] Fix the word shedule -> schedule in function name
Signed-off-by: SilverIce <slifeleaf@gmail.com>
2011-02-22 03:53:29 +02:00
SilverIce
724092d9e5 [11193] Optimize visibility update and AI notification code. Optimization decreases amount of visibility and AI notification operations in 8-10 times, and as a result, lowers CPU usage by 30-40%
You need to update your config file, new "Visibility.RelocationLowerLimit" and "Visibility.AIRelocationNotifyDelay' options added

Special thanks to Ambal for code hints and advices
Thanks to Undergarun and kero99 for making tests
2011-02-22 02:37:08 +02:00
VladimirMangos
04c21c95d3 [11159] Remove now redundent GetDBTableGUIDLow support.
Now any creatures/gameobjects loaded base at DB data
in non-instanceable/instanceable maps always have same guid
as in DB data.

* Also remove useless by same reasons MaNGOS::GameObjectWithDbGUIDCheck
2011-02-14 07:20:09 +03:00
VladimirMangos
cf685da47a [11139] Use for Creature/GameObject local per-map guids
* Creature/GameObject guid generators moved to Map
* For avoid wrong not converted cases generic function in ObjectMgr has been replaced by
  specilized guid generation function like sObjectMgr.GeneratePlayerLowGuid().
  This let catch all cases that need update in custom code or scripts.
* Drop many ObjectAcessor.h now dead code. This is also make mangos more thread safe.
* Restore one more time unix build broken in prev. commits.

Note: many cases when something not wotk in instance but work in continents
possible magicly start work after this commit. For example, some gm commands.
From large systems that need more chnages for start work in full power in instances
can be referecned pool/gamevent system. Last need just small hacks drop changes but
in will addded in independent commit.
2011-02-12 09:52:16 +03:00
VladimirMangos
47060fe4b1 [11137] Fixed crash at reset normal dungeon while map loaded.
* Map Persistent noe have direct pointer back to map if map loaded.
  That let simplify some code and avoid map search.
* Crash showup in result changes in code logic related to reset processing.
* Also fix more old bug with reset normal dungeon with not loaded map.
* Reverse MapPersistentState::HasRespawnTimes and MapPersistentState::HasBounds() results
  to expected for function names and update related calls.

Thanks to Schmoozerd for help in research problem.
2011-02-12 06:44:52 +03:00
VladimirMangos
6d26ec0e7f [11129] Added WorldMap/WorldPersistentState subclass for non-instanceable maps.
This let have symmetric Map/MapPersistentState (sub)classes hierarchy.
2011-02-10 18:52:23 +03:00
VladimirMangos
108feb993d [11127] Rename src/game/InstanceSaveMgr.* -> src/game/MapPersistentStateMgr.* 2011-02-10 05:35:07 +03:00
VladimirMangos
dde16bc48c [11126] Rewrite InstanceSaveMgr related code.
* For better fit name to related map type class InstanceMap renamed -> DungeonMap.
  This clarify usage Instanceable()/IsDungeon() because BG/Arenas maps also instanceable maps.

* InstanceSave have many code related to only DungeonMap case, so it replaced by 3 new classes:
   - MapPersistentState as base class, used for non-instanceable maps (continents and some other) (!Instenceable())
   - DungeonPersistentState subclass of MapPersistentState, used for DungeonMap states (IsDungoen())
   - BattlegroundPersistentState subclass of MapPersistentState, used for BattlegroundMap states (IsBattleGroundOrArena())

   Now all dungeon resets code moved to subclass and all player/gpoup bound functions/structures also use it.

* Map::GetInstanceSave renamed to Map::GetPersistentState and DungeonMap have specialized version
  return DungeonPersistentState (same pointer in fact with proper subcalss type)

* InstanceResetScheduler renamed to DungeonResetScheduler
2011-02-10 05:20:56 +03:00
VladimirMangos
01178b69e5 [11124] Avoid save in DB instance/respawn data for BGs/Arenas.
* Fixed bug with not unloaded InstanceSave for BGs/ArenasPartly.
  This bug introduced with recent InstanceSave creating for all maps.
* Avoid save respawn data to DB for BGs/Arenas.
  No reason save to DB because BGs/Arenas reset at map unload.
* Always create InstanceSave for Map without recheck suggested data integrity.
  Map::GetInstanceSave expected always return != NULL value.
2011-02-09 18:34:29 +03:00
VladimirMangos
6cfa64db97 [11123] Move respawn data to InstanceSave.
This make prev commit more useful.
In future InstanceSave also planned store local pools state.
2011-02-09 06:09:32 +03:00
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