mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9964] Implement Treshold in Masterloot.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
702d368114
commit
8a424642e6
4 changed files with 16 additions and 5 deletions
|
|
@ -580,8 +580,17 @@ void Group::NeedBeforeGreed(Creature *creature, Loot *loot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::MasterLoot(Creature *creature, Loot* /*loot*/)
|
void Group::MasterLoot(Creature *creature, Loot* loot)
|
||||||
{
|
{
|
||||||
|
for (LootItemList::iterator i=loot->items.begin(); i != loot->items.end(); ++i)
|
||||||
|
{
|
||||||
|
ItemPrototype const *item = ObjectMgr::GetItemPrototype(i->itemid);
|
||||||
|
if (!item)
|
||||||
|
continue;
|
||||||
|
if (item->Quality < uint32(m_lootThreshold))
|
||||||
|
i->is_underthreshold = 1;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 real_count = 0;
|
uint32 real_count = 0;
|
||||||
|
|
||||||
WorldPacket data(SMSG_LOOT_MASTER_LIST, 330);
|
WorldPacket data(SMSG_LOOT_MASTER_LIST, 330);
|
||||||
|
|
|
||||||
|
|
@ -724,11 +724,11 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||||
case ALL_PERMISSION:
|
case ALL_PERMISSION:
|
||||||
case MASTER_PERMISSION:
|
case MASTER_PERMISSION:
|
||||||
{
|
{
|
||||||
uint8 slot_type = (lv.permission==MASTER_PERMISSION) ? 2 : 0;
|
|
||||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||||
{
|
{
|
||||||
if (!l.items[i].is_looted && !l.items[i].freeforall && !l.items[i].conditionId && l.items[i].AllowedForPlayer(lv.viewer))
|
if (!l.items[i].is_looted && !l.items[i].freeforall && !l.items[i].conditionId && l.items[i].AllowedForPlayer(lv.viewer))
|
||||||
{
|
{
|
||||||
|
uint8 slot_type = (lv.permission==MASTER_PERMISSION && !l.items[i].is_underthreshold) ? 2 : 0;
|
||||||
b << uint8(i) << l.items[i]; //only send one-player loot items now, free for all will be sent later
|
b << uint8(i) << l.items[i]; //only send one-player loot items now, free for all will be sent later
|
||||||
b << uint8(slot_type); // 0 - get 2 - master selection
|
b << uint8(slot_type); // 0 - get 2 - master selection
|
||||||
++itemsShown;
|
++itemsShown;
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,8 @@ struct LootItem
|
||||||
bool AllowedForPlayer(Player const * player) const;
|
bool AllowedForPlayer(Player const * player) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::vector<LootItem> LootItemList;
|
||||||
|
|
||||||
struct QuestItem
|
struct QuestItem
|
||||||
{
|
{
|
||||||
uint8 index; // position in quest_items;
|
uint8 index; // position in quest_items;
|
||||||
|
|
@ -220,7 +222,7 @@ struct Loot
|
||||||
QuestItemMap const& GetPlayerFFAItems() const { return PlayerFFAItems; }
|
QuestItemMap const& GetPlayerFFAItems() const { return PlayerFFAItems; }
|
||||||
QuestItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
|
QuestItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
|
||||||
|
|
||||||
std::vector<LootItem> items;
|
LootItemList items;
|
||||||
uint32 gold;
|
uint32 gold;
|
||||||
uint8 unlootedCount;
|
uint8 unlootedCount;
|
||||||
LootType loot_type; // required for achievement system
|
LootType loot_type; // required for achievement system
|
||||||
|
|
@ -281,7 +283,7 @@ struct Loot
|
||||||
QuestItemList* FillQuestLoot(Player* player);
|
QuestItemList* FillQuestLoot(Player* player);
|
||||||
QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player);
|
QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player);
|
||||||
|
|
||||||
std::vector<LootItem> quest_items;
|
LootItemList quest_items;
|
||||||
std::set<uint64> PlayersLooting;
|
std::set<uint64> PlayersLooting;
|
||||||
QuestItemMap PlayerQuestItems;
|
QuestItemMap PlayerQuestItems;
|
||||||
QuestItemMap PlayerFFAItems;
|
QuestItemMap PlayerFFAItems;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9963"
|
#define REVISION_NR "9964"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue