Skip to content

Commit 65e2474

Browse files
authored
Core/Players: Add separate config option for starting money for Death Knight characters (#30466)
1 parent c0d8dba commit 65e2474

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/server/game/Entities/Player/Player.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,9 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
543543

544544
InitRunes();
545545

546-
SetMoney(sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY));
546+
SetMoney(GetClass() != CLASS_DEATH_KNIGHT
547+
? sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY)
548+
: sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY));
547549
SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS));
548550
SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS));
549551

src/server/game/World/World.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,19 @@ void World::LoadConfigSettings(bool reload)
917917
m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT;
918918
}
919919

920+
m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY] = sConfigMgr->GetIntDefault("StartDeathKnightPlayerMoney", 2000);
921+
if (int32(m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY]) < 0)
922+
{
923+
TC_LOG_ERROR("server.loading", "StartDeathKnightPlayerMoney ({}) must be in range 0..{}. Set to {}.", m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY], MAX_MONEY_AMOUNT, 2000);
924+
m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY] = 2000;
925+
}
926+
else if (m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY] > MAX_MONEY_AMOUNT)
927+
{
928+
TC_LOG_ERROR("server.loading", "StartDeathKnightPlayerMoney ({}) must be in range 0..{}. Set to {}.",
929+
m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT);
930+
m_int_configs[CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY] = MAX_MONEY_AMOUNT;
931+
}
932+
920933
m_int_configs[CONFIG_MAX_HONOR_POINTS] = sConfigMgr->GetIntDefault("MaxHonorPoints", 75000);
921934
if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0)
922935
{

src/server/game/World/World.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ enum WorldIntConfigs : uint32
238238
CONFIG_START_PLAYER_LEVEL,
239239
CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL,
240240
CONFIG_START_PLAYER_MONEY,
241+
CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY,
241242
CONFIG_MAX_HONOR_POINTS,
242243
CONFIG_START_HONOR_POINTS,
243244
CONFIG_MAX_ARENA_POINTS,

src/server/worldserver/worldserver.conf.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,14 @@ StartDeathKnightPlayerLevel = 55
845845

846846
StartPlayerMoney = 0
847847

848+
#
849+
# StartDeathKnightPlayerMoney
850+
# Description: Amount of money (in Copper) that a death knight character has after creation.
851+
# Default: 2000
852+
# 100 - (1 Silver)
853+
854+
StartDeathKnightPlayerMoney = 2000
855+
848856
#
849857
# MaxHonorPoints
850858
# Description: Maximum honor points a character can have.

0 commit comments

Comments
 (0)