Commit Graph

434 Commits

Author SHA1 Message Date
Tereneckla
8e080f1e60 fix(Core/Pet): Remove unnecessary Pet Class reassignments (#20614)
remove unnecessary class assignment
2024-12-01 17:16:13 -03:00
gontrannopier
cf7959238a fix(Core/Players): don't set full heath/mana/rage while Dead (#20723)
fix level up while dead -> check if player is not dead, then update health/mana/rage/..

Co-authored-by: gontrannopier <gontrannopier@gontrannopier.com>
2024-12-01 17:09:26 -03:00
Kitzunu
ed008a8780 refactor(Core/Spells): Add helpers for HasAuraType (#20802) 2024-12-01 08:50:59 -03:00
FingerKnoten
593ca4dae1 fix(Core/Player): properly update m_usedTalentCount (#20232) 2024-11-16 22:31:24 +01:00
silviu20092
87fbdb7967 feat(Core/Scripting): Add hook for applying weapon damage (#20350)
Add hook for applying weapon damage
2024-11-14 05:35:26 -03:00
manstfu
21c5575d1a fix(Core/Player): Nerfing Heirloom Weapons Damage (#20357)
Fixing heirloom damage

Co-authored-by: ariel- <ariel-@users.noreply.github.com>
2024-11-13 21:53:03 +01:00
Jelle Meeus
3565e4a9eb feat(Core/WorldState): improved WorldState scripting (#20141)
* implement world state script

based on
0b87ca9d9e

Co-authored-by: killerwife <killerwife@gmail.com>

* refactor to use onleave and onenter instead of spell_area

allows players to right click remove adal's buff

* add MapMgr.h

* refactor: use condition enum instead of uint32, prefix WORLD_STATE where needed

* remove lock from WorldState::Update

sWorldState->Update() is only called from World::Update

* remove unsafe SmartAI action of setWorldState

---------

Co-authored-by: killerwife <killerwife@gmail.com>
2024-11-12 12:15:27 -03:00
Angelo Venturini
47c61b2576 fix(Core/BG): Fix double method call on removing a player (#20156) 2024-10-24 09:12:29 -03:00
Stefano Borzì
f6de601ddd new BattlegroundDesertionTypes for hook OnBattlegroundDesertion (#20039)
* new BattlegroundDesertionTypes for hook OnBattlegroundDesertion

* chore: minor improvements

---------

Co-authored-by: laasker <79991768+laasker@users.noreply.github.com>
2024-09-27 22:19:56 +02:00
IntelligentQuantum
985410f184 feat(Core/Items): Delete old item id from recovery item (#18332) 2024-09-22 08:32:16 +02:00
Kitzunu
386aea03ee chore(Core/Misc): Some cleanup (#19970)
* remove weird blanks

* update if

* ) ) to ))

* missed some ) )

* now switch

* .
2024-09-21 19:34:31 +02:00
Jelle Meeus
8d7463c670 fix(Core/PlayerStorage): Equip OH, 2H, Titan's Grip weapon swapping (#19884)
titan's grip, unequip with full bags
2024-09-13 16:15:25 -03:00
Benjamin Jackson
1edac37ac3 refactor(Core): Make more use of helpers. (#19835)
* Init.

* Reword.

* Update codestyle script.

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Add gameobject type ID check, reorder checks.

* Add helper/codestyle check for unit type.

* `IsUnit()` -> `IsCreature()`

* Add `IsUnit()` method.

* Use type mask.

https: //github.com/TrinityCore/TrinityCore/commit/cc71da35b5dc74abf71f8691161525a23d870bb5
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com>

* Replace instances of `isType` with `IsUnit`.

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
2024-09-03 14:41:31 -03:00
Grimdhex
221dbd3fdb chore(Apps/Codestyle): add new codestyle checks for pointers and range loops (#19841)
* chore(Apps/Codestyle): add new codestyle checks for pointers and range loops

* revert a typo
2024-09-03 13:02:38 -03:00
Kitzunu
9af86553c5 chore(Core/Misc): update floor and ceil to std (#19837) 2024-09-03 08:01:00 -03:00
Kitzunu
5d31b9f98f refactor(Core/Item): Add helpers (#19828) 2024-08-31 19:38:50 -03:00
ianmeesters
a83cd03bfb feat(Core/Player): add OnCalculateTalentsPoints hook (#19749)
* playerTalentsHook

* oeps :#

* :#

* does this work?

* make reference

---------

Co-authored-by: Amy Fang <amy@cavemail.ddns.net>
2024-08-30 09:06:07 -03:00
Grimdhex
643362d697 refactor(Core/Object): adds consistency in the use of type object check (#19671) 2024-08-25 09:57:37 -03:00
Grimdhex
7457aef78d refactor(Core/Entities): Cleanup Unit header file (#19622)
* move several enum definitions in a new files

* move more things

* remove the include comment

* move the related code to CharmInfo in this own file

*original idea of Ovahlord

Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com>

* fix clang build errors and few blank lines

* missing forward declaration

* new tentative to fix gcc/clang build

* add several include could be necessary for gcc/clang compilation

* .

* revert some include since the last AC update

* fix some loop inconsistencies

* align all enums in UnitDefine.h

---------

Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
2024-08-15 05:12:44 -03:00
Francesco Borzì
02a05fbd4c refactor(src/common): remove unused imports (#19506)
* refactor(src/common): remove unused imports

* fix: build

* chore: fix build

* chore: size_t -> std::size_t

* chore: fix fuckup from previous commit

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build with std::size_t

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build
2024-07-30 20:06:46 -03:00
Francesco Borzì
54fadbda67 refactor(src/server/game/Entities): remove unused imports (#19507) 2024-07-28 16:39:39 -03:00
Kitzunu
3fbded8f6b refactor(Core/Chat): PSendSysMessage to fmt (#19449)
* refactor(Core/Chat): PSendSysMessage to `fmt`
2024-07-23 23:48:46 +02:00
Kitzunu
3c50b1a135 fix(Core/Player): Vertical Message distance (#19302)
* cherry-pick commit (297541e9c9)

* Get rid of unused param

* Merge SendMessageToSetInRange_OwnTeam into SendMessageToSetInRange

Co-authored-by: Badgersson <83663557+dekz120@users.noreply.github.com>
2024-07-06 10:05:34 -03:00
Kitzunu
385d7fd515 chore(Core/DBC): define unused unknown dbc fields (#19262)
* chore(Core/DBC): define unused unknown dbc fields

* Name unused unknown dbc fields using WDBX and wowdev.wiki

* rename SpellShapeshiftEntry to SpellShapeshiftFormEntry to properly match the DBC used

* rename sSpellShapeshiftStore to sSpellShapeshiftFormStore to properly match the DBC used

* Comment out unused field for GlyphPropertiesEntry

* Comment out unused field for MapEntry

* forgot one

* SpellShapeshiftfmt to SpellShapeshiftFormfmt

* SpellShapeshiftFormEntryfmt
2024-07-04 14:23:25 -03:00
Kitzunu
f96d4c8670 Revert "Add (core\db): Support for Homebind Orientation (#13389)" (#19257)
* Revert "Add (core\db): Support for Homebind Orientation (#13389)"

This reverts commit 2e6f6e26da.

 Changes to be committed:
	modified:   src/server/database/Database/Implementation/CharacterDatabase.cpp
	modified:   src/server/game/DungeonFinding/LFGScripts.cpp
	modified:   src/server/game/Entities/Player/Player.cpp
	modified:   src/server/game/Entities/Player/Player.h
	modified:   src/server/game/Entities/Player/PlayerStorage.cpp
	modified:   src/server/game/Entities/Player/PlayerUpdates.cpp
	modified:   src/server/game/Handlers/CharacterHandler.cpp
	modified:   src/server/game/Handlers/MiscHandler.cpp
	modified:   src/server/game/Handlers/MovementHandler.cpp
	modified:   src/server/game/Maps/Map.cpp
	modified:   src/server/game/Spells/Spell.cpp
	modified:   src/server/scripts/Commands/cs_misc.cpp
	modified:   src/server/scripts/Commands/cs_tele.cpp
	modified:   src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp

 Untracked files:
	data/sql/updates/pending_db_world/rev_1719945200692175000.sql

* Revert "Add (core\db): Support for Homebind Orientation (#13389)"

* whoops
2024-07-02 22:02:15 +02:00
Kitzunu
744067b389 fix(Core/Player): Delete by group (#19015)
* fix(Core/Player): Delete by group

* closes https://github.com/azerothcore/azerothcore-wotlk/issues/19014

Co-Authored-By: trickerer <onlysuffering@gmail.com>

* Update Player.cpp

* fix build

---------

Co-authored-by: trickerer <onlysuffering@gmail.com>
2024-06-06 20:58:43 +02:00
Andrew
2a1d23e520 fix(Scripts/Hyjal): Implement Eternal Silence spell when going into t… (#18960)
fix(Scripts/Hyjal): Implement Eternal Silence spell when going into the Well of Eternity
2024-05-28 01:24:10 +02:00
silviu20092
3988e9581d feat(core): add hooks for applying item mods (#18760) 2024-05-18 10:02:57 +02:00
Anton Popovichenko
f7f1952f4b fix(Core/Player): Fix memory leak. (#18671) 2024-04-05 07:04:55 -03: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
47f9d66874 feat(Core/Optimization): Create index for sSkillLineAbilityStore to speedup search by skillLine. (#18622)
* feat(Core/Optimization): Create index for sSkillLineAbilityStore to speedup search by skillLine.

* Remove whitespace.
2024-04-01 05:50:12 -03:00
Mykhailo Redko
33f951d742 fix(Core/Spells): Fixed work of sobering spells and other improvements for drunk system (#18390)
* fix(Core/Spells): Fix sobering spells and possible uint8 overflow/underflow in SPELL_EFFECT_INEBRIATE handler.

* fix(Core/Spells): Improvements for SPELL_AURA_MOD_FAKE_INEBRIATE handling
2024-03-20 01:45:01 -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
sudlud
1785df7117 fix(Core/Player): Fix Player not starting at full health (#18136)
* fix(Core/Player): Fix Player not starting at full health

* remove first call to UpdateMaxHealth() and SetFullHealth()
2024-01-14 11:07:52 -03:00
Kitzunu
bceb6173c2 fix(Core/Player): Sometimes Player whisper is sent as boss whisper (#18128)
* fix(Core/Player): Sometimes Player emot is sent as boss whisper

* actually change it to whisper as it is boss whisper

* Update Player.cpp
2024-01-07 12:14:20 -03:00
Kitzunu
6202835cff fix(Core/LFG): Hide XP from max players (#18103)
* Cherry-pick Player::IsMaxLevel from TrinityCore
* Correctly hide XP reward for max level players in LFG
* Closes #18101
2024-01-03 19:47:26 +01:00
Andrew
f9f71fff36 fix(Core/Player): Check if the player can summon the warlock pet on B… (#18064)
fix(Core/Player): Check if the player can summon the warlock pet on BG ress
2024-01-01 14:56:32 +01:00
IntelligentQuantum
9f1abf1214 chore(Core/Entities): remove useless includes (#17994) 2023-12-12 01:36:35 -03:00
avarishd
f476c8a6c9 feat(Core/Hooks): Add OnPlayerJustDied hook (#17973)
feat(Core/Hooks): Add OnPlayerJustDied
2023-12-10 19:06:23 -03:00
Tristan 'Natrist' Cormier
ac676f87ab chore(Core/Player): remove unused AnticheatSetSkipOnePacketForASH() function (#17947) 2023-12-09 01:09:52 +01:00
Tristan 'Natrist' Cormier
4c94f62144 chore(Core/Account): move AccountMgr::IsGMAccount() to class WorldSession (#17845) 2023-11-28 21:44:48 +01:00
Kitzunu
f440a7479f fix(Core/Groups): Create the group at first invite (#17869)
* cherry-pick commit (132538db1d)
* cherry-pick commit (250e8d998b)
* part https://github.com/azerothcore/azerothcore-wotlk/issues/11070

Co-authored-by: Treeston <14020072+Treeston@users.noreply.github.com>
2023-11-26 20:34:45 +01: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
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
KJack
f417a166bc feat(Core/Scripts): added OnAfterSpecSlotChanged hook (#17637) 2023-11-07 23:46:08 +07:00
Kitzunu
f757e93da5 refactor(Core/Misc): Make DeathState enum class (#17607) 2023-10-28 10:54:03 +02: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
Hasn
5bf64a164a fix(Core/Player) Stop small durability loss from still occuring when DurabilityLoss options in worldserver.conf are set to 0 (#17407)
Fix durability loss even when "DurabilityLoss"-settings in
worldserver.conf are zeroed
2023-10-21 08:10:34 -03:00
Kitzunu
a4e4d6ddb2 feat(Core/Player): Implement commentator tag (#17449)
* feat(Core/Player): Implement commentator tag

* remove redundant session check
2023-10-08 09:07:17 +02:00