azerothcore-wotlk
azerothcore-wotlk copied to clipboard
feat(Scripting/Hooks): Add OnBeforeOpenItem Hook
Changes Proposed:
- Add OnBeforeOpenItem hook to allow items like Magically Wrapped Gift to be controlled before opening.
Issues Addressed:
- None
SOURCE:
Tests Performed:
- Tested without any modules to ensure items still open correctly.
- Tested with custom module that allows certain items to open and others to fail.
How to Test the Changes:
- Compile my module with the core.
- Enable it in the config.
- .additem 21363 - this item should open normally.
- .additem 34077 - this item should fail to open and report
OnBeforeOpenItem::FAIL
- .additem 41426 - this item should succeed to open and report
OnBeforeOpenItem::SUCCESS
Known Issues and TODO List:
- None
How to Test AzerothCore PRs
When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].
You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:
http://www.azerothcore.org/wiki/How-to-test-a-PR
REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).
For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.