diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 2232e63..f70c071 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -667,9 +667,7 @@ ElunaRegister PlayerMethods[] = { "SendTaxiMenu", &LuaPlayer::SendTaxiMenu }, // :SendTaxiMenu(creature) - Sends flight window to player from creature { "RewardQuest", &LuaPlayer::RewardQuest }, // :RewardQuest(entry) - Gives quest rewards for the player { "SendAuctionMenu", &LuaPlayer::SendAuctionMenu }, // :SendAuctionMenu(unit) - Sends auction window to player. Auction house is sent by object. -#ifdef WOTLK - { "SendMailMenu", &LuaPlayer::SendMailMenu }, // :SendMailMenu(object) - Sends mail window to player from gameobject -#endif + { "SendShowMailBox", &LuaPlayer::SendShowMailBox }, // :SendShowMailBox([guid]) - Sends mail window to player. Sent by guid if provided (valid mailbox required for < wotlk) { "StartTaxi", &LuaPlayer::StartTaxi }, // :StartTaxi(pathId) - player starts the given flight path { "GossipSendPOI", &LuaPlayer::GossipSendPOI }, // :GossipSendPOI(X, Y, Icon, Flags, Data, Name) - Sends a point of interest to the player { "GossipAddQuests", &LuaPlayer::GossipAddQuests }, // :GossipAddQuests(unit) - Adds unit's quests to player's gossip menu diff --git a/PlayerMethods.h b/PlayerMethods.h index 9a6e7be..b79f5d8 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -1333,17 +1333,19 @@ namespace LuaPlayer } #endif -#ifdef WOTLK - int SendMailMenu(lua_State* L, Player* player) + int SendShowMailBox(lua_State* L, Player* player) { - GameObject* object = sEluna->CHECKOBJ(L, 2); + uint64 guid = sEluna->CHECKVAL(L, 2, player->GET_GUID()); +#if (defined(CLASSIC) || defined(TBC)) WorldPacket data(SMSG_SHOW_MAILBOX, 8); - data << uint64(object->GetGUIDLow()); + data << uint64(guid); player->GetSession()->HandleGetMailList(data); +#else + player->GetSession()->SendShowMailBox(ObjectGuid(guid)); +#endif return 0; } -#endif #ifndef CATA #ifndef CLASSIC