aboutsummaryrefslogtreecommitdiff
path: root/src/game/LootMgr.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-21 16:18:57 -0600
committermegamage <none@none>2009-01-21 16:18:57 -0600
commit4230318f962f5faeddf188d61a367a635a8bb81a (patch)
tree6827d5a40216a2915c3d7724706c3121e237d51f /src/game/LootMgr.h
parent68c0bcd06980cbc5babc842d990d1b8eb564e388 (diff)
*Update to Mangos 7136.
--HG-- branch : trunk
Diffstat (limited to 'src/game/LootMgr.h')
-rw-r--r--src/game/LootMgr.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h
index f9fed651a1c..5205024a46c 100644
--- a/src/game/LootMgr.h
+++ b/src/game/LootMgr.h
@@ -77,7 +77,7 @@ struct LootStoreItem
group(_group), maxcount(_maxcount), conditionId(_conditionId),
needs_quest(_chanceOrQuestChance < 0) {}
- bool Roll() const; // Checks if the entry takes it's chance (at loot generation)
+ bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation)
bool IsValid(LootStore const& store, uint32 entry) const;
// Checks correctness of values
};
@@ -129,7 +129,8 @@ typedef std::set<uint32> LootIdSet;
class LootStore
{
public:
- explicit LootStore(char const* name, char const* entryName) : m_name(name), m_entryName(entryName) {}
+ explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
+ : m_name(name), m_entryName(entryName), m_ratesAllowed(m_ratesAllowed) {}
virtual ~LootStore() { Clear(); }
void Verify() const;
@@ -147,6 +148,7 @@ class LootStore
char const* GetName() const { return m_name; }
char const* GetEntryName() const { return m_entryName; }
+ bool IsRatesAllowed() const { return m_ratesAllowed; }
protected:
void LoadLootTable();
void Clear();
@@ -154,6 +156,7 @@ class LootStore
LootTemplateMap m_LootTemplates;
char const* m_name;
char const* m_entryName;
+ bool m_ratesAllowed;
};
class LootTemplate
@@ -165,7 +168,7 @@ class 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, uint8 GroupId = 0) const;
+ void Process(Loot& loot, LootStore const& store, bool rate, uint8 GroupId = 0) const;
// True if template includes at least 1 quest drop entry
bool HasQuestDrop(LootTemplateMap const& store, uint8 GroupId = 0) const;
@@ -303,6 +306,7 @@ extern LootStore LootTemplates_Skinning;
extern LootStore LootTemplates_Disenchant;
extern LootStore LootTemplates_Prospecting;
extern LootStore LootTemplates_QuestMail;
+extern LootStore LootTemplates_Spell;
void LoadLootTemplates_Creature();
void LoadLootTemplates_Fishing();
@@ -314,6 +318,8 @@ void LoadLootTemplates_Skinning();
void LoadLootTemplates_Disenchant();
void LoadLootTemplates_Prospecting();
void LoadLootTemplates_QuestMail();
+
+void LoadLootTemplates_Spell();
void LoadLootTemplates_Reference();
inline void LoadLootTables()
@@ -328,6 +334,8 @@ inline void LoadLootTables()
LoadLootTemplates_Disenchant();
LoadLootTemplates_Prospecting();
LoadLootTemplates_QuestMail();
+ LoadLootTemplates_Spell();
+
LoadLootTemplates_Reference();
}