Advertisement
Guest User

AzerothCore max items in loot diff

a guest
Dec 23rd, 2022
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.58 KB | Source Code | 0 0
  1. diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
  2. index 8b1a833d..743bf088 100644
  3. --- a/src/server/game/Loot/LootMgr.cpp
  4. +++ b/src/server/game/Loot/LootMgr.cpp
  5. @@ -149,12 +149,12 @@ uint32 LootStore::LoadLootTable()
  6.          bool   needsquest          = fields[4].GetBool();
  7.          uint16 lootmode            = fields[5].GetUInt16();
  8.          uint8  groupid             = fields[6].GetUInt8();
  9. -        int32  mincount            = fields[7].GetUInt8();
  10. -        int32  maxcount            = fields[8].GetUInt8();
  11. +        uint16  mincount           = fields[7].GetUInt16();
  12. +        uint16  maxcount           = fields[8].GetUInt16();
  13.  
  14. -        if (maxcount > std::numeric_limits<uint8>::max())
  15. +        if (maxcount > std::numeric_limits<uint16>::max())
  16.          {
  17. -            sLog->outErrorDb("Table '%s' Entry %d Item %d: MaxCount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
  18. +            sLog->outErrorDb("Table '%s' Entry %d Item %d: MaxCount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint16>::max());
  19.              continue;                                   // error already printed to log/console.
  20.          }
  21.  
  22. @@ -1126,7 +1126,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll(Loot& loot, Player const *pla
  23.          {
  24.              LootStoreItem* item = *itr;
  25.              float chance = item->chance;
  26. -
  27. +
  28.              sScriptMgr->OnItemRoll(player, item, chance, loot, store);
  29.  
  30.              if (chance >= 100.0f)
  31. @@ -1315,7 +1315,7 @@ void LootTemplate::CopyConditions(LootItem* li) const
  32.  void LootTemplate::Process(Loot& loot, LootStore const& store, uint16 lootMode, Player const* player, uint8 groupId) const
  33.  {
  34.      bool rate = store.IsRatesAllowed();
  35. -
  36. +
  37.      if (groupId)                                            // Group reference uses own processing of the group
  38.      {
  39.          if (groupId > Groups.size())
  40. diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
  41. index 9fccb5b5..4b5ffc3f 100644
  42. --- a/src/server/game/Loot/LootMgr.h
  43. +++ b/src/server/game/Loot/LootMgr.h
  44. @@ -120,14 +120,14 @@ struct LootStoreItem
  45.      bool    needs_quest : 1;                                // quest drop (quest is required for item to drop)
  46.      uint16  lootmode;
  47.      uint8   groupid     : 7;
  48. -    uint8   mincount;                                       // mincount for drop items
  49. -    uint8   maxcount;                                       // max drop count for the item mincount or Ref multiplicator
  50. +    uint16   mincount;                                       // mincount for drop items
  51. +    uint16   maxcount;                                       // max drop count for the item mincount or Ref multiplicator
  52.      ConditionList conditions;                               // additional loot condition
  53.  
  54.      // Constructor
  55.      // displayid is filled in IsValid() which must be called after
  56. -    LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount)
  57. -        : itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest),
  58. +    LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint16 _maxcount)
  59. +        : itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest),
  60.          lootmode(_lootmode), groupid(_groupid), mincount(_mincount), maxcount(_maxcount)
  61.           {}
  62.  
  63. @@ -146,7 +146,7 @@ struct LootItem
  64.      ConditionList conditions;                               // additional loot condition
  65.      AllowedLooterSet allowedGUIDs;
  66.      uint64  rollWinnerGUID;                                 // Stores the guid of person who won loot, if his bags are full only he can see the item in loot list!
  67. -    uint8   count             : 8;
  68. +    uint16  count             : 16;
  69.      bool    is_looted         : 1;
  70.      bool    is_blocked        : 1;
  71.      bool    freeforall        : 1;                          // free for all
  72. @@ -309,7 +309,7 @@ struct Loot
  73.      uint8 unlootedCount;
  74.      uint64 roundRobinPlayer;                                // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released.
  75.      LootType loot_type;                                     // required for achievement system
  76. -
  77. +
  78.      // GUIDLow of container that holds this loot (item_instance.entry), set for items that can be looted
  79.      uint32 containerId;
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement