Commit Graph
282 Commits
Author SHA1 Message Date
Carbenium eeffb310de Core/EventProcessor: std::chrono-ify CalculateTime
uint64 CalculateTime(uint64 t_offset) has been replaced with Milliseconds CalculateTime(Milliseconds t_offset).
Also add the std::chrono-ified overload void AddEvent(BasicEvent*, Milliseconds, bool)

(cherry picked from commit 92a02a5c8750913f596d7e3b58bf8439cb770c28)
2022-01-24 12:00:35 +01:00
Shaurenandaquadeus 0d3235f569 Core/Guilds: Separate guild rank id from guild rank order
Co-authored-by: aquadeus <[email protected]>
2022-01-09 23:12:00 +01:00
Carbenium 49523a74a4 Battlefields: Move BF scripts out of game
This commit introduces the usual script interface
for battlefields.

(cherry picked from commit f7faf20254a120a90b8ee8eb55a284a6351aabc3)
2022-01-07 00:20:57 +01:00
jackpoz c03af362c6 Core/Scripts: Show a message when aborting because two scripts have the same registered name
(cherry picked from commit 96df3b7adb02f763aaaa6138922bd032a75a9b9e)
2021-12-22 22:57:34 +01:00
Ovah 64fc549be8 Core/AI: call ModifyVehiclePassengerExitPos for CreatureScripts since the hook is available for that class as well
(cherry picked from commit ebf116e6a3381835fd2af885bd2721233485b684)
2021-12-20 23:56:31 +01:00
Aokromes 30cec73c61 Coding standards (#23514)
* Coding standards

* revert part

(cherry picked from commit fe744977c917957e112704ccd66e228b826b3f7a)
2021-12-13 00:42:17 +01:00
Wyrserth 1edd93bc0c Core/Script: add script hook to allow overriding of a vehicle passenger's exit position (#23322)
* Core/Script: add script hook to allow overriding of a vehicle passenger's exit position.

* Allow to change orientation, and fix nopch.

* Keep original orientation, thanks jackpoz!

* Update Unit.cpp

Code cleanup

* Update Unit.cpp

(cherry picked from commit 88c6c61b95ac2b2f911b519136770479d31de27d)
2021-12-08 23:51:07 +01:00
ccrs 672d4d6baa Core/AI: silence a freaking annoying VS IntelliSense warning
(cherry picked from commit 0eb5d240fa82592ff7a4b2df81206ac49df628e2)
2021-12-05 16:19:57 +01:00
Giacomo Pozzoni ed5ba915f1 Core/Scripts: Change PlayerScript and CreatureScript inheritance (#23048)
Remove UnitScript from PlayerScript and CreatureScript classes as that's how the original system that was PR'd worked, see https://github.com/TrinityCore/TrinityCore/pull/7867 for reference.
Please note these are used as global hooks and should really just invoke stateless functions.
If you need to hook methods from PlayerScript/CreatureScript and UnitScript, just define 2 different scripts (this is how the original system worked and how it was designed to work)

(cherry picked from commit 5b7ead65bb116195f4336934bcff830e1b2af5bb)
2021-11-23 22:54:24 +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
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 042f5515e4f3e52b0d2e23d9b9e147041849ce12)
2021-10-22 23:47:51 +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
Shauren b6b46924f6 Core/Scripts: Make ObjectMgr::LoadScriptNames safe to call multiple times 2021-10-12 16:09:47 +02:00
ModoX 6d9ce8e8ba Core/PacketIO: Implemented CMSG_CONVERSATION_LINE_STARTED (#27036)
* Added OnConversationLineStarted hook to ConversationScripts
* Added example for Defender of Azeroth conversation
2021-10-12 00:16:20 +02:00
Shauren 2d7af28e9f Core/Transports: Store information about continent transports 2021-10-02 19:59:56 +02:00
Treeston 5c80f50734 Core/Spawning: Actually check spawn group state before processing a respawn. It feels like that is something that should've been noticed at some point.
Also remove CreatureScript::CanSpawn since nobody uses it, and spawn groups do the same thing.

(cherry picked from commit 94b5d9bfa1195ad7c32cf51a665b55514dac0938)
2021-08-08 21:21:34 +02:00
Robingad 995fb23bc1 Core/Scripts: Add SpellInfo argument to ScriptMgr::ModifySpellDamageTaken (#26141) 2021-02-28 18:42:36 +01:00
Shauren f269f60d8a Scripts/Quests: Implemented new quest scripting hook, OnQuestAcknowledgeAutoAccept, used when player closes quest frame after viewing details of autoaccept quests 2021-02-26 20:42:29 +01:00
Shauren b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Treeston fe938b99f8 Core/Scripts: Implemented OnlyOnceAreaTriggerScript (#20288)
(cherry picked from commit 971ed856a49dc56ea33d9a0779b1386eea5cd3ca)
2020-08-29 00:41:22 +02:00
Yehonal ae4dacfd1d Core/Scripts: FOR_SCRIPTS macro shouldn't return early (#20187)
FOR_SCRIPTS, insteadof FOR_SCRIPTS_RET, shouldn't return
otherwise methods such as void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) will end prematurely

(cherry picked from commit 4ee16fb536177cdedcb435a59cb625490f5ec69f)
2020-08-23 16:06:43 +02:00
r00ty-tc 03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0a35028779fd76372ae06cc98c8086f)
2020-08-22 12:59:57 +02:00
Shauren 1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
ariel- bd96262248 Core/OutdoorPvP: refactor using Position and Quat to pack parameters
- Moved statics to cpp
- Save scriptids into an array

(cherry picked from commit 3e7b64b2f765bebc722c1194b7fc2f749fae77f7)
2020-07-16 22:00:29 +02:00
Peter Keresztes Schmidt bab5fd87a3 Core/Misc: Replace Trinity::make_unique with std (#24869) 2020-06-23 08:54:12 +02:00
treeston 57e3a67c94 Fix an issue where CanSpawn would never get invoked on creatures without per-guid script.
(cherry picked from commit aeaa8ecfabc2885aa24a86ce22034718cb4f62d8)
2020-06-14 23:49:04 +02:00
Shauren c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
ariel- 6604849716 Core/Scripts: unified scripted gossip/quest api
- Changed self-accessor on GameObjectAI to "me", like UnitAI
- Moved all related functions to AI, now Unit and GameObject have the same function names with identical behaviour
- Remove "OnUpdate" from CreatureScript/GameObjectScript, was never used and we already have AI Update method
- Quest methods no longer return a bool, the return value was used to call the AI version if the ScriptMgr one returned false
- Implemented GameObjectAI::Destroyed hook (was never called), implemented Damaged method
- Rename OnStateChanged to OnLootStateChanged to reflect when it's really called, and created a new hook OnStateChanged that only gets called on GOState change
- Since the functions are now only getting called from AI, made GetAI methods full virtual. (CanSpawn method is anyways going to be used on creatures with AI)

(cherry picked from commit f913f3bb8977c127d200d5d4a608ab434b21bbcd)
2020-05-03 03:04:32 +02:00
ariel- 1929ca3aa1 Core/Scripts: remove OnDummyEffect hook/sOnDummyEffect ai hook
- Duplicated logic never used, sometimes only ScriptMgr version was called, sometimes only AI
- They only encourage bad scripting practices
- You can still use OnSpellHit or a SpellScript

(cherry picked from commit b6b59f6c239bc0259c92c28bf43bbb50573330b5)
2020-04-29 01:36:46 +02:00
Shauren aced88b09b Core/AuctionHouse: After taking a break at the start of patch 8.3 auction house is now back in business. 2020-04-20 20:36:24 +02:00
Aokromes b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
ariel- 5f70be050f Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734

(cherrypicked from eac9c1f0b992fd3622fd7dd864b2acc2781ec778)
2019-08-17 20:04:14 +02:00
Kittnz 5291842a33 Game/Scripting: Add OnPlayerRepop hook
Called when a player presses release when he died

(cherrypicked from d550ba73927350c3f79ff6804609cf2f5d368987)
2019-06-15 18:41:09 +02:00
vincent-michael 5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
sirikfoll e64cd5669d Core/Scripting: Fixed hotswap calling evade mode for dead creatures
(cherry-picked from afa8527338f8d07531cf2cf8a59195321dfb257e)
2018-12-09 14:18:42 +01:00
Shauren 8ed52e9dc3 Core/Scripts: Fixed ENSURE_AI assertion failures when used in Reset()/InitializeAI() hooks with hotswap
Updates #20727

(cherry picked from commit 2fd9dc2edb0355d15f5afd21cc6aa61d172d19cc)
2018-02-05 23:41:39 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren 66621a85e9 Core/Quests: Implemented player choice rewards 2017-12-31 23:22:55 +01:00
Traesh 89c91c271b Core/Quests: Implemented player choices
* Implemented SPELL_EFFECT_LAUNCH_QUEST_CHOICE
* Script hook for player choices
2017-12-31 23:22:55 +01:00
Traesh 422ad436c7 Core/Scripts: Added new QuestScript hooks (#20950)
* OnQuestStatusChange and OnQuestObjectiveChange
2017-12-04 17:35:37 +01:00
funjoker 465012978f Core/Scripting: Implemented Conversation scripts (#20758) 2017-11-18 12:40:56 +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
Shauren 7e538980a2 Core/Database: Include cleanup 2017-05-12 18:50:27 +02:00
Traesh 9cc5273cd2 Core/AreaTriggers: Areatrigger rework script system + fix priest angelic feather
Closes #19171
2017-03-21 18:14:23 +01:00
Krudor 5a36a2eb17 Core/Scripts: Add support for spawn specific C++ scripts
Closes #19247
2017-03-18 11:31:31 +01:00
treeston ee6e27a1d6 Various: Fix coverity reported issues.
(cherry picked from commit 84cf239fdafbe12d7a5a695c57eff1f7a1cb42e3)

Core/Scripts: kill whitespace
(cherry picked from commit 83771597c1f1ed8089270e83091f7fb01df186d1)
2017-03-05 01:19:55 +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 6d00d3f28380dd0811a18913450b1dc4f07fef48)

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

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 4fa646c0b2ae3261e7fab249f4177900d4c8d013)

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 4a1a460241acf511467decd92d2a30e19927d74d)
2017-03-01 22:03:35 +01:00
Rochet2 117b45d768 Core/Scripts: Enhance quest status hook by making it catch more status changes (#17865)
(cherry picked from commit c52566a8881bdcd1cc33279e1a10621648cb664e)
2017-02-26 15:36:01 +01:00
treeston e941d7e04b Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
(cherry picked from commit b3d44d6c366c7e4f12a6ce30ee5cf6b9bff68a06)

Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0.
(cherry picked from commit 91c2b3162d350ab1a09053574ad67f45f089175b)

Build fix.
(cherry picked from commit a9f1151f2ca56394e315d0b07741c240ef59c2ff)

Fine, this time I actually built it. Promise.
(cherry picked from commit 0c2c88ed5025d9b51b6cbdf0603ceaf1ea54c80a)
2017-02-26 15:30:15 +01:00