Commit Graph

833 Commits

Author SHA1 Message Date
Wyrserth
7745e3f943 Core/SAI: add cooldownMin (event_param2) and cooldownMax (event_param3) to SMART_EVENT_ACCEPTED_QUEST and SMART_EVENT_REWARD_QUEST. (#23422)
(cherry picked from commit 50be697e1f)
2021-12-11 14:14:10 +01:00
Wyrserth
e846d4c3ef Core/SAI: don't allow to start a new SAI actionlist while the entity is already running one. (#23421)
(cherry picked from commit 2b1cde2560)
2021-12-11 14:13:11 +01:00
jackpoz
1b6dee9990 Core/SmartAI: Rename SMART_EVENT_HEALT_PCT to SMART_EVENT_HEALTH_PCT
(cherry picked from commit 50ed1bb5b3)
2021-12-11 11:35:07 +01:00
Wyrserth
d037c6b086 Core/SAI: add action_param3 to SMART_ACTION_REMOVEAURASFROMSPELL to allow it to remove only auras from spells that were cast by the entity itself. (#23345)
(cherry picked from commit d365dd9157)
2021-12-10 21:12:25 +01:00
Giacomo Pozzoni
33347c7d5f Core/Misc: Fix static analysis issues
Fix static analysis issues reported by Coverity Scan

(cherry picked from commit e12398afdc)
2021-12-09 00:24:41 +01:00
jackpoz
e9aed3e442 Core/SmartAI: Improve SMART_EVENT_GOSSIP_HELLO
Add another value to event_param1 for SMART_EVENT_GOSSIP_HELLO to support all cases of OnGossipHello/OnReportUse in GameObjects:
- event_param1 set to 0: execute the action for both OnGossipHello and OnReportUse. This might result in the action being executed twice when clicking the GameObject
- event_param1 set to 1: execute the action for only OnGossipHello
- event_param1 set to 2: execute the action for only OnReportUse

(cherry picked from commit 9e58ef6940)
2021-12-08 21:33:58 +01:00
jackpoz
6034992dff Core/SmartAI: Implement SMART_EVENT_SUMMONED_UNIT and SMART_EVENT_SUMMON_DESPAWNED for GameObject owners
(cherry picked from commit 507a56d627)
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 797fba98e9)
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 457fc22473)
2021-12-06 23:27:45 +01:00
ccrs
844f969ed7 Core/AI: logs, codestyle & cosmetics standarization
(cherry picked from commit fdb71ce19e)
2021-12-05 16:48:58 +01:00
ccrs
dd11603150 Core/AI: variable naming standarization
plus minimum codestyle changes

(cherry picked from commit 179c7da1fc)
2021-12-05 16:17:02 +01:00
Meji
198d18bef5 Core/SAI: Fixed crash when using SMART_TARGET_CLOSEST_* in areatrigger smart script (#27336)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-12-04 20:40:06 +01:00
ccrs
356358ee15 Core/Misc: standarize a couple logs
(cherry picked from commit aee26eb467)
2021-12-02 00:39:28 +01:00
Aokromes
dad95d16b2 Core/SmartScripts: Implement SMART_ACTION_PLAY_CINEMATIC
By Malcrom

(cherry picked from commit 63aa5d1e35)
2021-11-30 23:10:57 +01:00
Killyana
e5eff88282 Core/SAI: Fix Move to position and Set run if used after a waypoint
Closes #22976

(cherry picked from commit 9ab05e2b6d)
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 75a8639242)
2021-11-24 22:15:52 +01:00
Aokromes
2682bf0fca Core/Misc: Add categories to 3 logs
(cherry picked from commit 2d22c027fe)
2021-11-23 22:29:21 +01:00
jackpoz
d6ce2fa8b8 Core/SAI: Add maxSize parameter to SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_CREATURE_RANGE and SMART_TARGET_GAMEOBJECT_RANGE
(cherry picked from commit 46368188ce)
2021-11-10 00:12:08 +01:00
jackpoz
4fabfa0903 Core/SAI: Add a 4th target parameter to SAI
(cherry picked from commit 7634a57f64)
2021-11-10 00:11:52 +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
Shauren
b13e9f9d61 Core/Misc: Fixed clang 13 warnings, gcc 11 build errors and nopch build 2021-10-25 00:05:05 +02: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 da21ca80fc)
2021-10-23 14:44:05 +02:00
ModoX
437fb2aaba Core/CreatureTexts: Added new field SoundPlayType to enable usage of ObjectSounds within creature_text (#27136)
* Also adjusted Vigilant Quoram texts to use ObjectSounds
2021-10-23 13:10:32 +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 042f5515e4)
2021-10-22 23:47:51 +02:00
Treeston
f6ceb4bf0c Scripts/SmartScripts: _SET_IN_COMBAT_WITH_ZONE and _CALL_FOR_HELP no longer use a target. Because that feature made no sense and was unused.
(cherry picked from commit 5706d49e49)
2021-10-22 23:20:36 +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 f95a383293)
2021-10-22 00:41:41 +02:00
Treeston
45766c3d6e DBError follow-ups:
* broadcast_text mismatch (6eb7f06) is now a _INFO since Aok isn't nearly as fast as fixing as he claimed.
* SmartAI invoker misuse (482328b and a3c85c8) are now blocking errors

