Commit Graph

7419 Commits

Author SHA1 Message Date
Treeston
319ddd9bcd Core/Warden: Warden refactors (PR #25235)
(cherry picked from commit 6116e5b385)
2022-01-26 19:42:11 +01:00
jackpoz
26894508ef Core/Misc: Code cleanup
(cherry picked from commit dd28cecda3)
2022-01-26 19:18:46 +01:00
jackpoz
b3f0d92b81 Scripts/Command: Fix .mmap loc always printing command usage
(cherry picked from commit 0eb49a3cc9)
2022-01-26 19:16:55 +01:00
Jinnaix
169b0296e1 Scripts/BlackwingLair: Suppression Device Room (PR #25199)
Co-authored-by: offl <11556157+offl@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Treeston <treeston.mmoc@gmail.com>
(cherry picked from commit de56ed8736)
2022-01-26 18:51:07 +01:00
Giacomo Pozzoni
ffd85f9139 Scripts/Comamnds: Improve ".debug objectcount" command (#25208)
* Scripts/Comamnds: Improve ".debug objectcount" command

Include the top 5 most common creatures in the map

* Use C++ features to copy data

* Fix build warnings

* Update src/server/scripts/Commands/cs_debug.cpp

Co-authored-by: Shauren <shauren.trinity@gmail.com>

* Update src/server/scripts/Commands/cs_debug.cpp

Co-authored-by: Shauren <shauren.trinity@gmail.com>

* Update src/server/scripts/Commands/cs_debug.cpp

Co-authored-by: Shauren <shauren.trinity@gmail.com>

* Move CreatureCountWorker out of function and use template for unhandled cases

* Code cleanup

Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit bd5e832a64)
2022-01-26 16:22:00 +01:00
jackpoz
a23215c73d Scripts/Kologarn: Apply CREATURE_FLAG_EXTRA_NO_COMBAT on NPC_ARM_SWEEP_STALKER and NPC_RUBBLE_STALKER
(cherry picked from commit 6ad6d9e670)
2022-01-26 14:39:22 +01:00
Gildor
3780c05285 Scripts/Naxxramas: Frogger event improvements (#25202)
* Scripts/Naxxramas: Frogger event improvements
* Prevent Living Poison accumulation
* Now Living Poison cast Explode

* check for a nearby player

* move event to the frogger trigger's AI

* Initialize and removing unnecessary things

* applying suggestions

* remove unnecessary header

* Rename 9999_99_99_99_world.sql to 2020_08_05_00_world.sql

(cherry picked from commit 174ac95800)
2022-01-26 14:38:57 +01:00
Ovahlord
785b6f294f Scripts/World: updated Training Dummy script to modern model and removed pointless GameTime shenanigans
(cherry picked from commit 9bf57958e3)
2022-01-26 14:37:31 +01:00
Carbenium
c302ace100 Scripts/AzjolNerub: Fix potential error in pound spell script
Cast damage spell in AfterEffectApply instead OnEffectHitTarget. This avoids the scenario where we try to apply an aura to a potential dead target.

Ref #21856

(cherry picked from commit 0dd4b685df)
2022-01-26 14:37:05 +01:00
Giacomo Pozzoni
864d775280 Core/Misc: Fix static analysis issues (#25194)
(cherry picked from commit 07fd84b679)
2022-01-26 14:06:40 +01:00
Trond B. Krokli
c324f954ce Scripts/Outland: Convert 'Captain Tyralius' to SAI (#25188)
Closes #24676

(cherry picked from commit 7f2874a7ac)
2022-01-26 13:23:09 +01:00
Peter Keresztes Schmidt
43591bb4d5 Scripts/AzjolNerub: Update Anub'Arak encounter to current coding standards (#25192)
* Scripts/AzjolNerub: Update Anub'Arak to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Darter to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Assassin to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Guardian to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Venomancer to current coding standards

* no functional changes

* Scripts/AzjolNerub: Update Anub'Arak Impale Target to current coding standards

* Scripts/AzjolNerub: Update Anub'Arak Pound spell to current coding standards

* Scripts/AzjolNerub: Update Anub'Arak carrion beetles aura script to current coding standards

(cherry picked from commit dab8768c18)
2022-01-24 22:32:11 +01:00
Peter Keresztes Schmidt
5b1ba7b503 Scripts/Gundrak: Update Slad'ran encounter to current coding standards (#25180)
* Scripts/Gundrak: Update Slad'Ran's script to use TaskScheduler

* No functional changes

* Scripts/Gundrak: Update Slad'Ran's adds to use TaskScheduler

* No functional changes

(cherry picked from commit 7abe9d66d0)
2022-01-24 21:58:00 +01:00
Peter Keresztes Schmidt
35a348dfdb Scripts/Gundrak: Update Drakkari Colossus encounter to current coding standards (#25182)
* Scripts/Gundrak: Update Drakkari Colossus to current coding standards

* no functional changes

* Scripts/Gundrak: Update Drakkari Elemental to current coding standards

* no functional changes

* Scripts/Gundrak: Update Living Mojo to current coding standards

* no functional changes

(cherry picked from commit dd8666f38d)
2022-01-24 21:55:10 +01:00
Peter Keresztes Schmidt
0c65abe7a0 Scripts/MoltenCore: Update Golemagg encounter to current coding standards (#25183)
* Scripts/MoltenCore: Update Golemagg to current coding standards

* no functional changes

* Scripts/MoltenCore: Update Core Ranger to current coding standards

* no functional changes

(cherry picked from commit c88234727b)
2022-01-24 21:54:10 +01:00
Carbenium
7e0fb710ad Scripts/AhnKahet: Update Herald Volazj to current coding standards
* convert to BossAI
* no functional changes

(cherry picked from commit 90543fd41d)
2022-01-24 21:53:52 +01:00
Carbenium
18e5e1ef43 Scripts/AV: Update Vanndar's script to use TaskScheduler
* No functional changes

(cherry picked from commit 799d5376d8)
2022-01-24 21:35:52 +01:00
Carbenium
8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80)
2022-01-24 21:34:36 +01:00
Carbenium
35e0002df3 Core/Common: Add a std::chrono interface to TimeTrackerSmall
New methods:
TimeTrackerSmall(Milliseconds expiry);
void Update(Milliseconds diff);
void Reset(Milliseconds expiry)
Milliseconds GetExpiry() const

Removed methods:
int32 GetExpiry() const

Also add basic unit tests.

Core/Scripts: Use std::chrono interface of TimeTrackerSmall

(cherry picked from commit e55516348d)
2022-01-24 21:25:47 +01:00
Giacomo Pozzoni
61bf51874d Core/Misc: Fix static analysis issues (#25178)
(cherry picked from commit 7cf122fc2a)
2022-01-24 20:21:25 +01:00
Jinnaix
ab7680157b Scripts/BlackrockSpire: Fix encage event of Pyroguard encounter (#25177)
(cherry picked from commit e3aa87641f)
2022-01-24 15:05:20 +01:00
Trond B. Krokli
fa444aca66 Scripts/Quest: Force of Neltharaku quest credit (#24807)
* Scripts/Quest: Force of Neltharaku quest credit

**Description:**

Suggested solution to resolve the kill credit double cast issue
in the quest "The Force of Neltharaku" (10854).

by Rushor

**Changes proposed:**

- Remove duplicate spell casts in the zone quest script
- Remove commented-out script section
- Set a couple of unit flags (anim/stand/hover)
- Move return new creature script override to end of script
- Move PlayerGUID, FlyTimer, and Tapped to Private
- Add DB flight movement control to Enslaved Netherwing Drake
- Add SpellMgr MaxAffectedTargets = 1 for spell 38762
- Add movement enum POINT_MOVE_UP
- Add missing enum for quest ID

**Target branch(es):** 3.3.5/master

- [X] 3.3.5
- [X] master

**Issues addressed:** Closes #24796

**Tests performed:** (Does it build, tested in-game, etc.)

Pending for now.

**Known issues and TODO list:** (add/remove lines as needed)

- [X] Open PR in draft mode until testing is cleared
- [ ] Compile and create local server
- [ ] Test changes on local server

* Rename 9999_99_99_99_world.sql to 2020_07_29_00_world.sql

Co-authored-by: Rushor <Rushor@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
(cherry picked from commit e0dae8feb6)
2022-01-24 13:19:36 +01:00
Carbenium
b3f2ff97ff Core/CreatureAI: std::chrono-ify DoSummon* methods
(cherry picked from commit 1245833cdd)
2022-01-24 13:11:13 +01:00
Carbenium
82fce41852 Core/WorldObject: Replace non-std::chrono SummonGameObject overloads
Also fix intended despawn time of GOs used by the "Engineering a Disaster" quest

(cherry picked from commit 8642aaaf92)
2022-01-24 12:55:43 +01:00
Carbenium
217c2d9ef3 Core/WorldObject: Replace non-std::chrono SummonTrigger overloads
(cherry picked from commit 3620b47c41)
2022-01-24 12:47:56 +01:00
Carbenium
3bba8d50b1 Core/WorldObject: Remove non-std::chrono SummonCreature overload
Remove
TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0);

(cherry picked from commit a41f599be7)
2022-01-24 12:39:59 +01:00
Carbenium
03e4c0d7bf Core/Creature: Remove non-std::chrono overload of DespawnOrUnsummon
(cherry picked from commit 480dee3125)
2022-01-24 12:21:26 +01:00
Carbenium
a7cbb16229 Core/EventProcessor: std::chrono-ify the remaining public API
(cherry picked from commit 1d8782e356)
2022-01-24 12:06:56 +01:00
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 92a02a5c87)
2022-01-24 12:00:35 +01:00
Carbenium
310f996b1d Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0);
to
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s);

(cherry picked from commit 1131229ee9)
2022-01-24 11:55:32 +01:00
Carbenium
27c1f47598 EventMap: Change GetTimeUntilEvent to return std::chrono types
(cherry picked from commit 8cb35b0d5f)
2022-01-23 23:59:46 +01:00
Carbenium
a28bc7faaa Scripts/Kalimdor: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 40efda9726)
2022-01-23 23:59:11 +01:00
Carbenium
38695b0943 Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 5832790428)
2022-01-23 23:58:48 +01:00
Carbenium
271462ceec Scripts/Northrend: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit fc9e7226c0)
2022-01-23 23:57:56 +01:00
Carbenium
58e1c091a2 Scripts/EasternKingdoms: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit d1a39a2ebf)
2022-01-23 23:53:20 +01:00
Shauren
cacdb57c9c Core/Crypto: c++17-ify crypto code cherry picked earlier that was downgraded to c++14 2022-01-23 23:49:34 +01:00
Carbenium
5f5d32888a Core/EscortAI: std::chrono-ify SetPauseTimer
(cherry picked from commit cdaf890af4)
2022-01-23 23:34:52 +01:00
Carbenium
e660b870e9 Core/ScriptedAI: std::chrono-ify DoSpawnCreature
(cherry picked from commit f5076112cb)
2022-01-23 23:33:04 +01:00
Carbenium
da438c73e2 Core/BossAI: Remove _DespawnAtEvade(uint32, Creature*) overload
Use _DespawnAtEvade(Seconds,  Creature*) instead

(cherry picked from commit 27229c10cd)
2022-01-23 23:28:47 +01:00
Carbenium
5f296fb7c7 Core/InstanceScript: std::chrono-ify DoRespawnGameObject
(cherry picked from commit d7ff8c272a)
2022-01-23 23:09:27 +01:00
Trond B. Krokli
cf94f4a8ed Scripts/Borean Tundra: duplicate comment text (#25102)
(cherry picked from commit ebb9e1b4de)
2022-01-23 22:49:11 +01:00
Giacomo Pozzoni
e8583d04f6 Core/Metric: Add more metrics about World::Update() loop (#25098)
* Core/Metric: Add more metrics about World::Update() loop

* Add new Performance profiling grafana dashboard

* Add new cmake setting WITHOUT_METRICS that disables all metrics

As new metrics are added, someone might want to disable them if unused.

* Add more metrics about World::Update() loop

* Remove old performance profiling features

Remove "server set difftime" command, "-RecordUpdateTimeDiffInterval" and "MinRecordUpdateTimeDiff" worldserver config settings and their related code.
The whole UpdateTime class could be removed too.

* Update and rename 2020_07_99_99_world.sql to 2020_07_24_00_world.sql

(cherry picked from commit 3c0ac7302f)
2022-01-23 22:45:25 +01:00
Carbenium
330e7100cb Core/Scripts: Fix timing issue of EVENT_FLY_TO_RANDOM_PILLAR during Illidan encounter
The intention here is to add additional 30 seconds of delay to the current delay of EVENT_FLY_TO_RANDOM_PILLAR.
Instead of EventMap::GetNextEventTime, EventMap::GetTimeUntilEvent has to be used which returns the currently
scheduled delay until the event occurs.
EventMap::GetNextEventTime instead exposes the timer value internal to EventMap at which the event should occur.

(cherry picked from commit f1f251eb38)
2022-01-23 22:19:24 +01:00
Peter Keresztes Schmidt
44ea32ace4 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2022-01-23 22:16:15 +01:00
Peter Keresztes Schmidt
ad340466d0 Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
(cherry picked from commit 85b5b842ca)
2022-01-23 22:02:03 +01:00
Giacomo Pozzoni
fda8a09766 Core/Misc: Replace boost::shared_mutex with std::shared_mutex (#24328)
* Core/Misc: Replace boost::shared_mutex with std::shared_mutex

* Remove std forward declarations

(cherry picked from commit 7032ee0bdb)
2022-01-23 21:51:47 +01:00
Treeston
d11c3807b3 Core/Time: Rename GetGameTime{System, Steady}Point methods
The names are a bit unhandy. Rename them (shorter but still meaningful).

GetGameTimeSystemPoint() -> GetSystemTime()
GetGameTimeSteadyPoint() -> Now()

Also add 2 new typedefs:

typedef std::chrono::steady_clock::time_point TimePoint;
typedef std::chrono::system_clock::time_point SystemTimePoint;

Closes #25042

(cherry picked from commit 896b68d5c2)
2022-01-23 21:36:03 +01:00
Shauren
596bf2b772 Core/Misc: Replace boost::optional with std::optional part 2 2022-01-23 20:31:52 +01:00
Peter Keresztes Schmidt
770fbcca0c Core/Misc: Replace boost::optional with std::optional (#25047)
C++17 is already mandatory, so it's a safe thing to do

(cherry picked from commit 202fd41389)
2022-01-23 18:05:59 +01:00
Shauren
15d59640fa Scripts/World: Use std::chrono::duration overloads of EventMap 2022-01-23 16:39:31 +01:00