982{
984 {
987 return b;
988 }
989
991
992 uint8 itemsShown = 0;
993
995
996 size_t count_pos = b.
wpos();
998
999 switch (lv.permission)
1000 {
1004 {
1005 bool isMasterLooter = lv.viewer->GetGroup() && lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID();
1006
1007
1008
1010 {
1012 {
1013 uint8 slot_type = 0;
1014
1015 if (l.
items[i].is_blocked)
1016 {
1017 switch (lv.permission)
1018 {
1021 break;
1023 {
1024 if (lv.viewer->GetGroup())
1025 {
1026 if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
1028 else
1030 }
1031 break;
1032 }
1035 break;
1036 default:
1037 continue;
1038 }
1039 }
1040 else if (l.
items[i].rollWinnerGUID)
1041 {
1042 if (l.
items[i].rollWinnerGUID == lv.viewer->GetGUID())
1044 else
1045 continue;
1046 }
1048 {
1049
1050
1051
1053 }
1054 else
1055
1056 continue;
1057
1059 b <<
uint8(slot_type);
1060 ++itemsShown;
1061 }
1062 }
1063 break;
1064 }
1066 {
1068 {
1070 {
1072
1073 continue;
1074
1077 ++itemsShown;
1078 }
1079 }
1080 break;
1081 }
1084 {
1087 {
1089 {
1091 b <<
uint8(slot_type);
1092 ++itemsShown;
1093 }
1094 }
1095 break;
1096 }
1097 default:
1098 return b;
1099 }
1100
1102
1103
1105
1107 QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID());
1108 if (q_itr != lootPlayerQuestItems.end())
1109 {
1111 for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
1112 {
1115 {
1116 bool showInLoot = true;
1117 bool hasQuestForItem = lv.viewer->HasQuestForItem(item.
itemid, 0,
false, &showInLoot);
1118 if (!hasQuestForItem)
1119 {
1120 if (!showInLoot)
1121 {
1122 const_cast<QuestItem*
>(&(*qi))->is_looted =
true;
1124 {
1126 }
1127 continue;
1128 }
1129
1130 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1131 b << item;
1133 }
1134 else
1135 {
1136 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1137 b << item;
1138
1139 if (item.follow_loot_rules)
1140 {
1141 switch (lv.permission)
1142 {
1145 break;
1148 break;
1151 if (!item.is_blocked)
1153 else
1155 break;
1156 default:
1157 b <<
uint8(slotType);
1158 break;
1159 }
1160 }
1161 else if (!item.freeforall)
1162 b <<
uint8(partySlotType);
1163 else
1164 b <<
uint8(slotType);
1165 }
1166
1167 ++itemsShown;
1168 }
1169 }
1170 }
1171
1173 QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID());
1174 if (ffa_itr != lootPlayerFFAItems.end())
1175 {
1177 for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
1178 {
1181 {
1182 b <<
uint8(fi->index);
1183 b << item;
1184
1186 ++itemsShown;
1187 }
1188 }
1189 }
1190
1192 QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID());
1193 if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
1194 {
1196 for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
1197 {
1200 {
1201 b <<
uint8(ci->index);
1202 b << item;
1203 if (item.follow_loot_rules)
1204 {
1205 switch (lv.permission)
1206 {
1209 break;
1212 break;
1215 if (!item.is_blocked)
1217 else
1219 break;
1220 default:
1221 b <<
uint8(slotType);
1222 break;
1223 }
1224 }
1225 else if (!item.freeforall)
1226 b <<
uint8(partySlotType);
1227 else
1228 b <<
uint8(slotType);
1229 ++itemsShown;
1230 }
1231 }
1232 }
1233
1234
1235 b.
put<
uint8>(count_pos, itemsShown);
1236
1237 return b;
1238}
std::uint8_t uint8
Definition: Define.h:110
@ OWNER_PERMISSION
Definition: LootMgr.h:73
@ ALL_PERMISSION
Definition: LootMgr.h:68
@ RESTRICTED_PERMISSION
Definition: LootMgr.h:71
@ NONE_PERMISSION
Definition: LootMgr.h:74
@ ROUND_ROBIN_PERMISSION
Definition: LootMgr.h:72
@ MASTER_PERMISSION
Definition: LootMgr.h:70
@ GROUP_PERMISSION
Definition: LootMgr.h:69
std::map< ObjectGuid, QuestItemList * > QuestItemMap
Definition: LootMgr.h:201
LootSlotType
Definition: LootMgr.h:114
@ LOOT_SLOT_TYPE_MASTER
Definition: LootMgr.h:117
@ LOOT_SLOT_TYPE_ROLL_ONGOING
Definition: LootMgr.h:116
@ LOOT_SLOT_TYPE_ALLOW_LOOT
Definition: LootMgr.h:115
@ LOOT_SLOT_TYPE_OWNER
Definition: LootMgr.h:119
@ LOOT_SLOT_TYPE_LOCKED
Definition: LootMgr.h:118
std::vector< QuestItem > QuestItemList
Definition: LootMgr.h:199
Definition: LootMgr.h:155
uint32 itemid
Definition: LootMgr.h:156
bool is_looted
Definition: LootMgr.h:164
bool freeforall
Definition: LootMgr.h:166
Definition: LootMgr.h:186
Definition: LootMgr.h:313
ObjectGuid sourceWorldObjectGUID
Definition: LootMgr.h:330
ObjectGuid roundRobinPlayer
Definition: LootMgr.h:324
uint32 gold
Definition: LootMgr.h:322
QuestItemMap const & GetPlayerQuestItems() const
Definition: LootMgr.h:316
std::vector< LootItem > items
Definition: LootMgr.h:320
QuestItemMap const & GetPlayerFFAItems() const
Definition: LootMgr.h:317
QuestItemMap const & GetPlayerNonQuestNonFFAConditionalItems() const
Definition: LootMgr.h:318
std::vector< LootItem > quest_items
Definition: LootMgr.h:321
size_t wpos() const
Definition: ByteBuffer.h:330
void put(std::size_t pos, T value)
Definition: ByteBuffer.h:137