Commit graph

248 commits

Author SHA1 Message Date
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
NoFantasy
e3387ec6b0 [11120] Remove all auras at creature respawn.
This will remove death persistent auras and AI does no longer need to remove any such auras at respawn manually (GM will still see the death persistent aura all until creature respawn).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-02-08 21:21:08 +01: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
NoFantasy
3251f39684 [11081] Beautify some SQL log queries and remove not needed enclose character
Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-01-29 10:40:36 +01:00
mns
d699d0973b [11068] Prevent infinity creature fall at fail get heght.
Also fix wrong use INVALID_HEIGHT as height value.
It must be used only for _check_ height, and DON'T must use as real height value.
Must fix some wrong height check results.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-25 01:17:53 +03:00
Schmoozerd
54cb8f1a63 [11032] Implement CREATURE_FLAG_EXTRA_AGGRO_ZONE.
This let control zone wide aggro in DB data instead
need special script code.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-18 13:48:46 +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
a0e298179c [10952] Don't use singleton to access static functions. 2011-01-03 14:55:55 +03:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +03:00
VladimirMangos
d38df50a7e [10932] Imporvments gameevent creature morphing.
* Table `game_event_model_equip` renamed to `game_event_creature_data`
* Table allow now store same creatures for different events, BUT
  expected that related events no active in same time.
* Added possibility switch entry at gameevent time.
  This let have diff factions/loot and etc for creatures.
* Added possibility cast spells at gameevent start/end.
  Exist some spells that expected casted to creature at gameevent start
  for model replace, and for animation in other cases.

Note: `game_event_creature_data`.`modelid` field posisble will removed soon in fowor related spell use.
      Ofc, when spells will implemented in core.
2010-12-29 01:38:49 +03:00
VladimirMangos
3ff5ff2e6f [10929] Move game event creature morphing code to Creature::UpdateEntry
* This is allow have more clean logic in feature work.
* Prevent modify static creature data.
2010-12-28 22:52:40 +03:00
NoFantasy
f8921dbca8 [10928] Uncomment all races in enum Races
Race can also be creature race and needed for future implementation of spells.
RACE_UNDEAD_PLAYER renamed to more proper RACE_UNDEAD

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-12-28 19:53:01 +01:00
zergtmn
d400f00224 [10927] Prevent null-pointer dereference in AI calls 2010-12-28 22:09:25 +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
72b1d30a1c [10923] Cleanup some magic numbers 2010-12-27 19:04:59 +05:00
zergtmn
0d6f990e4e [10912] Move scripting related functions from ObjectMgr to ScriptMgr 2010-12-24 00:23:37 +05:00
VladimirMangos
4a7638c80e [10905] Fixed vendor templates work.
* Avoid unexpected errors at template loading for shared templates for many npc.
* Really use vendor template in work.
2010-12-21 19:39:43 +03:00
VladimirMangos
1d8f222621 [10867] Implement templates for trainer spell data in npc_trainer_template.
New table let avoid duplication similar trainer spells for different trainers.
2010-12-13 16:39:53 +03:00
SilverIce
d560503a03 [10819] Fixed creature's speed recalculation, forgotten DB speed mods are used now
Also properly update speeds at creature entry change(in case there are aura speed bonuses), thanks to Vladimir for pointing
2010-12-03 04:11:52 +02:00
NoFantasy
afe50cd549 [10797] Check for valid sheath state in creature addon at startup.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-11-30 09:42:51 +01:00
VladimirMangos
0c8a7c3826 [10788] Replace bytes in single field bytes2 by independent fields for creature_addon. 2010-11-27 23:56:08 +03:00
VladimirMangos
cc0655a402 [10782] Use Team enum types in all appropriate cases and catches bug in result fix.
* Fixed wrong arenaid use at leave arena queue.
* Fixed memory lost and etc at not virtual EndBattleground call
* Fixed crash at arena join with fake data from client.
* Code cleanups.
2010-11-25 01:11:17 +03:00
VladimirMangos
ce09cb70a2 [10769] Fixed trainer flags uses for pet trainers.
* Not exclude trainer flags for client for pet trainers.
* Not report error for pet trianers empty spell lists.

TODO:
* Add check for redundent trainer spell data for pet trainers at server startup
* Need hide train gossip option for pet trainers, but currently without it gossip
  window not open for pet trainer by some unknown reason.
2010-11-22 00:34:52 +03:00
VladimirMangos
12b80fec68 [10747] Some other aura caster object guid use cases. 2010-11-19 18:36:43 +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
534ff29f15 [10711] Check localization data for existance main table entres.
Data will skipped for nonexistent entries, and reported with
disabled LogFilter_DbStrictedCheck filter.
2010-11-09 20:26:59 +03:00
VladimirMangos
d2b3981631 [10695] Cleanup some death state enums usage. 2010-11-08 02:13:25 +03: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
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
VladimirMangos
0bf8b0aa79 [10679] New table npc_vendor_template for comon item data for diff vendors.
In vendor list show own vedor items + template ites if any.
Vendor template item lists selected by id stored in creature_template.vendor_id
2010-11-04 20:22:47 +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
a32d68febd [10671] Convert some Unit owner/etc guids to ObjectGuid way. 2010-11-01 13:19:50 +03:00
NoFantasy
81d3368e29 [10652] Allow set pvp flags from creatures *_addon data
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-27 09:49:55 +02:00
Schmoozerd
edbb840103 [10646] Preserve creature dynamic flags at UpdateEntry
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-26 13:23:46 +02: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
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
darkstalker
3a8ad26a5e [10526] Implement server side global cooldown check.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also pet/controlled unit global cooldown code replaced by new placed in charmInfo structure.

Thanks to nos4r2zod for testing and gcd range check implement.
2010-09-24 06:07:26 +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
d7994c1df4 [10480] Fix a bug causing creature dynamic flags to be removed at normal loot preparation.
In addition add use of UNIT_DYNFLAG_TAPPED_BY_PLAYER
Added check to see if creature is tapped for isAllowedToLoot()

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-13 10:34:53 +02:00
NoFantasy
334398b3f7 [10458] Changes to corpse decay/respawn times for creatures
*CORPSE_DECAY values adjusted (Rare/RareElite values are guessed) with more proper.
*RATE_CORPSE_DECAY_LOOTED is now 0.0 as default and a modifier of the creatures spawntimesecs are used for corpse decay.

Respawn time for creature is now set at death (result: database spawntimesecs are in most cases the time it takes from kill to respawn)

Overall, this will affect four things:
* corpse will stay visible longer before looted
* corpse will stay visible longer after looted, when creature has long respawn time
* creature without loot will "skip" the default decay times and then fix a "should respawn almost instant" -problem
* creature with loot and very short respawn time may respawn instantly after looted

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-09 11:58:53 +02:00
VladimirMangos
e3d9ebe81e [10448] Use base run speed * 2 as fall speed.
It equal to base flight speed and not dependent from real creature speed as expected.
2010-09-05 23:02:06 +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
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
Revils
5d6c271627 [10404] Additional checks for call assist.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-08-24 14:38:30 +04:00