Skip to content

Fix: Restore Core Eluna APIs (Gossip/Summon) & Enable Non-destructive Spell Hooks#57

Open
ttklmnt wants to merge 3 commits into
slash-design:masterfrom
ttklmnt:master
Open

Fix: Restore Core Eluna APIs (Gossip/Summon) & Enable Non-destructive Spell Hooks#57
ttklmnt wants to merge 3 commits into
slash-design:masterfrom
ttklmnt:master

Conversation

@ttklmnt

@ttklmnt ttklmnt commented Jun 16, 2026

Copy link
Copy Markdown

This PR restores several critical missing linkages in the 7.3.5 Eluna engine implementation, enabling developers to create complex custom features (such as a "Multi-function Hearthstone Menu") while maintaining strict compatibility with default retail behaviors.

Key Restorations & Fixes:

  1. Gossip Dispatch Restored: Hard-linked sEluna->OnGossipSelect in NPCHandler.cpp. Previously, menu clicks lacking strict Unit data were dropped by the ScriptMgr, causing Eluna gossip scripts to silently fail.
  2. Non-Destructive Spell Interception: Added an OnChat bridge in Spell.cpp to broadcast an internal signal (e.g., Hearthstone 8690 cast initialization).
    • Graceful Fallback: Because this is a passive hook, if no Eluna Lua script intercepts and interrupts the cast, the default spell functions completely normally.
  3. Cooldown Visual Desync Fix: Forced SpellHistory->ResetCooldown in HandleGossipHelloOpcode to clear phantom client-side item cooldowns triggered when Lua scripts manually interrupt items like the Hearthstone.
  4. Summon API Enabled: Ensures functions like SummonCreature work as intended without silent crashes.

Implementation Note:
The primary/core functionalities of the Eluna engine are now robust and stable for major script development. However, please note that some edge-case APIs or minor hooks may still require further patching by the community in the future.

Testing: Compiled and tested in-game. Custom Lua gossip menus now trigger 100% reliably. Vanilla spell casting remains unaffected when Lua scripts are absent.


⚠️ Important Note Regarding Eluna Engine Dependencies:
This PR provides the necessary C++ hooks in the core. However, to fully utilize features like SummonCreature in Lua scripts, modifications to the Eluna Engine source itself were also required (as the default Eluna branch for 7.x lacks/has broken implementations for some entity spawning APIs).

For anyone testing this PR or looking to implement advanced custom menus, I have published the restored Eluna API source files (with the missing Summon functions fixed) in my own repository here:
https://github.com/ttklmnt/Eluna-7.3.5-Fixed

@ttklmnt

ttklmnt commented Jun 26, 2026

Copy link
Copy Markdown
Author

Hi, I noticed the Clang / build check failed. However, the error seems to be caused by an unused parameter pos in Pathfinding.h and some pre-existing OpenSSL deprecation warnings triggered by -Werror. Since these are unrelated to my Bot AI fixes, I didn't modify them to avoid touching the core architecture. Please let me know if you want me to bypass the warning in this PR, or if you will handle it separately. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant