diff options
author | Dehravor <dehravor@gmail.com> | 2014-03-11 19:06:42 +0100 |
---|---|---|
committer | Dehravor <dehravor@gmail.com> | 2014-03-11 19:06:42 +0100 |
commit | 892d9eac79e94796e3b22e5be368063d59b20efc (patch) | |
tree | ca5ad782743f1c33a08bd6d61f0e2b81b1205e1b /src/server/game/Groups/Group.cpp | |
parent | 5221bd8c1099d0aa2c7317d9bf591fbe38c962c6 (diff) |
Core/Loot: Fix master loot
Players will be able to open the loot window and see the items in case of master loot.
If the item is under threshold FFA applies, else the item becomes locked.
Also fix an exploit related to master loot item give.
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r-- | src/server/game/Groups/Group.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 09b251984ee..abc4b19f3f2 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -890,12 +890,25 @@ void Group::SendLooter(Creature* creature, Player* groupLooter) WorldPacket data(SMSG_LOOT_LIST, (8+8)); data << uint64(creature->GetGUID()); - data << uint8(0); // unk1 if (groupLooter) - data.append(groupLooter->GetPackGUID()); + { + if (GetLootMethod() == MASTER_LOOT) + { + data.append(groupLooter->GetPackGUID()); + data << uint8(0); + } + else + { + data << uint8(0); + data.append(groupLooter->GetPackGUID()); + } + } else + { + data << uint8(0); data << uint8(0); + } BroadcastPacket(&data, false); } @@ -1196,10 +1209,26 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) } } -void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) +void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject) { TC_LOG_DEBUG("network", "Group::MasterLoot (SMSG_LOOT_MASTER_LIST)"); + for (std::vector<LootItem>::iterator i = loot->items.begin(); i != loot->items.end(); ++i) + { + if (i->freeforall) + continue; + + i->is_blocked = !i->is_underthreshold; + } + + for (std::vector<LootItem>::iterator i = loot->quest_items.begin(); i != loot->quest_items.end(); ++i) + { + if (!i->follow_loot_rules) + continue; + + i->is_blocked = !i->is_underthreshold; + } + uint32 real_count = 0; WorldPacket data(SMSG_LOOT_MASTER_LIST, 1 + GetMembersCount() * 8); |