Commit Graph

202 Commits

Author SHA1 Message Date
Shauren
1d2c7adeff Core/Network: Socket refactors
* Devirtualize calls to Read and Update by marking concrete implementations as final
* Removed derived class template argument
* Specialize boost::asio::basic_stream_socket for boost::asio::io_context instead of type-erased any_io_executor
* Make socket initialization easier composable (before entering Read loop)
* Remove use of deprecated boost::asio::null_buffers and boost::beast::ssl_stream

(cherry picked from commit e8b2be3527)
2026-01-09 20:29:37 +01:00
Shauren
9ffc85485a Core/Misc: Reduce differences between branches 2025-07-14 22:26:42 +02:00
Mykhailo Redko
ca1560f043 Core/Players: Improvements for talent reset logic. (#29580)
* Clean up Player::ResetTalents() from unnecessary logic, such as withdrawing money. Move it to more suitable places.
* Implemented SMSG_TALENTS_INVOLUNTARILY_RESET and use it instead of old trinity_string.
* Do not reset the accumulated talent reset cost if CONFIG_NO_RESET_TALENT_COST is enabled.
2024-02-13 15:55:37 +01:00
Shauren
3144566584 Core/Misc: Include cleanup, 2023 edition
(cherry picked from commit 92ed5e8af1)
2023-08-12 17:56:16 +02:00
offl
d7adc50daa Core/Scripting: Get rid of ModifyVehiclePassengerExitPos (#27126) 2021-10-20 01:04:02 +03:00
Kargatum
a32b6b8ac4 Core: whitespace cleanup, reduce double blank line to single (#25795)
* Core/Misc: fix double empty line

* worldserver.conf
2021-01-03 11:47:07 +01:00
Treeston
1eca51b417 [3.3.5] ChatCommands, the other half: chat command resolution refactor (PR #25463) 2020-09-20 02:50:38 +02:00
Treeston
0c7f6ac89f Scripts/AreaTrigger: Rename OnlyOnceAreaTriggerScript::_OnTrigger to TryHandleOnce, and make its return value useful. 2020-09-07 18:25:49 +02:00
Shauren
7d4fbf706a Scripts/Spells: Replace RegisterAuraScript with RegisterSpellScript and remove it 2020-08-20 16:03:47 +02:00
Shauren
75a6a7a0ad Core/Scripts: Unify RegisterSpellScript and RegisterAuraScript macros to do the same thing and implemented passing custom arguments to spell script classes 2020-08-20 15:49:59 +02:00
Peter Keresztes Schmidt
6c7837f947 Core/Unit: Make HandleEmoteCommand typesafe (#25249)
* 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
2020-08-15 15:29:43 +02:00
Carbenium
f7faf20254 Battlefields: Move BF scripts out of game
This commit introduces the usual script interface
for battlefields.
2020-06-24 15:09:57 +02:00
ForesterDev
58313fc330 Core/PacketIO: update cinematic packets to new system. Implement CMSG_OPENING_CINEMATIC and CMSG_COMPLETE_MOVIE (#24135)
* Server/PacketIO: Enable SMSG_TRIGGER_CINEMATIC & SMSG_TRIGGER_MOVIE.

* Update SMSG_TRIGGER_CINEMATIC & SMSG_TRIGGER_MOVIE to new Format.

Signed-off-by: AriDEV <aridev666@gmail.com>

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Packets/MiscPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp

* Core/Scripts: Add server-side script support for movie completion (#18308)

# Conflicts:
#	src/server/game/Entities/Player/Player.h
#	src/server/game/Handlers/MiscHandler.cpp
#	src/server/game/Scripting/ScriptMgr.h
#	src/server/game/Server/Packets/MiscPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/WorldSession.h

* Core/PacketIO: CMSG_COMPLETE_CINEMATIC, CMSG_NEXT_CINEMATIC_CAMERA and enabled some opcodes

# Conflicts:
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/WorldSession.h

* Core/Protocol: Implemented CMSG_OPENING_CINEMATIC

# Conflicts:
#	src/server/game/Handlers/GuildHandler.cpp
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/WorldSession.h

* fix build

Co-authored-by: Krudor <erikstrandberg93@hotmail.com>
Co-authored-by: MitchesD <majklprofik@seznam.cz>
Co-authored-by: Kaelima <kaelima@live.se>
2020-02-08 20:37:34 +01:00
Ovah
f0485cea39 Core/Scripting: fixed build. Re-enable ModifyVehiclePassengerExitPos for CreatureScript to allow scripted creatures that already have an AI to benefit from its functionality as well 2020-01-28 06:12:42 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
ccrs
06c6b30ed4 Scripts/ScarletMonastery: instance script cleanup (#23889)
Adapt InstanceScript into newer structure and style
Adapt existing boss scripts into newer structure and style
Improve existing boss related definitions

Should make each boss more functionally reliable, but nothing new has been added
2019-10-26 23:33:30 +02:00
Wyrserth
88c6c61b95 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
2019-05-30 17:35:18 +02:00
Wyrserth
404c4f8091 Core/Scripts: implement a PlayerScript hook called when a quest's objective receives progress (#23286) 2019-05-17 20:38:15 +02:00
Giacomo Pozzoni
5b7ead65bb 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)
2019-02-15 20:29:14 +01:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
Treeston
94b5d9bfa1 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.
2018-02-22 20:31:42 +01:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
ariel-
78a1c687a2 Core/Misc: minor typo and codestyle fixes
- Replace NULL uses in new code with nullptr
- Fix wrong (accumulated) load time log when loading calendar invites
- Make Creature::CanRegenerateHealth const as its just a getter
- Mark OnlyOnceAreaTriggerScript::OnTrigger as final in case someone wants to override that (you are supposed to use protected _OnTrigger hook)
2017-12-13 14:43:12 -03:00
Treeston
971ed856a4 Core/Scripts: Implemented OnlyOnceAreaTriggerScript (#20288) 2017-09-14 22:53:02 -03:00
r00ty-tc
59db2eeea0 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.
2017-07-31 21:21:04 +02:00
treeston
fb87ac8e8d Core/Scripts: Implement generic script loaders (and script registry macros) to greatly reduce code duplication (#19526) (cherry-picked from commit a9174d5). 2017-07-20 00:27:20 +02:00
ariel-
85a7d5ce9a Core: ported headers cleanup from master branch 2017-06-19 23:20:06 -03:00
ariel-
3e7b64b2f7 Core/OutdoorPvP: refactor using Position and Quat to pack parameters
- Moved statics to cpp
- Save scriptids into an array
2017-06-11 17:02:01 -03:00
ariel-
f913f3bb89 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)
2017-05-01 18:19:36 -03:00
ariel-
b6b59f6c23 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
2017-04-28 18:59:14 -03:00
ariel-
eac9c1f0b9 Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734
2017-02-21 22:38:30 -03:00
Kittnz
9d74252e8d Reverting: Game/Scripting: Add OnGameEvent hook for game objects. 2017-02-17 20:30:52 +01:00
Kittnz
a5ccbe9906 Fix tabs 2017-02-17 20:19:05 +01:00
Kittnz
343d2c7f91 Game/Scripting: Add OnGameEvent hook for game objects.
Called when specific game event starts
2017-02-17 20:16:22 +01:00
Kittnz
d550ba7392 Game/Scripting: Add OnPlayerRepop hook
Called when a player presses release when he died
2017-02-07 17:28:16 +01:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
ariel-
cbb5c073ce Core/ScriptMgr: use vector instead of list to contain Spell and Aura scripts and hooks 2016-11-14 02:05:51 -03:00
Rochet2
c52566a888 Core/Scripts: Enhance quest status hook by making it catch more status changes (#17865) 2016-09-09 21:11:36 +02:00
treeston
a9f1151f2c Build fix. 2016-09-09 19:43:29 +02:00
treeston
91c2b3162d Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0. 2016-09-09 19:37:04 +02:00
treeston
3c32086b81 Core/Maps: Add override to allow InstanceMap const* -> InstanceScript const*.
Also tighten const-ness on CanSpawn method of CreatureScript.
2016-09-09 18:08:43 +02:00
treeston
b3d44d6c36 Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep. 2016-09-09 16:21:27 +02:00
Naios
445746c402 Core/Scripting: Fix acquiring of references between script swaps
* Delay unloading of shared libraries to the next update tick
  to prevent crashes in the destructor of the last referenced
  script instance.
* Closes #17557
2016-07-13 21:58:50 +02:00
Naios
eaf102b3c5 Core/Game: Rewrote the ScriptMgr to support script reloading.
* Finally this commit enables dynamic script hotswapping
  and finished the PR #15671.
* Split the storage layout to use optimized storages
  for database bound and unbound scripts.
* Add several unload workers to reload scripts correctly
  -> Requires further investigation.
* Fixes memory leaks in ScriptMgr when dropping invalid scripts.
* Fixes VehicleScripts
* Makes OutdoorPvP scripts reloadable
* Makes InstanceMapScripts reloadable
* Makes CommandScripts reloadable

(cherry picked from commit 9cc97f226d)
2016-04-11 21:42:28 +02:00
Naios
3123c278b9 Core/Game: Add a dynamic script reloader which reloads scripts modules on changes.
* is responsible for registering plain modules.
* requires compilation with the `WITH_DYNAMIC_LINKING` flag.
* requires further support of the ScriptMgr.

(cherry picked from commit bc0f2b6e5a)
2016-04-11 21:42:16 +02:00
Naios
775e0764e8 Core/Game: Move scheduled map scripts counter methods into MapManager
* Since those have nothing to do with core scripts and are
  not wished inside the ScriptMgr

(cherry picked from commit 59e3cf82ac)
2016-04-11 21:40:38 +02:00
Rochet2
2348613f7b Add missing GAME_API exports 2016-03-27 17:02:31 +03:00
Naios
9f61b72679 Core/Game: Converted the game library to a shared library.
* There is still the possibility to static link against game.

(cherry picked from commit bf33159a70)
2016-03-24 02:46:42 +01:00
Naios
96bc31924a CMake: Use inherited dependencies in scripts
* Removes the circular dependency between game <-> scripts
2016-03-18 02:53:00 +01:00
Shauren
5a6db6e84d Core/Misc: Minimize differences between branches in WorldSession::Update
This commit removes OnUnknownPacketReceive script hook - it could never be fired anyway at that point
2016-03-13 00:12:09 +01:00