Commit Graph
170 Commits
Author SHA1 Message Date
Eridium 924116f046 Core/Movement: Formation Rewrite (#24379)
* Core/Movement: Formation Rewrite

* Add a missing include

* fixed another warning

* meh

Co-authored-by: Ovahlord <[email protected]>
Co-authored-by: Ovah <[email protected]>
(cherry picked from commit 0e2342c1698d9e2dc8a8c9d559f232cbb83707cb)
2021-12-31 19:28:14 +01:00
Giacomo Pozzoni 934c320d4b Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear (#24320)
* Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear

* Warning and no-pch build fix

(cherry picked from commit 6fde051e4e52d98d1a6cf31b8ad3fcf95e0e83fd)
2021-12-23 22:32:41 +01:00
NoName 61f3d51143 Core/Movement: Implement MoveSplineFlag::Enter_Cycle (#24049)
by xvwyh

(cherry picked from commit 40542f01e3fec0bff2c6e5eadbe20e58f19b0fd8)
2021-12-22 14:33:58 +01:00
ratkosrb 72093e98e1 Core/Creature: Use proper name for wander distance. (#24133)
* Use proper name for wander distance.

* Rename db field.

* Fix query.

* Remove underscore from chat command.

* Rename the handler too.

* Update chat command description.

* Fix remaining issues.

* Rename 2020_99_99_99_world_335.sql to 2020_02_16_01_world.sql

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 6176ce92ea01fd33b11c2e7f8e9ebb509e80c944)

# Conflicts:
#	sql/updates/world/master/2020_02_16_01_world.sql
#	src/server/database/Database/Implementation/WorldDatabase.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Globals/ObjectMgr.h
#	src/server/scripts/Commands/cs_npc.cpp
2021-12-21 19:50:12 +01:00
Giacomo Pozzoni d095d4afe9 Fix fleeing speed to 66% run speed (#24025)
* Core/Movement: Fix fleeing speed to 66% run speed

Fix fleeing speed to 66% run speed until the creature starts returning home

* Fix build

* Don't check speed type

* Don't apply speed reduction twice

* Fix no-pch (1st try)

* Make sure every spell focus is interrupted when seeking assistance

(cherry picked from commit 4ccf01de3947f50629c20192da3f99cb8c693b35)
2021-12-19 17:39:25 +01:00
jackpoz 2327ff4d6d Core/Movement: Fix fleeing speed to 66% run speed
Fix AssistanceMovementGenerator using 100% MOVE_RUN speed instead of 66% . Please note that the fleeing mechanic still has some open issues that this single commit doesn't fix

(cherry picked from commit 862d47394b8c879f42902f03ecd112b65ff631c2)
2021-12-19 15:34:20 +01:00
Giacomo Pozzoni b40cadd5a1 Core/Movement: Fix stunned falling units freezing the client (#24000)
(cherry picked from commit 8f94c9ef6b843f69d014b7e3a4b3b30e5d1515e4)
2021-12-19 15:33:57 +01:00
ccrs 1add1c31d8 Core/Movement: prevent any Initialize queue till AddToWorld is signaled
(cherry picked from commit c9c6871659bf2be52b4656bc641df5211fcb928f)
2021-12-18 23:18:26 +01:00
ccrs a59e4da7f5 Core/Movement: d033032 followup
ty jackpoz

(cherry picked from commit 5d056f37c74b652b3a3372d6aa88ac5e183f9d98)
2021-12-18 23:14:40 +01:00
ccrs c658ba2fc9 Core/Movement: d033032 followup
ty jackpoz

(cherry picked from commit bc507209a706cddb33a0a14bffc94d4db50ddce6)
2021-12-18 23:03:00 +01:00
ccrs dfb2221552 Core/Movement: delay movement update in MotionMaster until its owner signals AddToWorld
ref #23199
closes #23876

(cherry picked from commit d033032d33cff5dae76000f8432d78746cda9e06)
2021-12-18 23:03:00 +01:00
ccrs 6ae0a6ba22 Core/Movement: add missing parenthesis on MotionMaster::Size
pretty sure this can cause unexpected behaviour

(cherry picked from commit bec52dba3d7e4acb0b78c6a1093fe33da8205781)
2021-12-15 00:17:32 +01:00
ccrs c926184bca Core/Movement: move DelayedAction into MotionMaster and add a couple defines
(cherry picked from commit 2b78c70810cba22492b2586c6d79a90849d74ff9)
2021-12-05 22:50:21 +01:00
Shauren dc4b516844 Core/Movement: Use correct root check
(cherry picked from commit 3e9239a1e552d926caccf7e9a588e8d82ce0b9ee)
2021-12-05 14:38:39 +01:00
Shauren 34eedc2ad8 Core/Movement: Prevent rooted units from falling
* Fixes a client freeze

Closes #23042

(cherry picked from commit 99a9129a72a594cab8f3b15d9da388cf99afa47b)
2021-12-05 14:38:26 +01:00
ccrs 171947fa62 Core/Movement: replace multiset::find with std::find in MotionMaster
same reasoning as 11de6b5
Container's find uses the defined custom comparator

(cherry picked from commit 6e011c974d55135f56df7802699c05fc95ee7873)
2021-11-30 22:33:16 +01:00
ccrs 72301bf02f Core/Movement: implement and use new remove method in MotionMaster
All erases within MotionMaster are now done by itr.
Previous impl used value erase which uses the custom comparator which does not identify elements uniquely --> wrong values were deleted

ref #23187#discussion_r275791179

(cherry picked from commit 11de6b5f866e087307a719b931be8c51b984c54e)
2021-11-30 22:32:53 +01:00
Shauren 684cd9d968 Core/Movement: Implement initializing parabolic splines using jump gravity instead of max parabolic height 2021-11-27 21:56:00 +01:00
Sorikoff 956158d299 Core/Movement: Allow using walk when chasing v2 (#23073)
* Allow walk when chasing

(cherry picked from commit dbadb6369cf0b6d394fffaa1dedc612dfb5cbe2a)
2021-11-24 20:34:54 +01:00
Sorikoff b3f75852c2 Allow walk when chasing (#23069)
(cherry picked from commit c2f2db08aa4f729fbd5b21528a215f6df0c131b6)
2021-11-24 00:02:13 +01:00
ccrs e52be384d3 Core/Movement: 9080e7863c2 followup
not the desired optimization I was aiming at, ty Shauren

(cherry picked from commit 9695c3d46d752d23817da9255b1c02f79faceabd)
2021-11-21 14:17:56 +01:00
ccrs 1c5287032a Core/Movement: correct logic wrongly ported in 2a84562dc8
I'm referencing line 97 from ChaseMovementGenerator.
That commit introduced a modification in this use case:
- Chasing target is not my current victim, I should stop moving till it is my victim again
Changed To:
- Chasing target is not my current vicitm, I should stop chasing
My correction:
- I dont care about the relation of my current victim and my chasing target, I'm commanded to chase, something will tell me to stop chasing
--> Most likely: evade, new attackstart, etc.

the rest are just minor changes

(cherry picked from commit 9080e7863c28df7dc1c2af321964776e7b59e41a)
2021-11-21 14:17:23 +01:00
Treeston 792914fb51 Core/Movement: Add some extra assertions to MotionMaster to catch issues like #22444 earlier in the future.
(cherry picked from commit ead439fbd6620ab53530c3d1d28b4755280a1059)
2021-11-12 00:16:30 +01:00
ShaurenandSeyden 732a8ee261 Core/Movement: Corrected values sent in knockback packet when speedXY < 0
Co-authored-by: Seyden <[email protected]>
2021-11-06 23:17:43 +01: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
ccrs 0b6049fe0b Core/Movement: use helpers for validation
(cherry picked from commit 71188062314ee94402d9d3e228fd5b46e8865b18)
2021-09-26 14:21:14 +02:00
ccrs d59a6af9c6 Core/Movement: move MoveSplineInit (#21857)
The number of edge cases in which weirdness is seen on "effect movements" will be kinda reduced, plus consistency, plus movementInform on custom movement spline initalizations.

(cherry picked from commit 2a45418032233bc8779cdb44f9be6057c4b417c5)
2021-09-26 14:19:36 +02:00
ccrs d376058dcc Core/Movement: crashfix
New movement -> Mutate -> Finish current for that slot that happens to be the same type, Follow -> Finish method on the removed movement -> UpdateSpeed call -> search for top -> crash

Closes #21861

(cherry picked from commit bcab5bc4e7ac3866e86a54a1aa17e1174672ce75)
2021-09-26 01:43:24 +02:00
ccrs 4793b073ee Core/Misc: movement header cleanup
(cherry picked from commit f9914caefc59f36ab7583432442a26b29124b7f1)
2021-09-26 01:22:17 +02:00
Treeston 1493920495 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.

(cherry picked from commit 2a84562dc85516f432bb1e5de9add23c28b26ce4)
2021-09-24 23:37:43 +02:00
Treeston f69d12504c Core/Object: Bump hover delta handling on nearpoints downstack into GetNearPoint2D (from movement generators); functionality should be unchanged
(cherry picked from commit ebc96af6bb784819ba8824ac390864ae9ba12351)
2021-09-23 22:28:06 +02:00
Treeston bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2ffed5ba2a0336e9c93962b0fad9eaa)
2021-09-23 22:21:29 +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 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
Kittnz c6d6ece1c7 Core/Movement: Add MovePoint with facing (#20779)
(cherry picked from commit cd88406de9467127e988e4b0f7e2ba0ec787636b)
2021-04-15 05:53:27 +02:00
Golrag fe362cf2c9 Core/Entities: Some changes to LoS z checking & MotionMaster::MoveJumpTo (PR #20970)
- Use Midsection height for LoS checking.
- Changed MotionMaster::MoveJumpTo to use correct z. This change also makes sure the _owner will jump towards the given angle. Instead of jumping to a unintended angle if the first one is not in LoS.

(cherry picked from commit 95456ab5d8bd623481d315ae55dfbb44b45ba9f5)
2021-03-15 20:17:31 +01:00
Shauren 34cd11860d Core/Misc: Fixed nopch MSVC build
(cherry picked from commit e977bb4c4de3608cbbfe0b2d28cd0f4176a44777)
2021-02-25 19:59:07 +01:00
ccrs bf12bae467 Core/Misc: waypoint movement
- Creature: update current waypoint to store nodeId and pathId
- MotionMaster: change variable type on GetMotionSlotType and GetMotionSlot to keep consistency and prevent errors (ASSERT is now no longer needed)
- UnitAI: add new waypoint hooks WaypointPathStarted and WaypointPathEnded
- SAI: handle WAYPOINT related events if creature is no escorting
* SMART_EVENT_WAYPOINT_RESUMED still not implemented for no escorting

TODO: the new hooks can save, now duplicated, logic on EscortAI and SAI

closes #20777
updates #20310
updates 21bd52cb99

(cherry picked from commit e10d7dd45cfc073c791cd5e5f3f964d14b37df3d)
2021-01-29 19:23:53 +01:00
ccrs 5e39572c06 Core/Movement: 7fff83d6752 followup
since MOTION_SLOT_IDLE cannot be expired, signal path done and behave like IdleMotionGenerator

(cherry picked from commit eb2769996f01bfd7d7118503a44705711eb309a3)
2020-08-23 00:52:05 +02:00
ccrs 0a133e77d6 Core/Movement: 7fff83d6752 followup
remove home position set from creature PauseMovement, and use it when necessary
change log level on DelayedDelete

(cherry picked from commit cd4775420a4894012616d54467eb3827430245b5)
2020-08-23 00:48:46 +02:00
ccrs 97585597f0 Core/Movement: waypoint movement (#20121)
Following the work done in #19361 this is the cleanup and improvement of the related logic of waypoint management.

Ref 28050f3 #18020
(taking the good parts and ignoring the incomplete work)

(cherry picked from commit 7fff83d67526efff63867d41b9e036a19a9287b3)
2020-08-23 00:45:46 +02:00
ccrs 6209ceddb9 Core/Movement: ee2d7c1d53 followup
(cherry picked from commit 4f43f4d72f10cf1f4e522979f1050e5141c226c2)
2020-08-22 20:50:56 +02:00
ccrs b521bf1d3a Core/Movement: PropagateSpeedChange should only be called on the top (current active) movement generator
(cherry picked from commit 40903dcd65ef2b15efed6a32669c6b659685e7bd)
2020-08-22 20:50:24 +02:00
ccrs 4cf5cb9031 Core/Movement: add new helper that cleans the referenced MovementSlot
(cherry picked from commit ee2d7c1d53986d32779379caf0591d6cde530ead)
2020-08-22 20:49:13 +02:00
ariel- 1881088744 Core/AI: Factory functions cleanup
- Get rid of fugly void pointers
- Streamlined AI selection code, using Permissible as it should've been instead of harcoded checks on the selector code
- Moved IdleMovementGenerator singleton to factory code

(cherry picked from commit ce3787f190d28c1e981598eef2cd24c622a2cbae)
2020-06-14 23:49:05 +02:00
ccrs 84df2c57a3 Core/Movement: FormationMovementGenerator
Use own movement generator for creatures following on a formation.
First step of implementation, huge room for improvement.

Closes #19422

(cherry picked from commit 46221b6dc1272989e0de85a4563fc49dba8e7851)
2020-04-27 12:25:52 +02:00
ccrs 14c6a4d823 [3.3.5] Core/Movement: MotionMaster & MovementGenerators cleaning (#19361)
(cherry picked from commit 21b8c4997a260b5e2dc24ab07df17d3daa6b8b5d)
2020-04-27 12:25:52 +02:00
ccrs f135b7aea1 Core/Movement: 96f4c7c followup
(cherry picked from commit 9be7f5f57b897888983a9ca6f441479f3571513c)
2020-04-24 17:18:50 +02:00
ccrs b2d1b11326 Core/MotionMaster: cleanup use of _expireList
And restore broken _cleanFlag check/use on update (eca3645d8bb655b88e39f05e36b435171f738f70)

(cherry picked from commit 96f4c7c187e03aeb61e905421751f3d5a1df060e)
2020-04-24 17:18:50 +02:00
ccrs dbe54973fb Core/Movement: cleanup MovementGeneratorType
(cherry picked from commit fce974c3b33b38b71166960d37ca8cff67fa8f14)
2020-04-24 17:18:49 +02:00