Commit Graph

32 Commits

Author SHA1 Message Date
天鹿
f203b1b9dc fix(Scripts/PlayerScript): PlayerScript Error (#18806)
Update PlayerScript.cpp
2024-04-29 02:31:14 -03:00
Anton Popovichenko
c796d9291e fix(Core/PlayerScript): Fix adding XP on quest completion and other overlooks. (#18728)
* fix(Core/PlayerScript): Fix adding XP on quest completion.

* Fix other overlooks.
2024-04-12 12:12:57 -03:00
天鹿
97fc546c4b refactor(Core/Scripts): Optimize Script (#18708)
* Add files via upload

* Update PlayerScript.h
2024-04-12 10:50:44 -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
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
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
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
KJack
f417a166bc feat(Core/Scripts): added OnAfterSpecSlotChanged hook (#17637) 2023-11-07 23:46:08 +07: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
Žan Skamljič
cfc15abb16 fix(Scripts/Player): correct the parameter order in OnUpdateGatheringSkill (#16635) 2023-06-27 20:10:44 +02: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
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
Skjalf
6177ce4688 feat(Core/Scripting): Create OnStoreNewItem() hook (#13725) 2022-11-07 00:26:47 -03:00
DavuKnight
d8598c764e feat(core): OnFfaPvpStateUpdate Event (#13023)
* Event for Notification when the Player enters into or Leaves Ffa

* Bug and Formatting Fixes
2022-09-21 08:33:28 -04:00
ZhengPeiRu21
7a137767fa feat(Core): OnBeforeLootMoney hook (#13030) 2022-09-21 08:28:19 -04:00
ZhengPeiRu21
25f88caa42 fix(Core): Correct Post 3.1 Fishing Skill Leveling (#12996) 2022-09-18 22:09:47 -03:00
AnchyDev
9b6a3ee4f9 feat(Scripting/Hooks): Add OnBeforeOpenItem Hook (#12576) 2022-09-06 19:43:32 -03:00
ZhengPeiRu21
80e6a6d781 feat(Core): OnBeforeChooseGraveyard Hook (#12860) 2022-09-06 15:47:37 -03:00
AnchyDev
dcbf224392 feat(Core): Add OnGroupRollRewardItem hook. (#12538)
Added OnGroupRollRewardItem hook.
2022-07-26 21:08:41 -03:00
ZhengPeiRu21
44b7a0666c feat(Scripting/Hooks): implement OnQuestComputeXP() hook (#10934) 2022-03-24 10:27:15 +01:00
Kitzunu
455899dc75 fix(Core/Misc): Change const to be after type name (#10591) 2022-02-14 16:05:45 -03:00
Nefertumm
db09b11524 refactor(Core/Hook): OnPlayerReputationChange (#10471) 2022-02-02 13:05:47 -03:00
Kargatum
fad214efe0 feat(Core/ScriptMgr): replace macro and cleanup (#9598) 2021-12-10 15:05:28 -03:00