mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -40,7 +40,7 @@ void LootItemStorage::LoadStorageFromDB()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
|
||||
StoredLootItemList& itemList = lootItemStore[fields[0].GetUInt32()];
|
||||
itemList.push_back(StoredLootItem(fields[1].GetUInt32(), fields[2].GetUInt32(), fields[3].GetInt32(), fields[4].GetUInt32()));
|
||||
|
||||
@@ -152,12 +152,12 @@ bool LootItemStorage::LoadStoredLoot(Item* item)
|
||||
loot->unlootedCount++;
|
||||
}
|
||||
|
||||
// Mark the item if it has loot so it won't be generated again on open
|
||||
item->m_lootGenerated = true;
|
||||
return true;
|
||||
// Mark the item if it has loot so it won't be generated again on open
|
||||
item->m_lootGenerated = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LootItemStorage::RemoveStoredLootItem(uint32 containerId, uint32 itemid, uint32 count, Loot *loot)
|
||||
void LootItemStorage::RemoveStoredLootItem(uint32 containerId, uint32 itemid, uint32 count, Loot* loot)
|
||||
{
|
||||
LootItemContainer::iterator itr = lootItemStore.find(containerId);
|
||||
if (itr == lootItemStore.end())
|
||||
@@ -172,13 +172,13 @@ void LootItemStorage::RemoveStoredLootItem(uint32 containerId, uint32 itemid, ui
|
||||
break;
|
||||
}
|
||||
|
||||
// loot with empty itemList but unlootedCount > 0
|
||||
// loot with empty itemList but unlootedCount > 0
|
||||
// must be deleted manually by the player or traded
|
||||
if (!loot->unlootedCount)
|
||||
lootItemStore.erase(itr);
|
||||
}
|
||||
|
||||
void LootItemStorage::RemoveStoredLootMoney(uint32 containerId, Loot *loot)
|
||||
void LootItemStorage::RemoveStoredLootMoney(uint32 containerId, Loot* loot)
|
||||
{
|
||||
LootItemContainer::iterator itr = lootItemStore.find(containerId);
|
||||
if (itr == lootItemStore.end())
|
||||
@@ -193,7 +193,7 @@ void LootItemStorage::RemoveStoredLootMoney(uint32 containerId, Loot *loot)
|
||||
break;
|
||||
}
|
||||
|
||||
// loot with empty itemList but unlootedCount > 0
|
||||
// loot with empty itemList but unlootedCount > 0
|
||||
// must be deleted manually by the player or traded
|
||||
if (!loot->unlootedCount)
|
||||
lootItemStore.erase(itr);
|
||||
|
||||
@@ -13,7 +13,7 @@ Xinef
|
||||
|
||||
struct StoredLootItem
|
||||
{
|
||||
StoredLootItem(uint32 i, uint32 c, int32 ri, uint32 rs) :
|
||||
StoredLootItem(uint32 i, uint32 c, int32 ri, uint32 rs) :
|
||||
itemid(i), count(c), randomPropertyId(ri), randomSuffix(rs) { }
|
||||
|
||||
// If itemid == 0 - money amount is stored in count value
|
||||
@@ -28,25 +28,25 @@ typedef std::unordered_map<uint32, StoredLootItemList> LootItemContainer;
|
||||
|
||||
class LootItemStorage
|
||||
{
|
||||
private:
|
||||
LootItemStorage();
|
||||
~LootItemStorage();
|
||||
private:
|
||||
LootItemStorage();
|
||||
~LootItemStorage();
|
||||
|
||||
public:
|
||||
static LootItemStorage* instance();
|
||||
public:
|
||||
static LootItemStorage* instance();
|
||||
|
||||
void LoadStorageFromDB();
|
||||
void RemoveEntryFromDB(uint32 containerId, uint32 itemid, uint32 count);
|
||||
void LoadStorageFromDB();
|
||||
void RemoveEntryFromDB(uint32 containerId, uint32 itemid, uint32 count);
|
||||
|
||||
void AddNewStoredLoot(Loot* loot, Player* player);
|
||||
bool LoadStoredLoot(Item* item);
|
||||
void AddNewStoredLoot(Loot* loot, Player* player);
|
||||
bool LoadStoredLoot(Item* item);
|
||||
|
||||
void RemoveStoredLootItem(uint32 containerId, uint32 itemid, uint32 count, Loot* loot);
|
||||
void RemoveStoredLootMoney(uint32 containerId, Loot* loot);
|
||||
void RemoveStoredLoot(uint32 containerId);
|
||||
void RemoveStoredLootItem(uint32 containerId, uint32 itemid, uint32 count, Loot* loot);
|
||||
void RemoveStoredLootMoney(uint32 containerId, Loot* loot);
|
||||
void RemoveStoredLoot(uint32 containerId);
|
||||
|
||||
private:
|
||||
LootItemContainer lootItemStore;
|
||||
private:
|
||||
LootItemContainer lootItemStore;
|
||||
};
|
||||
|
||||
#define sLootItemStorage LootItemStorage::instance()
|
||||
|
||||
@@ -61,7 +61,7 @@ struct LootGroupInvalidSelector : public acore::unary_function<LootStoreItem*, b
|
||||
{
|
||||
++foundDuplicates;
|
||||
if (_proto->InventoryType == 0 && foundDuplicates == 3 && _proto->ItemId != 47242 /*Trophy of the Crusade*/) // Non-equippable items are limited to 3 drops
|
||||
return true;
|
||||
return true;
|
||||
else if (_proto->InventoryType != 0 && foundDuplicates == 1) // Equippable item are limited to 1 drop
|
||||
return true;
|
||||
}
|
||||
@@ -76,39 +76,39 @@ private:
|
||||
|
||||
class LootTemplate::LootGroup // A set of loot definitions for items (refs are not allowed)
|
||||
{
|
||||
public:
|
||||
LootGroup() { }
|
||||
~LootGroup();
|
||||
public:
|
||||
LootGroup() { }
|
||||
~LootGroup();
|
||||
|
||||
void AddEntry(LootStoreItem* item); // Adds an entry to the group (at loading stage)
|
||||
bool HasQuestDrop() const; // True if group includes at least 1 quest drop entry
|
||||
bool HasQuestDropForPlayer(Player const* player) const;
|
||||
// The same for active quests of the player
|
||||
void Process(Loot& loot, Player const *player, LootStore const& lootstore, uint16 lootMode) const; // Rolls an item from the group (if any) and adds the item to the loot
|
||||
float RawTotalChance() const; // Overall chance for the group (without equal chanced items)
|
||||
float TotalChance() const; // Overall chance for the group
|
||||
void AddEntry(LootStoreItem* item); // Adds an entry to the group (at loading stage)
|
||||
bool HasQuestDrop() const; // True if group includes at least 1 quest drop entry
|
||||
bool HasQuestDropForPlayer(Player const* player) const;
|
||||
// The same for active quests of the player
|
||||
void Process(Loot& loot, Player const* player, LootStore const& lootstore, uint16 lootMode) const; // Rolls an item from the group (if any) and adds the item to the loot
|
||||
float RawTotalChance() const; // Overall chance for the group (without equal chanced items)
|
||||
float TotalChance() const; // Overall chance for the group
|
||||
|
||||
void Verify(LootStore const& lootstore, uint32 id, uint8 group_id) const;
|
||||
void CollectLootIds(LootIdSet& set) const;
|
||||
void CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_set) const;
|
||||
LootStoreItemList* GetExplicitlyChancedItemList() { return &ExplicitlyChanced; }
|
||||
LootStoreItemList* GetEqualChancedItemList() { return &EqualChanced; }
|
||||
void CopyConditions(ConditionList conditions);
|
||||
private:
|
||||
LootStoreItemList ExplicitlyChanced; // Entries with chances defined in DB
|
||||
LootStoreItemList EqualChanced; // Zero chances - every entry takes the same chance
|
||||
void Verify(LootStore const& lootstore, uint32 id, uint8 group_id) const;
|
||||
void CollectLootIds(LootIdSet& set) const;
|
||||
void CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_set) const;
|
||||
LootStoreItemList* GetExplicitlyChancedItemList() { return &ExplicitlyChanced; }
|
||||
LootStoreItemList* GetEqualChancedItemList() { return &EqualChanced; }
|
||||
void CopyConditions(ConditionList conditions);
|
||||
private:
|
||||
LootStoreItemList ExplicitlyChanced; // Entries with chances defined in DB
|
||||
LootStoreItemList EqualChanced; // Zero chances - every entry takes the same chance
|
||||
|
||||
LootStoreItem const* Roll(Loot& loot, Player const *player, LootStore const& store, uint16 lootMode) const; // Rolls an item from the group, returns NULL if all miss their chances
|
||||
LootStoreItem const* Roll(Loot& loot, Player const* player, LootStore const& store, uint16 lootMode) const; // Rolls an item from the group, returns NULL if all miss their chances
|
||||
|
||||
// This class must never be copied - storing pointers
|
||||
LootGroup(LootGroup const&);
|
||||
LootGroup& operator=(LootGroup const&);
|
||||
// This class must never be copied - storing pointers
|
||||
LootGroup(LootGroup const&);
|
||||
LootGroup& operator=(LootGroup const&);
|
||||
};
|
||||
|
||||
//Remove all data and free all memory
|
||||
void LootStore::Clear()
|
||||
{
|
||||
for (LootTemplateMap::const_iterator itr=m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr)
|
||||
for (LootTemplateMap::const_iterator itr = m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr)
|
||||
delete itr->second;
|
||||
m_LootTemplates.clear();
|
||||
}
|
||||
@@ -173,7 +173,7 @@ uint32 LootStore::LoadLootTable()
|
||||
}
|
||||
|
||||
// Looking for the template of the entry
|
||||
// often entries are put together
|
||||
// often entries are put together
|
||||
if (m_LootTemplates.empty() || tab->first != entry)
|
||||
{
|
||||
// Searching the template (in case template Id changed)
|
||||
@@ -190,8 +190,7 @@ uint32 LootStore::LoadLootTable()
|
||||
// Adds current row to the template
|
||||
tab->second->AddEntry(storeitem);
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
Verify(); // Checks validity of the loot store
|
||||
|
||||
@@ -286,7 +285,7 @@ void LootStore::ReportNonExistingId(uint32 lootId, const char* ownerType, uint32
|
||||
|
||||
// Checks if the entry (quest, non-quest, reference) takes it's chance (at loot generation)
|
||||
// RATE_DROP_ITEMS is no longer used for all types of entries
|
||||
bool LootStoreItem::Roll(bool rate, Player const *player, Loot& loot, LootStore const& store) const
|
||||
bool LootStoreItem::Roll(bool rate, Player const* player, Loot& loot, LootStore const& store) const
|
||||
{
|
||||
float _chance = chance;
|
||||
|
||||
@@ -296,13 +295,13 @@ bool LootStoreItem::Roll(bool rate, Player const *player, Loot& loot, LootStore
|
||||
return true;
|
||||
|
||||
if (reference > 0) // reference case
|
||||
return roll_chance_f(_chance* (rate ? sWorld->getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f));
|
||||
return roll_chance_f(_chance * (rate ? sWorld->getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f));
|
||||
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
|
||||
|
||||
float qualityModifier = pProto && rate ? sWorld->getRate(qualityToRate[pProto->Quality]) : 1.0f;
|
||||
|
||||
return roll_chance_f(_chance*qualityModifier);
|
||||
return roll_chance_f(_chance * qualityModifier);
|
||||
}
|
||||
|
||||
// Checks correctness of values
|
||||
@@ -338,7 +337,7 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
|
||||
if (chance != 0 && chance < 0.000001f) // loot with low chance
|
||||
{
|
||||
sLog->outErrorDb("Table '%s' Entry %d Item %d: low chance (%f) - skipped",
|
||||
store.GetName(), entry, itemid, chance);
|
||||
store.GetName(), entry, itemid, chance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -529,7 +528,7 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting)
|
||||
if (i < items.size())
|
||||
item = &items[i];
|
||||
else
|
||||
item = &quest_items[i-itemsSize];
|
||||
item = &quest_items[i - itemsSize];
|
||||
|
||||
if (!item->is_looted && item->freeforall && item->AllowedForPlayer(player))
|
||||
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid))
|
||||
@@ -544,7 +543,7 @@ QuestItemList* Loot::FillFFALoot(Player* player)
|
||||
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
{
|
||||
LootItem &item = items[i];
|
||||
LootItem& item = items[i];
|
||||
if (!item.is_looted && item.freeforall && item.AllowedForPlayer(player))
|
||||
{
|
||||
ql->push_back(QuestItem(i));
|
||||
@@ -570,7 +569,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
|
||||
|
||||
for (uint8 i = 0; i < quest_items.size(); ++i)
|
||||
{
|
||||
LootItem &item = quest_items[i];
|
||||
LootItem& item = quest_items[i];
|
||||
|
||||
if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT ))))
|
||||
{
|
||||
@@ -605,7 +604,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool pres
|
||||
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
{
|
||||
LootItem &item = items[i];
|
||||
LootItem& item = items[i];
|
||||
if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT ))))
|
||||
{
|
||||
if (presentAtLooting)
|
||||
@@ -690,7 +689,7 @@ void Loot::NotifyQuestItemRemoved(uint8 questIndex)
|
||||
break;
|
||||
|
||||
if (j < pql.size())
|
||||
player->SendNotifyLootItemRemoved(items.size()+j);
|
||||
player->SendNotifyLootItemRemoved(items.size() + j);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -711,7 +710,7 @@ void Loot::generateMoneyLoot(uint32 minAmount, uint32 maxAmount)
|
||||
}
|
||||
}
|
||||
|
||||
LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qitem, QuestItem* *ffaitem, QuestItem* *conditem)
|
||||
LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem * *qitem, QuestItem * *ffaitem, QuestItem * *conditem)
|
||||
{
|
||||
LootItem* item = nullptr;
|
||||
bool is_looted = true;
|
||||
@@ -739,10 +738,10 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
|
||||
QuestItemMap::const_iterator itr = PlayerFFAItems.find(player->GetGUIDLow());
|
||||
if (itr != PlayerFFAItems.end())
|
||||
{
|
||||
for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
for (QuestItemList::const_iterator iter = itr->second->begin(); iter != itr->second->end(); ++iter)
|
||||
if (iter->index == lootSlot)
|
||||
{
|
||||
QuestItem* ffaitem2 = (QuestItem*)&(*iter);
|
||||
QuestItem* ffaitem2 = (QuestItem*) & (*iter);
|
||||
if (ffaitem)
|
||||
*ffaitem = ffaitem2;
|
||||
is_looted = ffaitem2->is_looted;
|
||||
@@ -755,11 +754,11 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
|
||||
QuestItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow());
|
||||
if (itr != PlayerNonQuestNonFFAConditionalItems.end())
|
||||
{
|
||||
for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
for (QuestItemList::const_iterator iter = itr->second->begin(); iter != itr->second->end(); ++iter)
|
||||
{
|
||||
if (iter->index == lootSlot)
|
||||
{
|
||||
QuestItem* conditem2 = (QuestItem*)&(*iter);
|
||||
QuestItem* conditem2 = (QuestItem*) & (*iter);
|
||||
if (conditem)
|
||||
*conditem = conditem2;
|
||||
is_looted = conditem2->is_looted;
|
||||
@@ -792,7 +791,7 @@ bool Loot::hasItemFor(Player* player) const
|
||||
QuestItemList* q_list = q_itr->second;
|
||||
for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
|
||||
{
|
||||
const LootItem &item = quest_items[qi->index];
|
||||
const LootItem& item = quest_items[qi->index];
|
||||
if (!qi->is_looted && !item.is_looted)
|
||||
return true;
|
||||
}
|
||||
@@ -805,7 +804,7 @@ bool Loot::hasItemFor(Player* player) const
|
||||
QuestItemList* ffa_list = ffa_itr->second;
|
||||
for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
|
||||
{
|
||||
const LootItem &item = items[fi->index];
|
||||
const LootItem& item = items[fi->index];
|
||||
if (!fi->is_looted && !item.is_looted)
|
||||
return true;
|
||||
}
|
||||
@@ -818,7 +817,7 @@ bool Loot::hasItemFor(Player* player) const
|
||||
QuestItemList* conditional_list = nn_itr->second;
|
||||
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
|
||||
{
|
||||
const LootItem &item = items[ci->index];
|
||||
const LootItem& item = items[ci->index];
|
||||
if (!ci->is_looted && !item.is_looted)
|
||||
return true;
|
||||
}
|
||||
@@ -859,7 +858,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
return b; // nothing output more
|
||||
}
|
||||
|
||||
Loot &l = lv.loot;
|
||||
Loot& l = lv.loot;
|
||||
|
||||
uint8 itemsShown = 0;
|
||||
|
||||
@@ -873,97 +872,97 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
case GROUP_PERMISSION:
|
||||
case MASTER_PERMISSION:
|
||||
case RESTRICTED_PERMISSION:
|
||||
{
|
||||
// if you are not the round-robin group looter, you can only see
|
||||
// blocked rolled items and quest items, and !ffa items
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
// if you are not the round-robin group looter, you can only see
|
||||
// blocked rolled items and quest items, and !ffa items
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
uint8 slot_type = 0;
|
||||
|
||||
if (l.items[i].is_blocked) // for ML & restricted is_blocked = !is_underthreshold
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
{
|
||||
switch (lv.permission)
|
||||
uint8 slot_type = 0;
|
||||
|
||||
if (l.items[i].is_blocked) // for ML & restricted is_blocked = !is_underthreshold
|
||||
{
|
||||
case GROUP_PERMISSION:
|
||||
slot_type = LOOT_SLOT_TYPE_ROLL_ONGOING;
|
||||
break;
|
||||
case MASTER_PERMISSION:
|
||||
switch (lv.permission)
|
||||
{
|
||||
if (lv.viewer->GetGroup())
|
||||
{
|
||||
if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
|
||||
slot_type = LOOT_SLOT_TYPE_MASTER;
|
||||
else
|
||||
slot_type = LOOT_SLOT_TYPE_LOCKED;
|
||||
}
|
||||
break;
|
||||
case GROUP_PERMISSION:
|
||||
slot_type = LOOT_SLOT_TYPE_ROLL_ONGOING;
|
||||
break;
|
||||
case MASTER_PERMISSION:
|
||||
{
|
||||
if (lv.viewer->GetGroup())
|
||||
{
|
||||
if (lv.viewer->GetGroup()->GetMasterLooterGuid() == lv.viewer->GetGUID())
|
||||
slot_type = LOOT_SLOT_TYPE_MASTER;
|
||||
else
|
||||
slot_type = LOOT_SLOT_TYPE_LOCKED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RESTRICTED_PERMISSION:
|
||||
slot_type = LOOT_SLOT_TYPE_LOCKED;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
case RESTRICTED_PERMISSION:
|
||||
slot_type = LOOT_SLOT_TYPE_LOCKED;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
else if (l.items[i].rollWinnerGUID)
|
||||
{
|
||||
if (l.items[i].rollWinnerGUID == lv.viewer->GetGUID())
|
||||
slot_type = LOOT_SLOT_TYPE_OWNER;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (l.items[i].rollWinnerGUID)
|
||||
{
|
||||
if (l.items[i].rollWinnerGUID == lv.viewer->GetGUID())
|
||||
slot_type = LOOT_SLOT_TYPE_OWNER;
|
||||
else if (l.roundRobinPlayer == 0 || lv.viewer->GetGUID() == l.roundRobinPlayer || !l.items[i].is_underthreshold)
|
||||
{
|
||||
// no round robin owner or he has released the loot
|
||||
// or it IS the round robin group owner
|
||||
// => item is lootable
|
||||
slot_type = LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
}
|
||||
else
|
||||
// item shall not be displayed.
|
||||
continue;
|
||||
}
|
||||
else if (l.roundRobinPlayer == 0 || lv.viewer->GetGUID() == l.roundRobinPlayer || !l.items[i].is_underthreshold)
|
||||
{
|
||||
// no round robin owner or he has released the loot
|
||||
// or it IS the round robin group owner
|
||||
// => item is lootable
|
||||
slot_type = LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
}
|
||||
else
|
||||
// item shall not be displayed.
|
||||
continue;
|
||||
|
||||
b << uint8(i) << l.items[i];
|
||||
b << uint8(slot_type);
|
||||
++itemsShown;
|
||||
b << uint8(i) << l.items[i];
|
||||
b << uint8(slot_type);
|
||||
++itemsShown;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ROUND_ROBIN_PERMISSION:
|
||||
{
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
if (l.roundRobinPlayer != 0 && lv.viewer->GetGUID() != l.roundRobinPlayer)
|
||||
// item shall not be displayed.
|
||||
continue;
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
{
|
||||
if (l.roundRobinPlayer != 0 && lv.viewer->GetGUID() != l.roundRobinPlayer)
|
||||
// item shall not be displayed.
|
||||
continue;
|
||||
|
||||
b << uint8(i) << l.items[i];
|
||||
b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
|
||||
++itemsShown;
|
||||
b << uint8(i) << l.items[i];
|
||||
b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
|
||||
++itemsShown;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ALL_PERMISSION:
|
||||
case OWNER_PERMISSION:
|
||||
{
|
||||
uint8 slot_type = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
uint8 slot_type = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
b << uint8(i) << l.items[i];
|
||||
b << uint8(slot_type);
|
||||
++itemsShown;
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
{
|
||||
b << uint8(i) << l.items[i];
|
||||
b << uint8(slot_type);
|
||||
++itemsShown;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return b;
|
||||
}
|
||||
@@ -980,7 +979,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
QuestItemList* q_list = q_itr->second;
|
||||
for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
|
||||
{
|
||||
LootItem &item = l.quest_items[qi->index];
|
||||
LootItem& item = l.quest_items[qi->index];
|
||||
if (!qi->is_looted && !item.is_looted)
|
||||
{
|
||||
b << uint8(l.items.size() + (qi - q_list->begin()));
|
||||
@@ -1023,7 +1022,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
QuestItemList* ffa_list = ffa_itr->second;
|
||||
for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
|
||||
{
|
||||
LootItem &item = l.items[fi->index];
|
||||
LootItem& item = l.items[fi->index];
|
||||
if (!fi->is_looted && !item.is_looted)
|
||||
{
|
||||
b << uint8(fi->index);
|
||||
@@ -1042,7 +1041,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
QuestItemList* conditional_list = nn_itr->second;
|
||||
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
|
||||
{
|
||||
LootItem &item = l.items[ci->index];
|
||||
LootItem& item = l.items[ci->index];
|
||||
if (!ci->is_looted && !item.is_looted)
|
||||
{
|
||||
b << uint8(ci->index);
|
||||
@@ -1051,22 +1050,22 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
{
|
||||
switch (lv.permission)
|
||||
{
|
||||
case MASTER_PERMISSION:
|
||||
b << uint8(LOOT_SLOT_TYPE_MASTER);
|
||||
break;
|
||||
case RESTRICTED_PERMISSION:
|
||||
b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType));
|
||||
break;
|
||||
case GROUP_PERMISSION:
|
||||
case ROUND_ROBIN_PERMISSION:
|
||||
if (!item.is_blocked)
|
||||
b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
|
||||
else
|
||||
b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
|
||||
break;
|
||||
default:
|
||||
b << uint8(slotType);
|
||||
break;
|
||||
case MASTER_PERMISSION:
|
||||
b << uint8(LOOT_SLOT_TYPE_MASTER);
|
||||
break;
|
||||
case RESTRICTED_PERMISSION:
|
||||
b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType));
|
||||
break;
|
||||
case GROUP_PERMISSION:
|
||||
case ROUND_ROBIN_PERMISSION:
|
||||
if (!item.is_blocked)
|
||||
b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
|
||||
else
|
||||
b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
|
||||
break;
|
||||
default:
|
||||
b << uint8(slotType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!item.freeforall)
|
||||
@@ -1113,7 +1112,7 @@ void LootTemplate::LootGroup::AddEntry(LootStoreItem* item)
|
||||
}
|
||||
|
||||
// Rolls an item from the group, returns NULL if all miss their chances
|
||||
LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const *player, LootStore const& store, uint16 lootMode) const
|
||||
LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const* player, LootStore const& store, uint16 lootMode) const
|
||||
{
|
||||
LootStoreItemList possibleLoot = ExplicitlyChanced;
|
||||
possibleLoot.remove_if(LootGroupInvalidSelector(loot, lootMode));
|
||||
@@ -1126,7 +1125,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const *pla
|
||||
{
|
||||
LootStoreItem* item = *itr;
|
||||
float chance = item->chance;
|
||||
|
||||
|
||||
sScriptMgr->OnItemRoll(player, item, chance, loot, store);
|
||||
|
||||
if (chance >= 100.0f)
|
||||
@@ -1184,7 +1183,7 @@ void LootTemplate::LootGroup::CopyConditions(ConditionList /*conditions*/)
|
||||
}
|
||||
|
||||
// Rolls an item from the group (if any takes its chance) and adds the item to the loot
|
||||
void LootTemplate::LootGroup::Process(Loot& loot, Player const *player, LootStore const& store, uint16 lootMode) const
|
||||
void LootTemplate::LootGroup::Process(Loot& loot, Player const* player, LootStore const& store, uint16 lootMode) const
|
||||
{
|
||||
if (LootStoreItem const* item = Roll(loot, player, store, lootMode))
|
||||
loot.AddItem(*item);
|
||||
@@ -1195,7 +1194,7 @@ float LootTemplate::LootGroup::RawTotalChance() const
|
||||
{
|
||||
float result = 0;
|
||||
|
||||
for (LootStoreItemList::const_iterator i=ExplicitlyChanced.begin(); i != ExplicitlyChanced.end(); ++i)
|
||||
for (LootStoreItemList::const_iterator i = ExplicitlyChanced.begin(); i != ExplicitlyChanced.end(); ++i)
|
||||
if (!(*i)->needs_quest)
|
||||
result += (*i)->chance;
|
||||
|
||||
@@ -1315,7 +1314,7 @@ void LootTemplate::CopyConditions(LootItem* li) const
|
||||
void LootTemplate::Process(Loot& loot, LootStore const& store, uint16 lootMode, Player const* player, uint8 groupId) const
|
||||
{
|
||||
bool rate = store.IsRatesAllowed();
|
||||
|
||||
|
||||
if (groupId) // Group reference uses own processing of the group
|
||||
{
|
||||
if (groupId > Groups.size())
|
||||
@@ -1348,7 +1347,9 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, uint16 lootMode,
|
||||
sScriptMgr->OnAfterRefCount(player, loot, rate, lootMode, item, maxcount, store);
|
||||
for (uint32 loop = 0; loop < maxcount; ++loop) // Ref multiplicator
|
||||
Referenced->Process(loot, store, lootMode, player, item->groupid);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Plain entries (not a reference, not grouped)
|
||||
sScriptMgr->OnBeforeDropAddItem(player, loot, rate, lootMode, item, store);
|
||||
loot.AddItem(*item); // Chance is already checked, just add
|
||||
@@ -1372,7 +1373,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con
|
||||
if (!Groups[groupId - 1])
|
||||
return false;
|
||||
|
||||
return Groups[groupId-1]->HasQuestDrop();
|
||||
return Groups[groupId - 1]->HasQuestDrop();
|
||||
}
|
||||
|
||||
for (LootStoreItemList::const_iterator i = Entries.begin(); i != Entries.end(); ++i)
|
||||
|
||||
@@ -70,7 +70,7 @@ enum LootType
|
||||
LOOT_PICKPOCKETING = 2,
|
||||
LOOT_FISHING = 3,
|
||||
LOOT_DISENCHANTING = 4,
|
||||
// ignored always by client
|
||||
// ignored always by client
|
||||
LOOT_SKINNING = 6,
|
||||
LOOT_PROSPECTING = 7,
|
||||
LOOT_MILLING = 8,
|
||||
@@ -127,13 +127,13 @@ struct LootStoreItem
|
||||
// Constructor
|
||||
// displayid is filled in IsValid() which must be called after
|
||||
LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount)
|
||||
: itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest),
|
||||
lootmode(_lootmode), groupid(_groupid), mincount(_mincount), maxcount(_maxcount)
|
||||
{}
|
||||
: itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest),
|
||||
lootmode(_lootmode), groupid(_groupid), mincount(_mincount), maxcount(_maxcount)
|
||||
{}
|
||||
|
||||
bool Roll(bool rate, Player const *player, Loot& loot, LootStore const& store) const; // Checks if the entry takes it's chance (at loot generation)
|
||||
bool Roll(bool rate, Player const* player, Loot& loot, LootStore const& store) const; // Checks if the entry takes it's chance (at loot generation)
|
||||
bool IsValid(LootStore const& store, uint32 entry) const;
|
||||
// Checks correctness of values
|
||||
// Checks correctness of values
|
||||
};
|
||||
|
||||
typedef std::set<uint32> AllowedLooterSet;
|
||||
@@ -165,7 +165,7 @@ struct LootItem
|
||||
bool AllowedForPlayer(Player const* player) const;
|
||||
|
||||
void AddAllowedLooter(Player const* player);
|
||||
const AllowedLooterSet & GetAllowedLooters() const { return allowedGUIDs; }
|
||||
const AllowedLooterSet& GetAllowedLooters() const { return allowedGUIDs; }
|
||||
};
|
||||
|
||||
struct QuestItem
|
||||
@@ -192,39 +192,39 @@ typedef std::set<uint32> LootIdSet;
|
||||
|
||||
class LootStore
|
||||
{
|
||||
public:
|
||||
explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
|
||||
: m_name(name), m_entryName(entryName), m_ratesAllowed(ratesAllowed) {}
|
||||
public:
|
||||
explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
|
||||
: m_name(name), m_entryName(entryName), m_ratesAllowed(ratesAllowed) {}
|
||||
|
||||
virtual ~LootStore() { Clear(); }
|
||||
virtual ~LootStore() { Clear(); }
|
||||
|
||||
uint32 LoadAndCollectLootIds(LootIdSet& ids_set);
|
||||
void ResetConditions();
|
||||
uint32 LoadAndCollectLootIds(LootIdSet& ids_set);
|
||||
void ResetConditions();
|
||||
|
||||
void Verify() const;
|
||||
void CheckLootRefs(LootIdSet* ref_set = nullptr) const; // check existence reference and remove it from ref_set
|
||||
void ReportUnusedIds(LootIdSet const& ids_set) const;
|
||||
void ReportNonExistingId(uint32 lootId) const;
|
||||
void ReportNonExistingId(uint32 lootId, const char* ownerType, uint32 ownerId) const;
|
||||
void Verify() const;
|
||||
void CheckLootRefs(LootIdSet* ref_set = nullptr) const; // check existence reference and remove it from ref_set
|
||||
void ReportUnusedIds(LootIdSet const& ids_set) const;
|
||||
void ReportNonExistingId(uint32 lootId) const;
|
||||
void ReportNonExistingId(uint32 lootId, const char* ownerType, uint32 ownerId) const;
|
||||
|
||||
bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); }
|
||||
bool HaveQuestLootFor(uint32 loot_id) const;
|
||||
bool HaveQuestLootForPlayer(uint32 loot_id, Player const* player) const;
|
||||
bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); }
|
||||
bool HaveQuestLootFor(uint32 loot_id) const;
|
||||
bool HaveQuestLootForPlayer(uint32 loot_id, Player const* player) const;
|
||||
|
||||
LootTemplate const* GetLootFor(uint32 loot_id) const;
|
||||
LootTemplate* GetLootForConditionFill(uint32 loot_id) const;
|
||||
LootTemplate const* GetLootFor(uint32 loot_id) const;
|
||||
LootTemplate* GetLootForConditionFill(uint32 loot_id) const;
|
||||
|
||||
char const* GetName() const { return m_name; }
|
||||
char const* GetEntryName() const { return m_entryName; }
|
||||
bool IsRatesAllowed() const { return m_ratesAllowed; }
|
||||
protected:
|
||||
uint32 LoadLootTable();
|
||||
void Clear();
|
||||
private:
|
||||
LootTemplateMap m_LootTemplates;
|
||||
char const* m_name;
|
||||
char const* m_entryName;
|
||||
bool m_ratesAllowed;
|
||||
char const* GetName() const { return m_name; }
|
||||
char const* GetEntryName() const { return m_entryName; }
|
||||
bool IsRatesAllowed() const { return m_ratesAllowed; }
|
||||
protected:
|
||||
uint32 LoadLootTable();
|
||||
void Clear();
|
||||
private:
|
||||
LootTemplateMap m_LootTemplates;
|
||||
char const* m_name;
|
||||
char const* m_entryName;
|
||||
bool m_ratesAllowed;
|
||||
};
|
||||
|
||||
class LootTemplate
|
||||
@@ -232,61 +232,61 @@ class LootTemplate
|
||||
class LootGroup; // A set of loot definitions for items (refs are not allowed inside)
|
||||
typedef std::vector<LootGroup*> LootGroups;
|
||||
|
||||
public:
|
||||
LootTemplate() { }
|
||||
~LootTemplate();
|
||||
public:
|
||||
LootTemplate() { }
|
||||
~LootTemplate();
|
||||
|
||||
// Adds an entry to the group (at loading stage)
|
||||
void AddEntry(LootStoreItem* item);
|
||||
// Rolls for every item in the template and adds the rolled items the the loot
|
||||
void Process(Loot& loot, LootStore const& store, uint16 lootMode, Player const* player, uint8 groupId = 0) const;
|
||||
void CopyConditions(ConditionList conditions);
|
||||
void CopyConditions(LootItem* li) const;
|
||||
// Adds an entry to the group (at loading stage)
|
||||
void AddEntry(LootStoreItem* item);
|
||||
// Rolls for every item in the template and adds the rolled items the the loot
|
||||
void Process(Loot& loot, LootStore const& store, uint16 lootMode, Player const* player, uint8 groupId = 0) const;
|
||||
void CopyConditions(ConditionList conditions);
|
||||
void CopyConditions(LootItem* li) const;
|
||||
|
||||
// True if template includes at least 1 quest drop entry
|
||||
bool HasQuestDrop(LootTemplateMap const& store, uint8 groupId = 0) const;
|
||||
// True if template includes at least 1 quest drop for an active quest of the player
|
||||
bool HasQuestDropForPlayer(LootTemplateMap const& store, Player const* player, uint8 groupId = 0) const;
|
||||
// True if template includes at least 1 quest drop entry
|
||||
bool HasQuestDrop(LootTemplateMap const& store, uint8 groupId = 0) const;
|
||||
// True if template includes at least 1 quest drop for an active quest of the player
|
||||
bool HasQuestDropForPlayer(LootTemplateMap const& store, Player const* player, uint8 groupId = 0) const;
|
||||
|
||||
// Checks integrity of the template
|
||||
void Verify(LootStore const& store, uint32 Id) const;
|
||||
void CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_set) const;
|
||||
bool addConditionItem(Condition* cond);
|
||||
bool isReference(uint32 id) const;
|
||||
// Checks integrity of the template
|
||||
void Verify(LootStore const& store, uint32 Id) const;
|
||||
void CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_set) const;
|
||||
bool addConditionItem(Condition* cond);
|
||||
bool isReference(uint32 id) const;
|
||||
|
||||
private:
|
||||
LootStoreItemList Entries; // not grouped only
|
||||
LootGroups Groups; // groups have own (optimised) processing, grouped entries go there
|
||||
private:
|
||||
LootStoreItemList Entries; // not grouped only
|
||||
LootGroups Groups; // groups have own (optimised) processing, grouped entries go there
|
||||
|
||||
// Objects of this class must never be copied, we are storing pointers in container
|
||||
LootTemplate(LootTemplate const&);
|
||||
LootTemplate& operator=(LootTemplate const&);
|
||||
// Objects of this class must never be copied, we are storing pointers in container
|
||||
LootTemplate(LootTemplate const&);
|
||||
LootTemplate& operator=(LootTemplate const&);
|
||||
};
|
||||
|
||||
//=====================================================
|
||||
|
||||
class LootValidatorRef : public Reference<Loot, LootValidatorRef>
|
||||
{
|
||||
public:
|
||||
LootValidatorRef() {}
|
||||
void targetObjectDestroyLink() {}
|
||||
void sourceObjectDestroyLink() {}
|
||||
public:
|
||||
LootValidatorRef() {}
|
||||
void targetObjectDestroyLink() {}
|
||||
void sourceObjectDestroyLink() {}
|
||||
};
|
||||
|
||||
//=====================================================
|
||||
|
||||
class LootValidatorRefManager : public RefManager<Loot, LootValidatorRef>
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< LootValidatorRef > iterator;
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< LootValidatorRef > iterator;
|
||||
|
||||
LootValidatorRef* getFirst() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getFirst(); }
|
||||
LootValidatorRef* getLast() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getLast(); }
|
||||
LootValidatorRef* getFirst() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getFirst(); }
|
||||
LootValidatorRef* getLast() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getLast(); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
iterator rend() { return iterator(nullptr); }
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
iterator rend() { return iterator(nullptr); }
|
||||
};
|
||||
|
||||
//=====================================================
|
||||
@@ -309,7 +309,7 @@ struct Loot
|
||||
uint8 unlootedCount;
|
||||
uint64 roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released.
|
||||
LootType loot_type; // required for achievement system
|
||||
|
||||
|
||||
// GUIDLow of container that holds this loot (item_instance.entry), set for items that can be looted
|
||||
uint32 containerId;
|
||||
|
||||
@@ -360,35 +360,35 @@ struct Loot
|
||||
bool FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bool personal, bool noEmptyError = false, uint16 lootMode = LOOT_MODE_DEFAULT);
|
||||
|
||||
// Inserts the item into the loot (called by LootTemplate processors)
|
||||
void AddItem(LootStoreItem const & item);
|
||||
void AddItem(LootStoreItem const& item);
|
||||
|
||||
LootItem* LootItemInSlot(uint32 lootslot, Player* player, QuestItem** qitem = NULL, QuestItem** ffaitem = NULL, QuestItem** conditem = nullptr);
|
||||
uint32 GetMaxSlotInLootFor(Player* player) const;
|
||||
bool hasItemFor(Player* player) const;
|
||||
bool hasOverThresholdItem() const;
|
||||
|
||||
private:
|
||||
void FillNotNormalLootFor(Player* player, bool presentAtLooting);
|
||||
QuestItemList* FillFFALoot(Player* player);
|
||||
QuestItemList* FillQuestLoot(Player* player);
|
||||
QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting);
|
||||
private:
|
||||
void FillNotNormalLootFor(Player* player, bool presentAtLooting);
|
||||
QuestItemList* FillFFALoot(Player* player);
|
||||
QuestItemList* FillQuestLoot(Player* player);
|
||||
QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting);
|
||||
|
||||
typedef std::set<uint64> PlayersLootingSet;
|
||||
PlayersLootingSet PlayersLooting;
|
||||
QuestItemMap PlayerQuestItems;
|
||||
QuestItemMap PlayerFFAItems;
|
||||
QuestItemMap PlayerNonQuestNonFFAConditionalItems;
|
||||
typedef std::set<uint64> PlayersLootingSet;
|
||||
PlayersLootingSet PlayersLooting;
|
||||
QuestItemMap PlayerQuestItems;
|
||||
QuestItemMap PlayerFFAItems;
|
||||
QuestItemMap PlayerNonQuestNonFFAConditionalItems;
|
||||
|
||||
// All rolls are registered here. They need to know, when the loot is not valid anymore
|
||||
LootValidatorRefManager i_LootValidatorRefManager;
|
||||
// All rolls are registered here. They need to know, when the loot is not valid anymore
|
||||
LootValidatorRefManager i_LootValidatorRefManager;
|
||||
};
|
||||
|
||||
struct LootView
|
||||
{
|
||||
Loot &loot;
|
||||
Loot& loot;
|
||||
Player* viewer;
|
||||
PermissionTypes permission;
|
||||
LootView(Loot &_loot, Player* _viewer, PermissionTypes _permission = ALL_PERMISSION)
|
||||
LootView(Loot& _loot, Player* _viewer, PermissionTypes _permission = ALL_PERMISSION)
|
||||
: loot(_loot), viewer(_viewer), permission(_permission) {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user