aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Loot/LootMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Loot/LootMgr.h')
-rw-r--r--src/server/game/Loot/LootMgr.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index 673e5b6841e..1f5c0251eec 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -125,19 +125,20 @@ class LootStore;
struct LootStoreItem
{
uint32 itemid; // id of the item
- float chance; // always positive, chance to drop for both quest and non-quest items, chance to be used for refs
- int32 mincountOrRef; // mincount for drop items (positive) or minus referenced TemplateleId (negative)
+ uint32 reference; // referenced TemplateleId
+ float chance; // chance to drop for both quest and non-quest items, chance to be used for refs
+ bool needs_quest : 1; // quest drop (quest is required for item to drop)
uint16 lootmode;
- uint8 group :7;
- bool needs_quest :1; // quest drop (negative ChanceOrQuestChance in DB)
- uint8 maxcount :8; // max drop count for the item (mincountOrRef positive) or Ref multiplicator (mincountOrRef negative)
+ uint8 groupid : 7;
+ uint8 mincount; // mincount for drop items
+ uint8 maxcount : 8; // max drop count for the item mincount or Ref multiplicator
ConditionList conditions; // additional loot condition
- // Constructor, converting ChanceOrQuestChance -> (chance, needs_quest)
+ // Constructor
// displayid is filled in IsValid() which must be called after
- LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, uint16 _lootmode, uint8 _group, int32 _mincountOrRef, uint8 _maxcount)
- : itemid(_itemid), chance(std::fabs(_chanceOrQuestChance)), mincountOrRef(_mincountOrRef), lootmode(_lootmode),
- group(_group), needs_quest(_chanceOrQuestChance < 0), maxcount(_maxcount)
+ 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)
{ }
bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation)
@@ -165,7 +166,7 @@ struct LootItem
bool canSave;
// Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties
- // Should be called for non-reference LootStoreItem entries only (mincountOrRef > 0)
+ // Should be called for non-reference LootStoreItem entries only (reference = 0)
explicit LootItem(LootStoreItem const& li);
// Empty constructor for creating an empty LootItem to be filled in with DB data
@@ -215,7 +216,7 @@ class LootStore
uint32 LoadAndCollectLootIds(LootIdSet& ids_set);
void CheckLootRefs(LootIdSet* ref_set = NULL) const; // check existence reference and remove it from ref_set
void ReportUnusedIds(LootIdSet const& ids_set) const;
- void ReportNotExistedId(uint32 id) const;
+ void ReportNonExistingId(uint32 id) const;
bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); }
bool HaveQuestLootFor(uint32 loot_id) const;