Commit Graph

503 Commits

Author SHA1 Message Date
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
92a02a5c87 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)
2020-07-27 13:36:25 +02:00
Treeston
210176fd91 Core/Authserver: Authserver cleanup (PR#25093)
- Fix a handful of 1/256 bugs with most significant byte zero in BigNumber
- Get rid of (most of) the C-style arrays in authserver
- CryptoRandom as a unified source for cryptographic randomness
- Bring our other crypto APIs into 2020
- BigNumber usability improvements
- Authserver is now actually readable as a result of all of the above
2020-07-26 01:53:34 +02:00
Shauren
524d167398 Dep: Switch to boost process instead of old standalone version 2020-07-15 19:33:12 +02:00
Peter Keresztes Schmidt
c92950b3e1 Core/DataStores: Update DBC field names to generated ones (#24999) 2020-07-12 15:36:55 +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
Peter Keresztes Schmidt
b210bb3713 Core/Misc: Replace Trinity::make_unique with std (#24869)
(cherry picked from commit bab5fd87a3)
2020-06-23 18:03:16 +02:00
jackpoz
96df3b7adb Core/Scripts: Show a message when aborting because two scripts have the same registered name 2020-03-09 20:08:26 +01: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
Ujp8LfXBJ6wCPR
76831f1f46 Use boost::optional and boost::none instead of smelly pointer (#24134)
* Remove bad pointer usage from CharacterCache

Use TrinityCore Option type instead which is intended for this purpose. (Wrapper around boost::option until C++17 bump is finalised)

* Unify codestyle regarding TC optional type

Based upon advice from @Shauren
2020-02-08 20:29:18 +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
Ovah
ebf116e6a3 Core/AI: call ModifyVehiclePassengerExitPos for CreatureScripts since the hook is available for that class as well 2020-01-28 05:48:10 +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
Ovah
3f7b2252a1 Core/Movement: add a velocity argument for the spline chain meta table (PR #23575) 2019-07-18 15:52:03 +02:00
Aokromes
fe744977c9 Coding standards (#23514)
* Coding standards

* revert part
2019-06-26 08:56:20 +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
ccrs
0eb5d240fa Core/AI: silence a freaking annoying VS IntelliSense warning 2019-05-15 16:42:28 +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
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
8a4858bdcf Core/Handlers: Spell handler no longer downranks otherwise-negative spells because they have a potentially-positive aura effect. Closes #22153. 2018-07-19 12:46:31 +02:00
Treeston
2ef9d301f0 Misc: Pass std::chrono types by value everywhere. 2018-07-18 17:48:15 +02: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
Shauren
2fd9dc2edb Core/Scripts: Fixed ENSURE_AI assertion failures when used in Reset()/InitializeAI() hooks with hotswap
Updates #20727
2018-02-05 20:52:19 +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
Aokromes
7ed36d353a Core/Scripting: remove long time dead code 2017-09-11 18:03:57 +02:00
Yehonal
4ee16fb536 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
2017-08-22 21:24:22 +02:00
ccrs
7fff83d675 Core/Movement: waypoint movement (#20121)
Following the work done in #19361 this is the cleanup and improvement of the related logic of waypoint management.

Ref 28050f3 #18020
(taking the good parts and ignoring the incomplete work)
2017-08-12 01:40:25 +02: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
treeston
aeaa8ecfab Fix an issue where CanSpawn would never get invoked on creatures without per-guid script. 2017-05-31 14:03:48 +02:00
DoctorKraft
04dfd78dac Core/Hotswap: Fix Reload on Linux
* Closes #19465
2017-05-23 18:17:40 +02:00
Shauren
cb5d22a6cb Core/Hotswap: Replace #ifdef conditions with comparisons of values defined in CompilerDefs.h
(cherry picked from commit 43510a258c)
2017-05-23 18:16:02 +02:00
ForesterDev
abea8bf4cb Core/Defines: define faction templates and replace magic numbers from scripts 2017-05-23 12:30:27 +02: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
S.V
f3d795d8dd Core/ScriptReloadMgr: Fixed scripts hot swapping on OS X (#19365) 2017-03-31 23:10:18 +02:00
Aokromes
0999ef0b77 Core/Scripts: Add support for spawn specific C++ scripts
By Krudor
2017-03-26 13:32:28 +02: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
ariel-
57798b649c Core/Scripts: fix dynamic build 2017-02-06 21:32:40 -03:00