mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
AuctionHouseBot patch added. thanx to everyone who worked on it especially Paradox. Only apply 930_characters.sql if you dont already have AHBot installed. AHBot requires an account ID and a character ID to work with, set them in trinitycore.conf and also login atleast once to this character.
--HG-- branch : trunk
This commit is contained in:
175
README.AHBOT
Normal file
175
README.AHBOT
Normal file
@@ -0,0 +1,175 @@
|
||||
This patch modifies the core so it populates the auction houses with items. It
|
||||
makes the game feel a bit more like official. Items and prices are chosen
|
||||
randomly based on the parameters you define. If an auction expires, auctions
|
||||
are deleted quietly. AHBot will not buy it's own items, and will not receive
|
||||
mail from the AH or get returned mail.
|
||||
|
||||
===============================================================================
|
||||
~~HOW TO CONFIGURE~~
|
||||
===============================================================================
|
||||
Step 1.) Create a character that you are going to use as the auction house bot
|
||||
character. This character will be the auction's owner for all the
|
||||
items created by the bot.
|
||||
Step 2.) Go into the realm database and note the account number for the
|
||||
character.
|
||||
Step 3.) Go into the characters database and note the character's GUID.
|
||||
Step 4.) Log in at least once with this character.
|
||||
(Do not change the configuration before this)
|
||||
Step 5.) Tune the configuration options in the configuration file and the
|
||||
Database.
|
||||
|
||||
#These are the settings in the configuration file:
|
||||
AuctionHouseBot.EnableSeller = 0
|
||||
AuctionHouseBot.EnableBuyer = 0
|
||||
AuctionHouseBot.Account = 0
|
||||
AuctionHouseBot.GUID = 0
|
||||
AuctionHouseBot.VendorItems = 0
|
||||
AuctionHouseBot.LootItems = 1
|
||||
AuctionHouseBot.OtherItems = 0
|
||||
AuctionHouseBot.No_Bind = 1
|
||||
AuctionHouseBot.Bind_When_Picked_Up = 0
|
||||
AuctionHouseBot.Bind_When_Equipped = 1
|
||||
AuctionHouseBot.Bind_When_Use = 1
|
||||
AuctionHouseBot.Bind_Quest_Item = 0
|
||||
AuctionHouseBot.ItemsPerCycle = 200
|
||||
AuctionHouseBot.UseBuyPriceForSeller = 0
|
||||
AuctionHouseBot.UseBuyPriceForBuyer = 0
|
||||
|
||||
AuctionHouseBot.EnableSeller enables (1) or disables (0) the Seller
|
||||
AuctionHouseBot.EnableBuyer enables (1) or disables (0) the Buyer
|
||||
AuctionHouseBot.Account is the account number (in realmd->account table) of the player you want to run as the auction bot. Note: a value of 0 will disable the bot.
|
||||
AuctionHouseBot.GUID is the GUID (in characters->characters table) of the player you want to run as the auction bot. Note: a value of 0 will disable the bot.
|
||||
AuctionHouseBot.VendorItems is a boolean value (0 or 1) that indicates whether to include Vendor only items
|
||||
AuctionHouseBot.LootItems is a boolean value (0 or 1) that indicates whether to include Loot/Fish/Skin/etc. only items
|
||||
AuctionHouseBot.OtherItems is a boolean value (0 or 1) that indicates whether to include Other items not covered by the first 2
|
||||
AuctionHouseBot.No_Bind is a boolean value (0 or 1) that indicates whether to include items with a bonding of 0
|
||||
AuctionHouseBot.Bind_When_Picked_Up = is a boolean value (0 or 1) that indicates whether to include items with a bonding of 1
|
||||
AuctionHouseBot.Bind_When_Equipped = is a boolean value (0 or 1) that indicates whether to include items with a bonding of 2
|
||||
AuctionHouseBot.Bind_When_Use = is a boolean value (0 or 1) that indicates whether to include items with a bonding of 3
|
||||
AuctionHouseBot.Bind_Quest_Item = is a boolean value (0 or 1) that indicates whether to include items with a bonding of 4
|
||||
AuctionHouseBot.ItemsPerCycle determines how many items are added each time AHBot is run (once per minute, by default)
|
||||
AuctionHouseBot.UseBuyPriceForSeller Use SellPrice (0) or BuyPrice (1) for determining prices
|
||||
AuctionHouseBot.UseBuyPriceForBuyer Use SellPrice (0) or BuyPrice (1) for determining prices
|
||||
|
||||
#These are the settings in the Database:
|
||||
#Each Auctionhouse has it's own set of these
|
||||
MinItems = 0
|
||||
MaxItems = 0
|
||||
MinTime = 8
|
||||
MaxTime = 24
|
||||
|
||||
PercentWhiteTradeGoods = 27
|
||||
PercentGreenTradeGoods = 12
|
||||
PercentBlueTradeGoods = 10
|
||||
PercentPurpleTradeGoods = 1
|
||||
|
||||
PercentWhiteItems = 10
|
||||
PercentGreenItems = 30
|
||||
PercentBlueItems = 8
|
||||
PercentPurpleItems = 2
|
||||
|
||||
MinPriceWhite = 150
|
||||
MaxPriceWhite = 250
|
||||
MinBidPriceWhite = 70
|
||||
MaxBidPriceWhite = 100
|
||||
MaxStackWhite = 0
|
||||
MinPriceGreen = 800
|
||||
MaxPriceGreen = 1400
|
||||
MinBidPriceGreen = 80
|
||||
MaxBidPriceGreen = 100
|
||||
MaxStackGreen = 3
|
||||
MinPriceBlue = 1250
|
||||
MaxPriceBlue = 1750
|
||||
MinBidPriceBlue = 75
|
||||
MaxBidPriceBlue = 100
|
||||
MaxStackBlue = 2
|
||||
MinPricePurple = 2250
|
||||
MaxPricePurple = 4550
|
||||
MinBidPricePurple = 80
|
||||
MaxBidPricePurple = 100
|
||||
MaxStackPurple = 1
|
||||
|
||||
BuyerPriceGrey = 1
|
||||
BuyerPriceWhite = 1
|
||||
BuyerPriceGreen = 5
|
||||
BuyerPriceBlue = 12
|
||||
BuyerPricePurple = 15
|
||||
BuyerBiddingInterval = 1
|
||||
BuyerBidsPerInterval = 1
|
||||
|
||||
MaxItems is the number of items you want to keep in the auction houses.
|
||||
MinItems Minimum items in auctionhouses (default 0 - minimum will be the same as maximum). If it is higher than the value of the corresponding maxItems setting, it will be set down to match the maxItems setting.
|
||||
MinTime is the minimum number of hours for an auction.
|
||||
MaxTime is the maximum number of hours for an auction.
|
||||
|
||||
#These must add up to 100
|
||||
PercentWhiteTradeGoods is the percentage of the auction items that should be trade goods of white quality. A value of 0 will disable.
|
||||
PercentGreenTradeGoods is the percentage of the auction items that should be trade goods of green quality. A value of 0 will disable.
|
||||
PercentBlueTradeGoods is the percentage of the auction items that should be trade goods of blue quality. A value of 0 will disable.
|
||||
PercentPurpleTradeGoods is the percentage of the auction items that should be trade goods of purple quality. A value of 0 will disable.
|
||||
PercentWhiteItems is the percentage of the auction items that should be items of white quality. A value of 0 will disable.
|
||||
PercentGreenItems is the percentage of the auction items that should be items of green quality. A value of 0 will disable.
|
||||
PercentBlueItems is the percentage of the auction items that should be items of blue quality. A value of 0 will disable.
|
||||
PercentPurpleItems is the percentage of the auction items that should be items of purple quality. A value of 0 will disable.
|
||||
|
||||
MinPriceWhite is the minimum price adjustment for white items. For example the default is 150, which means 150%. So if an item vendors for 1g it would go to auction for a minimum of 1.5g.
|
||||
MaxPriceWhite is the maximum price adjustment for white items.
|
||||
MinBidPriceWhite these two control the starting bid as a percent of the buyout price. For example, if MinBidPrice is 30 and MaxBidPrice is 80 the starting bid for the auction will randomly be between 30-80% of the randomly chosen buyout price.
|
||||
MaxBidPriceWhite these two control the starting bid as a percent of the buyout price. For example, if MinBidPrice is 30 and MaxBidPrice is 80 the starting bid for the auction will randomly be between 30-80% of the randomly chosen buyout price.
|
||||
MaxStackWhite is maximum stack size to create for this quality type. A value of zero will disable the maximum stack size for this quality allowing the bot to create stacks (of random size) of items as big as the item type allows.
|
||||
|
||||
MinPriceGreen - see above
|
||||
MaxPriceGreen - see above
|
||||
MinBidPriceGreen - see above
|
||||
MaxBidPriceGreen - see above
|
||||
MaxStackGreen - see above
|
||||
MinPriceBlue - see above
|
||||
MaxPriceBlue - see above
|
||||
MinBidPriceBlue - see above
|
||||
MaxBidPriceBlue - see above
|
||||
MaxStackBlue - see above
|
||||
MinPricePurple - see above
|
||||
MaxPricePurple - see above
|
||||
MinBidPricePurple - see above
|
||||
MaxBidPricePurple - see above
|
||||
MaxStackPurple - see above
|
||||
|
||||
#These are the multipliers that are applied to the vendor price for an item, that determines if AHBot will buy it or not.
|
||||
#1 means AHBot will pay the same as (or less than) a vendor would pay, 2 means up to twice as much, etc.
|
||||
BuyerPriceGrey
|
||||
BuyerPriceWhite
|
||||
BuyerPriceGreen
|
||||
BuyerPriceBlue
|
||||
BuyerPricePurple
|
||||
|
||||
BuyerBiddingInterval is the time (in minutes) between bids.
|
||||
BuyerBidsPerInterval is the number of bids the buyer will make in a cycle
|
||||
|
||||
How to use ahcommands from the console (CLI) or in game with GM level 3 players:
|
||||
ahbotoptions - will display usage instructions
|
||||
ahbotoptions help - will display the list of commands
|
||||
|
||||
ahexpire - will expire all the auctions in the requested auction house that were created by AHBot.
|
||||
minitems - will set the minimum number of items in the AH before it starts being filled again.
|
||||
maxitems - will set the maximum number of items in the AH.
|
||||
mintime - will set the minimum time (in hours) for auctions to expire.
|
||||
maxtime - will set the maximum time (in hours) for auctions to expire.
|
||||
percentages - will set the percentage of each quality in the AH
|
||||
minprice - will set the minimum price multiplier for auctions.
|
||||
maxprice - will set the maximum price multiplier for auctions.
|
||||
minbidprice - will set the minimum starting bid as a percent of the buyout price for auctions.
|
||||
maxbidprice - will set the maximum starting bid as a percent of the buyout price for auctions.
|
||||
maxstack - will set the maximum number of items in stacks for auctions. 0 will set the maximum to the maximum for that item type.
|
||||
buyerprice - will set the bid price multiplier for auctions.
|
||||
biddinginterval - will set the number of minutes between bids on auctions.
|
||||
bidsperinterval - will set the number of bids to enter per cycle.
|
||||
|
||||
The auction house IDs are:
|
||||
2 - Alliance
|
||||
6 - Horde
|
||||
7 - Neutral
|
||||
|
||||
|
||||
AHBot Originally made by Chris K.
|
||||
Much thanks to Chris K, grether and Dolomit6!
|
||||
AHBot Now includes AHBuyer created by Kerbe as a derivative of AHBot, and later modified by Paradox
|
||||
@@ -122,6 +122,65 @@ LOCK TABLES `auctionhouse` WRITE;
|
||||
/*!40000 ALTER TABLE `auctionhouse` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `auctionhousebot`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `auctionhousebot`;
|
||||
CREATE TABLE `auctionhousebot` (
|
||||
`auctionhouse` int(11) NOT NULL default '0' COMMENT 'mapID of the auctionhouse.',
|
||||
`name` char(25) default NULL COMMENT 'Text name of the auctionhouse.',
|
||||
`minitems` int(11) default '0' COMMENT 'This is the minimum number of items you want to keep in the auction house. a 0 here will make it the same as the maximum.',
|
||||
`maxitems` int(11) default '0' COMMENT 'This is the number of items you want to keep in the auction house.',
|
||||
`mintime` int(11) default '8' COMMENT 'Sets the minimum number of hours for an auction.',
|
||||
`maxtime` int(11) default '24' COMMENT 'Sets the maximum number of hours for an auction.',
|
||||
`percentwhitetradegoods` int(11) default '27' COMMENT 'Sets the percentage of the White Trade Goods auction items',
|
||||
`percentgreentradegoods` int(11) default '12' COMMENT 'Sets the percentage of the Green Trade Goods auction items',
|
||||
`percentbluetradegoods` int(11) default '10' COMMENT 'Sets the percentage of the Blue Trade Goods auction items',
|
||||
`percentpurpletradegoods` int(11) default '1' COMMENT 'Sets the percentage of the Purple Trade Goods auction items',
|
||||
`percentwhiteitems` int(11) default '10' COMMENT 'Sets the percentage of the non trade White auction items',
|
||||
`percentgreenitems` int(11) default '30' COMMENT 'Sets the percentage of the non trade Green auction items',
|
||||
`percentblueitems` int(11) default '8' COMMENT 'Sets the percentage of the non trade Blue auction items',
|
||||
`percentpurpleitems` int(11) default '2' COMMENT 'Sets the percentage of the non trade Purple auction items',
|
||||
`minpricewhite` int(11) default '150' COMMENT 'Minimum price of White items (percentage).',
|
||||
`maxpricewhite` int(11) default '250' COMMENT 'Maximum price of White items (percentage).',
|
||||
`minpricegreen` int(11) default '800' COMMENT 'Minimum price of Green items (percentage).',
|
||||
`maxpricegreen` int(11) default '1400' COMMENT 'Maximum price of Green items (percentage).',
|
||||
`minpriceblue` int(11) default '1250' COMMENT 'Minimum price of Blue items (percentage).',
|
||||
`maxpriceblue` int(11) default '1750' COMMENT 'Maximum price of Blue items (percentage).',
|
||||
`minpricepurple` int(11) default '2250' COMMENT 'Minimum price of Purple items (percentage).',
|
||||
`maxpricepurple` int(11) default '4550' COMMENT 'Maximum price of Purple items (percentage).',
|
||||
`minbidpricewhite` int(11) default '70' COMMENT 'Starting bid price of White items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpricewhite` int(11) default '100' COMMENT 'Starting bid price of White items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`minbidpricegreen` int(11) default '80' COMMENT 'Starting bid price of Green items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpricegreen` int(11) default '100' COMMENT 'Starting bid price of Green items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`minbidpriceblue` int(11) default '75' COMMENT 'Starting bid price of Blue items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpriceblue` int(11) default '100' COMMENT 'Starting bid price of Blue items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`minbidpricepurple` int(11) default '80' COMMENT 'Starting bid price of Purple items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpricepurple` int(11) default '100' COMMENT 'Starting bid price of Purple items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxstackwhite` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`maxstackgreen` int(11) default '3' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`maxstackblue` int(11) default '2' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`maxstackpurple` int(11) default '1' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`buyerpricegrey` int(11) default '1' COMMENT 'Multiplier to vendorprice when buying grey items from auctionhouse',
|
||||
`buyerpricewhite` int(11) default '1' COMMENT 'Multiplier to vendorprice when buying white items from auctionhouse',
|
||||
`buyerpricegreen` int(11) default '5' COMMENT 'Multiplier to vendorprice when buying green items from auctionhouse',
|
||||
`buyerpriceblue` int(11) default '12' COMMENT 'Multiplier to vendorprice when buying blue items from auctionhouse',
|
||||
`buyerpricepurple` int(11) default '15' COMMENT 'Multiplier to vendorprice when buying purple items from auctionhouse',
|
||||
`buyerbiddinginterval` int(11) default '1' COMMENT 'Interval how frequently AHB bids on each AH. Time in minutes',
|
||||
`buyerbidsperinterval` int(11) default '1' COMMENT 'number of bids to put in per bidding interval',
|
||||
PRIMARY KEY (`auctionhouse`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Data for table `auctionhousebot`
|
||||
--
|
||||
|
||||
insert into `auctionhousebot`(`auctionhouse`,`name`,`minitems`,`maxitems`,`mintime`,`maxtime`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerbiddinginterval`,`buyerbidsperinterval`) values
|
||||
(2,'Alliance',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1),
|
||||
(6,'Horde',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1),
|
||||
(7,'Neutral',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1);
|
||||
|
||||
--
|
||||
-- Table structure for table `bugreport`
|
||||
--
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
INSTALL(FILES
|
||||
XXX_characters.sql
|
||||
11_characters.sql
|
||||
45_characters.sql
|
||||
54_world.sql
|
||||
|
||||
56
sql/updates/XXX_characters.sql
Normal file
56
sql/updates/XXX_characters.sql
Normal file
@@ -0,0 +1,56 @@
|
||||
--
|
||||
-- Table structure for table `auctionhousebot`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `auctionhousebot` (
|
||||
`auctionhouse` int(11) NOT NULL default '0' COMMENT 'mapID of the auctionhouse.',
|
||||
`name` char(25) default NULL COMMENT 'Text name of the auctionhouse.',
|
||||
`minitems` int(11) default '0' COMMENT 'This is the minimum number of items you want to keep in the auction house. a 0 here will make it the same as the maximum.',
|
||||
`maxitems` int(11) default '0' COMMENT 'This is the number of items you want to keep in the auction house.',
|
||||
`mintime` int(11) default '8' COMMENT 'Sets the minimum number of hours for an auction.',
|
||||
`maxtime` int(11) default '24' COMMENT 'Sets the maximum number of hours for an auction.',
|
||||
`percentwhitetradegoods` int(11) default '27' COMMENT 'Sets the percentage of the White Trade Goods auction items',
|
||||
`percentgreentradegoods` int(11) default '12' COMMENT 'Sets the percentage of the Green Trade Goods auction items',
|
||||
`percentbluetradegoods` int(11) default '10' COMMENT 'Sets the percentage of the Blue Trade Goods auction items',
|
||||
`percentpurpletradegoods` int(11) default '1' COMMENT 'Sets the percentage of the Purple Trade Goods auction items',
|
||||
`percentwhiteitems` int(11) default '10' COMMENT 'Sets the percentage of the non trade White auction items',
|
||||
`percentgreenitems` int(11) default '30' COMMENT 'Sets the percentage of the non trade Green auction items',
|
||||
`percentblueitems` int(11) default '8' COMMENT 'Sets the percentage of the non trade Blue auction items',
|
||||
`percentpurpleitems` int(11) default '2' COMMENT 'Sets the percentage of the non trade Purple auction items',
|
||||
`minpricewhite` int(11) default '150' COMMENT 'Minimum price of White items (percentage).',
|
||||
`maxpricewhite` int(11) default '250' COMMENT 'Maximum price of White items (percentage).',
|
||||
`minpricegreen` int(11) default '800' COMMENT 'Minimum price of Green items (percentage).',
|
||||
`maxpricegreen` int(11) default '1400' COMMENT 'Maximum price of Green items (percentage).',
|
||||
`minpriceblue` int(11) default '1250' COMMENT 'Minimum price of Blue items (percentage).',
|
||||
`maxpriceblue` int(11) default '1750' COMMENT 'Maximum price of Blue items (percentage).',
|
||||
`minpricepurple` int(11) default '2250' COMMENT 'Minimum price of Purple items (percentage).',
|
||||
`maxpricepurple` int(11) default '4550' COMMENT 'Maximum price of Purple items (percentage).',
|
||||
`minbidpricewhite` int(11) default '70' COMMENT 'Starting bid price of White items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpricewhite` int(11) default '100' COMMENT 'Starting bid price of White items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`minbidpricegreen` int(11) default '80' COMMENT 'Starting bid price of Green items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpricegreen` int(11) default '100' COMMENT 'Starting bid price of Green items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`minbidpriceblue` int(11) default '75' COMMENT 'Starting bid price of Blue items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpriceblue` int(11) default '100' COMMENT 'Starting bid price of Blue items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`minbidpricepurple` int(11) default '80' COMMENT 'Starting bid price of Purple items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxbidpricepurple` int(11) default '100' COMMENT 'Starting bid price of Purple items as a percentage of the randomly chosen buyout price. Default: 100 (Bid and buyout price the same)',
|
||||
`maxstackwhite` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`maxstackgreen` int(11) default '3' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`maxstackblue` int(11) default '2' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`maxstackpurple` int(11) default '1' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.',
|
||||
`buyerpricegrey` int(11) default '1' COMMENT 'Multiplier to vendorprice when buying grey items from auctionhouse',
|
||||
`buyerpricewhite` int(11) default '1' COMMENT 'Multiplier to vendorprice when buying white items from auctionhouse',
|
||||
`buyerpricegreen` int(11) default '5' COMMENT 'Multiplier to vendorprice when buying green items from auctionhouse',
|
||||
`buyerpriceblue` int(11) default '12' COMMENT 'Multiplier to vendorprice when buying blue items from auctionhouse',
|
||||
`buyerpricepurple` int(11) default '15' COMMENT 'Multiplier to vendorprice when buying purple items from auctionhouse',
|
||||
`buyerbiddinginterval` int(11) default '1' COMMENT 'Interval how frequently AHB bids on each AH. Time in minutes',
|
||||
`buyerbidsperinterval` int(11) default '1' COMMENT 'number of bids to put in per bidding interval',
|
||||
PRIMARY KEY (`auctionhouse`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Data for table `auctionhousebot`
|
||||
--
|
||||
insert into `auctionhousebot` (`auctionhouse`,`name`,`minitems`,`maxitems`,`mintime`,`maxtime`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerbiddinginterval`,`buyerbidsperinterval`) values
|
||||
(2,'Alliance',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1),
|
||||
(6,'Horde',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1),
|
||||
(7,'Neutral',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1);
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "UpdateMask.h"
|
||||
#include "AuctionHouseObject.h"
|
||||
#include "Util.h"
|
||||
#include "AuctionHouseBot.h"
|
||||
|
||||
//please DO NOT use iterator++, because it is slower than ++iterator!!!
|
||||
//post-incrementation is always slower than pre-incrementation !
|
||||
@@ -171,7 +172,10 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
|
||||
std::ostringstream msgAuctionOutbiddedSubject;
|
||||
msgAuctionOutbiddedSubject << auction->item_template << ":0:" << AUCTION_OUTBIDDED;
|
||||
|
||||
if (oldBidder)
|
||||
if (oldBidder && !_player)
|
||||
oldBidder->GetSession()->SendAuctionBidderNotification( auction->location, auction->Id, AHBplayerGUID, newPrice, objmgr.GetAuctionOutBid(auction->bid), auction->item_template);
|
||||
|
||||
if (oldBidder && _player)
|
||||
oldBidder->GetSession()->SendAuctionBidderNotification( auction->location, auction->Id, _player->GetGUID(), newPrice, objmgr.GetAuctionOutBid(auction->bid), auction->item_template);
|
||||
|
||||
WorldSession::SendMailTo(oldBidder, MAIL_AUCTION, MAIL_STATIONERY_AUCTION, auction->location, auction->bidder, msgAuctionOutbiddedSubject.str(), 0, NULL, auction->bid, 0, MAIL_CHECK_MASK_NONE);
|
||||
|
||||
1198
src/game/AuctionHouseBot.cpp
Normal file
1198
src/game/AuctionHouseBot.cpp
Normal file
File diff suppressed because it is too large
Load Diff
687
src/game/AuctionHouseBot.h
Normal file
687
src/game/AuctionHouseBot.h
Normal file
@@ -0,0 +1,687 @@
|
||||
#ifndef AUCTION_HOUSE_BOT_H
|
||||
#define AUCTION_HOUSE_BOT_H
|
||||
#include "Common.h"
|
||||
#include "Log.h"
|
||||
#include "Config/ConfigEnv.h"
|
||||
#define AHB_GREY 0
|
||||
#define AHB_WHITE 1
|
||||
#define AHB_GREEN 2
|
||||
#define AHB_BLUE 3
|
||||
#define AHB_PURPLE 4
|
||||
#define AHB_GREY_TG 0
|
||||
#define AHB_WHITE_TG 1
|
||||
#define AHB_GREEN_TG 2
|
||||
#define AHB_BLUE_TG 3
|
||||
#define AHB_PURPLE_TG 4
|
||||
#define AHB_GREY_I 5
|
||||
#define AHB_WHITE_I 6
|
||||
#define AHB_GREEN_I 7
|
||||
#define AHB_BLUE_I 8
|
||||
#define AHB_PURPLE_I 9
|
||||
#define AHBplayerAccount sConfig.GetIntDefault("AuctionHouseBot.Account", 0)
|
||||
#define AHBplayerGUID sConfig.GetIntDefault("AuctionHouseBot.GUID", 0)
|
||||
#define ItemsPerCycle sConfig.GetIntDefault("AuctionHouseBot.ItemsPerCycle", 200)
|
||||
#define SellMethod sConfig.GetIntDefault("AuctionHouseBot.UseBuyPriceForSeller", 1)
|
||||
#define BuyMethod sConfig.GetIntDefault("AuctionHouseBot.UseBuyPriceForBuyer", 0)
|
||||
|
||||
class AHBConfig
|
||||
{
|
||||
private:
|
||||
uint32 AHID;
|
||||
uint32 minItems;
|
||||
uint32 maxItems;
|
||||
uint32 minTime;
|
||||
uint32 maxTime;
|
||||
uint32 percentWhiteTradeGoods;
|
||||
uint32 percentGreenTradeGoods;
|
||||
uint32 percentBlueTradeGoods;
|
||||
uint32 percentPurpleTradeGoods;
|
||||
uint32 percentWhiteItems;
|
||||
uint32 percentGreenItems;
|
||||
uint32 percentBlueItems;
|
||||
uint32 percentPurpleItems;
|
||||
uint32 minPriceWhite;
|
||||
uint32 maxPriceWhite;
|
||||
uint32 minBidPriceWhite;
|
||||
uint32 maxBidPriceWhite;
|
||||
uint32 maxStackWhite;
|
||||
uint32 minPriceGreen;
|
||||
uint32 maxPriceGreen;
|
||||
uint32 minBidPriceGreen;
|
||||
uint32 maxBidPriceGreen;
|
||||
uint32 maxStackGreen;
|
||||
uint32 minPriceBlue;
|
||||
uint32 maxPriceBlue;
|
||||
uint32 minBidPriceBlue;
|
||||
uint32 maxBidPriceBlue;
|
||||
uint32 maxStackBlue;
|
||||
uint32 minPricePurple;
|
||||
uint32 maxPricePurple;
|
||||
uint32 minBidPricePurple;
|
||||
uint32 maxBidPricePurple;
|
||||
uint32 maxStackPurple;
|
||||
|
||||
uint32 buyerPriceGrey;
|
||||
uint32 buyerPriceWhite;
|
||||
uint32 buyerPriceGreen;
|
||||
uint32 buyerPriceBlue;
|
||||
uint32 buyerPricePurple;
|
||||
uint32 buyerBiddingInterval;
|
||||
uint32 buyerBidsPerInterval;
|
||||
|
||||
uint32 wtgp;
|
||||
uint32 gtgp;
|
||||
uint32 btgp;
|
||||
uint32 ptgp;
|
||||
uint32 wip;
|
||||
uint32 gip;
|
||||
uint32 bip;
|
||||
uint32 pip;
|
||||
public:
|
||||
AHBConfig(uint32 ahid)
|
||||
{
|
||||
AHID = ahid;
|
||||
}
|
||||
AHBConfig()
|
||||
{
|
||||
}
|
||||
uint32 GetAHID()
|
||||
{
|
||||
return AHID;
|
||||
}
|
||||
void SetMinItems(uint32 value)
|
||||
{
|
||||
minItems = value;
|
||||
}
|
||||
uint32 GetMinItems()
|
||||
{
|
||||
if ((minItems == 0) && (maxItems))
|
||||
return maxItems;
|
||||
else if ((maxItems) && (minItems > maxItems))
|
||||
return maxItems;
|
||||
else
|
||||
return minItems;
|
||||
}
|
||||
void SetMaxItems(uint32 value)
|
||||
{
|
||||
maxItems = value;
|
||||
CalculatePercents();
|
||||
}
|
||||
uint32 GetMaxItems()
|
||||
{
|
||||
return maxItems;
|
||||
}
|
||||
void SetMinTime(uint32 value)
|
||||
{
|
||||
minTime = value;
|
||||
}
|
||||
uint32 GetMinTime()
|
||||
{
|
||||
if (minTime < 1)
|
||||
return 1;
|
||||
else if ((maxTime) && (minTime > maxTime))
|
||||
return maxTime;
|
||||
else
|
||||
return minTime;
|
||||
}
|
||||
void SetMaxTime(uint32 value)
|
||||
{
|
||||
maxTime = value;
|
||||
}
|
||||
uint32 GetMaxTime()
|
||||
{
|
||||
return maxTime;
|
||||
}
|
||||
void SetPercentages(uint32 wtg, uint32 gtg, uint32 btg, uint32 ptg, uint32 wi, uint32 gi, uint32 bi, uint32 pi)
|
||||
{
|
||||
uint32 totalPercent = wtg + gtg + btg + ptg + wi + gi + bi + pi;
|
||||
|
||||
if (totalPercent == 0)
|
||||
{
|
||||
maxItems = 0;
|
||||
}
|
||||
else if (totalPercent != 100)
|
||||
{
|
||||
double scale = (double) 100 / (double) totalPercent;
|
||||
|
||||
wtg = (uint32) (scale * (double) pi);
|
||||
gtg = (uint32) (scale * (double) gtg);
|
||||
btg = (uint32) (scale * (double) btg);
|
||||
ptg = (uint32) (scale * (double) ptg);
|
||||
wi = (uint32) (scale * (double) wi);
|
||||
gi = (uint32) (scale * (double) gi);
|
||||
bi = (uint32) (scale * (double) bi);
|
||||
pi = 100 - wtg - gtg - btg - ptg - wi - gi - bi;
|
||||
|
||||
}
|
||||
percentWhiteTradeGoods = wtg;
|
||||
percentGreenTradeGoods = gtg;
|
||||
percentBlueTradeGoods = btg;
|
||||
percentPurpleTradeGoods = ptg;
|
||||
percentWhiteItems = wi;
|
||||
percentGreenItems = gi;
|
||||
percentBlueItems = bi;
|
||||
percentPurpleItems = pi;
|
||||
CalculatePercents();
|
||||
}
|
||||
uint32 GetPercentages(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY_TG:
|
||||
return 0;
|
||||
break;
|
||||
case AHB_WHITE_TG:
|
||||
return percentWhiteTradeGoods;
|
||||
break;
|
||||
case AHB_GREEN_TG:
|
||||
return percentGreenTradeGoods;
|
||||
break;
|
||||
case AHB_BLUE_TG:
|
||||
return percentBlueTradeGoods;
|
||||
break;
|
||||
case AHB_PURPLE_TG:
|
||||
return percentPurpleTradeGoods;
|
||||
break;
|
||||
case AHB_GREY_I:
|
||||
return 0;
|
||||
break;
|
||||
case AHB_WHITE_I:
|
||||
return percentWhiteItems;
|
||||
break;
|
||||
case AHB_GREEN_I:
|
||||
return percentGreenItems;
|
||||
break;
|
||||
case AHB_BLUE_I:
|
||||
return percentBlueItems;
|
||||
break;
|
||||
case AHB_PURPLE_I:
|
||||
return percentPurpleItems;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void SetMinPrice(uint32 color, uint32 value)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
minPriceWhite = value;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
minPriceGreen = value;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
minPriceBlue = value;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
minPricePurple = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 GetMinPrice(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case AHB_WHITE:
|
||||
{
|
||||
if (minPriceWhite == 0)
|
||||
return 150;
|
||||
else if (minPriceWhite > maxPriceWhite)
|
||||
return maxPriceWhite;
|
||||
else
|
||||
return minPriceWhite;
|
||||
break;
|
||||
}
|
||||
case AHB_GREEN:
|
||||
{
|
||||
if (minPriceGreen == 0)
|
||||
return 200;
|
||||
else if (minPriceGreen > maxPriceGreen)
|
||||
return maxPriceGreen;
|
||||
else
|
||||
return minPriceGreen;
|
||||
break;
|
||||
}
|
||||
case AHB_BLUE:
|
||||
{
|
||||
if (minPriceBlue == 0)
|
||||
return 250;
|
||||
else if (minPriceBlue > maxPriceBlue)
|
||||
return maxPriceBlue;
|
||||
else
|
||||
return minPriceBlue;
|
||||
break;
|
||||
}
|
||||
case AHB_PURPLE:
|
||||
{
|
||||
if (minPricePurple == 0)
|
||||
return 300;
|
||||
else if (minPricePurple > maxPricePurple)
|
||||
return maxPricePurple;
|
||||
else
|
||||
return minPricePurple;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetMaxPrice(uint32 color, uint32 value)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
maxPriceWhite = value;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
maxPriceGreen = value;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
maxPriceBlue = value;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
maxPricePurple = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 GetMaxPrice(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case AHB_WHITE:
|
||||
{
|
||||
if (maxPriceWhite == 0)
|
||||
return 250;
|
||||
else
|
||||
return maxPriceWhite;
|
||||
break;
|
||||
}
|
||||
case AHB_GREEN:
|
||||
{
|
||||
if (maxPriceGreen == 0)
|
||||
return 300;
|
||||
else
|
||||
return maxPriceGreen;
|
||||
break;
|
||||
}
|
||||
case AHB_BLUE:
|
||||
{
|
||||
if (maxPriceBlue == 0)
|
||||
return 350;
|
||||
else
|
||||
return maxPriceBlue;
|
||||
break;
|
||||
}
|
||||
case AHB_PURPLE:
|
||||
{
|
||||
if (maxPricePurple == 0)
|
||||
return 450;
|
||||
else
|
||||
return maxPricePurple;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetMinBidPrice(uint32 color, uint32 value)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
minBidPriceWhite = value;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
minBidPriceGreen = value;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
minBidPriceBlue = value;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
minBidPricePurple = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 GetMinBidPrice(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case AHB_WHITE:
|
||||
{
|
||||
if (minBidPriceWhite > 100)
|
||||
return 100;
|
||||
else
|
||||
return minBidPriceWhite;
|
||||
break;
|
||||
}
|
||||
case AHB_GREEN:
|
||||
{
|
||||
if (minBidPriceGreen > 100)
|
||||
return 100;
|
||||
else
|
||||
return minBidPriceGreen;
|
||||
break;
|
||||
}
|
||||
case AHB_BLUE:
|
||||
{
|
||||
if (minBidPriceBlue > 100)
|
||||
return 100;
|
||||
else
|
||||
return minBidPriceBlue;
|
||||
break;
|
||||
}
|
||||
case AHB_PURPLE:
|
||||
{
|
||||
if (minBidPricePurple > 100)
|
||||
return 100;
|
||||
else
|
||||
return minBidPricePurple;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetMaxBidPrice(uint32 color, uint32 value)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
maxBidPriceWhite = value;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
maxBidPriceGreen = value;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
maxBidPriceBlue = value;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
maxBidPricePurple = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 GetMaxBidPrice(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case AHB_WHITE:
|
||||
{
|
||||
if (maxBidPriceWhite > 100)
|
||||
return 100;
|
||||
else
|
||||
return maxBidPriceWhite;
|
||||
break;
|
||||
}
|
||||
case AHB_GREEN:
|
||||
{
|
||||
if (maxBidPriceGreen > 100)
|
||||
return 100;
|
||||
else
|
||||
return maxBidPriceGreen;
|
||||
break;
|
||||
}
|
||||
case AHB_BLUE:
|
||||
{
|
||||
if (maxBidPriceBlue > 100)
|
||||
return 100;
|
||||
else
|
||||
return maxBidPriceBlue;
|
||||
break;
|
||||
}
|
||||
case AHB_PURPLE:
|
||||
{
|
||||
if (maxBidPricePurple > 100)
|
||||
return 100;
|
||||
else
|
||||
return maxBidPricePurple;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetMaxStack(uint32 color, uint32 value)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
maxStackWhite = value;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
maxStackGreen = value;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
maxStackBlue = value;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
maxStackPurple = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 GetMaxStack(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case AHB_WHITE:
|
||||
{
|
||||
return maxStackWhite;
|
||||
break;
|
||||
}
|
||||
case AHB_GREEN:
|
||||
{
|
||||
return maxStackGreen;
|
||||
break;
|
||||
}
|
||||
case AHB_BLUE:
|
||||
{
|
||||
return maxStackBlue;
|
||||
break;
|
||||
}
|
||||
case AHB_PURPLE:
|
||||
{
|
||||
return maxStackPurple;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetBuyerPrice(uint32 color, uint32 value)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
buyerPriceGrey = value;
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
buyerPriceWhite = value;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
buyerPriceGreen = value;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
buyerPriceBlue = value;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
buyerPricePurple = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 GetBuyerPrice(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY:
|
||||
return buyerPriceGrey;
|
||||
break;
|
||||
case AHB_WHITE:
|
||||
return buyerPriceWhite;
|
||||
break;
|
||||
case AHB_GREEN:
|
||||
return buyerPriceGreen;
|
||||
break;
|
||||
case AHB_BLUE:
|
||||
return buyerPriceBlue;
|
||||
break;
|
||||
case AHB_PURPLE:
|
||||
return buyerPricePurple;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void SetBiddingInterval(uint32 value)
|
||||
{
|
||||
buyerBiddingInterval = value;
|
||||
}
|
||||
uint32 GetBiddingInterval()
|
||||
{
|
||||
return buyerBiddingInterval;
|
||||
}
|
||||
void CalculatePercents()
|
||||
{
|
||||
wtgp = (uint32) (((double)percentWhiteTradeGoods / 100.0) * maxItems);
|
||||
gtgp = (uint32) (((double)percentGreenTradeGoods / 100.0) * maxItems);
|
||||
btgp = (uint32) (((double)percentBlueTradeGoods / 100.0) * maxItems);
|
||||
ptgp = (uint32) (((double)percentPurpleTradeGoods / 100.0) * maxItems);
|
||||
wip = (uint32) (((double)percentWhiteItems / 100.0) * maxItems);
|
||||
gip = (uint32) (((double)percentGreenItems / 100.0) * maxItems);
|
||||
bip = (uint32) (((double)percentBlueItems / 100.0) * maxItems);
|
||||
pip = (uint32) (((double)percentPurpleItems / 100.0) * maxItems);
|
||||
uint32 total = wtgp + gtgp + btgp + ptgp + wip + gip + bip + pip;
|
||||
if (total != maxItems)
|
||||
{
|
||||
wtgp = (uint32) (maxItems * (double) wtgp);
|
||||
gtgp = (uint32) (maxItems * (double) gtgp);
|
||||
btgp = (uint32) (maxItems * (double) btgp);
|
||||
ptgp = (uint32) (maxItems * (double) ptgp);
|
||||
wip = (uint32) (maxItems * (double) wip);
|
||||
gip = (uint32) (maxItems * (double) gip);
|
||||
bip = (uint32) (maxItems * (double) bip);
|
||||
pip = (maxItems - (wtgp + gtgp + btgp + ptgp + wip + gip + bip));
|
||||
total = wtgp + gtgp + btgp + ptgp + wip + gip + bip + pip;
|
||||
}
|
||||
//sLog.outString("%u %u %u %u %u %u %u %u", wtgp, gtgp, btgp, ptgp, wip, gip, bip, pip);
|
||||
}
|
||||
uint32 GetPercents(uint32 color)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case AHB_GREY_TG:
|
||||
return 0;
|
||||
break;
|
||||
case AHB_WHITE_TG:
|
||||
return wtgp;
|
||||
break;
|
||||
case AHB_GREEN_TG:
|
||||
return gtgp;
|
||||
break;
|
||||
case AHB_BLUE_TG:
|
||||
return btgp;
|
||||
break;
|
||||
case AHB_PURPLE_TG:
|
||||
return ptgp;
|
||||
break;
|
||||
case AHB_GREY_I:
|
||||
return 0;
|
||||
break;
|
||||
case AHB_WHITE_I:
|
||||
return wip;
|
||||
break;
|
||||
case AHB_GREEN_I:
|
||||
return gip;
|
||||
break;
|
||||
case AHB_BLUE_I:
|
||||
return bip;
|
||||
break;
|
||||
case AHB_PURPLE_I:
|
||||
return pip;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void SetBidsPerInterval(uint32 value)
|
||||
{
|
||||
buyerBidsPerInterval = value;
|
||||
}
|
||||
uint32 GetBidsPerInterval()
|
||||
{
|
||||
return buyerBidsPerInterval;
|
||||
}
|
||||
~AHBConfig()
|
||||
{
|
||||
}
|
||||
};
|
||||
void AuctionHouseBot();
|
||||
void AuctionHouseBotInit();
|
||||
void AuctionHouseBotLoadValues(AHBConfig*);
|
||||
void AuctionHouseBotCommands(uint32, uint32, uint32, char*);
|
||||
#endif
|
||||
@@ -13,6 +13,8 @@ SET(game_STAT_SRCS
|
||||
ArenaTeam.h
|
||||
ArenaTeamHandler.cpp
|
||||
AuctionHouse.cpp
|
||||
AuctionHouseBot.cpp
|
||||
AuctionHouseBot.h
|
||||
AuctionHouseObject.h
|
||||
Bag.cpp
|
||||
Bag.h
|
||||
|
||||
@@ -616,6 +616,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "cometome", SEC_ADMINISTRATOR, false, &ChatHandler::HandleComeToMeCommand, "", NULL },
|
||||
{ "damage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDamageCommand, "", NULL },
|
||||
{ "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
|
||||
{ "ahbotoptions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotOptionsCommand, "", NULL },
|
||||
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
||||
{ "chardelete", SEC_CONSOLE, true, &ChatHandler::HandleCharacterDeleteCommand, "", NULL },
|
||||
{ "sendmessage", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
|
||||
|
||||
@@ -100,6 +100,7 @@ class ChatHandler
|
||||
bool HandleAccountSetPasswordCommand(const char* args);
|
||||
|
||||
bool HandleHelpCommand(const char* args);
|
||||
bool HandleAHBotOptionsCommand(const char * args);
|
||||
bool HandleCommandsCommand(const char* args);
|
||||
bool HandleStartCommand(const char* args);
|
||||
bool HandleDismountCommand(const char* args);
|
||||
|
||||
@@ -52,6 +52,379 @@
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceData.h"
|
||||
#include "AuctionHouseBot.h"
|
||||
|
||||
bool ChatHandler::HandleAHBotOptionsCommand(const char* args)
|
||||
{
|
||||
uint32 ahMapID = 0;
|
||||
char * opt = strtok((char*)args, " ");
|
||||
char * ahMapIdStr = strtok(NULL, " ");
|
||||
if (ahMapIdStr)
|
||||
{
|
||||
ahMapID = (uint32) strtoul(ahMapIdStr, NULL, 0);
|
||||
}
|
||||
if (!opt)
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions $option $ahMapID (2, 6 or 7) $parameter");
|
||||
PSendSysMessage("Try ahbotoptions help to see a list of options.");
|
||||
return false;
|
||||
}
|
||||
int l = strlen(opt);
|
||||
|
||||
if (strncmp(opt,"help",l) == 0)
|
||||
{
|
||||
PSendSysMessage("AHBot commands:");
|
||||
PSendSysMessage("ahexpire");
|
||||
PSendSysMessage("minitems");
|
||||
PSendSysMessage("maxitems");
|
||||
PSendSysMessage("mintime");
|
||||
PSendSysMessage("maxtime");
|
||||
PSendSysMessage("percentages");
|
||||
PSendSysMessage("minprice");
|
||||
PSendSysMessage("maxprice");
|
||||
PSendSysMessage("minbidprice");
|
||||
PSendSysMessage("maxbidprice");
|
||||
PSendSysMessage("maxstack");
|
||||
PSendSysMessage("buyerprice");
|
||||
PSendSysMessage("bidinterval");
|
||||
PSendSysMessage("bidsperinterval");
|
||||
return true;
|
||||
}
|
||||
else if (strncmp(opt,"ahexpire",l) == 0)
|
||||
{
|
||||
if (!ahMapIdStr)
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions ahexpire $ahMapID (2, 6 or 7)");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(0, ahMapID, NULL, NULL);
|
||||
}
|
||||
else if (strncmp(opt,"minitems",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions minitems $ahMapID (2, 6 or 7) $minItems");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(1, ahMapID, NULL, param1);
|
||||
}
|
||||
else if (strncmp(opt,"maxitems",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxitems $ahMapID (2, 6 or 7) $maxItems");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(2, ahMapID, NULL, param1);
|
||||
}
|
||||
else if (strncmp(opt,"mintime",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions mintime $ahMapID (2, 6 or 7) $mintime");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(3, ahMapID, NULL, param1);
|
||||
}
|
||||
else if (strncmp(opt,"maxtime",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxtime $ahMapID (2, 6 or 7) $maxtime");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(4, ahMapID, NULL, param1);
|
||||
}
|
||||
else if (strncmp(opt,"percentages",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
char * param3 = strtok(NULL, " ");
|
||||
char * param4 = strtok(NULL, " ");
|
||||
char * param5 = strtok(NULL, " ");
|
||||
char * param6 = strtok(NULL, " ");
|
||||
char * param7 = strtok(NULL, " ");
|
||||
char * param8 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2) || (!param3) || (!param4) || (!param5) || (!param6) || (!param7) || (!param8))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions percentages $ahMapID (2, 6 or 7) $1 $2 $3 $4 $5 $6 $7 $8");
|
||||
PSendSysMessage("1 WhiteTradeGoods 2 GreenTradeGoods 3 BlueTradeGoods 4 PurpleTradeGoods");
|
||||
PSendSysMessage("5 WhiteItems 6 GreenItems 7 BlueItems 8 PurpleItems");
|
||||
PSendSysMessage("The total must add up to 100%");
|
||||
return false;
|
||||
}
|
||||
uint32 wtg = (uint32) strtoul(param1, NULL, 0);
|
||||
uint32 gtg = (uint32) strtoul(param2, NULL, 0);
|
||||
uint32 btg = (uint32) strtoul(param3, NULL, 0);
|
||||
uint32 ptg = (uint32) strtoul(param4, NULL, 0);
|
||||
uint32 wi = (uint32) strtoul(param5, NULL, 0);
|
||||
uint32 gi = (uint32) strtoul(param6, NULL, 0);
|
||||
uint32 bi = (uint32) strtoul(param7, NULL, 0);
|
||||
uint32 pi = (uint32) strtoul(param8, NULL, 0);
|
||||
uint32 totalPercent = wtg + gtg + btg + ptg + wi + gi + bi + pi;
|
||||
if ((totalPercent == 0) || (totalPercent != 100))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions percentages $ahMapID (2, 6 or 7) $1 $2 $3 $4 $5 $6 $7 $8");
|
||||
PSendSysMessage("1 WhiteTradeGoods 2 GreenTradeGoods 3 BlueTradeGoods 4 PurpleTradeGoods");
|
||||
PSendSysMessage("5 WhiteItems 6 GreenItems 7 BlueItems 8 PurpleItems");
|
||||
PSendSysMessage("The total must add up to 100%");
|
||||
return false;
|
||||
}
|
||||
char param[100];
|
||||
param[0] = '\0';
|
||||
strcat(param, param1);
|
||||
strcat(param, " ");
|
||||
strcat(param, param2);
|
||||
strcat(param, " ");
|
||||
strcat(param, param3);
|
||||
strcat(param, " ");
|
||||
strcat(param, param4);
|
||||
strcat(param, " ");
|
||||
strcat(param, param5);
|
||||
strcat(param, " ");
|
||||
strcat(param, param6);
|
||||
strcat(param, " ");
|
||||
strcat(param, param7);
|
||||
strcat(param, " ");
|
||||
strcat(param, param8);
|
||||
AuctionHouseBotCommands(5, ahMapID, NULL, param);
|
||||
}
|
||||
else if (strncmp(opt,"minprice",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions minprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
if (strncmp(param1,"white",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(6, ahMapID, AHB_WHITE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"green",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(6, ahMapID, AHB_GREEN, param2);
|
||||
}
|
||||
else if (strncmp(param1,"blue",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(6, ahMapID, AHB_BLUE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"purple",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(6, ahMapID, AHB_PURPLE, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions minprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strncmp(opt,"maxprice",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
if (strncmp(param1,"white",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(7, ahMapID, AHB_WHITE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"green",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(7, ahMapID, AHB_GREEN, param2);
|
||||
}
|
||||
else if (strncmp(param1,"blue",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(7, ahMapID, AHB_BLUE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"purple",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(7, ahMapID, AHB_PURPLE, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strncmp(opt,"minbidprice",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions minbidprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
uint32 minBidPrice = (uint32) strtoul(param2, NULL, 0);
|
||||
if ((minBidPrice < 1) || (minBidPrice > 100))
|
||||
{
|
||||
PSendSysMessage("The min bid price multiplier must be between 1 and 100");
|
||||
return false;
|
||||
}
|
||||
if (strncmp(param1,"white",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(8, ahMapID, AHB_WHITE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"green",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(8, ahMapID, AHB_GREEN, param2);
|
||||
}
|
||||
else if (strncmp(param1,"blue",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(8, ahMapID, AHB_BLUE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"purple",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(8, ahMapID, AHB_PURPLE, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions minbidprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strncmp(opt,"maxbidprice",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxbidprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
uint32 maxBidPrice = (uint32) strtoul(param2, NULL, 0);
|
||||
if ((maxBidPrice < 1) || (maxBidPrice > 100))
|
||||
{
|
||||
PSendSysMessage("The max bid price multiplier must be between 1 and 100");
|
||||
return false;
|
||||
}
|
||||
if (strncmp(param1,"white",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(9, ahMapID, AHB_WHITE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"green",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(9, ahMapID, AHB_GREEN, param2);
|
||||
}
|
||||
else if (strncmp(param1,"blue",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(9, ahMapID, AHB_BLUE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"purple",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(9, ahMapID, AHB_PURPLE, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions max bidprice $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strncmp(opt,"maxstack",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxstack $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $value");
|
||||
return false;
|
||||
}
|
||||
uint32 maxStack = (uint32) strtoul(param2, NULL, 0);
|
||||
if (maxStack < 0)
|
||||
{
|
||||
PSendSysMessage("maxstack can't be a negative number.");
|
||||
return false;
|
||||
}
|
||||
if (strncmp(param1,"white",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(10, ahMapID, AHB_WHITE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"green",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(10, ahMapID, AHB_GREEN, param2);
|
||||
}
|
||||
else if (strncmp(param1,"blue",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(10, ahMapID, AHB_BLUE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"purple",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(10, ahMapID, AHB_PURPLE, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions maxstack $ahMapID (2, 6 or 7) $color (white, green, blue or purple) $value");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strncmp(opt,"buyerprice",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
char * param2 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1) || (!param2))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions buyerprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
if (strncmp(param1,"white",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(11, ahMapID, AHB_WHITE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"green",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(11, ahMapID, AHB_GREEN, param2);
|
||||
}
|
||||
else if (strncmp(param1,"blue",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(11, ahMapID, AHB_BLUE, param2);
|
||||
}
|
||||
else if (strncmp(param1,"purple",l) == 0)
|
||||
{
|
||||
AuctionHouseBotCommands(11, ahMapID, AHB_PURPLE, param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions buyerprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue or purple) $price");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strncmp(opt,"bidinterval",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions bidinterval $ahMapID (2, 6 or 7) $interval(in minutes)");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(12, ahMapID, NULL, param1);
|
||||
}
|
||||
else if (strncmp(opt,"bidsperinterval",l) == 0)
|
||||
{
|
||||
char * param1 = strtok(NULL, " ");
|
||||
if ((!ahMapIdStr) || (!param1))
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions bidsperinterval $ahMapID (2, 6 or 7) $bids");
|
||||
return false;
|
||||
}
|
||||
AuctionHouseBotCommands(13, ahMapID, NULL, param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
PSendSysMessage("Syntax is: ahbotoptions $option $ahMapID (2, 6 or 7) $parameter");
|
||||
PSendSysMessage("Try ahbotoptions help to see a list of options.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//reload commands
|
||||
bool ChatHandler::HandleReloadCommand(const char* arg)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "Unit.h"
|
||||
#include "Language.h"
|
||||
#include "Database/DBCStores.h"
|
||||
#include "AuctionHouseBot.h"
|
||||
|
||||
void MailItem::deleteItem( bool inDB )
|
||||
{
|
||||
@@ -348,7 +349,14 @@ void WorldSession::HandleReturnToSender(WorldPacket & recv_data )
|
||||
}
|
||||
}
|
||||
|
||||
SendReturnToSender(MAIL_NORMAL, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
|
||||
if (m->sender == AHBplayerGUID)
|
||||
{
|
||||
SendReturnToSender(MAIL_CREATURE, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendReturnToSender(MAIL_NORMAL, GetAccountId(), m->receiver, m->sender, m->subject, m->itemTextId, &mi, m->money, m->mailTemplateId);
|
||||
}
|
||||
|
||||
delete m; //we can deallocate old mail
|
||||
pl->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, 0);
|
||||
@@ -765,6 +773,14 @@ void WorldSession::HandleMsgQueryNextMailtime(WorldPacket & /*recv_data*/ )
|
||||
|
||||
void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 stationery, uint32 sender_guidlow_or_entry, uint32 receiver_guidlow, std::string subject, uint32 itemTextId, MailItemsInfo* mi, uint32 money, uint32 COD, uint32 checked, uint32 deliver_delay, uint16 mailTemplateId)
|
||||
{
|
||||
if (receiver_guidlow == AHBplayerGUID)
|
||||
{
|
||||
if(messageType == MAIL_AUCTION && mi) // auction mail with items
|
||||
{
|
||||
mi->deleteIncludedItems(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
uint32 mailId = objmgr.GenerateMailID();
|
||||
|
||||
time_t deliver_time = time(NULL) + deliver_delay;
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "AuctionHouseBot.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "GlobalEvents.h"
|
||||
@@ -1379,6 +1380,9 @@ void World::SetInitialWorldSettings()
|
||||
uint32 nextGameEvent = gameeventmgr.Initialize();
|
||||
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
|
||||
|
||||
sLog.outString("Initialize AuctionHouseBot...");
|
||||
AuctionHouseBotInit();
|
||||
|
||||
sLog.outString( "WORLD: World initialized" );
|
||||
}
|
||||
|
||||
@@ -1489,7 +1493,8 @@ void World::Update(time_t diff)
|
||||
/// <ul><li> Handle auctions when the timer has passed
|
||||
if (m_timers[WUPDATE_AUCTIONS].Passed())
|
||||
{
|
||||
m_timers[WUPDATE_AUCTIONS].Reset();
|
||||
AuctionHouseBot();
|
||||
m_timers[WUPDATE_AUCTIONS].Reset();
|
||||
|
||||
///- Update mails (return old mails with item, or delete them)
|
||||
//(tested... works on win)
|
||||
|
||||
@@ -1188,6 +1188,79 @@ Network.OutKBuff = -1
|
||||
Network.OutUBuff = 65536
|
||||
Network.TcpNodelay = 1
|
||||
|
||||
###################################################################################################################
|
||||
# AUCTION HOUSE BOT SETTINGS
|
||||
#
|
||||
# AuctionHouseBot.EnableSeller
|
||||
# Enable/Disable the part of AHBot that puts items up for auction
|
||||
# Default 0 (disabled)
|
||||
#
|
||||
# AuctionHouseBot.EnableBuyer
|
||||
# Enable/Disable the part of AHBot that buys items from players
|
||||
# Default 0 (disabled)
|
||||
#
|
||||
# Auction House Bot character data
|
||||
# AuctionHouseBot.Account is the account number (in realmd->account table) of the player you want to run as the auction bot.
|
||||
# AuctionHouseBot.GUID is the GUID (in characters->characters table) of the player you want to run as the auction bot.
|
||||
# Default: 0 (Auction House Bot disabled)
|
||||
#
|
||||
# AuctionHouseBot.VendorItems
|
||||
# Include items that can be bought from vendors.
|
||||
# Default 0
|
||||
#
|
||||
# AuctionHouseBot.LootItems
|
||||
# Include items that can be looted or fished for.
|
||||
# Default 1
|
||||
#
|
||||
# AuctionHouseBot.OtherItems
|
||||
# Include misc. items.
|
||||
# Default 0
|
||||
#
|
||||
# AuctionHouseBot.Bonding_types
|
||||
# Indicates which bonding types to allow seller to put up for auction
|
||||
# No_Bind
|
||||
# Default 1
|
||||
# Bind_When_Picked_Up
|
||||
# Default 0
|
||||
# Bind_When_Equipped
|
||||
# Default 1
|
||||
# Bind_When_Use
|
||||
# Default 1
|
||||
# Bind_Quest_Item
|
||||
# Default 0
|
||||
#
|
||||
# AuctionHouseBot.ItemsPerCycle
|
||||
# Number of Items to Add/Remove from the AH during mass operations
|
||||
# Default 200
|
||||
#
|
||||
# AuctionHouseBot.UseBuyPriceForSeller
|
||||
# Should the Seller use BuyPrice or SellPrice to determine Bid Prices
|
||||
# Default 0 (use SellPrice)
|
||||
#
|
||||
# AuctionHouseBot.UseBuyPriceForBuyer
|
||||
# Should the Buyer use BuyPrice or SellPrice to determine Bid Prices
|
||||
# Default 0 (use SellPrice)
|
||||
#
|
||||
# All other settings have been moved to sql
|
||||
#
|
||||
###################################################################################################################
|
||||
|
||||
AuctionHouseBot.EnableSeller = 0
|
||||
AuctionHouseBot.EnableBuyer = 0
|
||||
AuctionHouseBot.Account = 0
|
||||
AuctionHouseBot.GUID = 0
|
||||
AuctionHouseBot.VendorItems = 0
|
||||
AuctionHouseBot.LootItems = 1
|
||||
AuctionHouseBot.OtherItems = 0
|
||||
AuctionHouseBot.No_Bind = 1
|
||||
AuctionHouseBot.Bind_When_Picked_Up = 0
|
||||
AuctionHouseBot.Bind_When_Equipped = 1
|
||||
AuctionHouseBot.Bind_When_Use = 1
|
||||
AuctionHouseBot.Bind_Quest_Item = 0
|
||||
AuctionHouseBot.ItemsPerCycle = 200
|
||||
AuctionHouseBot.UseBuyPriceForSeller = 0
|
||||
AuctionHouseBot.UseBuyPriceForBuyer = 0
|
||||
|
||||
###################################################################################################################
|
||||
# CONSOLE AND REMOTE ACCESS
|
||||
#
|
||||
|
||||
@@ -199,6 +199,16 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="AuctionHouseBot"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Objects"
|
||||
>
|
||||
@@ -214,6 +224,12 @@
|
||||
RelativePath="..\..\src\game\AuctionHouseObject.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\Bag.cpp"
|
||||
>
|
||||
|
||||
@@ -419,6 +419,16 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="AuctionHouseBot"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Objects"
|
||||
>
|
||||
@@ -430,6 +440,12 @@
|
||||
RelativePath="..\..\src\game\ArenaTeam.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseObject.h"
|
||||
>
|
||||
|
||||
@@ -424,6 +424,16 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="AuctionHouseBot"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\AuctionHouseBot.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Objects"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user