mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna change sendmail not req sender
This commit is contained in:
@@ -926,15 +926,15 @@ namespace LuaGlobalFunctions
|
|||||||
int SendMail(lua_State* L)
|
int SendMail(lua_State* L)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
std::string subject = luaL_checkstring(L, ++i);
|
std::string subject = sEluna->CHECKVAL<std::string>(L, ++i);
|
||||||
std::string text = luaL_checkstring(L, ++i);
|
std::string text = sEluna->CHECKVAL<std::string>(L, ++i);
|
||||||
uint32 receiverGUIDLow = luaL_checkunsigned(L, ++i);
|
uint32 receiverGUIDLow = sEluna->CHECKVAL<uint32>(L, ++i);
|
||||||
Player* senderPlayer = sEluna->CHECKOBJ<Player>(L, ++i);
|
uint32 senderGUIDLow = sEluna->CHECKVAL<uint32>(L, ++i, 0);
|
||||||
uint32 stationary = luaL_optunsigned(L, ++i, MAIL_STATIONERY_DEFAULT);
|
uint32 stationary = sEluna->CHECKVAL<uint32>(L, ++i, MAIL_STATIONERY_DEFAULT);
|
||||||
uint32 delay = luaL_optunsigned(L, ++i, 0);
|
uint32 delay = sEluna->CHECKVAL<uint32>(L, ++i, 0);
|
||||||
int32 argAmount = lua_gettop(L);
|
int argAmount = lua_gettop(L);
|
||||||
|
|
||||||
MailSender sender(MAIL_NORMAL, senderPlayer ? senderPlayer->GetGUIDLow() : 0, (MailStationery)stationary);
|
MailSender sender(MAIL_NORMAL, senderGUIDLow, (MailStationery)stationary);
|
||||||
MailDraft draft(subject, text);
|
MailDraft draft(subject, text);
|
||||||
|
|
||||||
#ifndef MANGOS
|
#ifndef MANGOS
|
||||||
@@ -961,7 +961,7 @@ namespace LuaGlobalFunctions
|
|||||||
luaL_error(L, "Item entry %d has invalid amount %d", entry, amount);
|
luaL_error(L, "Item entry %d has invalid amount %d", entry, amount);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (Item* item = Item::CreateItem(entry, amount, senderPlayer ? senderPlayer : 0))
|
if (Item* item = Item::CreateItem(entry, amount))
|
||||||
{
|
{
|
||||||
#ifdef MANGOS
|
#ifdef MANGOS
|
||||||
item->SaveToDB();
|
item->SaveToDB();
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void RegisterGlobals(lua_State* L)
|
|||||||
lua_register(L, "Kick", &LuaGlobalFunctions::Kick); // Kick(player) - Kicks given player
|
lua_register(L, "Kick", &LuaGlobalFunctions::Kick); // Kick(player) - Kicks given player
|
||||||
lua_register(L, "Ban", &LuaGlobalFunctions::Ban); // Ban(banMode(integer), nameOrIP(string), duration(string), reason(string), player(whoBanned)) - Banmode: 0 account, 1 character, 2 IP
|
lua_register(L, "Ban", &LuaGlobalFunctions::Ban); // Ban(banMode(integer), nameOrIP(string), duration(string), reason(string), player(whoBanned)) - Banmode: 0 account, 1 character, 2 IP
|
||||||
lua_register(L, "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers); // SaveAllPlayers() - Saves all players
|
lua_register(L, "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers); // SaveAllPlayers() - Saves all players
|
||||||
lua_register(L, "SendMail", &LuaGlobalFunctions::SendMail); // SendMail(subject, text, receiverLowGUID[, sender, stationary, delay, itemEntry, itemAmount, itemEntry2, itemAmount2...]) - Sends a mail to player with lowguid. use nil to use default values on optional arguments. Sender is an optional player object. UNDOCUMENTED
|
lua_register(L, "SendMail", &LuaGlobalFunctions::SendMail); // SendMail(subject, text, receiverLowGUID[, senderLowGUID, stationary, delay, itemEntry, itemAmount, itemEntry2, itemAmount2...]) - Sends a mail to player with lowguid. use nil to use default values on optional arguments. UNDOCUMENTED
|
||||||
lua_register(L, "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath); // AddTaxiPath(pathTable, mountA, mountH[, price, pathId]) - Adds a new taxi path. Returns the path's ID. Will replace an existing path if pathId provided and already used. path table structure: T = {{map, x, y, z[, actionFlag, delay, arrivalEvId, departEvId]}, {...}, ...} UDOCUMENTED
|
lua_register(L, "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath); // AddTaxiPath(pathTable, mountA, mountH[, price, pathId]) - Adds a new taxi path. Returns the path's ID. Will replace an existing path if pathId provided and already used. path table structure: T = {{map, x, y, z[, actionFlag, delay, arrivalEvId, departEvId]}, {...}, ...} UDOCUMENTED
|
||||||
lua_register(L, "AddCorpse", &LuaGlobalFunctions::AddCorpse); // AddCorpse(corpse) - Adds the player's corpse to the world. More specifically, the cell.
|
lua_register(L, "AddCorpse", &LuaGlobalFunctions::AddCorpse); // AddCorpse(corpse) - Adds the player's corpse to the world. More specifically, the cell.
|
||||||
lua_register(L, "RemoveCorpse", &LuaGlobalFunctions::RemoveCorpse); // RemoveCorpse(corpse) - Removes the player's corpse from the world.
|
lua_register(L, "RemoveCorpse", &LuaGlobalFunctions::RemoveCorpse); // RemoveCorpse(corpse) - Removes the player's corpse from the world.
|
||||||
|
|||||||
Reference in New Issue
Block a user