aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Loot/LootMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Loot/LootMgr.cpp')
-rw-r--r--src/server/game/Loot/LootMgr.cpp48
1 files changed, 29 insertions, 19 deletions
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 899637a7615..60475382d5e 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -555,7 +555,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
{
LootItem &item = quest_items[i];
- if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT ))))
+ if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT))))
{
ql->push_back(QuestItem(i));
@@ -589,7 +589,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool pres
for (uint8 i = 0; i < items.size(); ++i)
{
LootItem &item = items[i];
- if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT ))))
+ if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT))))
{
if (presentAtLooting)
item.AddAllowedLooter(player);
@@ -883,6 +883,8 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
switch (lv.permission)
{
case GROUP_PERMISSION:
+ case MASTER_PERMISSION:
+ case RESTRICTED_PERMISSION:
{
// if you are not the round-robin group looter, you can only see
// blocked rolled items and quest items, and !ffa items
@@ -892,9 +894,24 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
{
uint8 slot_type;
- if (l.items[i].is_blocked)
- slot_type = LOOT_SLOT_TYPE_ROLL_ONGOING;
- else if (l.roundRobinPlayer == 0 || !l.items[i].is_underthreshold || lv.viewer->GetGUID() == l.roundRobinPlayer)
+ if (l.items[i].is_blocked) // for ML & restricted is_blocked = !is_underthreshold
+ {
+ switch (lv.permission)
+ {
+ case GROUP_PERMISSION:
+ slot_type = LOOT_SLOT_TYPE_ROLL_ONGOING;
+ break;
+ case MASTER_PERMISSION:
+ slot_type = LOOT_SLOT_TYPE_MASTER;
+ break;
+ case RESTRICTED_PERMISSION:
+ slot_type = LOOT_SLOT_TYPE_LOCKED;
+ break;
+ default:
+ continue;
+ }
+ }
+ else if (l.roundRobinPlayer == 0 || lv.viewer->GetGUID() == l.roundRobinPlayer || !l.items[i].is_underthreshold)
{
// no round robin owner or he has released the loot
// or it IS the round robin group owner
@@ -930,22 +947,9 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
break;
}
case ALL_PERMISSION:
- case MASTER_PERMISSION:
case OWNER_PERMISSION:
{
- uint8 slot_type = LOOT_SLOT_TYPE_ALLOW_LOOT;
- switch (lv.permission)
- {
- case MASTER_PERMISSION:
- slot_type = LOOT_SLOT_TYPE_MASTER;
- break;
- case OWNER_PERMISSION:
- slot_type = LOOT_SLOT_TYPE_OWNER;
- break;
- default:
- break;
- }
-
+ uint8 slot_type = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
for (uint8 i = 0; i < l.items.size(); ++i)
{
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
@@ -981,6 +985,9 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
case MASTER_PERMISSION:
b << uint8(LOOT_SLOT_TYPE_MASTER);
break;
+ case RESTRICTED_PERMISSION:
+ b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType));
+ break;
case GROUP_PERMISSION:
case ROUND_ROBIN_PERMISSION:
if (!item.is_blocked)
@@ -1037,6 +1044,9 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
case MASTER_PERMISSION:
b << uint8(LOOT_SLOT_TYPE_MASTER);
break;
+ case RESTRICTED_PERMISSION:
+ b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType));
+ break;
case GROUP_PERMISSION:
case ROUND_ROBIN_PERMISSION:
if (!item.is_blocked)