aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-07-27 19:16:30 +0200
committerShauren <shauren.trinity@gmail.com>2016-07-27 19:16:30 +0200
commit60a6d9c85d8b5ddc227b52f828cf5fc9955626d8 (patch)
tree0c346a64d16ce5f54f7db9ed2a0649255ed5e5c4 /src/server/game/Groups/Group.cpp
parente9274de4ffc1234893b61be43b547fdcfd6e8f29 (diff)
Core/Loot: Removed need before greed and round robin loot methods
"Round Robin and the old "Group Loot" option were removed in 7.0.3, since they were almost entirely unused. Loot options are now: Group Loot, Master Loot (if in a guild party), Personal Loot, and Free For All"
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp156
1 files changed, 2 insertions, 154 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 594284d8fc8..bd19b6bb04c 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -227,7 +227,7 @@ void Group::LoadMemberFromDB(ObjectGuid::LowType guidLow, uint8 memberFlags, uin
void Group::ConvertToLFG()
{
m_groupType = GroupType(m_groupType | GROUPTYPE_LFG | GROUPTYPE_LFG_RESTRICTED);
- m_lootMethod = NEED_BEFORE_GREED;
+ m_lootMethod = GROUP_LOOT;
if (!isBGGroup() && !isBFGroup())
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
@@ -978,159 +978,7 @@ void Group::SendLooter(Creature* creature, Player* groupLooter)
BroadcastPacket(lootList.Write(), false);
}
-void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
-{
- std::vector<LootItem>::iterator i;
- ItemTemplate const* item;
- uint8 itemSlot = 0;
-
- for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
- {
- if (i->freeforall)
- continue;
-
- item = sObjectMgr->GetItemTemplate(i->itemid);
- if (!item)
- {
- //TC_LOG_DEBUG("misc", "Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
- continue;
- }
-
- //roll for over-threshold item if it's one-player loot
- if (item->GetQuality() >= uint32(m_lootThreshold))
- {
- ObjectGuid newitemGUID = ObjectGuid::Create<HighGuid::Item>(sObjectMgr->GetGenerator<HighGuid::Item>().Generate());
- Roll* r = new Roll(newitemGUID, *i);
-
- //a vector is filled with only near party members
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player* member = itr->GetSource();
- if (!member || !member->GetSession())
- continue;
- if (i->AllowedForPlayer(member))
- {
- if (member->IsAtGroupRewardDistance(pLootedObject))
- {
- r->totalPlayersRolling++;
-
- if (member->GetPassOnGroupLoot())
- {
- r->playerVote[member->GetGUID()] = PASS;
- r->totalPass++;
- // can't broadcast the pass now. need to wait until all rolling players are known.
- }
- else
- r->playerVote[member->GetGUID()] = NOT_EMITED_YET;
- }
- }
- }
-
- if (r->totalPlayersRolling > 0)
- {
- r->setLoot(loot);
- r->itemSlot = itemSlot;
- if (item->DisenchantID && m_maxEnchantingLevel >= item->RequiredDisenchantSkill)
- r->rollVoteMask |= ROLL_FLAG_TYPE_DISENCHANT;
-
- loot->items[itemSlot].is_blocked = true;
-
- // If there is any "auto pass", broadcast the pass now.
- if (r->totalPass)
- {
- for (Roll::PlayerVote::const_iterator itr=r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
- {
- Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
- if (!p || !p->GetSession())
- continue;
-
- if (itr->second == PASS)
- SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r);
- }
- }
-
- SendLootStartRoll(60000, pLootedObject->GetMapId(), *r);
-
- RollId.push_back(r);
-
- if (Creature* creature = pLootedObject->ToCreature())
- {
- creature->m_groupLootTimer = 60000;
- creature->lootingGroupLowGUID = GetGUID();
- }
- else if (GameObject* go = pLootedObject->ToGameObject())
- {
- go->m_groupLootTimer = 60000;
- go->lootingGroupLowGUID = GetGUID();
- }
- }
- else
- delete r;
- }
- else
- i->is_underthreshold = true;
- }
-
- for (i = loot->quest_items.begin(); i != loot->quest_items.end(); ++i, ++itemSlot)
- {
- if (!i->follow_loot_rules)
- continue;
-
- item = sObjectMgr->GetItemTemplate(i->itemid);
- if (!item)
- {
- //TC_LOG_DEBUG("misc", "Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
- continue;
- }
-
- ObjectGuid newitemGUID = ObjectGuid::Create<HighGuid::Item>(sObjectMgr->GetGenerator<HighGuid::Item>().Generate());
- Roll* r = new Roll(newitemGUID, *i);
-
- //a vector is filled with only near party members
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player* member = itr->GetSource();
- if (!member || !member->GetSession())
- continue;
-
- if (i->AllowedForPlayer(member))
- {
- if (member->IsAtGroupRewardDistance(pLootedObject))
- {
- r->totalPlayersRolling++;
- r->playerVote[member->GetGUID()] = NOT_EMITED_YET;
- }
- }
- }
-
- if (r->totalPlayersRolling > 0)
- {
- r->setLoot(loot);
- r->itemSlot = itemSlot;
-
- loot->quest_items[itemSlot - loot->items.size()].is_blocked = true;
-
- SendLootStartRoll(60000, pLootedObject->GetMapId(), *r);
-
- RollId.push_back(r);
-
- if (Creature* creature = pLootedObject->ToCreature())
- {
- creature->m_groupLootTimer = 60000;
- creature->lootingGroupLowGUID = GetGUID();
- }
- else if (GameObject* go = pLootedObject->ToGameObject())
- {
- go->m_groupLootTimer = 60000;
- go->lootingGroupLowGUID = GetGUID();
- }
- }
- else
- delete r;
- }
-}
-
-void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
+void Group::GroupLoot(Loot* loot, WorldObject* lootedObject)
{
ItemTemplate const* item;
uint8 itemSlot = 0;