Welcome to AC Web.
Results 1 to 11 of 11
  1. #1

    Arrow [RELEASE] Changing your items max drop amount


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Greetings, I helped @fullhouser here on his thread http://www.ac-web.org/forums/showthread.php?237355-Loot
    And I want to release this for everyone who wants to change the quantity of items that can be dropped by ANY object (creature, items, disenchant, etc).


    Ice Thistle Patriarch dropping +255 Soul Shards(4957) because now max item drop amount is 65535 (uint16)


    Let's start.

    RED CODE = Code to edit.
    BLUE CODE = Function/Structure where you find the code to be edited.
    GREEN CODE = Edited code.


    1. Open 'LootMgr.cpp' file (inside your Core project (.sln)), Press Ctrl + F to open the Find window, and find these lines:

      Code:
              uint8 mincount            = fields[7].GetUInt8();
              uint8 maxcount            = fields[8].GetUInt8();


      Inside the function:
      Code:
      uint32 LootStore::LoadLootTable()
      Then change them to:
      Code:
              uint16 mincount            = fields[7].GetUInt16();
              uint16 maxcount            = fields[8].GetUInt16();
    2. Now you change way it's stored, find these lines inside 'LootMgr.h' file:
      Code:
          uint8 mincount;                                        // mincount for drop items
          uint8 maxcount;                                        // max drop count for the item mincount or Ref multiplicator


      Inside this structure:
      Code:
      struct TC_GAME_API LootStoreItem
      And change them to:
      Code:
          uint16 mincount;                                        // mincount for drop items
          uint16 maxcount;                                        // max drop count for the item mincount or Ref multiplicator


      Down there you got the class constructor:
      Code:
      LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount)


      Change it to:
      Code:
      LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint16 _maxcount)

    3. And you must also change from 'Loot.h' file:
      Code:
          uint8   count            : 8;


      From LootItem structure:
      Code:
      struct TC_GAME_API LootItem
      To:
      Code:
          uint16   count            : 16;

    4. Compile your core & Go to your DB's (*_loot_template), and change the value type of 'mincount', 'maxcount' from 'tinyint'(uint8) to 'smallint'(uint16) or 'int'(uint32).

      To do this just select any *_loot_template table, press F6 to open the table configuration menu, find 'mincount' & 'maxcount' values and there you change the value type, don't forget to save your modification.


    Voilá, now your core loads drop amount as uint16, now max items dropped can be 65535 (instead of 255).
    NOTE:
    If you set everything to uint32 instead of uint16 your max items dropped would be 4294967295 instead.

    uint16 -> Drop amount from 1 to 65535.
    uint32 -> Drop amount from 1 to 4294967295.



    List of molinita's releases:
    Last edited by molinita; 04-12-2020 at 07:27 PM. Reason: Image added.

  2. #2
    Derp of the herp dept.

    Join Date
    Oct 2011
    Location
    Finland
    Posts
    726
    Have you tried looting a max uint32 value?

  3. #3
    Quote Originally Posted by Hamar View Post
    Have you tried looting a max uint32 value?
    No, uint32 is not tested. Ima add that into post.

  4. #4


    Join Date
    Dec 2015
    Location
    Developing the world
    Posts
    1,221
    Max int32 (2bil) is working. Tested it like few months ago.

  5. #5
    Step 1 : Lootmgr.cpp
    Step 2 : Loogmgr.h
    Step 3 : loot.h

  6. #6

  7. #7
    Quote Originally Posted by titkata_bg View Post
    Max int32 (2bil) is working. Tested it like few months ago.
    Quote Originally Posted by UnknownGhost View Post
    Step 1 : Lootmgr.cpp
    Step 2 : Loogmgr.h
    Step 3 : loot.h
    Quote Originally Posted by boobler View Post
    Great, thanks.

  8. #8
    http://YugoWoW.com/

    Join Date
    Feb 2014
    Location
    http://yugowow.com
    Posts
    2,566
    Amazing release + rep

  9. #9
    Quote Originally Posted by JadaDev View Post
    Amazing release + rep
    You're welcome.

  10. #10
    Light of the Crusade

    Join Date
    Dec 2010
    Location
    www.TheForgottenCrusade.net
    Posts
    1,208
    +rep

  11. #11

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by Nerc View Post
    +rep
    Preciate that.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •