Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li)
- {
- b << uint32(li.itemid);
- b << uint32(li.count); // nr of items of this type
- b << uint32(ObjectMgr::GetItemPrototype(li.itemid)->DisplayInfoID);
- b << int32(li.randomSuffix);
- b << uint32(li.randomPropertyId);
- return b;
- }
- ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
- {
- if (lv.permission == NONE_PERMISSION)
- {
- b << uint32(0); //gold
- b << uint8(0); // item count
- b << uint8(0); // unk
- return b; // nothing output more
- }
- Loot &l = lv.loot;
- uint8 itemsShown = 0;
- //gold
- b << uint32(l.gold);
- size_t count_pos = b.wpos(); // pos of item count byte
- b << uint8(0); // item count placeholder
- b << uint8(0); // unk
- // тут код формирующий предметы для лута
- b << uint8(i) << l.items[i];
- b << uint8(slot_type);
- }
- // Формирование самого пакета
- {
- WorldPacket data(SMSG_LOOT_RESPONSE, (8+1+50));
- data << uint64(guid);
- data << uint8(loot_type);
- data << LootView(*loot, this, permission);
- SendDirectMessage(&data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement