* 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 <giacomopoz@gmail.com>
(cherry picked from commit e7a714f66c)
Unlike SMART_ACTION_AUTO_ATTACK, this action is actually stopping the entire attack procedure, rather than just hack-disabling auto-attacks. Keep in mind that this action requires a passive react state to prevent a immediate AttackStart ai reaction
(cherry picked from commit 152ea60116)
* 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 e3b232fe0e)
* Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT which allows to search for closest unspawned gameobjects
* updates: https://github.com/TrinityCore/TrinityCore/issues/24067
* Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT which allows to search for closest unspawned gameobjects
(cherry picked from commit 2d948d3366)
* Game/SmartScripts: Reset counter in SAI only on Initialize.
* Game/SmartScripts: Reset counter in SAI only on Initialize.
(cherry picked from commit 4f52f7d7c9)
* Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects
* Include new Coalesce(..) template by @Shauren
(cherry picked from commit 90b00288c2)
* 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 ddf2f60c13)
* Core\SmartAI: implement SMART_ACTION_OVERRIDE_LIGHT and SMART_ACTION_OVERRIDE_WEATHER
* Change the invoker of action to any worldobject
* Revert "Change the invoker of action to any worldobject"
This reverts commit 2e15f72585.
* Add dbc-validations for new actions
* Use GetBaseObject() instead of Creature* for new actions. Add debug-logging
(cherry picked from commit c65ba35269)
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime
(cherry picked from commit d60082ae86)
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)
* 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)