diff options
author | maximius <none@none> | 2009-10-28 16:31:19 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-28 16:31:19 -0700 |
commit | f4d76b8216c911901e8a13996c55128bbfa4b08e (patch) | |
tree | d1db8d946c29cb9bdca5e0bf4d0da0a029f46d45 /src/game/LootMgr.h | |
parent | d5b8ad0080d45c2f02ef5a4fdd4d8853da286b6d (diff) |
*Implement new LootMode system, and add some basic support in boss_sartharion.cpp. Requires database support.
--HG--
branch : trunk
Diffstat (limited to 'src/game/LootMgr.h')
-rw-r--r-- | src/game/LootMgr.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h index c629977ea67..be20c57ec9a 100644 --- a/src/game/LootMgr.h +++ b/src/game/LootMgr.h @@ -81,14 +81,15 @@ struct LootStoreItem 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) uint8 group :7; + uint16 lootmode; 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) uint16 conditionId :16; // additional loot condition Id // Constructor, converting ChanceOrQuestChance -> (chance, needs_quest) // displayid is filled in IsValid() which must be called after - LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, int8 _group, uint8 _conditionId, int32 _mincountOrRef, uint8 _maxcount) - : itemid(_itemid), chance(fabs(_chanceOrQuestChance)), mincountOrRef(_mincountOrRef), + LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, uint8 _group, uint16 _lootmode, uint8 _conditionId, int32 _mincountOrRef, uint8 _maxcount) + : itemid(_itemid), chance(fabs(_chanceOrQuestChance)), mincountOrRef(_mincountOrRef), lootmode(_lootmode), group(_group), needs_quest(_chanceOrQuestChance < 0), maxcount(_maxcount), conditionId(_conditionId) {} @@ -183,12 +184,12 @@ 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, bool rate, uint8 GroupId = 0) const; + void Process(Loot& loot, LootStore const& store, bool rate, uint16 lootMode, 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; + 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; @@ -285,7 +286,7 @@ struct Loot void RemoveLooter(uint64 GUID) { PlayersLooting.erase(GUID); } void generateMoneyLoot(uint32 minAmount, uint32 maxAmount); - void FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal); + void FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal, uint16 lootMode = DEFAULT_LOOT_MODE); // Inserts the item into the loot (called by LootTemplate processors) void AddItem(LootStoreItem const & item); |