EverWrath/src/server/scripts/Spells
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
..
spell_dk.cpp feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243) 2024-02-10 12:25:00 -03:00
spell_druid.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spell_generic.cpp feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243) 2024-02-10 12:25:00 -03:00
spell_hunter.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spell_item.cpp feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243) 2024-02-10 12:25:00 -03:00
spell_mage.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spell_paladin.cpp feat(Core/Unit): New helper HasActivePowerType and script hook OnPlayerHasActivePowerType (#18293) 2024-02-09 06:27:02 -03:00
spell_priest.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spell_quest.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spell_rogue.cpp fix(Scripts/Rogue): Fix Vanish not granting stealth (#18155) 2024-01-12 02:28:32 -03:00
spell_shaman.cpp feat(Core/Unit): New helper HasActivePowerType and script hook OnPlayerHasActivePowerType (#18293) 2024-02-09 06:27:02 -03:00
spell_warlock.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spell_warrior.cpp feat(Core/Scripting): move all script objects to separated files (#17860) 2023-12-02 21:13:20 +01:00
spells_script_loader.cpp feat(License): add new headers information about license (#7941) 2021-09-30 13:40:52 +07:00