Edit: Updated information 10/24/2007, 1:00pm EST and updated the attachment for compatibility with Ascent revision 2052 - applied against the trunk.
This implements three GM commands:
.ahload <itemsToAdd> <ahid> (AH id is optional = 1 - Alliance, 2 - Horde, 3 - Neutral)
.ahunload <ahid> (AH is optional here, too)
.ahauto (triggers the same event that occurs on server startup to automatically load the AHs)
If an ah id is specified in the args, it takes precedence.
If no ahid is specified and an auctioneer is targeted, the AH for that auctioneer is used
If no ahid is specified and no auctioneer is targeted, the character's association (Alliance/Horde) is used
By default, this uses player and owner guid 0 since when I used anything else and that player opened an AH window, the WoW client would crash when more than 100 items were in the AH with their guid. The Ascent core requires a valid guid (ie. != 0), so it includes an option in the <auctions> section of the ascent.conf to specify the name of a character and it will retrieve the guid from the characters table.
NOTE: If you create an AHBot user for this patch, it is not intended for you to log in as this user - create it and then forget it. The WoW client never intended for a player to have more than about 100 active auctions and you'll probably crash your server and client if you use that character inside WoW for anything AH-related. Any GM can issue the commands listed above, you don't need to use an AHBot character to issue the commands.
I made some minor changes to AuctionHouse.cpp to suppress sending mails to AHbot related cancellations, expirations or auction won events.
(Changelog: recent SVN 1254 change prohibited buying auctions with player guid == 0 (!auct-owner), reversed this specific change in the current AHBot patch)
(Changelog: recent SVN 1360 caused expired auctions to crash the server because it was deleting the item - changed to remove from world and DB instead)
(Changelog: removed (Not implemented yet...) from RefreshInterval and ExpirationMinutes)
(Changelog: Added LogLevel to the conf file options)
(Changelog: Added MaxItemCount to the conf file options and removed (buyprice >= 1) from the conditional selection criteria)
(Changelog: Added MinPlayerLevel, MaxPlayerLevel, IncludeClasses to conf file)
(Changelog: Added compatibility with Ascent revision 1931)
(Changelog: Fixed buyout calculation bug - thanks to TheCollector for finding it)
(Changelog: Moved from FindXinYString to using .find method in autoloading - thanks to titus4k)
(Changelog: Fixed CharacterDatabase and WorldDatabase references for SQL command execution)
I tested with thousands of items (30,000+) in the Auction House it has worked fine.
This uses the random number generator to pick random items; there are options in a new <auctions> section of the ascent.conf to tweak the min and max item levels, buyout price modifier, etc.
If you find that it is selecting a larger number of the same items, check your database with this SQL command:
Code:
SELECT Count(Entry) FROM items WHERE Class <> 12 AND Class <> 13 AND ItemExtendedCost <> 0 AND Bonding <> 1 AND Bonding <> 4 AND Bonding <> 5;
This is a quick SQL equivalent to the conditional criteria applied to a potential item id that was selected at random.
Auctions can be loaded automatically at startup and can be controlled by the extension to the ascent.conf file shown below:
Code:
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Auctions Setup
#
# LoadOnStartUp:
# If 1, then load the auction house(s) at startup
# Default: 0
#
# RefreshInterval
# If LoadOnStartup = 1, the number of hours between refreshing
# Default: 0
#
# ExpirationMinutes:
# Minutes before the auction expires
# Default: 1440 (1 day)
#
# PlayerName:
# The player to use when creating auctions, default guid is 0 if player is not found
# Default: AHbot
#
# MinAuctions:
# If LoadOnStartup = 1, the minimum number of items to have in the auction house
# Default: None
#
# MinItemLevel:
# Minimum Level of the item
# Default: 0
#
# MaxItemLevel:
# Maxiimum Level of the item
# Default: Maximum integer value in C++
#
# MaxItemCount:
# Maximum number of a specific item id for auction
# Default: 0 (disabled)
#
# MinPlayerLevel:
# Minimum Level of the player to use the item
# Default: 0
#
# MaxPlayerLevel:
# Maximum Level of the player to use the item
# Default: Maximum integer value in C++
#
# MinQuality:
# Minimum Quality of the items
# 1 = Poor, 2 = Common, 3 = Rare, 4 = Epic, 5 = Legendary
# Default: 0
#
# MaxQuality:
# Maximum Quality of the items
# 1 = Poor, 2 = Common, 3 = Rare, 4 = Epic, 5 = Legendary
# Default: Maximum integer value in C++
#
# Houses:
# Specifies the auction houses to load
# 1 = Alliance, 2 = Horde, 3 = Neutral
# Default: None
#
# BidMultiplier:
# Multiplication factor applied to the item's buy price
# Default: 0
#
# BuyoutMultiplier:
# Multiplication factor applied to the item's buy price
# Default: 1
#
# IncludeClasses:
# List of classes to include
# Default: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
#
# 0 = ITEM_CLASS_CONSUMABLE 8 = ITEM_CLASS_GENERIC
# 1 = ITEM_CLASS_CONTAINER 9 = ITEM_CLASS_RECIPE
# 2 = ITEM_CLASS_WEAPON 10 = ITEM_CLASS_MONEY
# 3 = ITEM_CLASS_JEWELRY 11 = ITEM_CLASS_QUIVER
# 4 = ITEM_CLASS_ARMOR 12 = ITEM_CLASS_QUEST
# 5 = ITEM_CLASS_REAGENT 13 = ITEM_CLASS_KEY
# 6 = ITEM_CLASS_PROJECTILE 14 = ITEM_CLASS_PERMANENT
# 7 = ITEM_CLASS_TRADEGOODS 15 = ITEM_CLASS_MISCELLANEOUS
#
# LogLevel:
# If 1, then display more informational events, 2 then more, etc.
# Default: 0
#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
<Auctions LoadOnStartUp = "1"
RefreshInterval = "1"
ExpirationMinutes = "2"
PlayerName = "Ahbot"
MinAuctions = "1000"
MinItemLevel = "40"
MaxItemLevel = "200"
MaxItemCount = "0"
MinPlayerLevel = "0"
MaxPlayerLevel = "100"
MinQuality = "2"
MaxQuality = "10"
Houses = "1,2,3"
BidMultiplier = "0"
BuyoutMultiplier = "1"
IncludeClasses = "1,2,3,4,5,6,7,8,9,10,11,14,15"
LogLevel = "0">
More quest-related items have been excluded from the list of randomly selected items and a BidMultiplier has been added to the ascent.conf.