FirelandsProject / firelands-cata

This is an open source project, from the emulator version 4.3.4. Log in to the discord for more information: https://discord.com/invite/GZ5rsxumxN
GNU Affero General Public License v3.0
55 stars 45 forks source link

Implement Item Disable #165

Closed Meltie2013 closed 1 year ago

Meltie2013 commented 1 year ago

Changes proposed

How to Test the Changes:

  1. Use the SQL script below to test with the Game Master items. Testing only for Auction House, since it will be the easier to test. Make sure to reload your disable table before testing once the SQL script is added to your database.

Try adding the items listed below to the Auction House after you apply the SQL for Game Master items.

DELETE FROM disables WHERE sourcetype = 9;
INSERT INTO disables (sourcetype, entry, flags, comment) VALUES
(9,  2586, 3, 'Disable item 2586 (GameMaster\'s Robe) for Auction House Player & Bot'),
(9, 11508, 3, 'Disable item 11508 (GameMaster\'s Slippers) for Auction House Player & Bot'),
(9, 12064, 3, 'Disable item 12064 (GameMaster\'s Hood) for Auction House Player & Bot'),
(9,  7192, 2, 'Disable item 7192 (Plans: Goblin Rocket Boots) for Auction House Bot');

Newly added item disable flags.

ITEM_DISABLE_AUCTIONHOUSE     = 0x01
ITEM_DISABLE_AUCTIONHOUSE_BOT = 0x02
ITEM_DISABLE_LOOT_DROP        = 0x04
ITEM_DISABLE_VENDOR           = 0x08

Example Commands:

The idea is to make managing your server easier in the long run then by the old method.

disable add item 926 1 -- This will disable Battle Axe from being sold in the auction house by player
disable add item 926 2 -- This will disable Battle Axe from being sold in the auction house by bot
disable add item 926 3 -- This will disable Battle Axe from being sold in the auction house by player & bot

To remove the item from being disable system, use the remove option and all data relating to item 926 will be removed.

disable remove item 926

Known issues and TODO list

Notice: This feature came from MinaseCore my private project I been working on for +10 years. If you plan on to use this feature in your own project, please give credit where its due.

Disclaimer: I am releasing this feature under the GPL Version 2.0 license and not AGPL 3.0 license. If you wanting to release this under AGPL 3.0 license, contact me in discord here: https://discord.com/invite/GZ5rsxumxN.


Meltie2013 commented 1 year ago

@seobryn This PR is ready to be merged.