Commit Graph

218 Commits

Author SHA1 Message Date
jackpoz
49e77d7c9e Core/AI: Fix charmed Creatures with SAI scripts not starting waypoint paths 2020-03-07 23:18:21 +01:00
jackpoz
69809d1203 Core/AI: Fix remaining charming issue
Make creatures evade when a charming expires and they cannot attack the charmer (i.e. charmer with .gm on)
2020-03-02 20:43:52 +01:00
Giacomo Pozzoni
ddf2f60c13 Core/AI: Make charmed creatures follow their owner (#24195)
* Core/AI: Make charmed creatures follow their owner

* Follow the charmer only when applying the charm

* Make SmartAI follow the charmer
2020-03-01 13:31:13 +01:00
Ujp8LfXBJ6wCPR
a933ba6015 Modernize codebase with Clang-Tidy range based loops (#24165)
Manual expansion of auto types into "typed types"
2020-02-29 13:22:51 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
Killyana
7fb7432620 Core/AI: Fix creatures not updating their target properly once engaged
Closes  #21562
2019-12-30 19:03:14 +01:00
Treeston
1faa54fe8b Core/SmartAI: SmartAI creatures no longer process health-based hooks after death. 2019-08-02 21:27:23 +02:00
ccrs
0e3e4353a1 Core/SmartAI: add missing movement generator type check on SmartAI::SetCombatMove
ref #21562
2019-07-19 16:07:00 +02:00
ccrs
c8cb866db0 Core/SmartAI: allow more Unit::ResumeMovement calls on JustReachedHome()
Since ResumeMovement also works on other MOTION_SLOT_DEFAULT generators (like RandomMG)
2019-07-19 15:52:35 +02:00
Wyrserth
7a71127da9 Core/SAI: allow creatures to handle gameobject spellhit SAI events. (#23492) 2019-06-26 18:08:19 +02:00
ccrs
3c77c04b05 Core/AI: remove extra empty line 2019-06-24 12:52:35 +02:00
Treeston
854a113fc7 AI/SmartAI: Properly forward to inherited CreatureAI::JustAppeared in SmartAI::JustAppeared. Fixes #23491. 2019-06-23 23:32:21 +02:00
Treeston
37fc38b917 AI/SmartAI: Move SMART_EVENT_RESPAWN invocation from ::InitializeAI() to ::JustAppeared(). Closes #23313. 2019-06-23 17:37:35 +02:00
Wyrserth
d6e3660115 Core/SAI: allow to start waypoint movement for a creature that is in combat. (#23426) 2019-06-18 20:04:34 +02:00
jackpoz
507a56d627 Core/SmartAI: Implement SMART_EVENT_SUMMONED_UNIT and SMART_EVENT_SUMMON_DESPAWNED for GameObject owners 2019-05-24 20:52:54 +02:00
Giacomo Pozzoni
797fba98e9 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
2019-05-23 21:08:29 +02:00
jackpoz
457fc22473 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
2019-05-23 20:54:09 +02:00
ccrs
fdb71ce19e Core/AI: logs, codestyle & cosmetics standarization 2019-05-15 19:23:28 +02:00
ccrs
179c7da1fc Core/AI: variable naming standarization
plus minimum codestyle changes
2019-05-15 01:33:55 +02:00
ccrs
aee26eb467 Core/Misc: standarize a couple logs 2019-04-28 19:41:30 +02:00
Killyana
9ab05e2b6d Core/SAI: Fix Move to position and Set run if used after a waypoint
Closes #22976
2019-03-13 23:29:52 +01:00
Killyana
75a8639242 Core/SAI: Fix the respawn event for GameObjects (#23112)
Closes #22612
2019-03-13 23:24:51 +01:00
Aokromes
2d22c027fe Core/Misc: Add categories to 3 logs 2019-02-08 10:58:33 +01:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
Treeston
da21ca80fc 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
2018-08-28 12:53:13 +02:00
Treeston
042f5515e4 Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans 2018-08-23 16:34:42 +02:00
Treeston
f95a383293 Core/SmartAI: SetRun fix for SAI, because for some reason it has like 95% of escortai code duplicated??? shitshow zz
closes #21463
2018-08-19 19:59:32 +02:00
ccrs
982643cd96 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
2018-06-03 10:06:57 -07:00
Killyana
e27a745c58 Core/SmartAI: Remove PauseMovement on AttackStart
Closes #21144
2018-04-14 15:49:53 +02:00
ariel-
45c5e1b9d6 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752
2018-03-09 14:41:28 -03:00
ariel-
98d6258efd 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>
2018-02-24 15:52:09 -03:00
Treeston
cfc77fd843 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.
2018-02-15 11:44:37 +01:00
Treeston
2cd5992f37 oops, now it builds (and a bonus refactor that annoyed me) 2018-02-13 18:42:28 +01:00
Treeston
6fb0bc1038 Scripts/SmartAI: Forward invoker to invoked action list actions. Also JustAppeared -> InitializeAI. 2018-02-13 18:29:38 +01:00
Treeston
482328bddf 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.)
2018-02-13 16:59:32 +01:00
Treeston
6e0df9fce1 AI/SmartAI: Remove a silly incorrect piece of code that was breaking react state swaps on SAI creatures. Fixes #21353. 2018-02-04 15:03:05 +01:00
ccrs
275c17b4c2 Revert "Core/SmartAI: Remove duplicate OnReset() call"
This reverts commit 42c9289be3.
2018-01-26 23:56:39 +01:00
sirikfoll
42c9289be3 Core/SmartAI: Remove duplicate OnReset() call
It is already called for every creature in SmartAI::InitializeAI(), removing the one from SmartAI::JustAppeared to keep as much as possible of the old behavior, because JustAppeared is called on the next tick after InitializeAI

Closes #20881
Closes #20771
2018-01-26 19:18:10 -02:00
ariel-
73cc613dc8 Core/Formations: update codestyle and fix crash
Closes #21288
2018-01-22 02:43:34 -03:00
Treeston
9c1e675590 Core/AI: UnitAI.h trimming part two. WaypointX methods kicked upstairs to CreatureAI.h. 2018-01-01 17:22:29 +01:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
Treeston
6113b9dec2 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. 2017-12-31 03:23:42 +01:00
Keader
465b43fabe Core/AI: Making guid const& in SetGUID method (#21128) 2017-12-27 22:17:13 +01:00
ccrs
60a5535f64 Core/AI: rearrange SAI private methods 2017-11-07 19:22:39 +01:00
ccrs
e10d7dd45c 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
2017-11-06 22:19:23 +01:00
Wyreth
637b5f922d Core/SAI: remove double calls to SMART_EVENT_RESPAWN for creatures and gameobjects (#20420) 2017-10-23 23:45:21 +02:00
Wyreth
21bd52cb99 Core/SAI: allow to pause/resume waypoint for non-escorting NPCs (#20684) 2017-10-22 21:37:38 +02:00
jackpoz
7dc97c0353 Core/SAI: Fix static analysis issue
Initialize uninitialized value, move class field from public to private.
2017-10-21 16:42:07 +02:00
ccrs
ee5cbf28bc Core/AI: add missing checks on AssistPlayerInCombatAgainst 2017-08-12 18:19:18 +02:00
ccrs
d117a0e4d4 Core/SmatAI: correct MoveInLineOfSight
mistake introduced in 15f2706aca that was masqueraded by other checks in combat start, till recent related commits
2017-08-12 17:57:13 +02:00