28 SF_LOG_DEBUG(
"network",
"WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
34 std::vector<ObjectGuid> guids(lootCount);
36 for (
int i = 0; i < lootCount; i++)
38 (guids[i])[2] = recvData.
ReadBit();
39 (guids[i])[7] = recvData.
ReadBit();
40 (guids[i])[0] = recvData.
ReadBit();
41 (guids[i])[6] = recvData.
ReadBit();
42 (guids[i])[5] = recvData.
ReadBit();
43 (guids[i])[3] = recvData.
ReadBit();
44 (guids[i])[1] = recvData.
ReadBit();
45 (guids[i])[4] = recvData.
ReadBit();
48 for (
int i = 0; i < lootCount; i++)
113 loot = &creature->
loot;
133 if (lootGuids.empty())
136 lootGuids.push_back(guid);
139 if (lootGuids.empty())
142 bool isAoE = lootGuids.size() > 1;
143 std::vector<uint64> releaseGuids;
145 for (std::vector<uint64>::const_iterator itr = lootGuids.begin(); itr != lootGuids.end(); ++itr)
149 bool shareMoney =
true;
191 loot = &creature->
loot;
205 if (shareMoney && player->
GetGroup())
209 std::vector<Player*> playersNear;
212 Player* member = itr->GetSource();
217 playersNear.push_back(member);
222 for (std::vector<Player*>::const_iterator i = playersNear.begin(); i != playersNear.end(); ++i)
224 (*i)->ModifyMoney(goldPerPlayer);
229 guild->HandleMemberDepositMoney(
this, guildGold,
true);
232 data.
WriteBit(playersNear.size() <= 1);
234 data <<
uint32(goldPerPlayer);
235 (*i)->GetSession()->SendPacket(&data);
245 guild->HandleMemberDepositMoney(
this, guildGold,
true);
262 releaseGuids.push_back(guid);
265 for (std::vector<uint64>::const_iterator itr = releaseGuids.begin(); itr != releaseGuids.end(); ++itr)
285 return _looter->isAllowedToLoot(creature);
306 std::list<Creature*> corpses;
310 _player->VisitNearbyGridObject(lootDistance, searcher);
313 data <<
uint32(corpses.size());
318 for (std::list<Creature*>::const_iterator itr = corpses.begin(); itr != corpses.end(); ++itr)
322 if (
GetPlayer()->IsNonMeleeSpellCasted(
false))
412 loot = &corpse->
loot;
457 loot = &creature->
loot;
477 group->SendLooter(creature, NULL);
496 uint64 lootguid, target_playerguid;
498 recvData >> lootguid >> slotid >> target_playerguid;
510 SF_LOG_DEBUG(
"network",
"WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->
GetName().c_str());
512 if (
_player->GetLootGUID() != lootguid)
523 loot = &creature->
loot;
539 SF_LOG_DEBUG(
"loot",
"MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)",
540 GetPlayer()->GetName().c_str(), slotid, (
unsigned long)loot->
items.size());
578 SF_LOG_DEBUG(
"network",
"CHARACTER: CMSG_SET_CURRENCY_FLAGS");
582 recvPacket >> flags >> currencyId;
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY
@ EQUIP_ERR_CANT_EQUIP_EVER
@ ITEM_PROTO_FLAG_MILLABLE
@ ITEM_PROTO_FLAG_PROSPECTABLE
#define SF_LOG_DEBUG(filterType__,...)
std::set< uint32 > AllowedLooterSet
#define INTERACTION_DISTANCE
bool IS_GAMEOBJECT_GUID(uint64 guid)
bool IS_ITEM_GUID(uint64 guid)
bool IS_CRE_OR_VEH_GUID(uint64 guid)
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
uint32 GUID_HIPART(uint64 guid)
bool IS_CORPSE_GUID(uint64 guid)
std::vector< ItemPosCount > ItemPosCountVec
@ GAMEOBJECT_TYPE_FISHINGHOLE
@ GAMEOBJECT_TYPE_FISHINGNODE
@ CORPSE_DYNFLAG_LOOTABLE
@ SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT
@ CORPSE_FIELD_DYNAMIC_FLAGS
@ OBJECT_FIELD_DYNAMIC_FLAGS
T CalculatePct(T base, U pct)
bool WriteBit(uint32 bit)
uint32 ReadBits(size_t bits)
void ReadGuidBytes(ObjectGuid &guid, Offsets... offsets)
void ReadByteSeq(uint8 &b)
void ReadGuidMask(ObjectGuid &guid, Offsets... offsets)
void AllLootRemovedFromCorpse()
uint64 GetOwnerGUID() const
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
GameObjectValue const * GetGOValue() const
GameobjectTypes GetGoType() const
uint32 GetUseCount() const
void SetLootState(LootState s, Unit *unit=NULL)
GroupReference * GetFirstMember()
ItemTemplate const * GetTemplate() const
GameObject * GetGameObject(uint64 guid)
Creature * GetCreature(uint64 guid)
static Corpse * GetCorpse(WorldObject const &u, uint64 guid)
static Player * FindPlayer(uint64)
void RemoveFlag(uint16 index, uint32 oldFlag)
void ForceValuesUpdateAtIndex(uint32)
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=NULL, uint32 itemid=0)
bool ModifyMoney(int64 amount, bool sendError=true)
uint32 GetGuildId() const
void SendLootRelease(ObjectGuid guid)
bool IsLootingObject(uint64 guid) const
uint64 GetLootGUID() const
WorldSession * GetSession() const
Item * GetItemByGuid(uint64 guid) const
void DestroyItem(uint8 bag, uint8 slot, bool update)
void RemoveLootedObject(uint64 guid)
std::set< uint64 > const & GetLootView() const
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=NULL) const
void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
void StoreLootItem(uint8 lootSlot, Loot *loot, uint64 lootGuid=0)
void SetLootGUID(uint64 guid)
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0, AllowedLooterSet const &allowedLooters=AllowedLooterSet())
void ModifyCurrencyFlag(uint32 id, uint8 flag)
void SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast=false)
void SendLoot(uint64 guid, LootType loot_type, bool isAoE=false)
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
int32 GetTotalAuraModifier(AuraType auratype) const
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
std::string const & GetName() const
void HandleLootMoneyOpcode(WorldPacket &recvPacket)
void HandleLootMasterGiveOpcode(WorldPacket &recvPacket)
Player * GetPlayer() const
void HandleLootOpcode(WorldPacket &recvPacket)
void HandleAutostoreLootItemOpcode(WorldPacket &recvPacket)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
void HandleChangeCurrencyFlags(WorldPacket &recvPacket)
void DoLootRelease(uint64 lguid)
void HandleLootReleaseOpcode(WorldPacket &recvPacket)
@ CONFIG_GROUP_XP_DISTANCE
bool operator()(Creature *creature) const
AELootCreatureCheck(Player *looter, uint64 mainLootTarget, float lootDistance)
bool HasLooter(uint64 GUID)
void NotifyMoneyRemoved(ObjectGuid lootGuid=0)
void NotifyItemRemoved(uint8 lootIndex, ObjectGuid lootGuid=0)
void RemoveLooter(uint64 GUID)
std::vector< LootItem > items
void DeleteLootMoneyFromContainerItemDB()
std::vector< LootItem > quest_items
bool AllowedForPlayer(Player const *player) const
const AllowedLooterSet & GetAllowedLooters() const
struct GameObjectValue::@350066061234367104023065253003102330370272142167 FishingHole