1005{
1007 {
1010 return b;
1011 }
1012
1014
1015 uint8 itemsShown = 0;
1016
1018
1019 std::size_t count_pos = b.
wpos();
1021
1022 switch (lv.permission)
1023 {
1027 {
1028 bool isMasterLooter = lv.viewer->GetGroup() && lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID();
1029
1030
1031
1033 {
1035 {
1036 uint8 slot_type = 0;
1037
1038 if (l.
items[i].is_blocked)
1039 {
1040 switch (lv.permission)
1041 {
1044 break;
1046 {
1047 if (lv.viewer->GetGroup())
1048 {
1049 if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
1051 else
1053 }
1054 break;
1055 }
1058 break;
1059 default:
1060 continue;
1061 }
1062 }
1063 else if (l.
items[i].rollWinnerGUID)
1064 {
1065 if (l.
items[i].rollWinnerGUID == lv.viewer->GetGUID())
1067 else
1068 continue;
1069 }
1071 {
1072
1073
1074
1076 }
1077 else
1078
1079 continue;
1080
1082 b <<
uint8(slot_type);
1083 ++itemsShown;
1084 }
1085 }
1086 break;
1087 }
1089 {
1091 {
1093 {
1095
1096 continue;
1097
1100 ++itemsShown;
1101 }
1102 }
1103 break;
1104 }
1107 {
1110 {
1112 {
1114 b <<
uint8(slot_type);
1115 ++itemsShown;
1116 }
1117 }
1118 break;
1119 }
1120 default:
1121 return b;
1122 }
1123
1125
1126
1128
1130 QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID());
1131 if (q_itr != lootPlayerQuestItems.end())
1132 {
1134 for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
1135 {
1138 {
1139 bool showInLoot = true;
1140 bool hasQuestForItem = lv.viewer->HasQuestForItem(item.
itemid, 0,
false, &showInLoot);
1141 if (!hasQuestForItem)
1142 {
1143 if (!showInLoot)
1144 {
1145 const_cast<QuestItem*
>(&(*qi))->is_looted =
true;
1147 {
1149 }
1150 continue;
1151 }
1152
1153 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1154 b << item;
1156 }
1157 else
1158 {
1159 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1160 b << item;
1161
1162 if (item.follow_loot_rules)
1163 {
1164 switch (lv.permission)
1165 {
1168 break;
1171 break;
1174 if (!item.is_blocked)
1176 else
1178 break;
1179 default:
1180 b <<
uint8(slotType);
1181 break;
1182 }
1183 }
1184 else if (!item.freeforall)
1185 b <<
uint8(partySlotType);
1186 else
1187 b <<
uint8(slotType);
1188 }
1189
1190 ++itemsShown;
1191 }
1192 }
1193 }
1194
1196 QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID());
1197 if (ffa_itr != lootPlayerFFAItems.end())
1198 {
1200 for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
1201 {
1204 {
1205 b <<
uint8(fi->index);
1206 b << item;
1207
1209 ++itemsShown;
1210 }
1211 }
1212 }
1213
1215 QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID());
1216 if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
1217 {
1219 for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
1220 {
1223 {
1224 b <<
uint8(ci->index);
1225 b << item;
1226 if (item.follow_loot_rules)
1227 {
1228 switch (lv.permission)
1229 {
1232 break;
1235 break;
1238 if (!item.is_blocked)
1240 else
1242 break;
1243 default:
1244 b <<
uint8(slotType);
1245 break;
1246 }
1247 }
1248 else if (!item.freeforall)
1249 b <<
uint8(partySlotType);
1250 else
1251 b <<
uint8(slotType);
1252 ++itemsShown;
1253 }
1254 }
1255 }
1256
1257
1258 b.
put<
uint8>(count_pos, itemsShown);
1259
1260 return b;
1261}
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