Skip to content

Commit

Permalink
[10117] New config option set min size of auction deposit fee.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirMangos committed Jun 28, 2010
1 parent 775063d commit 9f4ab8d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/game/AuctionHouseMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,16 @@ AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap( uint32 factionTemplateId )

uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem)
{
uint32 deposit = pItem->GetProto()->SellPrice * pItem->GetCount() * (time / MIN_AUCTION_TIME );
float deposit = float(pItem->GetProto()->SellPrice * pItem->GetCount() * (time / MIN_AUCTION_TIME ));

return uint32(deposit * entry->depositPercent * 3 * sWorld.getConfig(CONFIG_FLOAT_RATE_AUCTION_DEPOSIT) / 100.0f );
deposit = deposit * entry->depositPercent * 3.0f / 100.0f;

float min_deposit = float(sWorld.getConfig(CONFIG_UINT32_AUCTION_DEPOSIT_MIN));

if (deposit < min_deposit)
deposit = min_deposit;

return uint32(deposit * sWorld.getConfig(CONFIG_FLOAT_RATE_AUCTION_DEPOSIT));
}

//does not clear ram
Expand Down
1 change: 1 addition & 0 deletions src/game/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ void World::LoadConfigSettings(bool reload)
setConfigPos(CONFIG_FLOAT_RATE_AUCTION_TIME, "Rate.Auction.Time", 1.0f);
setConfig(CONFIG_FLOAT_RATE_AUCTION_DEPOSIT, "Rate.Auction.Deposit", 1.0f);
setConfig(CONFIG_FLOAT_RATE_AUCTION_CUT, "Rate.Auction.Cut", 1.0f);
setConfigPos(CONFIG_UINT32_AUCTION_DEPOSIT_MIN, "Auction.Deposit.Min", 0);
setConfig(CONFIG_FLOAT_RATE_HONOR, "Rate.Honor",1.0f);
setConfigPos(CONFIG_FLOAT_RATE_MINING_AMOUNT, "Rate.Mining.Amount", 1.0f);
setConfigPos(CONFIG_FLOAT_RATE_MINING_NEXT, "Rate.Mining.Next", 1.0f);
Expand Down
1 change: 1 addition & 0 deletions src/game/World.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_GROUP_VISIBILITY,
CONFIG_UINT32_MAIL_DELIVERY_DELAY,
CONFIG_UINT32_UPTIME_UPDATE,
CONFIG_UINT32_AUCTION_DEPOSIT_MIN,
CONFIG_UINT32_SKILL_CHANCE_ORANGE,
CONFIG_UINT32_SKILL_CHANCE_YELLOW,
CONFIG_UINT32_SKILL_CHANCE_GREEN,
Expand Down
5 changes: 5 additions & 0 deletions src/mangosd/mangosd.conf.dist.in
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,10 @@ Visibility.Distance.Grey.Object = 10
# Rate.Auction.Cut
# Auction rates (auction time, deposit get at auction start, auction cut from price at auction end)
#
# Auction.Deposit.Min
# Mininumum auction deposit size in copper
# Default: 0
#
# Rate.Honor
# Honor gain rate
#
Expand Down Expand Up @@ -1274,6 +1278,7 @@ Rate.Damage.Fall = 1
Rate.Auction.Time = 1
Rate.Auction.Deposit = 1
Rate.Auction.Cut = 1
Auction.Deposit.Min = 0
Rate.Honor = 1
Rate.Mining.Amount = 1
Rate.Mining.Next = 1
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10116"
#define REVISION_NR "10117"
#endif // __REVISION_NR_H__

0 comments on commit 9f4ab8d

Please sign in to comment.