(cherry picked from commit 38d3b35561)
2021-10-22 00:41:07 +02:00
Treeston
0aee79dfb8 AI/SmartScripts: Replace SMART_ACTION_INVOKER_CAST with SMART_ACTION_SELF_CAST in action 85. SMART_ACTION_INVOKER_CAST moves to 134.
(cherry picked from commit 0df3cb5bcc)
2021-10-17 22:07:54 +02:00
Treeston
a2d266edf3 AI/SmartScripts: Warn on startup for ACTION_INVOKER_CAST without invoker (same as invoker targets)
(cherry picked from commit a3c85c8a2b)
2021-10-17 20:14:45 +02:00
Shauren
d2dcce09d7 Core/SAI: Fixed SMART_ACTION_EQUIP to properly set values in all slots (cherry-pick error) 2021-10-10 14:22:18 +02:00
Shauren
3fe9b0a296 Core/Conversations: Replace _participants with generic personal object implementation 2021-10-09 13:30:47 +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 982643cd96)
2021-09-28 00:15:13 +02:00
ccrs
0b6049fe0b Core/Movement: use helpers for validation
(cherry picked from commit 7118806231)
2021-09-26 14:21:14 +02:00
Shauren
334b02e1da Core/SAI: Fixed crashes when SAI targets pets that use sai if not tamed
Closes #21870

(cherry picked from commit beb333738d)
2021-09-26 12:43:18 +02:00
Shauren
e598cfe28d Core/SAI: Fixed silence logic in 1e8227eda7
(cherry picked from commit 668df7fd01)
2021-09-25 20:46:13 +02:00
Killyana
c0cb8fc1fe Core/SAI: Allow movements for creature using castflag 64 when silenced
Closes #20222

(cherry picked from commit 1e8227eda7)
2021-09-25 20:45:27 +02:00
Killyana
e7f93ca96d Core/SmartAI: Remove PauseMovement on AttackStart
Closes #21144

(cherry picked from commit e27a745c58)
2021-09-25 20:43:39 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +02:00
Shauren
8cc418460f Core/Misc: Fix gcc warnings 2021-08-28 16:08:33 +02:00
ariel-
962f6d7988 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d6)
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 98d6258efd)
2021-08-08 21:21:34 +02:00
Treeston
32997a5989 Core/SmartScripts: Rename SMART_ACTION_RESPAWN_TARGET -> SMART_ACTION_ENABLE_TEMP_GOBJ, since that's the only thing it still does in the dynspawn model. Adjust body accordingly to warn on misuse.
(cherry picked from commit 0850b5ff39)
2021-08-08 21:21:34 +02:00
Treeston
61baf6704c AI/SmartAI: New SMART_ACTION_RESPAWN_BY_SPAWNID (hi kilyana)
(cherry picked from commit 691c67f0be)
2021-08-08 21:21:34 +02:00
Killyana
4b6e76a5ef Core/SAI: Add an action_param3 to "summon gob" to control when the object will despawn
0 - For despawn when creature dies or time runs out
1 - For despawn after time
Closes #11601

(cherry picked from commit ca4f1e334a)
2021-06-22 12:51:28 +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 cfc77fd843)
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 264d4e1d30)
2021-06-20 22:10:08 +02:00
Treeston
bccd81e12a Entities/GO: GameObjects now support (delayed) despawning in a reasonable manner. Closes #21406.
(cherry picked from commit f071fa9e93)
2021-06-20 21:49:11 +02:00
Treeston
bd158f6c29 oops, now it builds (and a bonus refactor that annoyed me)
(cherry picked from commit 2cd5992f37)
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 6fb0bc1038)
2021-06-20 21:42:35 +02:00