Feat(LuaEngine/SpellHooks): Add support for RegisterSpellEvent with initial events #224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request integrates the
RegisterSpellEvent
system from the TrinityCore version of Eluna into AzerothCore, allowing scripts to handle specific spell-related events.Supported Events
SPELL_EVENT_ON_PREPARE
Triggered when a spell is prepared.
Signature:
(event, caster, spell)
SPELL_EVENT_ON_CAST
Triggered when a spell is cast.
Signature:
(event, caster, spell, skipCheck)
SPELL_EVENT_ON_CAST_CANCEL
Triggered when a spell cast is canceled.
Signature:
(event, caster, spell, bySelf)
Example Usage
Test performed :
Results:
![image](https://private-user-images.githubusercontent.com/125808072/405700475-f12a2978-d0fe-4dab-956d-5fdbb4240c62.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjQ3MDYsIm5iZiI6MTczOTI2NDQwNiwicGF0aCI6Ii8xMjU4MDgwNzIvNDA1NzAwNDc1LWYxMmEyOTc4LWQwZmUtNGRhYi05NTZkLTVmZGJiNDI0MGM2Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQwOTAwMDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03YzFkZmQ2NzVhODUxOWNiMDJhMWEyNWE4ODkxNDNhNTBjMTc1MzYzMzIxY2FlYTEwYzJiMjkyMzJjODkwYmI4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.O0756hMkueWqUUyVVz0UsJ-qXDbyTn6h9sNPwFCy_oA)
Desktop.2025-01-22.17-11-52.1.mp4