skyrim-multiplayer / skymp

Multiplayer Mod & TypeScript SDK for Skyrim Special Edition
Other
221 stars 75 forks source link

feat(skymp5-server): add onReadBook event #2212

Closed Pospelove closed 2 weeks ago

Pospelove commented 2 weeks ago

[!IMPORTANT] Adds ReadBookEvent to handle book reading in MpActor, updating learned spells and logging events.

  • Behavior:
    • Introduces ReadBookEvent to handle book reading in MpActor::ReadBook().
    • Logs error if book form not found and logs unimplemented skill book handling.
    • Updates actor's learned spells if the book teaches a spell.
  • Event Handling:
    • ReadBookEvent class added with methods GetName(), GetArgumentsJsonArray(), SpellLearned(), and OnFireSuccess().
    • OnFireSuccess() checks if the spell is already learned and updates the change form.
  • Misc:
    • Removes previous book reading logic from MpActor::ReadBook() and replaces it with ReadBookEvent firing.

This description was created by Ellipsis for 8039acb61329fcb760b78a8c9fbea36e4c0c74b4. It will automatically update as commits are pushed.