975{
977 {
980 return b;
981 }
982
984
985 uint8 itemsShown = 0;
986
988
989 std::size_t count_pos = b.
wpos();
991
992 switch (lv.permission)
993 {
997 {
998 bool isMasterLooter = lv.viewer->GetGroup() && lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID();
999
1000
1001
1003 {
1005 {
1006 uint8 slot_type = 0;
1007
1008 if (l.
items[i].is_blocked)
1009 {
1010 switch (lv.permission)
1011 {
1014 break;
1016 {
1017 if (lv.viewer->GetGroup())
1018 {
1019 if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
1021 else
1023 }
1024 break;
1025 }
1028 break;
1029 default:
1030 continue;
1031 }
1032 }
1033 else if (l.
items[i].rollWinnerGUID)
1034 {
1035 if (l.
items[i].rollWinnerGUID == lv.viewer->GetGUID())
1037 else
1038 continue;
1039 }
1041 {
1042
1043
1044
1046 }
1047 else
1048
1049 continue;
1050
1052 b <<
uint8(slot_type);
1053 ++itemsShown;
1054 }
1055 }
1056 break;
1057 }
1059 {
1061 {
1063 {
1065
1066 continue;
1067
1070 ++itemsShown;
1071 }
1072 }
1073 break;
1074 }
1077 {
1080 {
1082 {
1084 b <<
uint8(slot_type);
1085 ++itemsShown;
1086 }
1087 }
1088 break;
1089 }
1090 default:
1091 return b;
1092 }
1093
1095
1096
1098
1100 QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID());
1101 if (q_itr != lootPlayerQuestItems.end())
1102 {
1104 for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
1105 {
1108 {
1109 bool showInLoot = true;
1110 bool hasQuestForItem = lv.viewer->HasQuestForItem(item.
itemid, 0,
false, &showInLoot);
1111 if (!hasQuestForItem)
1112 {
1113 if (!showInLoot)
1114 {
1115 const_cast<QuestItem*
>(&(*qi))->is_looted =
true;
1117 {
1119 }
1120 continue;
1121 }
1122
1123 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1124 b << item;
1126 }
1127 else
1128 {
1129 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1130 b << item;
1131
1132 if (item.follow_loot_rules)
1133 {
1134 switch (lv.permission)
1135 {
1138 break;
1141 break;
1144 if (!item.is_blocked)
1146 else
1148 break;
1149 default:
1150 b <<
uint8(slotType);
1151 break;
1152 }
1153 }
1154 else if (!item.freeforall)
1155 b <<
uint8(partySlotType);
1156 else
1157 b <<
uint8(slotType);
1158 }
1159
1160 ++itemsShown;
1161 }
1162 }
1163 }
1164
1166 QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID());
1167 if (ffa_itr != lootPlayerFFAItems.end())
1168 {
1170 for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
1171 {
1174 {
1175 b <<
uint8(fi->index);
1176 b << item;
1177
1179 ++itemsShown;
1180 }
1181 }
1182 }
1183
1185 QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID());
1186 if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
1187 {
1189 for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
1190 {
1193 {
1194 b <<
uint8(ci->index);
1195 b << item;
1196 if (item.follow_loot_rules)
1197 {
1198 switch (lv.permission)
1199 {
1202 break;
1205 break;
1208 if (!item.is_blocked)
1210 else
1212 break;
1213 default:
1214 b <<
uint8(slotType);
1215 break;
1216 }
1217 }
1218 else if (!item.freeforall)
1219 b <<
uint8(partySlotType);
1220 else
1221 b <<
uint8(slotType);
1222 ++itemsShown;
1223 }
1224 }
1225 }
1226
1227
1228 b.
put<
uint8>(count_pos, itemsShown);
1229
1230 return b;
1231}
std::uint8_t uint8
Definition Define.h:109
@ OWNER_PERMISSION
Definition LootMgr.h:72
@ ALL_PERMISSION
Definition LootMgr.h:67
@ RESTRICTED_PERMISSION
Definition LootMgr.h:70
@ NONE_PERMISSION
Definition LootMgr.h:73
@ ROUND_ROBIN_PERMISSION
Definition LootMgr.h:71
@ MASTER_PERMISSION
Definition LootMgr.h:69
@ GROUP_PERMISSION
Definition LootMgr.h:68
std::map< ObjectGuid, QuestItemList * > QuestItemMap
Definition LootMgr.h:200
LootSlotType
Definition LootMgr.h:113
@ LOOT_SLOT_TYPE_MASTER
Definition LootMgr.h:116
@ LOOT_SLOT_TYPE_ROLL_ONGOING
Definition LootMgr.h:115
@ LOOT_SLOT_TYPE_ALLOW_LOOT
Definition LootMgr.h:114
@ LOOT_SLOT_TYPE_OWNER
Definition LootMgr.h:118
@ LOOT_SLOT_TYPE_LOCKED
Definition LootMgr.h:117
std::vector< QuestItem > QuestItemList
Definition LootMgr.h:198
std::size_t wpos() const
Definition ByteBuffer.h:330
void put(std::size_t pos, T value)
Definition ByteBuffer.h:137
uint32 itemid
Definition LootMgr.h:155
bool is_looted
Definition LootMgr.h:163
bool freeforall
Definition LootMgr.h:165
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