Attempt to fix players getting stuck after dying caused by a hack that calls SetControlled(true, UNIT_STATE_ROOT) by calling the opposite when a dead player leaves the instance, i.e. on releasing.
Close#24458
(cherry picked from commit dc21ac342ec3293ecf37b6a87244c46a39ff687f)
Add a second parameter to SetCorpseDelay() that specifies if Rate.Corpse.Decay.Looted setting should be ignored, false by default (aka don't ignore by default).
Add a second parameter to SMART_ACTION_SET_CORPSE_DELAY to specify if Rate.Corpse.Decay.Looted should be included, false by default (aka ignore by default).
(cherry picked from commit d5fc86af8b22fed5b054e51349eb3ab47b06b784)
* Core/SAI: Add new action SMART_ACTION_SET_HEALTH_PCT
Add new action SMART_ACTION_SET_HEALTH_PCT (142) with one single parameter "percent" to set the Unit health.
Close#25317
* Do not allow 0%
(cherry picked from commit 7d6f7e4d19b298632deeb27830b876b12c490a03)
* Core/Creature: Add new db field InteractionPauseTimer
Add new db field InteractionPauseTimer to allow to define different interaction pause timers for each creature (the previous system was a global setting in worldserver.conf Creature.MovingStopTimeForPlayer)
* Set all columns in creature_template_movement as optional (can be NULL, default NULL). Fill only the columns that should override the default C++ value
* Use the InteractionPauseTimer value throughout the code instead of Creature.MovingStopTimeForPlayer
* Handle InteractionPauseTimer set to 0 as "don't stop at all"
* Implement InteractionPauseTimer in creature_movement_override
creature_movement_override allows NULL values, in which case the values from creature_template_movement will be used for those columns that are NULL, falling back to default C++ values if creature_template_movement has NULL values too (or no rows for the creature)
* Read default InteractionPauseTimer from worldserver.conf
* Rename 2021_99_99_99_world.sql to 2021_01_22_00_world.sql
(cherry picked from commit a22bc236ebc038c723774e5b38cd93e814ccc43d)
* Core/Unit: Allow to define Units which can enter water but cannot swim
Allow to define Units which can enter water but cannot swim, i.e. crabs walking at the bottom of a sea.
* Add UNIT_FLAG_SWIMMING to creatures when entering combat
* Fix charmed creatures not entering water
* Always allow Creatures controlled by players to enter water
* Add swimming flag when possessing a unit and remove it properly at the end, even if the creature engaged combat before and after.
When adding/removing UNIT_FLAG_SWIMMING manually calling Creature::RefreshSwimmingFlag(true) might be required.
(cherry picked from commit fc1a0d936888395f114028af3337e7d674e0a43c)
* Core/SAI: Fix SMART_EVENT_FLAG_NOT_REPEATABLE flag being ignored when specifying a chance
Fix SMART_EVENT_FLAG_NOT_REPEATABLE flag being ignored when specifying a chance, always making the action trigger.
* Fix SMART_ACTION_CAST with SMART_EVENT_FLAG_NOT_REPEATABLE not casting the spell at all if rolled chance was successful but creature couldn't cast the spell
* Prevent linked actions if SMART_ACTION_CAST couldn't be completed and will be retried later
(cherry picked from commit 96b289cadbf304e427ddbd281d1a6f592af612a7)
A more generic solution might be better, maybe depending on spell flags
Ref #25652
(cherry picked from commit 0ad1854d1c6a3b6ff93e71272c919f1f5f11d5ed)
Use the same logic of (CENTER_GRID_ID - x / SIZE_OF_GRIDS) in GridMap::getMinHeight() as Map::GetGrid() to avoid coord grid mismatches caused by floating point precision, i.e. getting the wrong grid.
Replace defines with constexpr in grids to make debugging easier.
Closes#25652
(cherry picked from commit 0c69316714d0558e32462f5401197fe1e803ae75)
Move fall damage log to "entities.player.falldamage" category and include the usual debug info
(cherry picked from commit 5270ff58daf31ce10919d9da53e09f494956a5f2)
* CI/GitHub: Switch to GCC 8
Build on GitHub Actions using GCC 8 as it's the oldest supported GCC
* Core/Misc: Attempt to fix GCC 8 build
(cherry picked from commit d7459cccedc7ca9ba85e209dfeef61969fc78d9a)
The displayed "tileloc" value is a "swapped" Tile XY, not to be confused with Grid XY.
(cherry picked from commit 34af088c9b381db5b5212075f0df486a8593fae3)
* Core/SAI: Add orientation and delay columns to waypoints table
* Rename 2020_99_99_99_world.sql to 2020_09_19_00_world.sql
(cherry picked from commit 4b7d19c91bde2cabb8498809dee935c7efb2660a)
* Core/SAI: Fix SMART_ACTION_WP_PAUSE with 0 delay pausing the path only for 1 world loop update
* Add code comments
* Remove special handling of SMART_ACTION_WP_PAUSE in SMART_EVENT_WAYPOINT_REACHED
(cherry picked from commit 7dd51ae6d98cf6dd8ac71412aa689f888c7bf369)
* Script/Commands: Add ".pdump copy" command
Syntax: .pdump copy $playerNameOrGUID $account [$newname] [$newguid]
Copy character with name/guid $playerNameOrGUID into character list of $account with $newname, with first free or $newguid guid.
* Add missing return
* Restore eof check
* Fix sql
* Use forward declaration header
Co-authored-by: Shauren <[email protected]>
* Remove buffer when reading a line
* Rename sql files
Co-authored-by: Shauren <[email protected]>
(cherry picked from commit 6215da0d640bd86a7c2bc144859c1542f09fc1a6)
* Core/Maps: Always update the grid of player summons even if far away
* Code cleanup
* Use a vector instead of unordered_set
(cherry picked from commit c68faf108edf50ae8a2ff4a341eff1e0d4269cbc)
Remove multiple calls to SMART_EVENT_WAYPOINT_START for the 1st waypoint.
Closes#24760
(cherry picked from commit b3694bf47bfdab8ee9c074ac4a22d8f389e1cfc1)
* Core/Unit: Fix units on vehicles not dismounting on death
Closes#23095
Issue added in 982643cd96790ffc54e7a3e507469649f3b074d2
* Remove leftovers from previous tries
(cherry picked from commit ff26027453179448bb972d88a51e565d71e95f3f)
There might be cases where this should be allowed (i.e. if the SMART_TARGET_* is another object) but for now we'll just never allow it.
(cherry picked from commit 28921f191de2269dd90b50ac99dd0d29ba90d0c4)
Change NearestGameObjectEntryInObjectRangeCheck to allow returning GameObject not spawned.
Fixes other occurrences where a similar issue exists.
(cherry picked from commit ca2159bf405fb96a8eba9f1e58bda7ee6c7eb247)
* Core/SAI: Implement SMART_TARGET_ACTION_INVOKER in SMART_EVENT_FRIENDLY_HEALTH_PCT
* Require radius (5th parameter) to be set
(cherry picked from commit cbed1039c47f0e3487cea555bb8552a4e6445f5a)
Fix RandomMovementGenerator for swimming creatures not moving at all due to PATHFIND_FARFROMPOLY being handled as wrong path.
Fixes#25236
(cherry picked from commit 1aceb413495c18e5840112d6ada0c4c71cc03c7b)
* Core/Pet: Attempt to fix an assertion triggered when re-summoning the current pet
* Core/Pet: Attempt to fix an assertion triggered when stabling a pet while in a vehicle
* Core/Pet: Attempt to fix an assertion triggered when stabling a pet and casting spell 6962
* Core/Pet: Attempt to fix an assertion triggered when casting spell 6962 while being dead
* Core/Pet: Attempt to fix an assertion triggered when summoning a pet while on vehicle 34775
* Handle cases in a generic way
* Code cleanup
* Core/Pet: Attempt to fix an assertion triggered when summoning a pet while on vehicle 34775 with a new character
(cherry picked from commit e203ecda88a327c4e93588f39cc4ffdcf99b30f7)
* Core/SAI: Spell casts that cannot be executed because the unit is currently casting another spell will be retried asap with priority over other events
* Core/SAI: Re-sort the events only when needed
* Fix some priority reset and wrong mEventSortingRequired handling
* Code cleanup.
Sort only events loaded from db (not stored events, not timed action list).
* Code cleanup.
Raise priority of failed casts so they are retried before other spells
* Keep priority of the action fails and is rescheduled on next update
* Don't try recasting a spell in SMART_ACTION_CAST if there are multiple targets and at least 1 was successful
(cherry picked from commit ca25e8d0199730c0976ebc37317e9407aceccc34)
* Core/AI: Remove code that removed UNIT_DYNFLAG_LOOTABLE from possessed units
* Update PassiveAI.cpp
Restored logic that removes loot flag while being possessed
* Restored logic that removes loot flag while being possessed
(cherry picked from commit 298d7994850dfc777c56a7672042d78074b67f3d)
* Core/SAI: Fix creatures casting with flag SMARTCAST_COMBAT_MOVE not switching to melee when the school of the spell they are trying to cast gets silenced (and other cases of spell failure)
* Core/SAI: Retry casting after 500ms if a cast failed
Fixes#24914
(cherry picked from commit 63a6e1e0480df659e773a3df5e1acc2027ebcf15)
* Scripts/Comamnds: Improve ".debug objectcount" command
Include the top 5 most common creatures in the map
* Use C++ features to copy data
* Fix build warnings
* Update src/server/scripts/Commands/cs_debug.cpp
Co-authored-by: Shauren <[email protected]>
* Update src/server/scripts/Commands/cs_debug.cpp
Co-authored-by: Shauren <[email protected]>
* Update src/server/scripts/Commands/cs_debug.cpp
Co-authored-by: Shauren <[email protected]>
* Move CreatureCountWorker out of function and use template for unhandled cases
* Code cleanup
Co-authored-by: Shauren <[email protected]>
(cherry picked from commit bd5e832a648aadf1d1be94f913ea00b67398f249)
* Core/Metric: Log detailed metrics about each opcode handler
* Add new panel to Performance profiling dashboard and use fill(0) instead of fill(none)
* Add new settings Metric.Threshold.* to be able to specify the minimum threshold for the specified metrics
* Update dashboard
* Change thresholds to be required to send the metrics. A TC_METRIC_DETAILED_TIMER metric with an expected threshold not configured will be ignored
* Use typedef Milliseconds
* Refresh realms on load
(cherry picked from commit 8a2c79c850199a73fd431d04f83d6aa89733060d)
* Core/Metric: Add new cmake option WITH_DETAILED_METRICS to enable more metrics
Add more detailed metrics in World::UpdateSessions().
* Attempt using C++17 features
* Fix cmake typo
Co-authored-by: NoName <[email protected]>
* Fix build with WITHOUT_METRICS
* Update Performance profiling dashboard with Update sessions panel
* Add panel to show sessions with update time above 100 ms
* Move legends on the right and add max update time diff in the legend of sessions
Co-authored-by: NoName <[email protected]>
(cherry picked from commit 36ef487a90d0d14c4da8ce7e19b5916b8b15056c)
* Core/Metric: Add more metrics about World::Update() loop
* Add new Performance profiling grafana dashboard
* Add new cmake setting WITHOUT_METRICS that disables all metrics
As new metrics are added, someone might want to disable them if unused.
* Add more metrics about World::Update() loop
* Remove old performance profiling features
Remove "server set difftime" command, "-RecordUpdateTimeDiffInterval" and "MinRecordUpdateTimeDiff" worldserver config settings and their related code.
The whole UpdateTime class could be removed too.
* Update and rename 2020_07_99_99_world.sql to 2020_07_24_00_world.sql
(cherry picked from commit 3c0ac7302f902d1811d2c215217a3d701f8b5b19)
* Core/Combat: Disable triggers entering combat
* Move check to database flags_extra flag in creature_template with value 0x00002000
* Fix Rotface puddle stalker too
* Rename 9999_99_99_99_world.sql to 2020_07_22_00_world.sql
(cherry picked from commit 6440c3bcac85a40de5c34aef1d8a8856966cc140)
* Core/Threads: Replace Boost TLS with C++11 one
Replace boost::thread_specific_ptr<T> thread-local storage with C++11 thread_local to remove libboost_thread dependency from common project
* Fix no-pch build
(cherry picked from commit 00b16992f1ae3bf14ab5fe6366028a2b8648bfa0)
* Core/Metric: Log Map::Update() times
* Add more performant version to reduce allocations when metrics are disabled
* Linux build fix
* Add metric stopwatch version that doesnt let users forget to _END it
* Fix linux build
* Code cleanup
* Add Map updates panel to General dashboard
* Add "Recent events" panel to General dashboard
* Apply latest codestyle changes
Co-authored-by: Shauren <[email protected]>
(cherry picked from commit 5eb742ee6a892b684b0c4cbde9f02f838b8300e5)
* Core/Pools: Attempt to workaround pools being broken since 2015
Attempt n°2
* Fix warning
(cherry picked from commit 8c0a315734840f99455026ef443a21ae73d7bc3b)