* Fix AI refresh on charmed
* Remove unnecessary refresh
* Check SMART_EVENT_FLAG_WHILE_CHARMED flag
(cherry picked from commit f6e52f6b3df92a837787f63514417a7d240144cd)
* 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)
Remove multiple calls to SMART_EVENT_WAYPOINT_START for the 1st waypoint.
Closes#24760
(cherry picked from commit b3694bf47bfdab8ee9c074ac4a22d8f389e1cfc1)
* Core/SmartAI: allow AreaTrigger SAI scripts to use the player triggering it as base object for actions and targeting.
Closes#23669Closes#24791Closes#24792Closes#24793
* Apply suggested changes.
* Initialize atPlayer in the constructor
Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit e7a714f66c371cdeb6585846ddedb1bc445e695f)
* Core/AI: refactor SpellHit and SpellHitTarget.
- now caster/target is WorldObject instead of Unit
- remove SpellHitByGameObject / SpellHitTargetGameObject (handled by SpellHit / SpellHitTarget)
- rename parameters in scripts according parent methods
* Restore logic in Algalon script
* Changed check for REMORSELESS_WINTER hit to avoid dublicate call, because it has TARGET_UNIT_CASTER for effects 0/1 and TARGET_GAMEOBJECT_SRC_AREA for effect 2
* Fix build after merge
(cherry picked from commit e3b232fe0e5c21a87d3fe71813e9d750259823f1)
Make creatures evade when a charming expires and they cannot attack the charmer (i.e. charmer with .gm on)
(cherry picked from commit 69809d12031d055d8d0cffb5a187d9af09dd0efe)
* Core/AI: Make charmed creatures follow their owner
* Follow the charmer only when applying the charm
* Make SmartAI follow the charmer
(cherry picked from commit ddf2f60c1317f0ce728d5894064f51251cf71c72)
Since ResumeMovement also works on other MOTION_SLOT_DEFAULT generators (like RandomMG)
(cherry picked from commit c8cb866db088837cd7c771059e66d98a46de4fdd)
* 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)
Fix SMART_EVENT_SUMMON_DESPAWNED not working when event_param1 was set to any value other than 0
(cherry picked from commit 457fc224733cc78cedc5e956442a9f5d7bd2f049)
* 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)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
(cherry picked from commit 982643cd96790ffc54e7a3e507469649f3b074d2)