Commit Graph
225 Commits
Author SHA1 Message Date
Ujp8LfXBJ6wCPR ee5384a15d Modernize codebase with Clang-Tidy range based loops (#24165)
Manual expansion of auto types into "typed types"

(cherry picked from commit a933ba60151f478c7bae23dddbba315a448ffe3e)
2021-12-22 16:42:54 +01:00
Killyana d946d74ff9 Core/AI: Fix creatures not updating their target properly once engaged
Closes  #21562

(cherry picked from commit 7fb74326205acbc5c0fa6b2aa9731d891e788d64)
2021-12-19 15:54:20 +01:00
Treeston 3db58c4d96 Core/SmartAI: SmartAI creatures no longer process health-based hooks after death.
(cherry picked from commit 1faa54fe8b2690507e4177a9a7373c0b24855291)
2021-12-18 00:03:55 +01:00
ccrs e94dca132b Core/SmartAI: add missing movement generator type check on SmartAI::SetCombatMove
ref #21562

(cherry picked from commit 0e3e4353a1824dd6e40ca10a01c4465aa1b1fbad)
2021-12-16 22:10:54 +01:00
ccrs f1ef2f73a4 Core/SmartAI: allow more Unit::ResumeMovement calls on JustReachedHome()
Since ResumeMovement also works on other MOTION_SLOT_DEFAULT generators (like RandomMG)

(cherry picked from commit c8cb866db088837cd7c771059e66d98a46de4fdd)
2021-12-16 22:08:01 +01:00
Wyrserth 83a9222c39 Core/SAI: allow creatures to handle gameobject spellhit SAI events. (#23492)
(cherry picked from commit 7a71127da92bd833caf4188aee2d5e88c61ae772)
2021-12-13 00:42:17 +01:00
ccrs f4a71ea9aa Core/AI: remove extra empty line
(cherry picked from commit 3c77c04b052f721efb96bdaaceeca8de09926f12)
2021-12-12 02:15:10 +01:00
Treeston 743d022cee AI/SmartAI: Properly forward to inherited CreatureAI::JustAppeared in SmartAI::JustAppeared. Fixes #23491.
(cherry picked from commit 854a113fc7b6610873b77355aed88900ce3b5bc0)
2021-12-12 02:11:15 +01:00
Treeston e398bb1664 AI/SmartAI: Move SMART_EVENT_RESPAWN invocation from ::InitializeAI() to ::JustAppeared(). Closes #23313.
(cherry picked from commit 37fc38b91701c3e699b20f3ed8de8da3b5c42063)
2021-12-12 01:27:04 +01:00
Wyrserth 5331656785 Core/SAI: allow to start waypoint movement for a creature that is in combat. (#23426)
(cherry picked from commit d6e36601151046d5e99f97fa9594ac2d86fa698c)
2021-12-11 15:29:32 +01:00
jackpoz 6034992dff Core/SmartAI: Implement SMART_EVENT_SUMMONED_UNIT and SMART_EVENT_SUMMON_DESPAWNED for GameObject owners
(cherry picked from commit 507a56d62764f63113d35dfcca9273b8d0b16cc5)
2021-12-07 00:31:26 +01:00
Giacomo Pozzoni 5f545f5402 3.3.5 gameobject summoner (#23289)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*)

* Scripts/Misc: Fix build

* Core/TempSummons: Rename GetSummoner() to GetSummonerUnit()

* Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too

* Fix build

* Core/TempSummons: Allow GameObject to be owner of TempSummon

* Core/TempSummons: Add support to SAI for GameObject owner of TempSummon

* Scripts/Misc: Fix no-pch build

* Core/TempSummons: Implement PR comments

(cherry picked from commit 797fba98e95da1236465a15061ec4122d7ec33fe)
2021-12-07 00:02:03 +01:00
jackpoz 54044bda82 Core/SmartAI: Fix SMART_EVENT_SUMMON_DESPAWNED
Fix SMART_EVENT_SUMMON_DESPAWNED not working when event_param1 was set to any value other than 0

(cherry picked from commit 457fc224733cc78cedc5e956442a9f5d7bd2f049)
2021-12-06 23:27:45 +01:00
ccrs 844f969ed7 Core/AI: logs, codestyle & cosmetics standarization
(cherry picked from commit fdb71ce19e02b44323fbb9dfa5f07dae2a35f8ba)
2021-12-05 16:48:58 +01:00
ccrs dd11603150 Core/AI: variable naming standarization
plus minimum codestyle changes

(cherry picked from commit 179c7da1fc264b1444aa50632317e16dca02f78b)
2021-12-05 16:17:02 +01:00
ccrs 356358ee15 Core/Misc: standarize a couple logs
(cherry picked from commit aee26eb46727171593ef7cc1d2652a7847dc88fc)
2021-12-02 00:39:28 +01:00
Killyana e5eff88282 Core/SAI: Fix Move to position and Set run if used after a waypoint
Closes #22976

(cherry picked from commit 9ab05e2b6dee2008aac512e98bc477c4ed637cfc)
2021-11-24 22:16:02 +01:00
Killyana da1166db98 Core/SAI: Fix the respawn event for GameObjects (#23112)
Closes #22612

(cherry picked from commit 75a8639242c9d28deaa0565aba138d2e05b12db9)
2021-11-24 22:15:52 +01:00
Aokromes 2682bf0fca Core/Misc: Add categories to 3 logs
(cherry picked from commit 2d22c027fe0df505ddc63d4faaad032cddd5e258)
2021-11-23 22:29:21 +01:00
Shauren f2456ff319 Scripts/Areatriggers: Fixed all areatrigger scripts triggering both on enter and exit instead of only on enter 2021-11-10 00:01:50 +01:00
Treeston 34f9666f20 Core/Unit: Some charm fixes:
* Properly restore react state after possession expires. Closes #20769.
* Possessed creatures now don't override player control with random/waypoint motion
* SmartAI creatures now properly re-aggress charmer after charm expires

(cherry picked from commit da21ca80fc35a325df0fb0ef2f687a91121d42de)
2021-10-23 14:44:05 +02:00
Treeston e4e8c1c59c Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans
(cherry picked from commit 042f5515e4f3e52b0d2e23d9b9e147041849ce12)
2021-10-22 23:47:51 +02:00
Seyden 8f097e4425 Core/Scripts: Implement script name reloading
* Authored by Seyden
* Co-authored by Naios
* We thank Shauren for your helpful feedback
2021-10-22 12:52:37 +02:00
Treeston 0c3690db91 Core/SmartAI: SetRun fix for SAI, because for some reason it has like 95% of escortai code duplicated??? shitshow zz
closes #21463

(cherry picked from commit f95a383293e32eeae514899c132e901174f4207e)
2021-10-22 00:41:41 +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
Killyana e7f93ca96d Core/SmartAI: Remove PauseMovement on AttackStart
Closes #21144

(cherry picked from commit e27a745c582f1c45a5d8a1b72c1d61fe3cecf2f1)
2021-09-25 20:43:39 +02:00
ariel- 962f6d7988 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d63796d168339a44f63418f220cf2403)
2021-08-28 15:59:11 +02:00
ariel- a1a00f823e Core/Entities: kill unused return value from Unit::HandleSpellClick
- AI hook will now receive the result by copy, as modifying it had no effect
- Some renaming: result->spellClickHandled, clickPair is actually clickBounds, the clickPair is the pair <creatureID, SpellClickInfo>

(cherry picked from commit 98d6258efdc07b53808ba6177e5427c65163bc0d)
2021-08-08 21:21:34 +02:00
Treeston 37298ca99c Scripts/SmartAI: SetData now has an invoker (if the setting is done by something using SmartAI).
Also, some refactors. SMARTAI IS SUCH A FUCKING CLUSTERFUCK I SWEAR.

(cherry picked from commit cfc77fd84355d28737f3f85f2ba318be5caacdea)
2021-06-21 00:06:41 +02:00
Treeston 168be492f5 Entities/GO: Add forceRespawnTimer support to DespawnOrUnsummon. Use it in SAI.
(cherry picked from commit 264d4e1d30debcf6feacee3d29982875672a7bbe)
2021-06-20 22:10:08 +02:00
Treeston bd158f6c29 oops, now it builds (and a bonus refactor that annoyed me)
(cherry picked from commit 2cd5992f37fe386786ddd906cd4dd691125ad2b6)
2021-06-20 21:42:35 +02:00
Treeston 1f26122528 Scripts/SmartAI: Forward invoker to invoked action list actions. Also JustAppeared -> InitializeAI.
(cherry picked from commit 6fb0bc10387b73836cea9a3c0eaaafcf58794b7d)
2021-06-20 21:42:35 +02:00
Treeston 06b5b8d8b7 Scripts/SmartAI: SMART_TARGET_INVOKER cleanup step 1. The core will now log errors on start-up if SMART_TARGET_INVOKER abuse is found, but will continue to load the scripts as deprecated for now.
Note that a lot of these scripts may either not currently work, not work reliably, or may be prone to breaking unexpectedly when core internals change. SMART_TARGET_INVOKER is undefined behavior on any event that doesn't directly specify its invoker.

(We are considering options for allowing INVOKER to make sense in timed action lists in a reliable fashion, so they are exempted at this time.)

(cherry picked from commit 482328bddf1c5fcd367268525d2f904793239bc9)
2021-06-20 21:42:33 +02:00
Treeston 7695784fd2 AI/SmartAI: Remove a silly incorrect piece of code that was breaking react state swaps on SAI creatures. Fixes #21353.
(cherry picked from commit 6e0df9fce1e1f4de3ffa97bf9ef711f13f2b9a55)
2021-06-19 01:55:18 +02:00
ariel- 861cf261c5 Core/Formations: update codestyle and fix crash
Closes #21288

(cherry picked from commit 73cc613dc86d7d72d78f22affe2faba6786bccc5)
2021-06-16 19:26:32 +02:00
Shauren b9d63c2009 Core/Scripts: Remove deprecated overload of QuestReward without LootItemType argument 2021-05-16 21:56:06 +02:00
Shauren 91b91b502f Core/Quests: Quest improvements
* Add quest log slot argument to functions dealing with objective progress
* Implemented QUEST_OBJECTIVE_FLAG_SEQUENCED (prevent progressing hidden objectives)
2021-05-09 20:21:32 +02:00
Shauren dd8aed421a Core/Quests: Drop unneeded QuestSpecialFlags 2021-05-09 16:01:34 +02:00
Treeston e0afca513a Core/AI: UnitAI.h trimming part two. WaypointX methods kicked upstairs to CreatureAI.h.
(cherry picked from commit 9c1e675590c1fa61a80b3f2c856aaf97c549f202)
2021-04-27 23:51:40 +02:00
Matan Shukry 8b0de23d0e Core/SAI: Don't clear stored pathid if it changed after processing waypoint events (#26334) 2021-04-26 21:39:22 +02:00
Treeston bce43de7f3 Core/AI: Some more refactoring prep for #19930. CreatureAI::EnterCombat is now called CreatureAI::JustEngagedWith. There's also two new methods on UnitAI, though they're never invoked right now.
(cherry picked from commit 6113b9dec2e0081c36c36c2974a28ed0693bc601)
2021-04-16 20:22:13 +02:00
Keader a7883380ce Core/AI: Making guid const& in SetGUID method (#21128)
(cherry picked from commit 465b43fabef1727432ddda27f04b882b29fd2c7f)
2021-04-15 05:53:27 +02:00
Matan Shukry 1b4c4d2164 Core/SAI: Implement quest source for SAI (#26170) 2021-03-06 14:20:39 +01:00
Shauren 875fd4107f Core/SAI: Added SAI support for new areatriggers 2021-02-05 18:12:55 +01:00
ccrs 3e5a955fc8 Core/AI: rearrange SAI private methods
(cherry picked from commit 60a5535f64e4c0301c338f5c7a5871c59e2ac218)
2021-01-29 19:23:53 +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
Wyreth b902e739d4 Core/SAI: remove double calls to SMART_EVENT_RESPAWN for creatures and gameobjects (#20420)
(cherry picked from commit 637b5f922d5849fa5b01d8ed28a826eddd3dc2cd)
2021-01-13 22:04:52 +01:00
Wyreth 56dca10f1b Core/SAI: allow to pause/resume waypoint for non-escorting NPCs (#20684)
(cherry picked from commit 21bd52cb995bb7ba6e0bee33317857a285ffd14c)
2021-01-13 22:04:52 +01:00
jackpoz d8804418ce Core/SAI: Fix static analysis issue
Initialize uninitialized value, move class field from public to private.

(cherry picked from commit 7dc97c035350f9505a9fba0b8ec2d2037044e586)
2021-01-13 22:04:52 +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