Commit Graph
524 Commits
Author SHA1 Message Date
Giacomo Pozzoni 97c1d01cbb Core/Pooling: Remove respawn times from the database when despawning a pool (#24422)
* Core/Pooling: Remove respawn times from the database when despawning a pool

Remove respawn times from the database when despawning a pool. This is needed when a Game Event ends but there are still some respawn times saved in the database.

* Remove respawn time of active pool objects even if they are not spawned

(cherry picked from commit 4f33fd3932d362466ee017111895bf14fcc79c88)
2022-01-01 14:02:00 +01:00
Giacomo Pozzoni a9e325f6b7 Core/Logs: Log full guid instead of just low guid, part 2
(cherry picked from commit 3def52c1c459f566ab2b2d8cf017c70df4d7cf22)
2022-01-01 00:51:54 +01:00
Giacomo Pozzoni 6ec933f281 Core/Logs: Log full guid instead of just low guid
(cherry picked from commit 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e)
2021-12-31 21:56:40 +01:00
Matan ShukryandShauren 8fabe5a3aa Core/Phasing: Implemented db spawns in personal phases (#26345)
Co-authored-by: Shauren <[email protected]>
2021-12-28 13:24:10 +01:00
Treeston ea0aa63d96 Core/Misc: C++17 cleanups, commit 2, the advstd commit
(cherry picked from commit 857f8d9231d148d4f2def9c83548b40059923029)
2021-12-24 00:37:21 +01:00
Shauren e8d1f37ee0 Core/Maps: Citizens of Dalaran! Raise your eyes to the skies and observe! Any non-map-default light can now be overriden!
Closes #24250

(cherry picked from commit e10313b380c84dafde462bdb116827f2b8be1851)
2021-12-22 21:51:33 +01:00
ForesterDev 5e178b30fa Core/DynamicInfo: rename some parameters according packet definitions (#24192)
(cherry picked from commit 5cfce94619cc02cc04bb25ccdd2e1b98e53d9160)
2021-12-22 14:54:59 +01:00
Treeston 94a79bac7a Core/Misc: Some refactoring, #23603 prep: (#23676)
- Split SpawnMetadata off from SpawnData
- No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 9304e496cbf6ab6c028671fb8526c732ae5d799f)
2021-12-21 15:16:26 +01:00
xvwyh 9b79d1b410 Core/DynamicObjects: Restore the ability of DynamicObjects to be world objects which was accidentally removed in f0f4a620fb breaking Far Sight (#24046)
Fixes #17081

(cherry picked from commit d4ba47a76e71a0ac103a1ff9b892593bc9c6a67a)
2021-12-20 21:22:37 +01:00
jackpoz e6ac3316b7 Core/Map: Load the grid of TempSummons owned by Players
Ensure to load the grid of TempSummons owned by Players when the relocate to another cell

(cherry picked from commit afbc47891965f9c31c4b31c66931a2dbc9846f93)
2021-12-19 13:14:33 +01:00
jackpoz 044cb4ff34 Core/Map: Move a log from ERROR to WARN
Move "Could not load MMAP" log from ERROR to WARN as 99% of times is a false positive

(cherry picked from commit 42ab6010f862e530517e2acd347ef6230bcf1c3b)
2021-12-18 22:21:01 +01:00
Shauren 8f3904f8fd Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster
(cherry picked from commit 3a4216fd979eb2a7667b0861a770e9af4f242eab)
2021-12-18 20:57:38 +01:00
Treeston 8c3eb07889 Scripts/FollowerAI: Some cleanup:
- FollowerAI properly resumes follow after evading.
- Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing
- FollowerAI properly assists in combat.
- FollowerAI properly despawns if quest is abandoned.
- FollowerAI now supports dynamic respawning for escort NPCs.

(cherry picked from commit 3d4bebd8d9210fbb84f8fc75742e248071192b09)
2021-12-17 23:05:55 +01:00
Treeston 3388cea685 Core/Misc: Remove Trinity::Containers::Size (duplicate of advstd::size)
(cherry picked from commit f1d9a36c5fce23ae9c68e221521a2b492709f8e5)
2021-12-17 21:57:41 +01:00
Treeston eee950cdd7 Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime

(cherry picked from commit d60082ae866d77a12a9e6d09dfce27fc1cb5df90)
2021-12-16 01:33:09 +01:00
Treeston d5e58cef69 Core/Spawns: Exterminate CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY with extreme prejudice. (It didn't work anyway.)
(cherry picked from commit 26440857c1a74031ea0a0234ca0b0fcb09b6bcb0)
2021-12-16 01:18:15 +01:00
Treeston be05590a12 Core/DB: Unify creature_respawn and gameobject_respawn into a single respawn table
(cherry picked from commit 374597c8e96c886f1e3647d405bf3160c8b98bf8)
2021-12-16 01:10:06 +01:00
ccrs 16bbc015e7 Core/Weather: 6eecb68 followup
missing IntervalTimer::Update call

(cherry picked from commit 965ec9a57180062aa8dad3b929146c7692186262)
2021-12-15 00:17:33 +01:00
Treeston 2532de6acb Entities/Unit: Nuke Map::ForceRespawn from orbit, with the following implications:
- .npc respawn no longer causes stupid things to happen (Fixes #23014)
- ::DeleteFromDB methods on Creature and GameObject rewritten to be as sensible as such a colossally stupid method can ever be. They're static now.
- .npc delete and .gobj delete ported to new argument handling, and rewritten as per above. They can no longer crash the server when used in instances, too. Yay for that.
- Adjusted various dusty cobwebbed hacks around the core (why does waypoint visualization use permanent spawns *shudder*) to still work too.

(cherry picked from commit 84b7b2e08ea55575cbe62d795383d4a5341ffd4d)
2021-12-14 22:42:22 +01:00
Treeston 2225cb1201 Entities/Creature: Some asserts are now LOG_ERRORs that block spawning. Fix a group spawning bug exposed by the CoS merge. Improve some command output.
(cherry picked from commit ded18a2690063991d5440df7d3e5d526b884ec16)
2021-12-14 22:24:24 +01:00
ccrs 6a63200e40 Core/Instance: add new hook & method
(cherry picked from commit 953b05459a517fb83f18047ab82ac09021bc9440)
2021-12-13 00:42:18 +01:00
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 9fcbd8f15d249070aabc25d48df86681e8ec3d11)
2021-11-26 22:43:48 +01:00
Aokromes 49e1ff34b7 Core/mmaps: add category to 2 logs
(cherry picked from commit a2f910fe5cc150b7459cc396ed8de66659a1128a)
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 9a924fb9d557434c5a2e4020c80db6e6bfe466ad)
2021-11-16 20:36:58 +01:00
Treeston 19f24b3e40 Core/Maps: Fix a crash when spawning a spawn group
(cherry picked from commit 969436adfe8fc0f1c6a01d422ab7f6aa08486be3)
2021-10-23 16:00:28 +02:00
Treeston 48ce1965ba visibility range check, fac4700 follow-up
(cherry picked from commit b7c0f1961c8800ff96e55b42df4448bdfc65092e)
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 fac470014b4b97060a22c346aadfaf9c03b99ff2)
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 982643cd96790ffc54e7a3e507469649f3b074d2)
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 b9c6bbb51df0ed10f74617482740fedb91ff5366)
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 080d2c6cd439acb2059adc4e24a279de98aa0db6)
2021-08-28 15:59:11 +02:00
Shauren 2e2b298618 Core/Movement: Fixed creature hover
Closes #15177

(cherry picked from commit 2baa81065ba27f0a6d278a8dd8a79b7c831e0a2b)
2021-08-24 12:44:38 +02:00
Jeremy 43b944bf92 Core/Maps: Fixed outdoors check (#21551)
(cherry picked from commit 367db4e1d641b56d8d7df83320c14b283bd007ce)
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 ec916db294760576ef4466d7e558f038dacecf20)
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 e79c595b695ea5f35b8324efbb7741ccb102bce9)
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 94b5d9bfa1195ad7c32cf51a665b55514dac0938)
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 51e28ae76a40bb40bdd6f163773d2e3bd8f76ec4)
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 3bb33e3108c65ba8a1c35b934526562aa542b63b)
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 e0b609a178528995959e5ea54255a3f856e62913)
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 9f9507e6a1fd50a5ce643a4096c1712700244a61)
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 532ab1c7f8653d1a2e48aa1f1f8a9ba1041d4bb7)
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 e42903ec16f4849b71bc8736e3151a1e11d3cd25)
2021-04-15 05:53:27 +02:00
jackpoz e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6c45eb105ad449eb9a56e76d84d691e)

 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 51c4196acf9d670601c0bba999498c8e7bb863dd)
2021-03-15 20:17:31 +01:00