Commit Graph
449 Commits
Author SHA1 Message Date
ratkosrb 122b52b079 Core/Creature: Use proper name for wander distance 2022-12-20 15:48:37 +01:00
Ovahlord b8f74928f4 Core/Movement: always update the home position to a reached waypoint node instead of only upon reaching the end of a non-repeatable path 2022-12-04 08:48:20 +01:00
Ovahlord fb120d761b Core/Movement: refactored waypoint movement internals to no longer call MovementInform hooks when resuming an interrupted path
* this fixes Raz the crazed to no longer prematurely jump of the bridge when returning back to his escort path
2022-12-04 08:40:00 +01:00
Shauren 25465699f7 Core/GameObjects: Transport (type 11) improvements
* Fully synchronize serverside animation progress with client
* Implemented updating passenger positions on elevators
* Removed visibility hack for elevators that always forced CreateObject packet to be sent to client
2022-06-18 21:36:17 +02:00
Shauren 2b7b0b0db1 Core/Scripts: Begin unifying triggering gameevents (not the game_event db stuff) 2022-06-18 19:05:57 +02:00
Ovahlord ca9f34574d Core/Misc: fixed a bunch of GCC warnings 2022-03-21 21:32:41 +01:00
Ovahlord d17ceb70d5 Core/Movement: add a helper to obtain movement direction angles from player movement 2022-01-16 11:31:14 +01:00
Ovahlord 7a602d4b44 Core/Creatures: apply database defined movementflags on (re)spawn and on reaching home only
This allows manipulating movementflags without having to block everything via CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE
Yo @keader that flag is your fuckery. gimme feedback
2021-10-31 10:52:45 +01:00
Ovahlord 949f92e0a1 Core/AI: ported charm updates from 335 2021-09-16 16:48:07 +02:00
Ovahlord bd3ca6e98a Core/Movement: fixed waypoint movement ignoring pause timers and interaction pause time 2021-07-08 00:41:54 +02:00
Ovahlord e2237624f6 Core/Movement: no longer store negative delays for smooth transition times and let the waypoint movement generator decide when to transition when allowed via new boolean value 2021-07-07 23:42:51 +02:00
Ovahlord c41fe84b8c Core/AI: reduce differences in ScriptedEscortAI between 4.x and 335 2021-04-12 10:32:44 +02:00
Ovahlord 82714dfa59 Core/Movement: removed the 1s initial delay when launching a waypoint path 2021-03-26 18:25:04 +01:00
Ovahlord 317bc49501 Core/Movement: flight waypoint movement is now correctly using catmullrom and uncompressed splines 2021-03-24 11:09:12 +01:00
Ovahlord 087e7e961a Core/Movement: waypoint movement will no longer pick up ongoing spline destinations when the spline path is being stored in db 2021-03-12 22:02:45 +01:00
Ovahlord 0299fa4fe1 Core/Misc: replace boost::optional with std::optional 2021-02-19 14:07:43 +01:00
Ovahlord c3e9861723 Core/Movement: implement creature movement info table to override movement speeds based on movement IDs
thx to @xvwyh for providing initial table data for the most common entries
2021-02-16 16:56:10 +01:00
Ovahlord c20838ceaa Core/Movement: allow waypoints to have orientation values of 0 2021-02-05 11:16:45 +01:00
Ovahlord c7540fc930 Core/Misc: corrected some oversights in recent commits 2021-01-26 05:37:10 +01:00
Ovahlord 9687131c65 Core/Movement: waypoint movement will now respect the currentwaypoint field in the creature table 2021-01-24 10:18:29 +01:00
Ovahlord b7aafc8d01 fixed warnings 2021-01-15 16:23:09 +01:00
Ovahlord dfab041648 Core/Movement: initialize stalled member in CyclicMovementGenerator's 2nd ctor overload 2021-01-15 16:01:18 +01:00
Ovahlord 7f04fb8137 Core/Movement: added a missing pointer check 2021-01-15 12:10:50 +01:00
Ovahlord d5f9b8c26f Core/Movement: implement smooth waypoints
* delays can now be negative to support sniffed transition times from one waypoint path to another
* early transitions will now pick up the ongoing spline destination and start calculating their path from that point on
* waypoints may now use db side spline pathings in a new db table to support special spline shapes are not generated by normal pathfinding (e.g. scripted flight paths)
* current waypoints will still the work the way they did before for legacy and custom support
2021-01-15 12:10:49 +01:00
Giacomo Pozzoni 5e3b57bae7 Core/Unit: Fix movement hiccups in water
* 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.
2021-01-11 12:33:54 +01:00
Ovahlord 882254e3cd Core/Movement: added PauseMovement and Resume functionality to cyclic spline movement generator to support pause and resume movements (e.g. on gossip hello) 2020-11-18 04:58:27 +01:00
Ovahlord 361ac2292b Core/Movement: add velocity field to waypoint_data to allow specifying custom speed value for waypoints and cyclic splines
* standartized member naming in WaypointNode and WaypointPath struct
2020-09-24 14:30:48 +02:00
Ovahlord c9afa1a6ed Core/Units: renamed SetInFront to SetOrientationTowards to clarify its actual functionality and added comments to SetOrientationTowards, SetFacingTo and SetFacingToObject 2020-09-23 20:48:44 +02:00
Ovahlord 27c1fd6aee Core/Movement: implement cyclic spline database support 2020-09-21 00:32:55 +02:00
Ovahlord 9d345f0d87 Core/Creatures: creature groups no longer unnecessarily throw their data on the heap and formations now support inversing angles when waypoint Ids are 0 2020-08-28 23:02:05 +02:00
jackpoz 5989ad860c Core/Movement: Fix RandomMovementGenerator for swimming creatures
Fix RandomMovementGenerator for swimming creatures not moving at all due to PATHFIND_FARFROMPOLY being handled as wrong path.
2020-08-23 20:38:03 +02:00
Ovahlord 3e66838874 Core/Movement: ensure that the wander distance of random movement is always at least 0.1 bathtub.... eeh yards 2020-08-05 18:53:33 +02:00
Treeston 942c3a77da 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.
2020-07-22 16:49:37 +02:00
Treeston 2cc36c5eec Core/AI: UnitAI.h trimming part two. WaypointX methods kicked upstairs to CreatureAI.h. 2020-07-22 15:11:26 +02:00
Ovahlord 9f116b86e9 Core/Movement: re-implement AbstractFollower as renamed version and index the pointers by following type (chase, follow, formation) for future access and improvements 2020-07-20 20:16:01 +02:00
Ovahlord fc4e2e4203 Core/Movement: followers will no longer get stuck behind obstacles 2020-07-17 13:10:58 +02:00
Ovahlord 322662ba69 Fixed nopch build 2020-07-15 00:45:51 +02:00
Ovahlord d82c00c915 Core/Units: changed _formationFollowers from unit references to object guids to have a safer access to its stored units 2020-07-14 23:47:23 +02:00
Ovahlord d7a4a6dad1 Core/Movement: do no predict follow destinations when the follower is faster than its target outside of catchup and formation mechanics 2020-07-09 22:02:42 +02:00
Ovahlord 4887e32dfc Core/Movement: followers will now have their relative angle to the predicted destination considered for a smoother turn movement 2020-07-09 13:46:05 +02:00
Ovahlord 29e64980d8 Core/Movement: throttle follow movement speeds only when the follower is very close to its destination 2020-07-08 00:03:26 +02:00
Ovahlord 779c52ec7b Core/Movement: cancel follow movement when the follow target has died 2020-07-05 10:42:47 +02:00
Ovahlord 6bb5405296 Core/Movement: removed unnecessary logging from f1b16b4820 2020-06-28 22:20:11 +02:00
Ovahlord 588ab1b45e Fixed nopch build 2020-06-28 14:31:35 +02:00
Ovahlord f1b16b4820 Core/Movement: added a safety and error output if a follow target has a dead / invalid follower reference that should have been cleared before. 2020-06-28 14:23:02 +02:00
Ovahlord 9bd1cb8970 Core/Movement: handle special follow movement case for companions 2020-06-27 16:04:37 +02:00
Ovahlord 043446f8f2 Core/Movement: fixed follow movement getting broken after its first update tick and removed legacy code 2020-06-27 15:37:41 +02:00
Ovah b09d6e2330 Core/Movement: reimplement follow movement (#124) 2020-06-26 21:22:21 +02:00
Warpten 5cb747620a Core/Movement: Fixed Animation Tier handling (#113) 2020-06-03 00:49:18 +02:00
Ovahlord 8eccdaefc9 Core/Movement: fixed an issue that was causing hovering units not chasing their targets close enough to perform melee attacks 2020-05-02 18:07:12 +02:00