Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(LuaEngine/GlobalMethods): add GetGossipMenuOptionLocale, GetMapEntrance #233

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

iThorgrim
Copy link

@iThorgrim iThorgrim commented Jan 24, 2025

This pull request introduces 2 new methods in mod-Eluna, enabling developers to retrieve specific localized gossip_menu option and box_text, get map entrance position.

New Methods

  1. GetMapEntrance: Returns the entrance position (x, y, z, o) for a specified map ID.
  2. GetGossipMenuOptionLocale: Retrieves the localized OptionText and BoxText for a specific gossip menu option. Falls back to the default text if the specified locale is unavailable.

Code Highlights

Example: Get Localized Gossip Text

local optionText, boxText = GetGossipMenuOptionLocale(1, 2, 3)
print(optionText, boxText)

Example: Retrieving Map Entrance position

local x, y, z, o = GetMapEntrance(571)
print(x, y, z, o)

Test performed :

local function OnPlayerLogin(event, player)
    local optionText, boxText = GetGossipMenuOptionLocale(10084, 0, 0)
    print("Option Menu Locale", optionText, boxText)

    optionText, boxText = GetGossipMenuOptionLocale(10084, 0, 2)
    print("Option Menu Locale", optionText, boxText)

    local x, y, z, o = GetMapEntrance(615)
    print("Map Entrance Position", x, y, z, o)

    player:Teleport(615, x, y, z, o)
end
RegisterPlayerEvent(3, OnPlayerLogin)

Results:
image

Desktop.2025-01-24.18-46-10.mp4

src/LuaEngine/methods/GlobalMethods.h Outdated Show resolved Hide resolved
@55Honey 55Honey changed the title Feat(LuaEngine/GlobalMethods): Add GetGossipMenuOptionLocale, GetMapEntrance feat(LuaEngine/GlobalMethods): add GetGossipMenuOptionLocale, GetMapEntrance Feb 5, 2025
@55Honey 55Honey merged commit 7621ace into azerothcore:master Feb 5, 2025
2 checks passed
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.

2 participants