feat: add PLAYER_EVENT_ON_CAN_SEND_MAIL (#85)
This commit is contained in:
@@ -761,6 +761,11 @@ public:
|
|||||||
{
|
{
|
||||||
return sEluna->OnCanInitTrade(player, target);
|
return sEluna->OnCanInitTrade(player, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 cod, Item* item) override
|
||||||
|
{
|
||||||
|
return sEluna->OnCanSendMail(player, receiverGuid, mailbox, subject, body, money, cod, item);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Eluna_ServerScript : public ServerScript
|
class Eluna_ServerScript : public ServerScript
|
||||||
|
|||||||
@@ -721,6 +721,7 @@ namespace LuaGlobalFunctions
|
|||||||
* PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
|
* PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
|
||||||
* PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea)
|
* PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea)
|
||||||
* PLAYER_EVENT_ON_CAN_INIT_TRADE = 48, // (event, player, target) - Can return false to prevent the trade
|
* PLAYER_EVENT_ON_CAN_INIT_TRADE = 48, // (event, player, target) - Can return false to prevent the trade
|
||||||
|
* PLAYER_EVENT_ON_CAN_SEND_MAIL = 49, // (event, player, receiverGuid, mailbox, subject, body, money, cod, item) - Can return false to prevent sending the mail
|
||||||
* };
|
* };
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ namespace Hooks
|
|||||||
PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
|
PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
|
||||||
PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea)
|
PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea)
|
||||||
PLAYER_EVENT_ON_CAN_INIT_TRADE = 48, // (event, player, target) - Can return false to prevent the trade
|
PLAYER_EVENT_ON_CAN_INIT_TRADE = 48, // (event, player, target) - Can return false to prevent the trade
|
||||||
|
PLAYER_EVENT_ON_CAN_SEND_MAIL = 49, // (event, player, receiverGuid, mailbox, subject, body, money, cod, item) - Can return false to prevent sending the mail
|
||||||
|
|
||||||
PLAYER_EVENT_COUNT
|
PLAYER_EVENT_COUNT
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -477,6 +477,7 @@ public:
|
|||||||
void OnAchiComplete(Player* player, AchievementEntry const* achievement);
|
void OnAchiComplete(Player* player, AchievementEntry const* achievement);
|
||||||
void OnFfaPvpStateUpdate(Player* player, bool hasFfaPvp);
|
void OnFfaPvpStateUpdate(Player* player, bool hasFfaPvp);
|
||||||
bool OnCanInitTrade(Player* player, Player* target);
|
bool OnCanInitTrade(Player* player, Player* target);
|
||||||
|
bool OnCanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 cod, Item* item);
|
||||||
|
|
||||||
#ifndef CLASSIC
|
#ifndef CLASSIC
|
||||||
#ifndef TBC
|
#ifndef TBC
|
||||||
|
|||||||
@@ -599,3 +599,17 @@ bool Eluna::OnCanInitTrade(Player* player, Player* target)
|
|||||||
Push(target);
|
Push(target);
|
||||||
return CallAllFunctionsBool(PlayerEventBindings, key);
|
return CallAllFunctionsBool(PlayerEventBindings, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Eluna::OnCanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid mailbox, std::string& subject, std::string& body, uint32 money, uint32 cod, Item* item)
|
||||||
|
{
|
||||||
|
START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_CAN_SEND_MAIL, true);
|
||||||
|
Push(player);
|
||||||
|
Push(receiverGuid);
|
||||||
|
Push(mailbox);
|
||||||
|
Push(subject);
|
||||||
|
Push(body);
|
||||||
|
Push(money);
|
||||||
|
Push(cod);
|
||||||
|
Push(item);
|
||||||
|
return CallAllFunctionsBool(PlayerEventBindings, key);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user