957{
959 {
962 return b;
963 }
964
966
967 uint8 itemsShown = 0;
968
970
971 std::size_t count_pos = b.
wpos();
973
974 switch (lv.permission)
975 {
979 {
980 bool isMasterLooter = lv.viewer->GetGroup() && lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID();
981
982
983
985 {
987 {
989
990 if (l.
items[i].is_blocked)
991 {
992 switch (lv.permission)
993 {
996 break;
998 {
999 if (lv.viewer->GetGroup())
1000 {
1001 if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
1003 else
1005 }
1006 break;
1007 }
1010 break;
1011 default:
1012 continue;
1013 }
1014 }
1015 else if (l.
items[i].rollWinnerGUID)
1016 {
1017 if (l.
items[i].rollWinnerGUID == lv.viewer->GetGUID())
1019 else
1020 continue;
1021 }
1023 {
1024
1025
1026
1028 }
1029 else
1030
1031 continue;
1032
1034 b <<
uint8(slot_type);
1035 ++itemsShown;
1036 }
1037 }
1038 break;
1039 }
1041 {
1043 {
1045 {
1047
1048 continue;
1049
1052 ++itemsShown;
1053 }
1054 }
1055 break;
1056 }
1059 {
1062 {
1064 {
1066 b <<
uint8(slot_type);
1067 ++itemsShown;
1068 }
1069 }
1070 break;
1071 }
1072 default:
1073 return b;
1074 }
1075
1077
1078
1080
1082 QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID());
1083 if (q_itr != lootPlayerQuestItems.end())
1084 {
1086 for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
1087 {
1090 {
1091 bool showInLoot = true;
1092 bool hasQuestForItem = lv.viewer->HasQuestForItem(item.
itemid, 0,
false, &showInLoot);
1093 if (!hasQuestForItem)
1094 {
1095 if (!showInLoot)
1096 {
1097 const_cast<QuestItem*
>(&(*qi))->is_looted =
true;
1099 {
1101 }
1102 continue;
1103 }
1104
1105 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1106 b << item;
1108 }
1109 else
1110 {
1111 b <<
uint8(l.
items.size() + (qi - q_list->begin()));
1112 b << item;
1113
1114 if (item.follow_loot_rules)
1115 {
1116 switch (lv.permission)
1117 {
1120 break;
1123 break;
1126 if (!item.is_blocked)
1128 else
1130 break;
1131 default:
1132 b <<
uint8(slotType);
1133 break;
1134 }
1135 }
1136 else if (!item.freeforall)
1137 b <<
uint8(partySlotType);
1138 else
1139 b <<
uint8(slotType);
1140 }
1141
1142 ++itemsShown;
1143 }
1144 }
1145 }
1146
1148 QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID());
1149 if (ffa_itr != lootPlayerFFAItems.end())
1150 {
1152 for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
1153 {
1156 {
1157 b <<
uint8(fi->index);
1158 b << item;
1159
1161 ++itemsShown;
1162 }
1163 }
1164 }
1165
1167 QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID());
1168 if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
1169 {
1171 for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
1172 {
1175 {
1176 b <<
uint8(ci->index);
1177 b << item;
1178 if (item.follow_loot_rules)
1179 {
1180 switch (lv.permission)
1181 {
1184 break;
1187 break;
1190 if (!item.is_blocked)
1192 else
1194 break;
1195 default:
1196 b <<
uint8(slotType);
1197 break;
1198 }
1199 }
1200 else if (!item.freeforall)
1201 b <<
uint8(partySlotType);
1202 else
1203 b <<
uint8(slotType);
1204 ++itemsShown;
1205 }
1206 }
1207 }
1208
1209
1210 b.
put<
uint8>(count_pos, itemsShown);
1211
1212 return b;
1213}
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