1004{
1006 {
1009 return b;
1010 }
1011
1013
1014 uint8 itemsShown = 0;
1015
1017
1018 std::size_t count_pos = b.
wpos();
1020
1021 switch (lv.permission)
1022 {
1026 {
1027 bool isMasterLooter = lv.viewer->GetGroup() && lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID();
1028
1029
1030
1032 {
1034 {
1035 uint8 slot_type = 0;
1036
1037 if (l.
items[i].is_blocked)
1038 {
1039 switch (lv.permission)
1040 {
1043 break;
1045 {
1046 if (lv.viewer->GetGroup())
1047 {
1048 if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
1050 else
1052 }
1053 break;
1054 }
1057 break;
1058 default:
1059 continue;
1060 }
1061 }
1062 else if (l.
items[i].rollWinnerGUID)
1063 {
1064 if (l.
items[i].rollWinnerGUID == lv.viewer->GetGUID())
1066 else
1067 continue;
1068 }
1070 {
1071
1072
1073
1075 }
1076 else
1077
1078 continue;
1079
1081 b <<
uint8(slot_type);
1082 ++itemsShown;
1083 }
1084 }
1085 break;
1086 }
1088 {
1090 {
1092 {
1094
1095 continue;
1096
1099 ++itemsShown;
1100 }
1101 }
1102 break;
1103 }
1106 {
1109 {
1111 {
1113 b <<
uint8(slot_type);
1114 ++itemsShown;
1115 }
1116 }
1117 break;
1118 }
1119 default:
1120 return b;
1121 }
1122
1124
1125
1127
1129 QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID());
1130 if (q_itr != lootPlayerQuestItems.end())
1131 {
1133 for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
1134 {
1137 {
1138 bool showInLoot = true;
1139 bool hasQuestForItem = lv.viewer->HasQuestForItem(item.
itemid, 0,
false, &showInLoot);
1140 if (!hasQuestForItem)
1141 {
1142 if (!showInLoot)
1143 {
1144 const_cast<QuestItem*
>(&(*qi))->is_looted =
true;
1146 {
1148 }
1149 continue;
1150 }
1151
1152 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1153 b << item;
1155 }
1156 else
1157 {
1158 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1159 b << item;
1160
1161 if (item.follow_loot_rules)
1162 {
1163 switch (lv.permission)
1164 {
1167 break;
1170 break;
1173 if (!item.is_blocked)
1175 else
1177 break;
1178 default:
1179 b <<
uint8(slotType);
1180 break;
1181 }
1182 }
1183 else if (!item.freeforall)
1184 b <<
uint8(partySlotType);
1185 else
1186 b <<
uint8(slotType);
1187 }
1188
1189 ++itemsShown;
1190 }
1191 }
1192 }
1193
1195 QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID());
1196 if (ffa_itr != lootPlayerFFAItems.end())
1197 {
1199 for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
1200 {
1203 {
1204 b <<
uint8(fi->index);
1205 b << item;
1206
1208 ++itemsShown;
1209 }
1210 }
1211 }
1212
1214 QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID());
1215 if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
1216 {
1218 for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
1219 {
1222 {
1223 b <<
uint8(ci->index);
1224 b << item;
1225 if (item.follow_loot_rules)
1226 {
1227 switch (lv.permission)
1228 {
1231 break;
1234 break;
1237 if (!item.is_blocked)
1239 else
1241 break;
1242 default:
1243 b <<
uint8(slotType);
1244 break;
1245 }
1246 }
1247 else if (!item.freeforall)
1248 b <<
uint8(partySlotType);
1249 else
1250 b <<
uint8(slotType);
1251 ++itemsShown;
1252 }
1253 }
1254 }
1255
1256
1257 b.
put<
uint8>(count_pos, itemsShown);
1258
1259 return b;
1260}
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
Definition: LootMgr.h:154
uint32 itemid
Definition: LootMgr.h:155
bool is_looted
Definition: LootMgr.h:163
bool freeforall
Definition: LootMgr.h:165
Definition: LootMgr.h:185
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
std::size_t wpos() const
Definition: ByteBuffer.h:330
void put(std::size_t pos, T value)
Definition: ByteBuffer.h:137