Commit Graph

202 Commits

Author SHA1 Message Date
xinef1
a32d5cfa17 Core/SmartAI: Various fixes and extensions for smart scripts: (#18673)
- Possible crashes fixed
- Memory leak fixed
- Implemented checking of vehicle conditions
- Extended eventphasemask to 12 bits (sql required to change DB field type)
- SMART_EVENT_GOSSIP_HELLO - added possibility to detect for gameobject reportUse call
- Renamed action SMART_ACTION_SET_FLY to SMART_ACTION_SET_DISABLE_GRAVITY (to reflect actual functionality)
- Added targetsLimit to action SMART_ACTION_CAST and SMART_ACTION_INVOKER_CAST to limit max amount of targets (selected randomly)
- Action SMART_ACTION_TALK corrected to always work as intended
- Properly call GroupEventHappens in action SMART_ACTION_CALL_GROUPEVENTHAPPENS if invoker was charmed or owned by the player
- Properly utilize followAngle in action SMART_ACTION_FOLLOW (db orientation should be in degrees), but keep backward compatibility
- Added action SMART_ACTION_SET_CAN_FLY (119) 0/1
- Added action SMART_ACTION_REMOVE_AURAS_BY_TYPE (120) AuraType, can be used to exit vehicle for example
- Added action SMART_ACTION_SET_SIGHT_DIST (121) sightDist
- Added action SMART_ACTION_FLEE (122) fleeTime
- Added action SMART_ACTION_ADD_THREAT (123) +threat, -threat
- Added action SMART_ACTION_LOAD_EQUIPMENT (124) equipmentId
- Added action SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT (125) minId, maxId
- Added action SMART_ACTION_REMOVE_ALL_GAMEOBJECTS (126), removes all owned gameobjects
- Added action SMART_ACTION_STOP_MOTION (127), stopMoving, movementExpired
- Extended target SMART_TARGET_HOSTILE_SECOND_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_LAST_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM_NOT_TOP with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_THREAT_LIST with maxdist
- Extended target SMART_TARGET_OWNER_OR_SUMMONER to be able to get charmer/owner of current owner
- Added new target SMART_TARGET_FARTHEST with maxDist, playerOnly, isInLos restrictions
- Added SpellHit hook to GameObjectAI and extended SmartGameObjectAI to call SMART_EVENT_SPELLHIT when gameobject is hit by spell
- Call GameObjectAI Reset hook on gameobject respawn (for ex. to reset one time events in smart scripts)
- Fixed some logic errors in code
- SmartAI Escorts properly despawn escortee if no players are in range
- Disable Evading while charming creature with SmartAI
- Don't call SMART_EVENT_RESPAWN for dead units before they actually respawn
- Don't call SMART_EVENT_RESPAWN for not spawned gameobjects
- Properly call SMART_EVENT_RESPAWN for gameobject respawn
- Allow action SMART_ACTION_SET_IN_COMBAT_WITH_ZONE to utilize targetlist
- Allow action SMART_ACTION_CALL_FOR_HELP to utilize targetList
- Allow action SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL to utilize targetList
- Allow action SMART_ACTION_SET_VISIBILITY to utilize targetList
- Allow action SMART_ACTION_SET_ACTIVE to utilize targetList
- Allow action SMART_ACTION_ATTACK_START to select random attack target instead of first on the list
- Allow gameobjects to summon gameobjects with action SMART_ACTION_SUMMON_GO
- Properly store action invokers for action SMART_ACTION_WP_START, if no player invokers are found, distance despawn check won't be used
- Allow action SMART_ACTION_WP_RESUME to compensate for the state the unit actually is in (eg. combat)
- Allow action SMART_ACTION_MOVE_TO_POS to select random of the avaiable targets, not only the first one.
- Allow action SMART_ACTION_MOVE_TO_POS to utilize x, y, z parameters as an offset to calculated coordinates
- Action SMART_ACTION_RESPAWN_TARGET should never modify respawntime of already spawned gameobjects, use dedicated function
- Properly delete ontime events created by SMART_ACTION_CREATE_TIMED_EVENT
- If action could not be started because conditions were not satisfied, do not recalculate the waittime to action repeattime, use smaller value to recheck more frequently
- Allow target SMART_TARGET_CLOSEST_PLAYER to be used by gameobjects
- Allow target SMART_TARGET_OWNER_OR_SUMMONER to be used by gameobjects
- Fixed SMART_EVENT_COUNTER_SET to be only called for the id that was incremented
- Changed the way counters work
- Protect PhaseInc from surpassing maximum phase
- Added loading checks for missing NON_REPEATABLE flag if no repeatmin, repeatmax is set
- Added spell validation for SMART_ACTION_CROSS_CAST

(cherrypicked from b0ae5fadd1)
2019-08-17 20:04:14 +02:00
Riztazz
2caec4f4d2 Revert "[3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)"
This reverts commit 05fb27dae4.

(cherrypicked from a3c6880579)
2019-08-17 20:04:14 +02:00
Shauren
e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
Aokromes
91409cc77e Core/SAI: Add a 5th parameter to SAI events
CP of 1c60af6328

By jackpoz
2019-04-30 13:03:49 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
91be2332e2 Core/Entities: Phasing rewrite
* Optimized phase visibility checking
* Handle all phase flags

Closes #16758
Closes #21119
2018-03-25 19:28:36 +03:00
Kittnz
61a838b599 Core/SmartScript: update ACTION_GO_SET_GO_STATE
GO_STATE_ACTIVE             = 0,                        // show in world as used and not reset (closed door open)
GO_STATE_READY              = 1,                        // show in world as ready (closed door close)
GO_STATE_ACTIVE_ALTERNATIVE = 2                         // show in world as used in alt way and not reset (closed door open by cannon fire)

Credits to Sunwell
(cherry picked from commit 072ea761c6)

Tabs
(cherry picked from commit 65e84d2f0a)
2018-03-18 00:19:39 +01:00
Gustavo
bc87d3a2b3 Core/Misc Remove WhiteSpaces (#18379)
(cherry picked from commit 7e0a616657)
2018-03-12 10:32:05 +01:00
Riztazz
05fb27dae4 [3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)
Implement smooth movement for all waypoint pathing and escortai

(cherry picked from commit 28050f338d)
2018-02-11 15:53:32 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Aokromes
abc8fe123b Core/SmartAI: Missing parts on previous commit
By Malcrom
2017-03-26 01:07:09 +01:00
Aokromes
464ba05dd4 Core/SmartAI: Add check to SMART_ACTION_PLAY_ANIMKIT to allow zero value to remove animKit.
By Malcrom
2017-03-21 23:27:07 +01:00
Traesh
01ded93a42 Core/AI: enable SmartScripts on Scenes + add scene related actions/events
Closes #19194
2017-03-17 21:21:35 +01:00
Lopfest
61547cab59 Core/SAI: added new action SMART_ACTION_PLAY_ANIMKIT (#19170) 2017-03-11 13:39:38 +01:00
treeston
59d48ce7e4 Core/Movement: Add new SplineChainMovementGenerator that allows accurate replication of sniffed waypoints in static sequences, along with DB facilities that allow loading of waypoints from DB.
(cherry picked from commit 6d00d3f283)

Merge remote-tracking branch 'Treeston/3.3.5-splinechains' into 3.3.5 (PR #17946)
(cherry picked from commit 20f483967f)

Core/Movement: Add a convenience default ctor to SplineChainResumeInfo, and fix PCH build in some configurations (zzz why do we even keep Appveyor and Travis around).
(cherry picked from commit 4fa646c0b2)

PCH build fix. Again.

(( Alright, you made me waste 20 minutes of my life on a full nonPCH rebuild of the core now. ))
(( I hope you're happy. ))
(cherry picked from commit 4a1a460241)
2017-03-01 22:03:35 +01:00
treeston
5654fb9343 Merge branch '3.3.5-goshdangitsmartai' into 3.3.5 (PR #17738)
(cherry picked from commit e9eacae7b2)

Core/SmartScripts: Add missing break, 5f43e7b follow-up.
(cherry picked from commit a4623efaa6)
2017-02-19 15:07:42 +01:00
Shauren
5dbe9e7890 Core/Creatures: Implemented all creature equipment modifiers
* It is now possible to give creatures a mythic/heroic weapon

Closes #19160
2017-02-19 10:58:08 +01:00
treeston
573cb9d20f AI/SmartScripts: SMART_ACTION_ADD_QUEST -> SMART_ACTION_OFFER_QUEST. Open quest offer instead of adding straight to log - old behavior can be requested using action_param2. Closes #17735.
(cherry picked from commit ba4d6f6393)
2017-02-12 16:07:27 +01:00
treeston
b18b05ee4a AI/SmartScripts: Add SMART_ACTION_DISABLE_EVADE (117).
(cherry picked from commit 14b44af38d)
2017-02-12 15:46:58 +01:00
treeston
d0f4588652 Core/SmartScripts: Add SMART_TARGET_LOOT_RECIPIENTS. Does what it says on the tin.
Use this new target type to fix The Rider of Blood, The Rider of Frost, The Rider of the Unholy. Closes #17817.

(cherry picked from commit e2c915fb43)
2017-02-12 15:46:19 +01:00
SnapperRy
3e74109857 Core/SmartAI: change SMART_ACTION_RISE_UP (114) to SMART_ACTION_MOVE_OFFSET and implement offset movement via target fields. (#17362)
(cherry picked from commit ba0cb53b02)

Rename 9999_99_99_99_world.sql to 2016_07_15_07_world.sql
(cherry picked from commit 2fd124f9a3)
2017-02-05 17:45:07 +01:00
Aokromes
927561c4cf DB/Quest: fix availability for some quests
Closes #17371 by SnapperRy
(cherry picked from commit a307157dac)
2017-01-29 20:45:47 +01:00
ariel-
d40c151cc8 Core/Scripts: Extended SMART_ACTION_SET_INST_DATA to also set BossStates. (#16739)
Scripts/Dire Maul: Initialize boss states array so it may be called from SmartAI. (Ref #6429)
(cherry picked from commit d1d0c64ad1)

# Conflicts:
#	src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
2017-01-29 18:04:10 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
885d9b53c3 Core/DataStores: Updated dbc/db2 to 7.0.1.20994 2016-05-20 23:48:48 +02:00
MitchesD
92b74d6bdc Merge pull request #16523 from tkrokli/smart_action_set_corpse_delay
[3.3.5][6.x]Core/SmartScript: create SMART_ACTION_SET_CORPSE_DELAY
(cherry picked from commit 8e152e0d4a)
2016-04-08 23:51:18 +02:00
Shauren
e6e3e799d0 Build fixes 2016-04-02 19:22:30 +02:00
DDuarte
252220ed6e Core/SAI: Code improvements to SMART_ACTION_RANDOM_SOUND
Warning fixes and extra sanity checks

Ref #16376

(cherry picked from commit 77087db793)
2016-04-02 14:52:15 +02:00
Lopfest
c457de1e80 Core/SAI: added SMART_ACTION_RANDOM_SOUND
Closes #16376

(cherry picked from commit e4af2baa7e)
2016-04-02 14:51:13 +02:00
Naios
329225b40d Core/Game: Move singleton instances into compilation units
* Fixes issues when building shared libraries
  (prevents gcc and clang from providing several instance)
2016-03-11 18:35:49 +01:00
Shauren
db0b8bf24e Core/Maps: Changed the way area data is stored in maps, it now uses ID field from AreaTable.dbc instead AreaBit used for exploration marker (and is not unique anymore on top of simply being stupidly confusing)
Note: Extracting maps is required
2016-02-02 19:13:04 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Rushor
58da855925 Core/SAI: Add SMART_ACTION_RISE_UP for Z Axis
* closes #15188
2015-07-30 10:37:02 +02:00
Vincent-Michael
2e586bc520 Core: Header cleanup in game/*/*.cpp 2015-07-25 20:18:42 +02:00
MitchesD
d68df33c76 Core/SmartScripts: added new action SMART_ACTION_COMBAT_STOP
* this avoid using hacks like evade, faction change or rooting. I wonder how SAI could be without this
2015-07-24 22:54:15 +02:00
DDuarte
57da378dea Core/SAI: Fix some weird code in SmartAIMgr::IsTextValid
Additions to cb0e6cac63
2015-07-19 21:54:48 +01:00
DDuarte
cb0e6cac63 Core/SAI: Fix an issue in IsTextValid when using guids
Fixes #15122
2015-07-19 17:19:41 +01:00
MitchesD
23b1c042ad Core/SmartScripts: added SMART_ACTION_SET_COUNTER and SMART_EVENT_COUNTER_SET
as per request of DB developers
2015-04-02 18:02:34 +02:00
Shauren
854917a31a Core/DataStores: Added an extra safeguard for loading db2 hotfix locale tables - invalid row will no longer cause crashes 2015-03-06 18:52:58 +01:00
jackpoz
e6f26cfb1f Core/Misc: Fix static analysis issues
Fix some static analysis issues reported by Coverity.
Rename SpellMgr::EnsureSpellInfo() to SpellMgr::AssertSpellInfo() to be consistent with other similar methods.
2015-02-08 19:40:03 +01:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
Rat
926a37a305 Core/Spells: more code updates... 2014-11-22 17:18:16 +01:00
DDuarte
07a640de0d Core: Fix warnings, mostly wrong printf formatters 2014-10-27 21:56:44 +00:00
Shauren
9e1930959d Core/Entities: Changed object lowguid to uint64 2014-10-26 02:57:28 +02:00
Vincent-Michael
02192ab870 Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4 2014-10-12 02:02:07 +02:00
Vincent-Michael
1e181d7021 Core:/SAI: Added better error log output in 0a897616da 2014-10-11 18:56:58 +02:00
joschiwald
90a2acfbdf Core/SAI: changed multiple validation checks 2014-10-11 18:52:01 +02:00
Vincent-Michael
0a897616da Core/SAI: Added new error for wrong target orientation value 2014-10-11 05:33:34 +02:00