985{
987 {
990 return b;
991 }
992
994
995 uint8 itemsShown = 0;
996
998
999 size_t count_pos = b.
wpos();
1001
1002 switch (lv.permission)
1003 {
1007 {
1008 bool isMasterLooter = lv.viewer->GetGroup() && lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID();
1009
1010
1011
1013 {
1015 {
1016 uint8 slot_type = 0;
1017
1018 if (l.
items[i].is_blocked)
1019 {
1020 switch (lv.permission)
1021 {
1024 break;
1026 {
1027 if (lv.viewer->GetGroup())
1028 {
1029 if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
1031 else
1033 }
1034 break;
1035 }
1038 break;
1039 default:
1040 continue;
1041 }
1042 }
1043 else if (l.
items[i].rollWinnerGUID)
1044 {
1045 if (l.
items[i].rollWinnerGUID == lv.viewer->GetGUID())
1047 else
1048 continue;
1049 }
1051 {
1052
1053
1054
1056 }
1057 else
1058
1059 continue;
1060
1062 b <<
uint8(slot_type);
1063 ++itemsShown;
1064 }
1065 }
1066 break;
1067 }
1069 {
1071 {
1073 {
1075
1076 continue;
1077
1080 ++itemsShown;
1081 }
1082 }
1083 break;
1084 }
1087 {
1090 {
1092 {
1094 b <<
uint8(slot_type);
1095 ++itemsShown;
1096 }
1097 }
1098 break;
1099 }
1100 default:
1101 return b;
1102 }
1103
1105
1106
1108
1110 QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID());
1111 if (q_itr != lootPlayerQuestItems.end())
1112 {
1114 for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
1115 {
1118 {
1119 bool showInLoot = true;
1120 bool hasQuestForItem = lv.viewer->HasQuestForItem(item.
itemid, 0,
false, &showInLoot);
1121 if (!hasQuestForItem)
1122 {
1123 if (!showInLoot)
1124 {
1125 const_cast<QuestItem*
>(&(*qi))->is_looted =
true;
1127 {
1129 }
1130 continue;
1131 }
1132
1133 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1134 b << item;
1136 }
1137 else
1138 {
1139 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1140 b << item;
1141
1142 if (item.follow_loot_rules)
1143 {
1144 switch (lv.permission)
1145 {
1148 break;
1151 break;
1154 if (!item.is_blocked)
1156 else
1158 break;
1159 default:
1160 b <<
uint8(slotType);
1161 break;
1162 }
1163 }
1164 else if (!item.freeforall)
1165 b <<
uint8(partySlotType);
1166 else
1167 b <<
uint8(slotType);
1168 }
1169
1170 ++itemsShown;
1171 }
1172 }
1173 }
1174
1176 QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID());
1177 if (ffa_itr != lootPlayerFFAItems.end())
1178 {
1180 for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
1181 {
1184 {
1185 b <<
uint8(fi->index);
1186 b << item;
1187
1189 ++itemsShown;
1190 }
1191 }
1192 }
1193
1195 QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID());
1196 if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
1197 {
1199 for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
1200 {
1203 {
1204 b <<
uint8(ci->index);
1205 b << item;
1206 if (item.follow_loot_rules)
1207 {
1208 switch (lv.permission)
1209 {
1212 break;
1215 break;
1218 if (!item.is_blocked)
1220 else
1222 break;
1223 default:
1224 b <<
uint8(slotType);
1225 break;
1226 }
1227 }
1228 else if (!item.freeforall)
1229 b <<
uint8(partySlotType);
1230 else
1231 b <<
uint8(slotType);
1232 ++itemsShown;
1233 }
1234 }
1235 }
1236
1237
1238 b.
put<
uint8>(count_pos, itemsShown);
1239
1240 return b;
1241}
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