mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -718,6 +718,27 @@ void WorldSession::SendAreaTriggerMessage(const char* Text, ...)
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendAreaTriggerMessage(uint32 entry, ...)
|
||||
{
|
||||
char const* format = GetAcoreString(entry);
|
||||
if (format)
|
||||
{
|
||||
va_list ap;
|
||||
char szStr[1024];
|
||||
szStr[0] = '\0';
|
||||
|
||||
va_start(ap, entry);
|
||||
vsnprintf(szStr, 1024, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
uint32 length = strlen(szStr) + 1;
|
||||
WorldPacket data(SMSG_AREA_TRIGGER_MESSAGE, 4 + length);
|
||||
data << length;
|
||||
data << szStr;
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
uint32 triggerId;
|
||||
|
||||
@@ -679,6 +679,8 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
|
||||
{
|
||||
LootItem& item = quest_items[i];
|
||||
|
||||
sScriptMgr->OnBeforeFillQuestLootItem(player, item);
|
||||
|
||||
// Quest item is not free for all and is already assigned to another player
|
||||
// or player doesn't need it
|
||||
if (item.is_blocked || !item.AllowedForPlayer(player, sourceWorldObjectGUID))
|
||||
|
||||
@@ -590,6 +590,14 @@ void ScriptMgr::OnLootItem(Player* player, Item* item, uint32 count, ObjectGuid
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeFillQuestLootItem(Player* player, LootItem& item)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
{
|
||||
script->OnBeforeFillQuestLootItem(player, item);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnStoreNewItem(Player* player, Item* item, uint32 count)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
|
||||
@@ -1183,6 +1183,9 @@ public:
|
||||
//After looting item
|
||||
virtual void OnLootItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/, ObjectGuid /*lootguid*/) { }
|
||||
|
||||
//Before looting item
|
||||
virtual void OnBeforeFillQuestLootItem(Player* /*player*/, LootItem& /*item*/) { }
|
||||
|
||||
//After looting item (includes master loot).
|
||||
virtual void OnStoreNewItem(Player* /*player*/, Item* /*item*/, uint32 /*count*/) { }
|
||||
|
||||
@@ -2331,6 +2334,7 @@ public: /* PlayerScript */
|
||||
void GetCustomArenaPersonalRating(Player const* player, uint8 slot, uint32& rating) const;
|
||||
void OnGetMaxPersonalArenaRatingRequirement(Player const* player, uint32 minSlot, uint32& maxArenaRating) const;
|
||||
void OnLootItem(Player* player, Item* item, uint32 count, ObjectGuid lootguid);
|
||||
void OnBeforeFillQuestLootItem(Player* player, LootItem& item);
|
||||
void OnStoreNewItem(Player* player, Item* item, uint32 count);
|
||||
void OnCreateItem(Player* player, Item* item, uint32 count);
|
||||
void OnQuestRewardItem(Player* player, Item* item, uint32 count);
|
||||
|
||||
@@ -369,6 +369,7 @@ public:
|
||||
void SendPetNameInvalid(uint32 error, std::string const& name, DeclinedName* declinedName);
|
||||
void SendPartyResult(PartyOperation operation, std::string const& member, PartyResult res, uint32 val = 0);
|
||||
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3);
|
||||
void SendAreaTriggerMessage(uint32 entry, ...);
|
||||
void SendSetPhaseShift(uint32 phaseShift);
|
||||
void SendQueryTimeResponse();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user