* 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
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>
* 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.
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>
* 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.
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>
* 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.
* 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.
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.
This reverts commit 10784a8c7cc81c468b5411e973d36ecf31de9603.
Main reason: impossibility for me as commiter test problem and fix all corner cases problems.
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.
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!
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.
* 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.
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>
*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>
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
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).