Commit Graph

157 Commits

Author SHA1 Message Date
iThorgrim
e28384b059 feat(Core/Scripting): Add new hooks for Ticket (#21238) 2025-02-17 03:26:05 +01:00
Exitare
98ceb1c067 fix(Core/PlayerScript) Align player script function names (#21020)
Co-authored-by: sudlud <sudlud@users.noreply.github.com>
2025-02-16 14:59:41 +01:00
iThorgrim
971ebcae31 feat(Core/Scripting): Add Player skill based hook (#21273)
Co-authored-by: IntelligentQuantum <IntelligentQuantum@ProtonMail.Com>
Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
2025-02-15 23:10:38 +01:00
Takenbacon
ee69a569c4 fix(Core/Grids): Grid improvements (#20955) 2025-02-14 22:11:27 +01:00
iThorgrim
054018232c feat(Core/Scripting): Add new hook OnUnitSetShapeshiftForm (#21235) 2025-02-04 07:41:29 +01:00
iThorgrim
c53112d820 Feat(Core/Scripting): Add new hook CanPlayerResurrect to simplify HardCore mod etc. (#21272) 2025-02-03 18:28:19 +01:00
iThorgrim
90566589b0 feat(Scripting/Spell): Add new hooks for Spell (OnSpellCast, OnSpellPrepare, OnSpellCancel) (#21149) 2025-01-18 12:26:39 -03:00
Exitare
7fd8b04a56 feat(Core/Motd): Allow localized motd (#20542)
* Initial commit for localized motd

* Rename function that created world packages

* Update to satisfy code check

* Update code to accomodate localized motd

* Update command to support multiple optionales & adjusted db

* Code cleanup

* Update sql name

* Fix codestyle issues

* Remove hardcoded schema

* Add check for valid player in reload command

* Update to better code style

* Add missing include

* Fix redundant code usage

* Add missing include

* Remove sql files and create new rev sql files

* Address minor code reviews

* Fix code style

* Update code to address code revisions.

- Remove two unused functions
- Remove map
- Use available function to resolve LocaleConstant

* Fix code style

* Add check for base motd and update locale to DEFAULT_LOCALE

* Code docs

* Removed some docs, readd defaultd motd formatting

* Fix oversight in variable declaration

* Code style fix

* Update code based on code review

* ready for merge

* Fix set motd command due to changes to DEFAULT_LOCALE

* Fix CI

* Fix trailing whitespace

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
2024-12-15 19:50:02 +01:00
Benjamin Jackson
53cd41b938 feat(Core/Scripting): Add hook during command security evaluation. (#20564) 2024-11-14 17:14:28 -03: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
Francesco Borzì
2ce2c8cf3a refactor(src/server/game/*): remove unused imports (big part 3) (#20315) 2024-10-27 13:10:28 +01:00
Stefano Borzì
d17c179c03 chore: remove unused hooks (#19919) 2024-09-11 11:50:59 -03:00
Stefano Borzì
f6e9bd51fd feat(ScriptMgr): add OnArenaStart hook (#19922) 2024-09-11 11:18:36 -03:00
Stefano Borzì
0dd5c6e3b4 feat(Battlegrounds): make it compatible with custom arena type (#18679)
* feat(Battlegrounds): make it compatible with custom arena type

* fix(BattlegroundQueue.cpp): ignore bg for arena condition

* feat(Scripting): add OnQueueUpdateValidity hook

* fix: codestyle
2024-09-08 20:05:58 +02:00
Stefano Borzì
e5e514bbbe feat(Core/Scripting): add OnBeforeArenaCheckWinConditions hook for mod-arena-replay compatibility (#19856) 2024-09-04 10:33:38 -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
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
sudlud
60be029e4c fix(Core/Scripting): fix OnBeforeCreateInstanceScript hook (#19252)
- to me this hook should obviously provide an option to overwrite
  the InstanceScript pointer
- this is e.g. beeing used by mod-eluna (but currently broken)
2024-07-03 14:54:45 -03:00
AnchyDev
e0cf15db93 fix(Scripts/Misc) CanExecuteCommand renamed and moved to be executed for all commands. (#19081)
* Fix CanExecuteCommand only being executed on command failure.

* Updated for style guide.

* Removed pointless hook call.

* Modified the name of the hook to better reflect function and moved the call to trigger for non-existent commands.

* Updated to OnTryExecuteCommand because Foe has a special place in my heart.

* Forgot to change these 2 areas.
2024-06-17 21:39:11 +02:00
silviu20092
3988e9581d feat(core): add hooks for applying item mods (#18760) 2024-05-18 10:02:57 +02:00
Anton Popovichenko
3a6231cb65 fix(Core/Scripts): Fix build and crash when calling uninitialized scripts (#18718)
fix(Core/Scripts): Fix build and crash when calling uninitialized scripts.
2024-04-12 07:13:37 -03:00
Anton Popovichenko
f792b0d708 feat(Core/Scripts): Optimize PlayerScripts by calling only overridden/implemented functions. (#18672)
* feat(Core/Scripts): Optimize PlayerScripts by calling only overridden/implemented functions.

* Fix codestyle.

* Fix typo

* PLAYERHOOK_END is not a hook

* Address code review feedback.

Co-authored-by: Winfidonarleyan <dowlandtop@yandex.com>

* Codestyle fixes

* Fix typo



Co-authored-by: PkllonG

---------

Co-authored-by: Winfidonarleyan <dowlandtop@yandex.com>
2024-04-11 17:08:30 -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
Elmsroth
b1cf830009 chore(PlayerScript/Hook) : Add CanSetTradeItem Hook in PlayerScript (#18583)
* chore(PlayerScript/Hook) : Add CanSetTradeItem Hook in PlayerScript

* Allowing non traded slots

* Fix typo and codestyle
2024-03-26 21:28:37 -03:00
silviu20092
5b8bc792b8 feat(core): account delete hook (#18605)
Add account delete hook
2024-03-26 20:57:42 -03:00
AnchyDev
1d8c4056b3 feat(Core/Hooks): Add the KillRewarder reference to the OnRewardKillRewarder hook. (#18290)
* Another hackfix attempt at warden payload forcechecks ban fix.

* Revert last commit, interrupt all forcechecks instead of just _dataSent ones.

* Add rewarder parameter to OnRewardKillRewarder hook.

* Undo old warden changes.

* Removed too much!
2024-02-10 21:58:49 +01: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
Nathan Handley
4321b8a4de feat(Core/Scripting): Implement new hook OnBeforePlayerLogout() (#18163)
* new hook OnPlayerPreLogout

* Changed PreLogout to BeforeLogout per review

* Renamed OnPlayerBeforeLogout to OnBeforePlayerLogout per review

---------

Co-authored-by: NathanHandley <nathanhandley@protonmail.com>
2024-01-14 00:10:49 +01: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
Andrew
0fa6a67815 feat(Core/Scripting): Implement AfterInstanceGameObjectCreate() global hook (#17935) 2023-12-03 18:04:16 -03: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
KJack
f417a166bc feat(Core/Scripts): added OnAfterSpecSlotChanged hook (#17637) 2023-11-07 23:46:08 +07:00
KJack
751ffc7c70 feat(Core/Hooks): Add OnAfterDatabaseLoadCreatureTemplates hook (#17621)
* Add OnAfterDatabaseLoadCreatureTemplates hook
- fix issue where the fast template cache was not updated correctly after a CS reload of a single creature template

* Parameter naming tweak to reduce confusion.

* Refactor to streamline fastcache creation, remove threading concerns

* Remove unneeded resize when loading creature templates

* Update fast cache resizing to highest-performing option
2023-10-31 06:58:45 -03:00
Hasn
e644dd949f feat(Core/Scripting): Implement hook OnAfterCalculateLootGroupAmount() (#17456)
Add hook 'OnAfterCalculateLootGroupAmount' to GlobalScript, similar to existing hook 'OnAfterRefCount'. Allows for dynamic modification of the group loot rate
2023-10-08 17:18:44 -03:00
KJack
a23d5ee50d feat(Core/Scripting): Implement OnBeforeCreatureSelectLevel() hook (#17391)
* Add `OnBeforeCreatureSelectLevel()` hook
- allows modules to alter the level of a creature just before it is set

* Fix missing class name.

* Hook should catch even if the level isn't being changed.

* Trim whitespace.

* Revert "Trim whitespace."

This reverts commit 76768d85c0b9878828b71a008e709c1df7ddadc5.

* Fix whitespace
2023-10-01 02:25:06 -03:00
KJack
c25d0b38e8 feat(Core/GameObject): Implement OnGameObjectModifyHealth() hook (#17374) 2023-09-28 22:39:57 +02:00
Tralenor
0796df57ac feat(Core/Player): Addition of a Hook in CanFlyInZone check (#16590)
---------

Co-authored-by: tmoos <tmoos@meteomatics.com>
Co-authored-by: Winfidonarleyan <dowlandtop@yandex.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
2023-09-20 22:40:08 +02:00
Skjalf
8d08a861aa feat(Core/Scripting): Implement OnAllowedToLootContainerCheck() hook (#17209)
* chore(Core/Loot): Move OnAllowedForPlayerLootCheck() hook call up

* Revert "chore(Core/Loot): Move OnAllowedForPlayerLootCheck() hook call up"

This reverts commit f841ef9da313976179fb788d9573ff8ced05ecb9.

* feat(Core/Scripting): Implement OnAllowedToLootContainerCheck() hook

* Update GlobalScript.cpp
2023-09-08 01:52:02 -03:00
Walter Pagani
7f9cdda17b chore(Core/ScriptMgr): Hooks used in mod-aoe-loot (#16589)
* Creating the necessary hooks for the loot aoe

* update hook

* Typing error

* Method name and add documentation

* codestyle

* Misc. fixes
2023-06-24 08:23:23 -03:00
Žan Skamljič
ee3ab6fe2a chore(Core/ScriptMgr): Add Hooks for profession skill gains (#16526) 2023-06-19 16:12:20 -03:00
Walter Pagani
c676a82837 chore(Core/ScriptMgr):Add Hook OnBeforeFillQuestLootItem (#16509)
* chore(Core/ScriptMgr):Add Hook OnBeforeLootItem

* Change name. Credit Anchy
2023-06-13 08:10:35 -03:00
AnchyDev
444793346d feat(Core/Hooks): Add parameter to detect XP origin for OnGiveXP hook. (#16109)
Added enum parameter to detect where XP originated from.
2023-05-05 22:39:36 -03:00
ZhengPeiRu21
5af67b384b feat: Add CanPlaceAuctionBid hook (#15154)
* feat: Add CanPlaceAuctionBid hook

* Codestyle fix
2023-04-17 21:06:04 -03:00
55Honey
a1fb48391b feat(Core/Scripting): Implement OnBeforeSetBossState (#14891) 2023-02-07 13:15:17 -03:00
UltraNix
b1bc1c24e4 feat(Core/Scripting): Added new hook: OnInstanceIdRemoved. (#14670)
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Co-authored-by: 55Honey <71938210+55Honey@users.noreply.github.com>
2023-02-04 19:56:20 -03:00
Skjalf
a73d4173df feat(Core/Scripting): Pass SpellInfo through the ModifyPeriodicDamage… (#14360)
feat(Core/Scripting): Pass SpellInfo through the ModifyPeriodicDamageAurasTick() hook
2022-12-24 11:38:21 -03:00
ZhengPeiRu21
7990de44c1 fix(Core): Correct Quest Details Display at Max Level (#13046)
* fix(Core): Quest Details Display at Max Level

* Add OnSetMaxLevel hook
2022-12-20 12:14:53 +01:00