Core/Loot
* Master Looter cannot freely loot items under threshold * Update round robin looter only if loot is not empty * Fixed loot bag icon appearing in raid frames when loot method was not Master Looter * Fixed changing loot method reseting current round robin looter
This commit is contained in:
1 parent
dee867547d
commit
3fd6dd6175
6 files changed
+41
-58
No files matched your search
@@ -15159,8 +15159,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
data << uint64(victim->GetGUID()); // victim
|
||||
|
||||
Player* looter = player;
|
||||
Group* group = player->GetGroup();
|
||||
bool hasLooterGuid = false;
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
if (group)
|
||||
{
|
||||
group->BroadcastPacket(&data, group->GetMemberGroup(player->GetGUID()));
|
||||
|
||||
@@ -15172,16 +15174,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
looter = ObjectAccessor::FindPlayer(group->GetLooterGuid());
|
||||
if (looter)
|
||||
{
|
||||
hasLooterGuid = true;
|
||||
creature->SetLootRecipient(looter); // update creature loot recipient to the allowed looter.
|
||||
group->SendLooter(creature, looter);
|
||||
}
|
||||
else
|
||||
group->SendLooter(creature, NULL);
|
||||
}
|
||||
else
|
||||
group->SendLooter(creature, NULL);
|
||||
|
||||
group->UpdateLooterGuid(creature);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -15198,6 +15194,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loot before updating looter
|
||||
if (creature)
|
||||
{
|
||||
Loot* loot = &creature->loot;
|
||||
@@ -15209,6 +15206,18 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
loot->FillLoot(lootid, LootTemplates_Creature, looter, false, false, creature->GetLootMode());
|
||||
|
||||
loot->generateMoneyLoot(creature->GetCreatureTemplate()->mingold, creature->GetCreatureTemplate()->maxgold);
|
||||
|
||||
if (group)
|
||||
{
|
||||
if (hasLooterGuid)
|
||||
group->SendLooter(creature, looter);
|
||||
else
|
||||
group->SendLooter(creature, NULL);
|
||||
|
||||
// Update round robin looter only if the creature had loot
|
||||
if (!creature->loot.empty())
|
||||
group->UpdateLooterGuid(creature);
|
||||
}
|
||||
}
|
||||
|
||||
player->RewardPlayerAndGroupAtKill(victim, false);
|
||||
|
||||
Reference in new issue
Block a user