Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
LootHandler.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "Common.h"
7#include "CellImpl.h"
8#include "Corpse.h"
9#include "Creature.h"
10#include "GameObject.h"
11#include "GridNotifiersImpl.h"
12#include "Group.h"
13#include "GuildMgr.h"
14#include "Log.h"
15#include "LootMgr.h"
16#include "Object.h"
17#include "ObjectAccessor.h"
18#include "Opcodes.h"
19#include "Player.h"
20#include "World.h"
21#include "WorldPacket.h"
22#include "WorldSession.h"
23
24#include <vector>
25
27{
28 SF_LOG_DEBUG("network", "WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
29 Player* player = GetPlayer();
30 Loot* loot = NULL;
31 bool isAoE = player->GetLootView().size() > 1;
32
33 int32 lootCount = recvData.ReadBits(23);
34 std::vector<ObjectGuid> guids(lootCount);
35
36 for (int i = 0; i < lootCount; i++)
37 {
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();
46 }
47
48 for (int i = 0; i < lootCount; i++)
49 {
50 recvData.ReadByteSeq((guids[i])[0]);
51 recvData.ReadByteSeq((guids[i])[4]);
52 recvData.ReadByteSeq((guids[i])[1]);
53 recvData.ReadByteSeq((guids[i])[7]);
54 recvData.ReadByteSeq((guids[i])[6]);
55 recvData.ReadByteSeq((guids[i])[5]);
56 recvData.ReadByteSeq((guids[i])[3]);
57 recvData.ReadByteSeq((guids[i])[2]);
58 uint8 lootSlot;
59 recvData >> lootSlot;
60
61 uint64 guid = guids[i];
62 if (!player->IsLootingObject(guid))
63 continue;
64
65 if (IS_GAMEOBJECT_GUID(guid))
66 {
67 GameObject* go = player->GetMap()->GetGameObject(guid);
68
69 // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO
70 if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player, INTERACTION_DISTANCE)))
71 {
72 player->SendLootRelease(guid);
73 break;
74 }
75
76 loot = &go->loot;
77 }
78 else if (IS_ITEM_GUID(guid))
79 {
80 Item* pItem = player->GetItemByGuid(guid);
81
82 if (!pItem)
83 {
84 player->SendLootRelease(guid);
85 break;
86 }
87
88 loot = &pItem->loot;
89 }
90 else if (IS_CORPSE_GUID(guid))
91 {
92 Corpse* bones = ObjectAccessor::GetCorpse(*player, guid);
93 if (!bones)
94 {
95 player->SendLootRelease(guid);
96 break;
97 }
98
99 loot = &bones->loot;
100 }
101 else
102 {
103 Creature* creature = GetPlayer()->GetMap()->GetCreature(guid);
104
105 bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
106
107 if (!lootAllowed || (!creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE) && !isAoE))
108 {
109 player->SendLootRelease(guid);
110 break;
111 }
112
113 loot = &creature->loot;
114 }
115
116 if (!loot->HasLooter(_player->GetGUID()))
117 break;
118
119 player->StoreLootItem(lootSlot, loot, guid);
120
121 // If player is removing the last LootItem, delete the empty container.
122 if (loot->isLooted() && IS_ITEM_GUID(guid))
123 player->GetSession()->DoLootRelease(guid);
124 }
125}
126
128{
129 SF_LOG_DEBUG("network", "WORLD: CMSG_LOOT_MONEY");
130
131 Player* player = GetPlayer();
132 std::vector<uint64> lootGuids(player->GetLootView().begin(), player->GetLootView().end());
133 if (lootGuids.empty())
134 {
135 if (uint64 guid = player->GetLootGUID())
136 lootGuids.push_back(guid);
137 }
138
139 if (lootGuids.empty())
140 return;
141
142 bool isAoE = lootGuids.size() > 1;
143 std::vector<uint64> releaseGuids;
144
145 for (std::vector<uint64>::const_iterator itr = lootGuids.begin(); itr != lootGuids.end(); ++itr)
146 {
147 uint64 guid = *itr;
148 Loot* loot = NULL;
149 bool shareMoney = true;
150
151 switch (GUID_HIPART(guid))
152 {
154 {
155 GameObject* go = GetPlayer()->GetMap()->GetGameObject(guid);
156
157 // do not check distance for GO if player is the owner of it (ex. fishing bobber)
158 if (go && ((go->GetOwnerGUID() == player->GetGUID() || go->IsWithinDistInMap(player, INTERACTION_DISTANCE))))
159 loot = &go->loot;
160
161 break;
162 }
163 case HIGHGUID_CORPSE: // remove insignia ONLY in BG
164 {
165 Corpse* bones = ObjectAccessor::GetCorpse(*player, guid);
166
167 if (bones && bones->IsWithinDistInMap(player, INTERACTION_DISTANCE))
168 {
169 loot = &bones->loot;
170 shareMoney = false;
171 }
172
173 break;
174 }
175 case HIGHGUID_ITEM:
176 {
177 if (Item* item = player->GetItemByGuid(guid))
178 {
179 loot = &item->loot;
180 shareMoney = false;
181 }
182 break;
183 }
184 case HIGHGUID_UNIT:
185 case HIGHGUID_VEHICLE:
186 {
187 Creature* creature = player->GetMap()->GetCreature(guid);
188 bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
189 if (lootAllowed && (creature->IsWithinDistInMap(player, INTERACTION_DISTANCE) || isAoE))
190 {
191 loot = &creature->loot;
192 if (creature->IsAlive())
193 shareMoney = false;
194 }
195 break;
196 }
197 default:
198 continue; // unlootable type
199 }
200
201 if (!loot)
202 continue;
203
204 loot->NotifyMoneyRemoved(guid);
205 if (shareMoney && player->GetGroup()) // item, pickpocket and players can be looted only single player
206 {
207 Group* group = player->GetGroup();
208
209 std::vector<Player*> playersNear;
210 for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
211 {
212 Player* member = itr->GetSource();
213 if (!member)
214 continue;
215
216 if (player->IsWithinDistInMap(member, sWorld->GetFloatConfig(WorldFloatConfigs::CONFIG_GROUP_XP_DISTANCE), false))
217 playersNear.push_back(member);
218 }
219
220 uint32 goldPerPlayer = uint32((loot->gold) / (playersNear.size()));
221
222 for (std::vector<Player*>::const_iterator i = playersNear.begin(); i != playersNear.end(); ++i)
223 {
224 (*i)->ModifyMoney(goldPerPlayer);
225 (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer);
226
227 if (Guild* guild = sGuildMgr->GetGuildById((*i)->GetGuildId()))
228 if (uint32 guildGold = CalculatePct(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)))
229 guild->HandleMemberDepositMoney(this, guildGold, true);
230
232 data.WriteBit(playersNear.size() <= 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..."
233 data.FlushBits();
234 data << uint32(goldPerPlayer);
235 (*i)->GetSession()->SendPacket(&data);
236 }
237 }
238 else
239 {
240 player->ModifyMoney(loot->gold);
242
243 if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId()))
245 guild->HandleMemberDepositMoney(this, guildGold, true);
246
248 data.WriteBit(1); // "You loot..."
249 data.FlushBits();
250 data << uint32(loot->gold);
251 SendPacket(&data);
252 }
253
254 loot->gold = 0;
255
256 // Delete the money loot record from the DB
257 if (loot->containerID > 0)
259
260 // Delete container if empty
261 if (loot->isLooted() && IS_ITEM_GUID(guid))
262 releaseGuids.push_back(guid);
263 }
264
265 for (std::vector<uint64>::const_iterator itr = releaseGuids.begin(); itr != releaseGuids.end(); ++itr)
266 player->GetSession()->DoLootRelease(*itr);
267}
268
270{
271 AELootCreatureCheck(Player* looter, uint64 mainLootTarget, float lootDistance)
272 : _looter(looter), _mainLootTarget(mainLootTarget), _lootDistance(lootDistance) { }
273
274 bool operator()(Creature* creature) const
275 {
276 if (creature->IsAlive())
277 return false;
278
279 if (creature->GetGUID() == _mainLootTarget)
280 return false;
281
282 if (!_looter->IsWithinDist(creature, _lootDistance))
283 return false;
284
285 return _looter->isAllowedToLoot(creature);
286 }
287
291};
292
294{
295 SF_LOG_DEBUG("network", "WORLD: CMSG_LOOT");
296
297 ObjectGuid guid;
298
299 recvData.ReadGuidMask(guid, 4, 5, 2, 7, 0, 1, 3, 6);
300 recvData.ReadGuidBytes(guid, 3, 5, 0, 6, 4, 1, 7, 2);
301
302 // Check possible cheat
303 if (!_player->IsAlive())
304 return;
305
306 std::list<Creature*> corpses;
307 float const lootDistance = sWorld->GetFloatConfig(WorldFloatConfigs::CONFIG_LOOT_AOE_RADIUS);
308 AELootCreatureCheck check(_player, guid, lootDistance);
310 _player->VisitNearbyGridObject(lootDistance, searcher);
311
313 data << uint32(corpses.size());
314 SendPacket(&data);
315
317
318 for (std::list<Creature*>::const_iterator itr = corpses.begin(); itr != corpses.end(); ++itr)
319 GetPlayer()->SendLoot((*itr)->GetGUID(), LootType::LOOT_CORPSE, true);
320
321 // interrupt cast
322 if (GetPlayer()->IsNonMeleeSpellCasted(false))
324}
325
327{
328 SF_LOG_DEBUG("network", "WORLD: CMSG_LOOT_RELEASE");
329
330 // cheaters can modify lguid to prevent correct apply loot release code and re-loot
331 // use internal stored guid
332
333 ObjectGuid guid;
334 recvData.ReadGuidMask(guid, 7, 4, 2, 3, 0, 5, 6, 1);
335 recvData.ReadGuidBytes(guid, 0, 6, 4, 2, 5, 3, 7, 1);
336
337 if (GetPlayer()->IsLootingObject(guid) || GetPlayer()->GetLootGUID() == guid)
338 DoLootRelease(guid);
339}
340
342{
343 Player* player = GetPlayer();
344 Loot* loot;
345
346 if (player->GetLootGUID() == lguid)
347 player->SetLootGUID(0);
348 player->SendLootRelease(lguid);
349
351 player->RemoveLootedObject(lguid);
352
353 if (!player->IsInWorld())
354 return;
355
356 if (IS_GAMEOBJECT_GUID(lguid))
357 {
358 GameObject* go = GetPlayer()->GetMap()->GetGameObject(lguid);
359
360 // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO
361 if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player, INTERACTION_DISTANCE)))
362 return;
363
364 loot = &go->loot;
365
366 if (go->GetGoType() == GAMEOBJECT_TYPE_DOOR)
367 {
368 // locked doors are opened with spelleffect openlock, prevent remove its as looted
369 go->UseDoorOrButton();
370 }
371 else if (loot->isLooted() || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE)
372 {
374 { // The fishing hole used once more
375 go->AddUse(); // if the max usage is reached, will be despawned in next tick
376 if (go->GetUseCount() >= go->GetGOValue()->FishingHole.MaxOpens)
378 else
380 }
381 else
383
384 loot->clear();
385 }
386 else
387 {
388 // not fully looted object
390
391 // if the round robin player release, reset it.
392 if (player->GetGUID() == loot->roundRobinPlayer)
393 {
394 if (Group* group = player->GetGroup())
395 {
396 if (group->GetLootMethod() != LootMethod::MASTER_LOOT)
397 {
398 loot->roundRobinPlayer = 0;
399 }
400 }
401 else
402 loot->roundRobinPlayer = 0;
403 }
404 }
405 }
406 else if (IS_CORPSE_GUID(lguid)) // ONLY remove insignia at BG
407 {
408 Corpse* corpse = ObjectAccessor::GetCorpse(*player, lguid);
409 if (!corpse || !corpse->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
410 return;
411
412 loot = &corpse->loot;
413
414 if (loot->isLooted())
415 {
416 loot->clear();
418 }
419 }
420 else if (IS_ITEM_GUID(lguid))
421 {
422 Item* pItem = player->GetItemByGuid(lguid);
423 if (!pItem)
424 return;
425
426 ItemTemplate const* proto = pItem->GetTemplate();
427
428 // destroy only 5 items from stack in case prospecting and milling
430 {
431 pItem->m_lootGenerated = false;
432 pItem->loot.clear();
433
434 uint32 count = pItem->GetCount();
435
436 // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks.
437 if (count > 5)
438 count = 5;
439
440 player->DestroyItemCount(pItem, count, true);
441 }
442 else
443 {
444 if (pItem->loot.isLooted()) // Only delete item if no loot or money (unlooted loot is saved to db)
445 player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
446 }
447 return; // item can be looted only single player
448 }
449 else
450 {
451 Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
452
453 bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
454 if (!lootAllowed || (player->GetLootGUID() == lguid && !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)))
455 return;
456
457 loot = &creature->loot;
458 if (loot->isLooted())
459 {
460 // skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
461 if (!creature->IsAlive())
462 creature->AllLootRemovedFromCorpse();
463
465 loot->clear();
466 }
467 else
468 {
469 // if the round robin player release, reset it.
470 if (player->GetGUID() == loot->roundRobinPlayer)
471 {
472 if (Group* group = player->GetGroup())
473 {
474 if (group->GetLootMethod() != LootMethod::MASTER_LOOT)
475 {
476 loot->roundRobinPlayer = 0;
477 group->SendLooter(creature, NULL);
478
479 // force update of dynamic flags, otherwise other group's players still not able to loot.
481 }
482 }
483 else
484 loot->roundRobinPlayer = 0;
485 }
486 }
487 }
488
489 //Player is not looking at loot list, he doesn't need to see updates on the loot list
490 loot->RemoveLooter(player->GetGUID());
491}
492
494{
495 uint8 slotid;
496 uint64 lootguid, target_playerguid;
497
498 recvData >> lootguid >> slotid >> target_playerguid;
499
500 if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetGUID())
501 {
502 _player->SendLootRelease(GetPlayer()->GetLootGUID());
503 return;
504 }
505
506 Player* target = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(target_playerguid, 0, HIGHGUID_PLAYER));
507 if (!target)
508 return;
509
510 SF_LOG_DEBUG("network", "WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName().c_str());
511
512 if (_player->GetLootGUID() != lootguid)
513 return;
514
515 Loot* loot = NULL;
516
517 if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID()))
518 {
519 Creature* creature = GetPlayer()->GetMap()->GetCreature(lootguid);
520 if (!creature)
521 return;
522
523 loot = &creature->loot;
524 }
525 else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID()))
526 {
527 GameObject* pGO = GetPlayer()->GetMap()->GetGameObject(lootguid);
528 if (!pGO)
529 return;
530
531 loot = &pGO->loot;
532 }
533
534 if (!loot)
535 return;
536
537 if (slotid >= loot->items.size() + loot->quest_items.size())
538 {
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());
541 return;
542 }
543
544 LootItem& item = slotid >= loot->items.size() ? loot->quest_items[slotid - loot->items.size()] : loot->items[slotid];
545
546 ItemPosCountVec dest;
547 InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
548 if (item.follow_loot_rules && !item.AllowedForPlayer(target))
550 if (msg != EQUIP_ERR_OK)
551 {
552 target->SendEquipError(msg, NULL, NULL, item.itemid);
553 // send duplicate of error massage to master looter
554 _player->SendEquipError(msg, NULL, NULL, item.itemid);
555 return;
556 }
557
558 // list of players allowed to receive this item in trade
559 AllowedLooterSet looters = item.GetAllowedLooters();
560
561 // not move item from loot to target inventory
562 Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters);
563 target->SendNewItem(newitem, uint32(item.count), false, false, true);
567
568 // mark as looted
569 item.count = 0;
570 item.is_looted = true;
571
572 loot->NotifyItemRemoved(slotid);
573 --loot->unlootedCount;
574}
575
577{
578 SF_LOG_DEBUG("network", "CHARACTER: CMSG_SET_CURRENCY_FLAGS");
579
580 uint32 currencyId, flags;
581
582 recvPacket >> flags >> currencyId;
583
584 if (GetPlayer())
585 GetPlayer()->ModifyCurrencyFlag(currencyId, uint8(flags));
586}
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE
Definition DBCEnums.h:264
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM
Definition DBCEnums.h:207
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM
Definition DBCEnums.h:251
@ ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY
Definition DBCEnums.h:230
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
@ GO_JUST_DEACTIVATED
Definition GameObject.h:619
#define sGuildMgr
Definition GuildMgr.h:53
InventoryResult
Definition Item.h:27
@ EQUIP_ERR_CANT_EQUIP_EVER
Definition Item.h:38
@ EQUIP_ERR_OK
Definition Item.h:28
@ ITEM_PROTO_FLAG_MILLABLE
@ ITEM_PROTO_FLAG_PROSPECTABLE
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
std::set< uint32 > AllowedLooterSet
Definition LootMgr.h:116
@ MASTER_LOOT
Definition LootMgr.h:50
@ LOOT_CORPSE
Definition LootMgr.h:67
#define INTERACTION_DISTANCE
Definition Object.h:21
bool IS_GAMEOBJECT_GUID(uint64 guid)
bool IS_ITEM_GUID(uint64 guid)
bool IS_CRE_OR_VEH_GUID(uint64 guid)
@ HIGHGUID_GAMEOBJECT
@ HIGHGUID_CORPSE
@ HIGHGUID_PLAYER
@ HIGHGUID_UNIT
@ HIGHGUID_ITEM
@ HIGHGUID_VEHICLE
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
Definition Player.h:777
@ GAMEOBJECT_TYPE_FISHINGHOLE
@ GAMEOBJECT_TYPE_FISHINGNODE
@ GAMEOBJECT_TYPE_DOOR
@ CORPSE_DYNFLAG_LOOTABLE
@ UNIT_DYNFLAG_LOOTABLE
@ CLASS_ROGUE
@ SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT
@ NULL_BAG
Definition Unit.h:336
@ NULL_SLOT
Definition Unit.h:337
@ UNIT_FLAG_LOOTING
Definition Unit.h:635
@ CORPSE_FIELD_DYNAMIC_FLAGS
@ UNIT_FIELD_FLAGS
@ OBJECT_FIELD_DYNAMIC_FLAGS
T CalculatePct(T base, U pct)
Definition Util.h:103
bool WriteBit(uint32 bit)
Definition ByteBuffer.h:164
uint32 ReadBits(size_t bits)
Definition ByteBuffer.h:198
void ReadGuidBytes(ObjectGuid &guid, Offsets... offsets)
Definition ByteBuffer.h:256
void ReadByteSeq(uint8 &b)
Definition ByteBuffer.h:215
void ReadGuidMask(ObjectGuid &guid, Offsets... offsets)
Definition ByteBuffer.h:240
void FlushBits()
Definition ByteBuffer.h:154
bool ReadBit()
Definition ByteBuffer.h:180
Loot loot
Definition Corpse.h:63
Loot loot
Definition Creature.h:544
bool lootForPickPocketed
Definition Creature.h:545
void AllLootRemovedFromCorpse()
void AddUse()
Definition GameObject.h:765
uint64 GetOwnerGUID() const
Definition GameObject.h:679
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
GameObjectValue const * GetGOValue() const
Definition GameObject.h:645
GameobjectTypes GetGoType() const
Definition GameObject.h:719
uint32 GetUseCount() const
Definition GameObject.h:767
void SetLootState(LootState s, Unit *unit=NULL)
Definition Group.h:147
GroupReference * GetFirstMember()
Definition Group.h:225
GroupReference * next()
Definition Guild.h:324
Definition Item.h:202
uint8 GetSlot() const
Definition Item.h:265
ItemTemplate const * GetTemplate() const
Definition Item.cpp:528
bool m_lootGenerated
Definition Item.h:302
uint32 GetCount() const
Definition Item.h:258
Loot loot
Definition Item.h:301
uint8 GetBagSlot() const
Definition Item.cpp:734
GameObject * GetGameObject(uint64 guid)
Definition Map.cpp:3184
Creature * GetCreature(uint64 guid)
Definition Map.cpp:3179
static Corpse * GetCorpse(WorldObject const &u, uint64 guid)
static Player * FindPlayer(uint64)
uint64 GetGUID() const
Definition Object.h:119
bool IsInWorld() const
Definition Object.h:114
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:1280
void ForceValuesUpdateAtIndex(uint32)
Definition Object.cpp:2328
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=NULL, uint32 itemid=0)
bool ModifyMoney(int64 amount, bool sendError=true)
Definition Player.cpp:18342
uint32 GetGuildId() const
Definition Player.h:2291
void SendLootRelease(ObjectGuid guid)
Definition Player.cpp:9311
bool IsLootingObject(uint64 guid) const
Definition Player.h:2405
uint64 GetLootGUID() const
Definition Player.h:2393
WorldSession * GetSession() const
Definition Player.h:2417
Item * GetItemByGuid(uint64 guid) const
void DestroyItem(uint8 bag, uint8 slot, bool update)
void RemoveLootedObject(uint64 guid)
Definition Player.cpp:9341
std::set< uint64 > const & GetLootView() const
Definition Player.h:2401
Group * GetGroup()
Definition Player.h:2972
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
Definition Player.cpp:21033
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)
Definition Player.cpp:20681
void SetLootGUID(uint64 guid)
Definition Player.h:2397
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0, AllowedLooterSet const &allowedLooters=AllowedLooterSet())
void ModifyCurrencyFlag(uint32 id, uint8 flag)
Definition Player.cpp:7678
void SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast=false)
Definition Player.cpp:11604
void SendLoot(uint64 guid, LootType loot_type, bool isAoE=false)
Definition Player.cpp:9346
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:1433
uint8 getClass() const
Definition Unit.h:1543
bool IsAlive() const
Definition Unit.h:2032
int32 GetTotalAuraModifier(AuraType auratype) const
Map * GetMap() const
Definition Object.h:740
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1735
std::string const & GetName() const
Definition Object.h:664
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.
Player * _player
void HandleChangeCurrencyFlags(WorldPacket &recvPacket)
void DoLootRelease(uint64 lguid)
void HandleLootReleaseOpcode(WorldPacket &recvPacket)
@ SMSG_AE_LOOT_TARGETS
Definition Opcodes.h:511
@ SMSG_LOOT_MONEY_NOTIFY
Definition Opcodes.h:770
#define sWorld
Definition World.h:910
@ CONFIG_LOOT_AOE_RADIUS
Definition World.h:180
@ CONFIG_GROUP_XP_DISTANCE
Definition World.h:178
bool operator()(Creature *creature) const
AELootCreatureCheck(Player *looter, uint64 mainLootTarget, float lootDistance)
bool isLooted() const
Definition LootMgr.h:332
void clear()
Definition LootMgr.h:308
bool HasLooter(uint64 GUID)
Definition LootMgr.h:339
uint8 unlootedCount
Definition LootMgr.h:285
uint64 roundRobinPlayer
Definition LootMgr.h:286
void NotifyMoneyRemoved(ObjectGuid lootGuid=0)
Definition LootMgr.cpp:618
void NotifyItemRemoved(uint8 lootIndex, ObjectGuid lootGuid=0)
Definition LootMgr.cpp:599
uint32 containerID
Definition LootMgr.h:292
uint32 gold
Definition LootMgr.h:284
void RemoveLooter(uint64 GUID)
Definition LootMgr.h:338
std::vector< LootItem > items
Definition LootMgr.h:282
void DeleteLootMoneyFromContainerItemDB()
Definition LootMgr.cpp:705
LootType loot_type
Definition LootMgr.h:287
std::vector< LootItem > quest_items
Definition LootMgr.h:283
uint32 itemid
Definition LootMgr.h:120
bool follow_loot_rules
Definition LootMgr.h:132
int32 randomPropertyId
Definition LootMgr.h:122
uint8 count
Definition LootMgr.h:125
bool is_looted
Definition LootMgr.h:126
bool AllowedForPlayer(Player const *player) const
Definition LootMgr.cpp:352
const AllowedLooterSet & GetAllowedLooters() const
Definition LootMgr.h:145
struct GameObjectValue::@350066061234367104023065253003102330370272142167 FishingHole