So far I see that only Cannot Turn flag can be changed by scripts and action to change it didn't existed in 3xx. If someone will need to change that flag, it should be implemented by action which will change only that flag and not any flag of that type.
(cherry picked from commit c8061d8ba6)
* Core/SAI: Show a clear error for no longer supported SAI actions
* Core/SAI: Show a warning for deprecated SAI events, still loading them.
Disable log "sql.sql.deprecation" in config if you want to ignore the warning
(cherry picked from commit 3af4d17188)
* Core/SAI: Warn when an unused parameter is set in the database
* Warn when an unused parameter is set in the database as all unused parameters are supposed to be set to 0.
* Remove unused struct from union.
* Add a new struct simpleTalk for SMART_ACTION_SIMPLE_TALK instead of reusing only some fields of struct talk from SMART_ACTION_TALK
* Add addAura and flag structs to be used instead of generic ones to match the parameters used by actions
* Add randRangeTimedActionList struct to be used instead of generic ones to match the parameters used by actions.
* Remove unused action structs.
(cherry picked from commit aa7279df09)
* Core/SAI: Add a warning when a boolean value is outside of [0,1] range
* Replace boolean fields in SAI with SAIBool (from uint32)
(cherry picked from commit 84c8d21ad3)
Add 6th parameter "count" to SMART_ACTION_SUMMON_CREATURE action to summon more than 1 creature. For backward compatibility, a value of 0 will be treated as 1.
(cherry picked from commit 5628ca7f7c)
Change SMART_EVENT_OOC_LOS and SMART_EVENT_IC_LOS first parameter to have 3 values:
- 0 : Hostile
- 1 : Not hostile (not that Friendly and Not hostile have different meanings)
- 2 : Any, as in both Hostile and Not hostile
Close#24789
* Add validation on startup for allowed values.
Code cleanup.
* Fix errors
(cherry picked from commit 9e7cdb02d2)
Add a second parameter to SetCorpseDelay() that specifies if Rate.Corpse.Decay.Looted setting should be ignored, false by default (aka don't ignore by default).
Add a second parameter to SMART_ACTION_SET_CORPSE_DELAY to specify if Rate.Corpse.Decay.Looted should be included, false by default (aka ignore by default).
(cherry picked from commit d5fc86af8b)
* Core/SAI: Add new action SMART_ACTION_SET_HEALTH_PCT
Add new action SMART_ACTION_SET_HEALTH_PCT (142) with one single parameter "percent" to set the Unit health.
Close#25317
* Do not allow 0%
(cherry picked from commit 7d6f7e4d19)
* Core/SAI: Fix SMART_EVENT_FLAG_NOT_REPEATABLE flag being ignored when specifying a chance
Fix SMART_EVENT_FLAG_NOT_REPEATABLE flag being ignored when specifying a chance, always making the action trigger.
* Fix SMART_ACTION_CAST with SMART_EVENT_FLAG_NOT_REPEATABLE not casting the spell at all if rolled chance was successful but creature couldn't cast the spell
* Prevent linked actions if SMART_ACTION_CAST couldn't be completed and will be retried later
(cherry picked from commit 96b289cadb)
* Core/SAI: Add orientation and delay columns to waypoints table
* Rename 2020_99_99_99_world.sql to 2020_09_19_00_world.sql
(cherry picked from commit 4b7d19c91b)
* 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 7dd51ae6d9)
* Game/AI: Implement option to move a creature back to Homeposition on Evade.
* If ToHomePosition (action param 1) is 1 > Move to last stored position
* If ToHomePosition (action param 1) is 0 > Move to homeposition
* Ref: https://github.com/TrinityCore/TrinityCore/issues/24226
* Add parameter for walkmode
* Game/AI: SAI SMART_ACTION_EVADE - Rename ToHomePosition to ToRespawnPosition and store point from GetRespawnPosition.
* Game/AI: SAI SMART_ACTION_EVADE - Rename ToHomePosition to ToRespawnPosition
* Remove broken bits, simplify the code
* Update comments
* Code cleanup
Co-authored-by: jackpoz <giacomopoz@gmail.com>
(cherry picked from commit 02fca032e1)
There might be cases where this should be allowed (i.e. if the SMART_TARGET_* is another object) but for now we'll just never allow it.
(cherry picked from commit 28921f191d)
* Core/SAI: Implement SMART_TARGET_ACTION_INVOKER in SMART_EVENT_FRIENDLY_HEALTH_PCT
* Require radius (5th parameter) to be set
(cherry picked from commit cbed1039c4)
* Core/SAI: Spell casts that cannot be executed because the unit is currently casting another spell will be retried asap with priority over other events
* Core/SAI: Re-sort the events only when needed
* Fix some priority reset and wrong mEventSortingRequired handling
* Code cleanup.
Sort only events loaded from db (not stored events, not timed action list).
* Code cleanup.
Raise priority of failed casts so they are retried before other spells
* Keep priority of the action fails and is rescheduled on next update
* Don't try recasting a spell in SMART_ACTION_CAST if there are multiple targets and at least 1 was successful
(cherry picked from commit ca25e8d019)
* Scripts/ScarletMonastery: Fix wrong emote during Headless Horseman encounter
* Scripts/HoR: Fix wrong emote during escape event
* Core/Unit: Make improve type safety of HandleEmoteCommand
Change argument type to the expected enum type Emote
* Scripts/CoS: Use SetUInt32Value to set UNIT_NPC_EMOTESTATE
UNIT_NPC_EMOTESTATE is no flag field
(cherry picked from commit 6c7837f947)
* Core/SAI: Fix creatures casting with flag SMARTCAST_COMBAT_MOVE not switching to melee when the school of the spell they are trying to cast gets silenced (and other cases of spell failure)
* Core/SAI: Retry casting after 500ms if a cast failed
Fixes#24914
(cherry picked from commit 63a6e1e048)