azerothcore / mod-eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io/
GNU General Public License v3.0
96 stars 126 forks source link

feature: Add GetGlyph #178

Closed Tralenor closed 2 months ago

Tralenor commented 3 months ago

adds player:GetGlyph(slotIndex) (requested by @55Honey in https://github.com/azerothcore/mod-eluna/issues/152#issuecomment-1669529044_)

how to test

add a scripting file with:

local function OnPlayerCommand(event, player, command)
  if (command == "add_glyph") then
        print("reached_command: add glyph")
        player:SetGlyph(190,0)
        player:SetGlyph(702,3)

        player:Say("glyph in slot 0: "..player:GetGlyph(0),0)

        player:Say("glyph in slot 1: "..player:GetGlyph(1),0)

        player:Say("glyph in slot 3: "..player:GetGlyph(3),0)
        return false
    end
end

RegisterPlayerEvent(42, OnPlayerCommand)

On a paladin execute command ".add_glyph" in chat Check that output matches input as written in script (190,0,702)

also credit to @kissingers who created a PR on this topics on the same day. https://github.com/azerothcore/mod-eluna/pull/177

kissingers commented 3 months ago

Good, so I can call back my pull...

Tralenor commented 3 months ago

Good, so I can call back my pull...

@kissingers Oh sorry, I did not see that you created one yesterday as well. If you prefer I can close this one and you could re-open yours.

kissingers commented 3 months ago

It seems your code and doc more good than me, so need not re-open.

55Honey commented 2 months ago

Thanks for the PR!