适用于MANGOS系统。比较老的代码了,不过貌似还是可以使用的,大概需要修改的地方不多
Index: src/game/Player.cpp===================================================================--- src/game/Player.cpp (revision 5495)
+++ src/game/Player.cpp (working copy)@@
-439,6 +439,7 @@
// set starting level SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) );
+ SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_START_PLAYER_MONEY) * 10000 );
// Played time m_Last_tick = time(NULL);
Index: src/game/World.cpp===================================================================
--- src/game/World.cpp (revision 5495)
+++ src/game/World.cpp (working copy)@@
-431,6 +431,17 @@ sLog.outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",m_configs[CONFIG_START_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_configs[CONFIG_START_PLAYER_LEVEL] = m_configs[CONFIG_MAX_PLAYER_LEVEL];
}
+ m_configs[CONFIG_START_PLAYER_MONEY] = sConfig.GetIntDefault("StartPlayerMoney", 1);
+ if(m_configs[CONFIG_START_PLAYER_MONEY] < 0)
+ {
+ sLog.outError("StartPlayerMoney (%i) must be a positive number. Set to 0.",m_configs[CONFIG_START_PLAYER_MONEY]);
+ m_configs[CONFIG_START_PLAYER_MONEY] = 0;
+ }
+ else if(m_configs[CONFIG_START_PLAYER_MONEY] > 214748)
+ {
+ sLog.outError("StartPlayerMoney (%i) must be in range 0..MaxPlayerMoney(%u). Set to %u.",m_configs[CONFIG_START_PLAYER_MONEY],214748,214748);
+ m_configs[CONFIG_START_PLAYER_MONEY] = 214748;
+ }
m_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfig.GetBoolDefault("Instance.IgnoreLevel", 0);
m_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfig.GetBoolDefault("Instance.IgnoreRaid", 0);
m_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", 1);
Index: src/game/World.h===================================================================
--- src/game/World.h (revision 5495)
+++ src/game/World.h (working copy)@@
-82,6 +82,7 @@
CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND,
CONFIG_MAX_PLAYER_LEVEL,
CONFIG_START_PLAYER_LEVEL,
+ CONFIG_START_PLAYER_MONEY,
CONFIG_INSTANCE_IGNORE_LEVEL,
CONFIG_INSTANCE_IGNORE_RAID,
CONFIG_BATTLEGROUND_CAST_DESERTER,
Index: src/mangosd/mangosd.conf.in===================================================================--- src/mangosd/mangosd.conf.in
(revision 5495)+++ src/mangosd/mangosd.conf.in (working copy)
@@ -306,6 +306,11 @@
# Staring level that have character at creating (in range 1 to MaxPlayerLevel)
# Default: 1 #
+# StartPlayerMoney
+# Starting money in Gold that have character at creating (in range 0 to 214748)
+# Todo: Break this up by copper silver and gold
+# Default: 0
+#
# ActivateWeather
# Activate weather system
# Default: 1 (true)
@@ -385,6 +390,7 @@
DBC.Locale = 255
MaxPlayerLevel = 70
StartPlayerLevel = 1
+StartPlayerMoney = 0
ActivateWeather = 1
Battleground.CastDeserter = 1
Instance.IgnoreLevel = 0
|