Commit Graph

394 Commits

Author SHA1 Message Date
Benjamin Jackson
d6d49a9e45 refactor(Core/ObjectMgr): Implement display probabilities. (#19068)
* Init.

Cherry-picked from TC commits 9d210476e5 and c488fb219a

Co-Authored-By: Traesh <9392905+traesh@users.noreply.github.com>
Co-Authored-By: Shauren <shauren.trinity@gmail.com>

* Add brute data.

Needs validation against what existed before, i.e. Classic change prevention.

* Add validation info for brute data.

* Remove incomplete data queries.

* Requested changes.

* Whitespace.

* Requested change.

Table name.

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Requested change.

Table name.

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Resolve the funny merge conflicts.

I wonder why git blame doesn't work on a file with 20k lines in it that's odd huh champ.

* Remove unused parameter.

* Remove uses of unused parameter.

* Use unused parameter.

Hopefully?

* I will cry.

* Sobbing endlessly.

* Remove comment.

* Adjust table structure query.

Remove length parameters and allow null for build value.

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Adjust column datatype and add check constraint.

---------

Co-authored-by: Traesh <9392905+traesh@users.noreply.github.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
2024-06-16 18:12:16 +02:00
Jelle Meeus
0793a979bb fix(Unit/ProcessTerrainStatusUpdate): prevent removal swimming auras if swimming (#18902)
* do not remove swimming auras if we are swimming

* refactor to isSwimming()

* Update src/server/game/Entities/Unit/Unit.cpp

Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>

---------

Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
2024-05-29 20:17:25 +02:00
Jelle Meeus
ac203da3d3 fix(Core/Unit): SPELLMOD_RESIST_MISS_CHANCE should decrease miss chance (#18849)
fix: hitchance should decrease misschance
2024-05-11 13:51:17 +01:00
Anton Popovichenko
1f640c9872 feat(Core/Optimization): Optimize build of units update object by leveraging cache (#18637)
* feat(Core/Optimization): Optimize build of units update object by leveraging cache.

* Remove whitespaces.

* Add alternative hooks to handle transmog and other similar things.

* Fix build on some compilers.

* Fix codestyle

* Fix build again.

* Take into account updateType.
2024-04-05 08:03:11 +02:00
Anton Popovichenko
73340b94e3 feat(Core/Compression): Move packets compression from map to network thread (#18602)
* feat(Code/Compression): Move packets compression from map to network thread.

* Code style fix

* Remove unicode letter
2024-03-28 08:57:29 -03:00
Nathan Handley
df33a57b78 feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243)
* Class Comparison Logic Encapsulation - Parity

* Add Context to IsClass

* Add Unit IsClass script hook

* Replace additional getClass with IsClass

* Update CanUseItem to replace getClass with IsClass

* Add separate context for pet vs ability

* Change Create to Init since not all referenced contexts are creation

* Align spacing in ClassContext

* Drop context on LFGManager max power

* Update IsClass context that wraps around Missle Barrage

* Rename context for swapping weapons

* Be more specific than CLASS_CONTEXT_TALENT

* Remove duplicate context

* Moved IsClass Hook to Player

* Removed unused parameter in virtual base function

* Added maybe_unused to IsClass virtual in order to compile

To match the override signature, the virtual base needs to include the parameter in question, so using [maybe_unused] to signal to the compiler to allow it

* Remove extra blank line

* Add ABILITY_REACTIVE context

* Add context for PET_CHARM

* Remove explicit nullopt check per review

* Code Readability - Change if to if else in pet

Due to the return pattern, this doesn't change functionality in any way

* Add OnPlayer to disambiguate

---------

Co-authored-by: NathanHandley <nathanhandley@protonmail.com>
2024-02-10 12:25:00 -03:00
Nathan Handley
425a490a7b feat(Core/Unit): New helper HasActivePowerType and script hook OnPlayerHasActivePowerType (#18293)
* Create HasActivePower for script intercept

* Replace relevant player-related getPowerType() comparators with HasActivePowerType

* Change OnPlayerHasActivePowerType to regular bool instead of optional

---------

Co-authored-by: NathanHandley <nathanhandley@protonmail.com>
2024-02-09 06:27:02 -03:00
Tereneckla
4cfad0ffac fix (Core/Unit) Apply Capacitor cooldown on trigger proc instead of on stack add (#18189)
fix capacitor cooldown
2024-01-20 08:51:49 -03:00
Alethrion
b2fcc1babf fix(Core/Unit): Remove delay for Conflagrate aura state (#18068)
Removes ConflagrateAuraStateDelayEvent

Cherry-picked from: e27c385b48

Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com>
2024-01-01 07:59:23 -03:00
IntelligentQuantum
9f1abf1214 chore(Core/Entities): remove useless includes (#17994) 2023-12-12 01:36:35 -03:00
Tristan 'Natrist' Cormier
ac676f87ab chore(Core/Player): remove unused AnticheatSetSkipOnePacketForASH() function (#17947) 2023-12-09 01:09:52 +01:00
Winfidonarleyan
eb1ecc38a5 feat(Core/Scripting): move all script objects to separated files (#17860)
* feat(Core/Scripts): move all script objects to separated files

* Apply 5bfeabde81

* try gcc build

* again
2023-12-02 21:13:20 +01:00
Kitzunu
5bfeabde81 chore(Core/Misc): rename spellInfo pointers (#17914)
* Rename all
2023-12-02 06:03:15 -03:00
Tristan 'Natrist' Cormier
4c94f62144 chore(Core/Account): move AccountMgr::IsGMAccount() to class WorldSession (#17845) 2023-11-28 21:44:48 +01:00
Andrew
d55b6753c9 feat(Core/Scripting): Implement Unit hooks to modify damage before ca… (#17785) 2023-11-18 23:36:59 -03:00
Winfidonarleyan
e90d7a2f92 chore(Core/Misc): sort includes (#17776)
* chore(Cleanup): sort includes

* fix build

* fix build again
2023-11-18 17:51:26 +01:00
Andrew
c4722de46a fix(Scripts/Karazhan): Fix Temptation target (#17710) 2023-11-14 20:09:25 -03:00
Andrew
5a4fdc7de4 fix(Core/Spells): Banish should only be dispelled by Mass Dispel (#17703)
* fix(Core/Spells): Banish should only be dispelled by Mass Dispel

* Update Unit.cpp

* Update Unit.cpp
2023-11-14 16:27:37 +01:00
Kitzunu
bbadc32bea Revert Visibility Notifier changes (#17682)
* Revert "fix(Core/Grid): Implement missing GridUnload setting (#17569)"

This reverts commit 79b39f9655.

* Revert "fix(Core/Grid): Address bugs and performance issues introduced by visibility notifier implementation (#17480)"

This reverts commit 60e27511c5.

* Revert "fix(Core): GridCleanUpDelay Log (#17436)"

This reverts commit 90b16ca065.

* Revert "feat(Core/Grids): Implement visibility notifier (#15919)"

This reverts commit 2779833768.
2023-11-12 00:48:49 +01:00
Ludwig
ef09d4b63f fix(Core/Unit): Implement GetDisplayRace() (#17609) 2023-11-08 19:19:38 +01:00
Kitzunu
f757e93da5 refactor(Core/Misc): Make DeathState enum class (#17607) 2023-10-28 10:54:03 +02:00
AG
79b39f9655 fix(Core/Grid): Implement missing GridUnload setting (#17569)
* Implement GridUnload setting

* Minor fixes

- Use GetOption instead of deprecated GetBoolDefault.
- Added a missing check for instances in LoadMap
- Replaced some numbers with global defines

* Possible crashfix + minor improvements

- Initialized initialOrientation which I had forgotten (likely cause of crash)
- Readded a previous check in UpdateSplineMovement
- Made i_objectsToRemove and i_worldObjects tos sets as they were previously, instead of unordered_set.

* Update worldserver.conf.dist

* Fix high CPU usage with preload grid enabled.

This should be it.
2023-10-26 19:32:15 -03:00
AG
60e27511c5 fix(Core/Grid): Address bugs and performance issues introduced by visibility notifier implementation (#17480)
* Bug fixes

- Corrected std::chrono from seconds to milliseconds
- Got rid of leftover code that caused objects to not show up on time

* Removed logic to set gameobject as active

- More alignement with TC.
- Reduces CPU usage drastically

* Revert back to using time_t instead of std chrono

* Invoke SetNoCreate() method to reduce CPU usage drastically

* Remove setActive from static and motion transports

* Fix performance issues

* Added SetFarVisible to WG and some dungeon scripts

- Also removed setActive(true) from creatures in Wintergrasp. As for gameobjects they are set to active upon being damaged/destroyed and removed from active on rebuild (reset)

* Removed comments related to VISIBILITY_COMPENSATION

* Fix log

* Deleted unused files + corrected a check

* Added missing header

* Removed unused parameter

* Removed another unsued parameter

* Changed vector to set for i_visibleNow

- Changed vector to set for i_visibleNow in VisibleNotifer
- Adjusted HaveAtClient to accept Object*
- Adjusted SendUpdateToPlayer to send createobject packet only if not known to client
2023-10-23 05:37:11 -03:00
Andrew
9935e72341 feat(Core/Unit): Implement OnPowerUpdate() unit script hook (#17560) 2023-10-22 09:14:41 -03:00
avarishd
4e5077ed80 fix(Core/Spells): Script Shaman T8 Elemental 4P Bonus (#17424)
* fix(Core/Spells): Script Shaman T8 Elemental 4P Bonus

* 🧙‍♂️
2023-10-08 09:31:54 -03:00
AG
2779833768 feat(Core/Grids): Implement visibility notifier (#15919)
* Cherry-picked from TrinityCore (unable to find author)
2023-09-28 22:28:28 +02:00
Skjalf
a8e514ea39 fix(Core/Unit): Threat from energize effects should be proportional t… (#17352)
fix(Core/Unit): Threat from energize effects should be proportional to the amount of power gained
2023-09-26 17:30:35 -03:00
Mickaël Mauger
1a84ab6983 fix(Core/Unit): Fix CanSwim method not accurate for players (#17320) 2023-09-23 20:49:20 +02:00
AG
540eda2af9 fix(Core/Unit): Added bluewall AoE check (#17064)
* Added bluewall AoE check

- AoE spells/abilities done by non-flagged players now has no effect on pvp flagged players.

* Crash fix

* Update Unit.cpp

Allow spells with flag "SPELL_ATTR5_IGNORE_AREA_EFFECT_PVP_CHECK" to pass this check.
2023-09-20 22:48:23 +02:00
Francesco Borzì
5d01b700fd refactor(Core): remove unused imports (#17094) 2023-08-28 13:39:43 +02:00
Skjalf
f5e555082e fix(Core/Unit): Fix Arena Preparation aura being removed on player ac… (#16925)
fix(Core/Unit): Fix Arena Preparation aura being removed on player actions
2023-08-08 23:48:20 -03:00
UltraNix
c3acf75618 fix(Core/Spells): Taunt always set proper target while channelling sp… (#13948)
* fix(Core/Spells): Taunt always set proper target while channelling spells.

Fixes #13841

* Update.

* Update.
2023-08-06 03:16:05 +02:00
Kitzunu
ee18f55f63 fix(Scripts/Spells): Convert some Druid spells to SpellScript (#16414)
Co-authored-by: joschiwald <736792+joschiwald@users.noreply.github.com>
2023-06-01 22:04:00 +02:00
天鹿
ab7c12fe41 chore(core): Cleanup code p2 (#16041)
* Update AchievementMgr.cpp

* Update M2Stores.cpp

* Update LFGHandler.cpp

* Update PetHandler.cpp

* Update WaypointMovementGenerator.cpp

* Update ScriptMgr.cpp

* Update SpellAuras.cpp

* Update Spell.cpp

* Update SecretMgr.cpp

* Update SpellScript.cpp

* Update SecretMgr.cpp

* Update Spell.cpp

* Update SpellAuras.cpp

* Add files via upload

* Update PetHandler.cpp

* Update PetHandler.cpp

* Update CalendarMgr.cpp

* Update LFG.h

* Update WaypointMovementGenerator.cpp

* Update MapScripts.cpp

* Update Unit.cpp

* Update SmartScript.cpp
2023-05-13 15:00:29 -03:00
Gultask
64c7c99bda revert(Core/Player): Revert Delayed Damage System (#16246)
* Revert "fix(Core/Spells): Delayed Damage system (#16183)"

This reverts commit d282cce4af.

* Revert "fix: Crash on ProcessDelayedDamages (#16166)"

This reverts commit 3dbdea5e28.

* Revert "fix(core\player): Missing combat animation (#14199)"

This reverts commit a238e5e27b.
2023-05-13 13:50:27 -03:00
Angelo Venturini
d7bdf5f717 fix(Vehicle): Crash (#16184) 2023-05-10 10:32:15 -03:00
Angelo Venturini
d282cce4af fix(Core/Spells): Delayed Damage system (#16183) 2023-05-07 08:58:38 -03:00
Angelo Venturini
3dbdea5e28 fix: Crash on ProcessDelayedDamages (#16166) 2023-05-03 06:27:44 -03:00
M'Dic
1c7ac83a1c feat(Core/Unit): anticheat helper (#16115)
this covers a case with SPELL_AURA_CONTROL_VEHICLE being used. commonly in dk starter spot and northrend.
2023-04-30 01:27:15 +02:00
M'Dic
7e58650cf5 revert(Core): ChrRace.dbc full implementation (#16114)
* revert (core): ChrRace.dbc full implementation

we revert this due to several issues arrising. Although the dbc reading is done in full and correctly. Azerothcore relied on the original handling (althought not propper) for so long that  there is

* revert

* Update remove_charrace_dbc.sql

* Update remove_charrace_dbc.sql

* Update remove_charrace_dbc.sql
2023-04-29 08:23:11 -03:00
M'Dic
a238e5e27b fix(core\player): Missing combat animation (#14199) 2023-04-29 12:27:13 +02:00
M'Dic
3eae4c5713 fix(core/dbc): improve ChrRace DBC handling (#14843)
Cherry pick of https://github.com/TrinityCore/TrinityCore/pull/24508

Co-authored-by: HelloKitty <5829095+HelloKitty@users.noreply.github.com>
2023-04-28 01:29:33 +02:00
UltraNix
790417b1b1 fix(Core/Spells): Fixed somed Druid idols not being modified by spell… (#15452)
fix(Core/Spells): Fixed somed Druid idols not being modified by spell power coefficients.

Fixes #14479
2023-04-22 10:08:01 -03:00
Gultask
b86cf11499 fix(Core/Creature): Adjust IGNORE ASSISTANCE CALL flag to prevent assistance on initial aggro only (#16046)
init
2023-04-20 18:16:31 -03:00
AnchyDev
570c0e8498 fix(Core/Hook): Fix OnAuraRemove not being called for owned auras. (#15930)
* Fix OnAuraRemove hook not being called for owned auras.

* Removed OnAuraRemove from multiple places and moved to singular call.
2023-04-17 22:10:57 -03:00
M'Dic
8aa2a2ac0f chore (core): Clean up (#15977)
* chore (core): Clean up

* Update SmartScript.cpp

* more clean up

* Update boss_xt002.cpp
2023-04-16 21:04:56 -04:00
Kitzunu
5a55cb9522 fix(Core/Spell): Remove channeled auras when caster and target are no… (#15419)
fix(Core/Spell): Remove channeled auras when caster and target are not on the same map

* Chery-pick commit (d23c839998)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2023-04-02 15:36:13 -03:00
UltraNix
1acbb9ee53 fix(Core/Spells): Fixed Spiritual Attunement not working with partial… (#15767)
fix(Core/Spells): Fixed Spiritual Attunement not working with partial overheals.

Fixes #14430
2023-04-02 10:13:16 -03:00
UltraNix
d4f8134b3b fix(Core/Spells): Lightning Overload should not proc off from itself. (#15595)
Fixes #15499
2023-03-29 01:28:00 -03:00
UltraNix
7035e87543 fix(Core/Spells): Shadow Word: Death vs critters. (#15594)
Fixes #14299
2023-03-29 01:27:17 -03:00