Commit Graph

503 Commits

Author SHA1 Message Date
Jeremy
4fcc4a3300 Core/Movement: Fix some undermap issues with random movement/fear/blink (#22937)
* Core/Movement:
- Only move to point if there is a path that is not a shortcut (which will make the unit move through terrain)
- Added new function to check if there is a vmap floor without search distance
- Units that can fly, are underground but far above the vmap floor will stay underground (bronze drakes in tanaris)
- Don't remove PATHFIND_SHORTCUT from path type in some cases

* Core/Object: Ignore UpdateAllowedPositionZ for flying units.

- This will make flying units go through mountains instead of going to the top and back to the bottom to reach you.

* Core/Object: Revert some changes and let MovePositionToFirstCollision deal with a position without ground

* Missing groundZ change for objects on transport

* use CanFly instead of IsFlying

(cherry picked from commit 9fcbd8f15d)
2021-11-26 22:43:48 +01:00
Aokromes
49e1ff34b7 Core/mmaps: add category to 2 logs
(cherry picked from commit a2f910fe5c)
2021-11-23 23:44:00 +01:00
Giacomo Pozzoni
d5c41d23e6 Core/Misc: Log more information in asserts (#22783)
* Core/Misc: Log more information in asserts

Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.

* Core/Misc: Fix dynamic build

Add missing attribute for dynamic build

* Core/Misc: Fix gcc/clang build

* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()

* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'

* Core/Misc: Add GetDebugInfo support to Unit

* Core/Misc: Add GetDebugInfo support to Creature

* Core/Misc: Add more info to GetDebugInfo for Creature

* Core/Misc: Add GetDebugInfo support to GameObject

* Core/Misc: Add GetDebugInfo support to Player

* Core/Misc: Add more GetDebugInfo info

* Core/Misc: Add GetDebugInfo support to Item

* Core/Misc: Add GetDebugInfo support to Bag

* Core/Misc: Add GetDebugInfo support to Transport

* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet

* Core/Misc: Add GetDebugInfo support to Map, InstanceMap

* Core/Misc: Add GetDebugInfo support to Spell

* Core/Misc: Fix build warning

* Core/Misc: Add GetDebugInfo support to Aura

* Core/Misc: Add GetDebugInfo support to UnitAI

(cherry picked from commit 9a924fb9d5)
2021-11-16 20:36:58 +01:00
Treeston
19f24b3e40 Core/Maps: Fix a crash when spawning a spawn group
(cherry picked from commit 969436adfe)
2021-10-23 16:00:28 +02:00
Treeston
48ce1965ba visibility range check, fac4700 follow-up
(cherry picked from commit b7c0f1961c)
2021-10-17 01:30:05 +02:00
Treeston
f7e5931b49 Core/Maps: Continue updating creatures that own auras applied to players. Closes #22110.
(cherry picked from commit fac470014b)
2021-10-17 01:11:51 +02:00
ModoX
68c2fc8ff5 Core/Characters: Made homebind location a WorldLocation (this implicitly adds orientation) (#27055) 2021-10-16 01:17:47 +02:00
Shauren
d7302ffd14 Core/Scenes: Implemented spell created SceneObjects 2021-10-11 12:59:19 +02:00
Shauren
2d7af28e9f Core/Transports: Store information about continent transports 2021-10-02 19:59:56 +02:00
ccrs
426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96)
2021-09-28 00:15:13 +02:00
Shauren
453b59de57 Core/Maps: Adjusted logic in GetFullTerrainStatusForPosition to closer match what the client does regarding being inside WMOs
Closes #21625
Closes #21624
Closes #21516

(cherry picked from commit b9c6bbb51d)
2021-09-25 01:04:21 +02:00
ariel-
65dca120d3 Core/Spells: rework part 4: iterate over effects first
Ref #18395

Implement far spell queue processing
Closes #7395

(cherry picked from commit 080d2c6cd4)
2021-08-28 15:59:11 +02:00
Shauren
2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065b)
2021-08-24 12:44:38 +02:00
Jeremy
43b944bf92 Core/Maps: Fixed outdoors check (#21551)
(cherry picked from commit 367db4e1d6)
2021-08-22 21:09:18 +02:00
Treeston
552ce7c286 Core/VMap: Use fuzzy equality and gridmap tolerance for floor-finding. Closes #21338. Supersedes #21479.
(cherry picked from commit ec916db294)
2021-08-08 21:21:34 +02:00
Treeston
e47e95b6dc Core/VMap: Add outdoor state to Map::GetFullTerrainStatusForPosition. Add WorldObject::IsOutdoors, basic member access.
Ref #21479.

(cherry picked from commit e79c595b69)
2021-08-08 21:21:34 +02:00
Treeston
5c80f50734 Core/Spawning: Actually check spawn group state before processing a respawn. It feels like that is something that should've been noticed at some point.
Also remove CreatureScript::CanSpawn since nobody uses it, and spawn groups do the same thing.

(cherry picked from commit 94b5d9bfa1)
2021-08-08 21:21:34 +02:00
Treeston
7db3f7ca96 DB/SpawnGroup: Instance spawn group data for Tempest Keep: The Eye and Hellfire Citadel: Ramparts.
(also some minor adjustments to command output for convenience)

(cherry picked from commit 51e28ae76a)
2021-06-16 23:01:48 +02:00
Shauren
8aaf750be1 Core/Conditions: Implemented missing PlayerCondition columns - time and weather 2021-06-04 21:47:43 +02:00
Shauren
6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Treeston
8b7728f82e Core/Map: New Map::ForceRespawn to override objections and force a respawn (equivalent to force = true). Use this to fix various GM commands.
Scripts/Valithria: Fix an issue that could get the encounter stuck in an unloaded state.

(cherry picked from commit 3bb33e3108)
2021-05-16 21:56:06 +02:00
Treeston
b00d3812ab Core/Map: Fix a crash that could happen if a player moved very far away from a creature they were in combat with. Closes #21177.
(cherry picked from commit e0b609a178)
2021-05-16 21:56:05 +02:00
Treeston
5aee452943 Core/Misc: A variety of clean-up changes, mostly following up on 532ab1c to fix legacy bugs exposed by it:
- Triggers can no longer have a threat list (this may expose some ugliness in old legacy scripts)
- Threat entries are forced to OFFLINE if the AI refuses to attack the target
- Clean up passive creature evade behavior to be more consistent
- Fix a months old issue in spawn group management that would cause "Inactive" to incorrectly show in .list respawns for system groups outside of map 0
- Valithria script cleanups, remove old hacks and make it work with the new system. Closes #21174.
- Some strings cleanup

(cherry picked from commit 9f9507e6a1)
2021-05-16 21:56:05 +02:00
Treeston
34c7810fe5 Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.

(cherry picked from commit 532ab1c7f8)
2021-05-16 21:56:01 +02:00
Jeremy
446fc391f0 Core/Entities: Fix some weird movement due to los issues (#21125)
* Core/Entities: Fix some weird movement due to los issues
- Made LoS check use collisionHeight instead of midsection. Value was too low.
- Gnomes will now have a breath bar more quickly than for example a tauren.
- Changes have been made to checking for ground z as well, some tweeking might be needed but removed most of the scattered +2.0f/+0.5f/we
* Add 0.05f to isInAir check in Creature::UpdateMovementFlags

(cherry picked from commit e42903ec16)
2021-04-15 05:53:27 +02:00
jackpoz
e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6)

 Conflicts:
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
	src/server/game/Battlefield/Battlefield.cpp
	src/server/game/Battlefield/Zones/BattlefieldWG.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Calendar/CalendarMgr.h
	src/server/game/DungeonFinding/LFGQueue.cpp
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Entities/Creature/Creature.cpp
	src/server/game/Entities/Item/Item.cpp
	src/server/game/Entities/Pet/Pet.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Grids/ObjectGridLoader.cpp
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/AuctionHouseHandler.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/CalendarHandler.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/ChatHandler.cpp
	src/server/game/Handlers/LFGHandler.cpp
	src/server/game/Handlers/MailHandler.cpp
	src/server/game/Handlers/MiscHandler.cpp
	src/server/game/Handlers/MovementHandler.cpp
	src/server/game/Handlers/PetHandler.cpp
	src/server/game/Handlers/QueryHandler.cpp
	src/server/game/Handlers/TicketHandler.cpp
	src/server/game/Instances/InstanceSaveMgr.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/Tickets/TicketMgr.cpp
	src/server/game/Tickets/TicketMgr.h
	src/server/game/World/World.cpp
	src/server/scripts/Commands/cs_gobject.cpp
	src/server/scripts/Commands/cs_instance.cpp
	src/server/scripts/Commands/cs_list.cpp
	src/server/scripts/Northrend/zone_wintergrasp.cpp
	src/server/scripts/Spells/spell_item.cpp
2021-04-15 05:53:27 +02:00
Shauren
d29dd1eeb5 Core/Misc: Change all unix time columns in character database to bigint (signed) 2021-04-05 23:47:05 +02:00
Matan Shukry
a8fb7109b7 Core/Maps: Refactor duplicated code from all ***CellRelocation and CheckGridIntegrity into single templated function (#26231) 2021-03-28 15:26:28 +02:00
Gustavo
044110d423 Core/Entities: add extra use of UPDATETYPE_CREATE_OBJECT2 (#20955)
(cherry picked from commit 51c4196acf)
2021-03-15 20:17:31 +01:00
ariel-
88ae43fa51 Core/Misc: minor typo and codestyle fixes
- Replace NULL uses in new code with nullptr
- Fix wrong (accumulated) load time log when loading calendar invites
- Make Creature::CanRegenerateHealth const as its just a getter
- Mark OnlyOnceAreaTriggerScript::OnTrigger as final in case someone wants to override that (you are supposed to use protected _OnTrigger hook)

(cherry picked from commit 78a1c687a2)
2021-03-15 20:17:31 +01:00
Shauren
af1b3301c9 Core/Maps: Remove unused code 2021-03-06 22:17:12 +01:00
r00ty-tc
f3ac10f36f Core/Spawn: Limit saved/stored respawn time.
- Limit to time_t maximum, for the compiled-for architecture.

Closes #20834

(cherry picked from commit 3446424540)
2021-02-06 21:41:51 +01:00
Shauren
7851cd3a96 Core/AreaTriggers: Code cleanup 2021-01-30 18:10:21 +01:00
Matan Shukry
0417c5ff5f Core/AreaTriggers: Implementation for sever side area triggers
- Spawn GridLoader to spawn area triggers correctly now
- Removed SAI completely
- Removed remnants of smart scripts. Created different issue for it
- Calling InitDbPhaseShift and not InDbPhaseShift
- changed SpawnId to uint64 rather than uint32
- not using CellGuidSet typedef as to not include ObjectMgr.h in the header
2021-01-30 18:10:21 +01:00
r00ty-tc
2a84b5ae1a Core/Spawns: Resolve crash in BattlegroundAV
- Correctly set spawngroup on spawned creatures in Alterac Valley BG
 - Sanity check on application of dynamic spawn rates (not for BG/Arena
   maps)
 - Check that spawndata exists before using it.

Closes #20535

(cherry picked from commit 55b9a3f65f)
2020-12-31 23:23:50 +01:00
Shauren
49f8b1dbb4 Core/Corpses: Fixed crash during loading corpses
Closes #25748
Closes #25744
2020-12-22 16:11:34 +01:00
Shauren
93f2affbf2 Core/Corpses: Fixed client crashes with player corpses
Closes #25714
2020-12-13 18:38:31 +01:00
Shauren
5a0e348a95 Dep/Boost: Support for boost 1.74 - heap
Closes #25470

(cherry picked from commit 868c82aa6c)
2020-12-12 18:50:19 +01:00
Shauren
7a406db506 Core/Collision: Fixed false positive errors in console about vmap loading 2020-12-08 18:16:47 +01:00
Shauren
b82a3a557a Core/DataStores: Updated db2 structures to 9.0.2
* Includes support for new character customization
2020-12-08 18:16:47 +01:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Treeston
35e74687c3 Core/Player: More cleanups to Player::UpdateZone, including correcting an oversight that was causing the last known zone id to not update when leaving map. Closes #20289 for real this time.
(cherry picked from commit 47af704f63)
2020-08-23 23:25:35 +02:00
Treeston
27806eeac9 Core/Spawn: Move spawn group state management from sObjectMgr to the Map object, which makes it actually function as intended with instances. Woops.
(cherry picked from commit f279207d48)
2020-08-23 17:00:59 +02:00
Treeston
608c9aaabf Scripts/InstanceScript: Implement database framework for managing spawn groups based on boss state. (#20103)
(cherry picked from commit 84590be26d)
2020-08-22 13:48:44 +02:00
r00ty-tc
03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0)
2020-08-22 12:59:57 +02:00
jackpoz
bf5be28396 Core/Misc: Fix static analysis issues
Fix various coverity reported issues

(cherry picked from commit 925557d1c0)
2020-08-21 23:13:13 +02:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
treeston
5392212799 So, I came in trying to fix gameobject LoS. So I restructured some stuff.
Then it turned out that gameobject LoS is already fixed. So all this does, really, is restructure some stuff.
And remove the hack from Sapphiron because I could.

(cherry picked from commit d57307f63d)
2020-07-16 22:00:28 +02:00
Golrag
2f27e41c3d Core/Maps: Corrected GetWaterOrGroundLevel (#19863)
* When a gameobject was above water like in ToC. It would return water level

(cherry picked from commit a2c123b529)
2020-07-16 22:00:28 +02:00
Treeston
51ce3b1c1d [3.3.5] Get zone/area IDs from vmap data in the liquid update (#19840)
* Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup
* Use this lookup in Map:: relocation methods to update m_areaId and m_zoneId fields on WorldObject
* Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields
* Clean up liquid state handling on Unit and Player
* Hand floor's Z coord up through GetFullTerrainStatusForPosition, use it to update a new field in WorldObject, and use that to feed a new GetFloorZ call on WorldObject.

Closes #16489

(cherry picked from commit f6c849729b)
2020-07-16 22:00:24 +02:00