Commit graph

174 commits

Author SHA1 Message Date
VladimirMangos
8feaf211f1 [11168] Use MapPersistentState for access to Pool System dynamic data.
* Direct store pool system dynamic data in sPoolMgr replaced by
  shared pool system data object (for all non instanceable maps)
  into WorldPersistentState, and own copies of pool system data
  object in DungeonPersistentState/BattlegroundPersistentState.
  This let have pools with object at many non-instanceable maps,
  and single map pools with unique state for each instance.

* Avoid direct global grid data modify from pool system, and use for this also
  recently added local for MapPersistentState grid spawn data.

* Implemented proper API for update pool system data in MapPersistentStates
  from GameEvent system.

* Initialize pool system state at MapPersistendState creating.
  For shared pool system state for non-instanceable maps initilized at first map state
  creating.

Now pool system propertly work in instance also!
2011-02-15 14:40:56 +03: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
9a8a74c2ad [11138] Make sure GameEvent/Pool systems work with static instance object guids
* Pool System for correct full power work in instance need implement
  MapPersistentState local pool system state for instanceable maps.
  Unit this not implemented pool system must avoid creating/despawn/touch
  instance map objects. Currently this work because instance map object use
  dynamic generated guids and "invisible" for Pool System, with explcitly forbiden
  for it spawn directly new objects. Code changes add explicit checks for preserve
  this way work for time when instance object will use static guids. When local pool
  state storing in persistent state this protection checks will possible drop.
  Non-instanced working cases converted in local map object search calls.

* GameEvent Systems currently have code that work correctly only with objects at
  non-instanced maps by same reasons as Pool System. But in different Pool System
  case game event activate/deactivate expected applied to _all_ object copies in all
  existed instanceable map copies. Code modified for work in expected way.
  Direct spawn disabled for instanceable maps until swith to static guids.
  Despawn code will make affect only for non-instanceavble maps unit swithc to static guids as-is.
  This is preserve current code working result.

* Convert last case usage global creature search in aura code to map local case.
  Player case also possible not need now after including caster damage/heal mods
  part to aura base damage/heal. In any cases player case preserved in old way work.

NOTE: this last places dependent from global creature/gameobject guid search so look like this
      make possible start direct work to switch instances use static guids instead dynamic generated
2011-02-12 07:24:04 +03:00
VladimirMangos
3bfe4bbd3b [11134] Make GCC happy and restore build at *nix. 2011-02-11 18:15:50 +03:00
VladimirMangos
da1b616312 [11133] Implement template functions for call functor for all Map/MapPersistentState with some map id. 2011-02-11 04:05:18 +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
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
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
VladimirMangos
abbd2f09be [11112] Implement use cooldown check for trap/goober gameobjects. 2011-02-07 03:45:01 +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
39e7b19267 [10989] Implement post-3.1 and later fishing changes.
* Fishing now prowide junk loot at fail skill check.
  This can be disabled for old way work using SkillFail.Loot.Fishing option.
  Junk loot expected to be listed in fishing_loot_template entry 0.

* Fishing can gain skill grow at skill fail check case.
  Controlled by SkillFail.Gain.Fishing option.

* Fishing from fishing pool gameobject can't be fail.
  Controlled by SkillFail.Possible.FishingPool
2011-01-09 14:37:56 +03:00
NoFantasy
86b8e4b2f0 [10964] Update a few GO create error messages with better engrish.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-01-05 00:38:21 +01: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
zergtmn
0d6f990e4e [10912] Move scripting related functions from ObjectMgr to ScriptMgr 2010-12-24 00:23:37 +05:00
zergtmn
d9579dd44a [10902] Simplify code for triggering linked trap 2010-12-21 15:34:06 +05:00
VladimirMangos
38118d17d7 [10886] Fixed crash at GO use in case GO owner/first user offline state. 2010-12-18 11:13:48 +03:00
NoFantasy
6aab362980 [10860] Handle GAMEOBJECT_TYPE_TRAP in Use, as done for other GO types.
This just move parts of existing code from TriggeringLinkedGameObject and does not affect summoned trap type GO's (or related to summoned).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-12-11 21:38:06 +01:00
NoFantasy
a2e068659c [10859] Search for linked GO using the original used GO as base of the search
Add some comments for future improvements of this function.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-12-11 14:28:52 +01: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
6154cb3b43 [10749] Convert Gameobject owner to objectguid use. 2010-11-19 20:55:19 +03: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
bffc07e4bc [10689] Restore some item checkes for temporary loot case. 2010-11-07 02:20:10 +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
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
c955941b55 [10627] Use ObjectGuid for player's selection and unit's target 2010-10-20 08:19:48 +04:00
DasBlub
fc5dd54f37 [10612] Revert "[10611] Made some values const"
Reason: It makes no sense to make a local variable const.

This reverts commit 49e3184d69056738701bc15d9b7f982bf11d7bbc.
2010-10-15 22:29:10 +02:00
Reve
47d971c7f9 [10611] Made some values const
Signed-off-by: DasBlub <dasblub@gmail.com>
2010-10-15 22:14:42 +02: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
Schmoozerd
c44438a517 [10607] Handle GAMEOBJECT_TYPE_GENERIC at Use() to trigger despawn of GO
In addition, a check is added to prevent unexpected call to Use() at received opcode. Despawn of this type GO can then only be used with explicit call to Use()

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-14 14:44:57 +02:00
NoFantasy
edbe9ed886 [10603] Replace one hard coded value w/enum name. Additional code style cleanup
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-13 09:41:44 +02:00
NoFantasy
2fe45365c0 [10600] Correct size of animprogress for GO Create()
Add a default define and use it instead of hard coded value.
Some additional minor corrections for transport GO's

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-10 13:27:25 +02:00
zerg
2fa5fa43bd [10594] Use equal_range instead of lower_bound/upper_bound pairs
(based on zergtmn's repo commit 0499169)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-10-09 01:37:57 +04:00
NoFantasy
0caa0e32dd [10593] Cleaning up code a bit, in related functions for recent commits
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 22:11:26 +02:00
NoFantasy
795c3e1f2f [10592] Make GO type 2 activate/deactivate
As with similar GO's that are not interactable (gameobject_template.flags|4) as default, GO's of type 2 becomes active when player can take a quest (or deliver quest).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 20:48:51 +02:00
NoFantasy
66555530a8 [10590] Check if GO is requirement of quest to activate sparkle if it is
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 12:14:28 +02:00
NoFantasy
b0d5e3e51a [10589] Always activate GO type 3 when quest id is defined (and active)
GO may be "lootless", but events at looting can happen

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 10:21:52 +02:00
NoFantasy
fc2e66231b [10588] Make GO type 8 activate and sparkle at related quest active
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 09:40:28 +02:00
NoFantasy
657894786a [10587] Make GO type 5 sparkle at related quest active
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 09:10:38 +02: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
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
VladimirMangos
0649b508e4 [10383] Store guid instaed pointer for first user of GAMEOBJECT_TYPE_SUMMONING_RITUAL
This is more safe way in pointer store comparison with.
LAso Some related code cleanups.
2010-08-20 12:58:32 +04:00
NoFantasy
2c165670b1 [10326] Process GAMEOBJECT_TYPE_FISHINGHOLE in normal way as for other GO's
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-06 15:30:47 +02:00
NoFantasy
027261e295 [10325] Improve process for Use() of GAMEOBJECT_TYPE_SUMMONING_RITUAL
This allow GO's not summoned by any to be processed and use the spells as defined in GO template as expected.
In addition some new checks to determine if GO should despawn and if group membership should be checked or not to allow use.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-06 14:34:20 +02:00