diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index f7cd08b..738127b 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -467,6 +467,7 @@ ElunaRegister PlayerMethods[] = { "GetItemByPos", &LuaPlayer::GetItemByPos }, { "GetItemByEntry", &LuaPlayer::GetItemByEntry }, { "GetItemByGUID", &LuaPlayer::GetItemByGUID }, + { "GetMailItem", &LuaPlayer::GetMailItem }, { "GetReputation", &LuaPlayer::GetReputation }, { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot }, { "GetQuestLevel", &LuaPlayer::GetQuestLevel }, diff --git a/PlayerMethods.h b/PlayerMethods.h index 99d12e6..0dc800f 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -1381,6 +1381,20 @@ namespace LuaPlayer return 1; } + /** + * Returns a mailed [Item] by guid. + * + * @param ObjectGuid guid : an item guid + * @return [Item] item + */ + int GetMailItem(lua_State* L, Player* player) + { + ObjectGuid guid = Eluna::CHECKVAL(L, 2); + + Eluna::Push(L, player->GetMItem(guid.GetCounter())); + return 1; + } + /** * Returns an [Item] from the player by entry. *