Commit Graph

436 Commits

Author SHA1 Message Date
Ovahlord
152ea60116 Core/SAI: implement SMART_ACTION_ATTACK_STOP
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
2020-06-14 22:51:42 +02:00
Rushor
2d948d3366 Game/AI: Implement new targettype SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT (#24494)
* 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
2020-04-26 21:32:24 +02:00
Rushor
a41bb4f77b Game/AI: Enable check for SMART_TARGET_GAMEOBJECT_RANGE (#24493)
* Thanks to joshwhedon
* Updates: https://github.com/TrinityCore/TrinityCore/issues/24439
2020-04-26 21:30:03 +02:00
Rushor
4f52f7d7c9 Game/SmartScripts: Reset counter in SAI only on Initialize. (#24489)
* Game/SmartScripts: Reset counter in SAI only on Initialize.

* Game/SmartScripts: Reset counter in SAI only on Initialize.
2020-04-22 19:49:41 +02:00
Giacomo Pozzoni
90b00288c2 Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects (#24416)
* Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects

* Include new Coalesce(..) template by @Shauren
2020-04-09 11:59:10 +02:00
Giacomo Pozzoni
3def52c1c4 Core/Logs: Log full guid instead of just low guid, part 2 2020-04-05 19:10:58 +02:00
Giacomo Pozzoni
468ecb7252 Core/Logs: Log full guid instead of just low guid 2020-04-05 19:10:57 +02:00
Shauren
e10313b380 Core/Maps: Citizens of Dalaran! Raise your eyes to the skies and observe! Any non-map-default light can now be overriden!
Closes #24250
2020-03-06 17:44:10 +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
ForesterDev
5cfce94619 Core/DynamicInfo: rename some parameters according packet definitions (#24192) 2020-02-28 19:23:20 +01:00
ForesterDev
c65ba35269 Core/SmartAI: implement SMART_ACTION_OVERRIDE_LIGHT and SMART_ACTION_OVERRIDE_WEATHER (#24146)
* 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 2e15f7258553b7057c3e8f67c54efc77fb6d75b8.

* Add dbc-validations for new actions

* Use GetBaseObject() instead of Creature* for new actions. Add debug-logging
2020-02-22 21:11:14 +01:00
Ovahlord
6f31784979 Core/SAI: SMART_ACTION_PAUSE_MOVEMENT
Closes #22346
2020-02-18 22:52:35 +01:00
Regigicas
1369620436 Core/SAI: Fix SMART_ACTION_SET_MOVEMENT_SPEED behavior (#24059) 2020-01-14 20:02:18 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
Lopfest
443a425c4c Core/SAI: Implement new action to set movement speed
(cherry picked from commit 5dd6d31c01)

# Conflicts:
#	src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
#	src/server/game/AI/SmartScripts/SmartScriptMgr.h
2020-01-01 19:56:05 +01:00
Giacomo Pozzoni
22f258edcc Core/SAI: Attempt to fix a crash 2019-07-30 16:33:24 +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
Treeston
d60082ae86 Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
- 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
2019-07-15 17:14:58 +02:00
ccrs
401777d024 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()
2019-07-01 21:36:32 +02:00
Wyrserth
eeba12778b Core/SAI: add param3 to SMART_ACTION_CALL_TIMED_ACTIONLIST to allow it to override a currently running actionlist. 2019-06-27 01:48:12 +02:00
Wyrserth
8967cc96df Core/SAI: do not pass old creatureData to UpdateEntry() and keep current health when changing a NPC's entry. (#23493) 2019-06-26 18:03:03 +02:00
Wyrserth
c95531595e Core/SAI: silence wrong SAI error when using SMART_ACTION_SET_DATA on a creature using CreatureAI.
This behavior is fully allowed and should not report any kind of error.
2019-06-25 18:06:20 +02:00
Wyrserth
50be697e1f Core/SAI: add cooldownMin (event_param2) and cooldownMax (event_param3) to SMART_EVENT_ACCEPTED_QUEST and SMART_EVENT_REWARD_QUEST. (#23422) 2019-06-16 20:08:37 +02:00
Wyrserth
2b1cde2560 Core/SAI: don't allow to start a new SAI actionlist while the entity is already running one. (#23421) 2019-06-16 20:00:57 +02:00
jackpoz
50ed1bb5b3 Core/SmartAI: Rename SMART_EVENT_HEALT_PCT to SMART_EVENT_HEALTH_PCT 2019-06-07 21:57:32 +02:00
Wyrserth
d365dd9157 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) 2019-06-02 21:40:55 +02:00
Giacomo Pozzoni
e12398afdc Core/Misc: Fix static analysis issues
Fix static analysis issues reported by Coverity Scan
2019-05-31 12:21:48 +02:00
jackpoz
9e58ef6940 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
2019-05-26 12:44:58 +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
Aokromes
63aa5d1e35 Core/SmartScripts: Implement SMART_ACTION_PLAY_CINEMATIC
By Malcrom
2019-04-17 23:59:02 +02:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
jackpoz
46368188ce Core/SAI: Add maxSize parameter to SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_CREATURE_RANGE and SMART_TARGET_GAMEOBJECT_RANGE 2018-09-21 17:59:15 +02:00
jackpoz
7634a57f64 Core/SAI: Add a 4th target parameter to SAI 2018-09-21 17:56:20 +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
5706d49e49 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. 2018-08-22 22:22:24 +02:00
Treeston
0df3cb5bcc AI/SmartScripts: Replace SMART_ACTION_INVOKER_CAST with SMART_ACTION_SELF_CAST in action 85. SMART_ACTION_INVOKER_CAST moves to 134. 2018-08-10 23:18:04 +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
Shauren
beb333738d Core/SAI: Fixed crashes when SAI targets pets that use sai if not tamed
Closes #21870
2018-04-23 20:27:48 +02:00
Shauren
668df7fd01 Core/SAI: Fixed silence logic in 1e8227eda7 2018-04-14 17:53:48 +02:00
Killyana
1e8227eda7 Core/SAI: Allow movements for creature using castflag 64 when silenced
Closes #20222
2018-04-14 16:45:05 +02:00
jackpoz
f555a67bf8 Core/SmartScripts: Code cleanup 2018-03-11 21:01:53 +01:00
Killyana
5ad38c31b0 Core/SAI: Add event_parm5 "player only" for EVENT_OOC_LOS and EVENT_IC_LOS
Closes #21497
2018-03-11 18:46:07 +01:00
Treeston
0850b5ff39 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. 2018-02-24 02:26:35 +01:00
Treeston
691c67f0be AI/SmartAI: New SMART_ACTION_RESPAWN_BY_SPAWNID (hi kilyana) 2018-02-23 03:20:03 +01:00
Killyana
ca4f1e334a 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
2018-02-16 02:19:19 +01: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
264d4e1d30 Entities/GO: Add forceRespawnTimer support to DespawnOrUnsummon. Use it in SAI. 2018-02-14 02:24:13 +01:00
Treeston
f071fa9e93 Entities/GO: GameObjects now support (delayed) despawning in a reasonable manner. Closes #21406. 2018-02-13 22:08:49 +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