Skip to content

Commit

Permalink
增加宠物经验配置。 (pet kills creature experience rate configuration.)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwisus authored and Phatcat committed Jun 28, 2016
1 parent d7300ce commit 0b47b50
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/game/Pet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ void Pet::GivePetXP(uint32 xp)
if (level >= maxlevel)
return;

xp *= sWorld.getConfig(CONFIG_FLOAT_RATE_PET_XP_KILL);

uint32 nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP);
uint32 curXP = GetUInt32Value(UNIT_FIELD_PETEXPERIENCE);
uint32 newXP = curXP + xp;
Expand Down
7 changes: 4 additions & 3 deletions src/game/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,10 @@ void World::LoadConfigSettings(bool reload)
setConfigPos(CONFIG_FLOAT_RATE_DROP_ITEM_ARTIFACT, "Rate.Drop.Item.Artifact", 1.0f);
setConfigPos(CONFIG_FLOAT_RATE_DROP_ITEM_REFERENCED, "Rate.Drop.Item.Referenced", 1.0f);
setConfigPos(CONFIG_FLOAT_RATE_DROP_MONEY, "Rate.Drop.Money", 1.0f);
setConfig(CONFIG_FLOAT_RATE_XP_KILL, "Rate.XP.Kill", 1.0f);
setConfig(CONFIG_FLOAT_RATE_XP_QUEST, "Rate.XP.Quest", 1.0f);
setConfig(CONFIG_FLOAT_RATE_XP_EXPLORE, "Rate.XP.Explore", 1.0f);
setConfig(CONFIG_FLOAT_RATE_PET_XP_KILL, "Rate.Pet.XP.Kill", 1.0f);
setConfig(CONFIG_FLOAT_RATE_XP_KILL, "Rate.XP.Kill", 1.0f);
setConfig(CONFIG_FLOAT_RATE_XP_QUEST, "Rate.XP.Quest", 1.0f);
setConfig(CONFIG_FLOAT_RATE_XP_EXPLORE, "Rate.XP.Explore", 1.0f);
setConfig(CONFIG_FLOAT_RATE_REPUTATION_GAIN, "Rate.Reputation.Gain", 1.0f);
setConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_KILL, "Rate.Reputation.LowLevel.Kill", 1.0f);
setConfig(CONFIG_FLOAT_RATE_REPUTATION_LOWLEVEL_QUEST, "Rate.Reputation.LowLevel.Quest", 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 @@ -227,6 +227,7 @@ enum eConfigFloatValues
CONFIG_FLOAT_RATE_DROP_ITEM_ARTIFACT,
CONFIG_FLOAT_RATE_DROP_ITEM_REFERENCED,
CONFIG_FLOAT_RATE_DROP_MONEY,
CONFIG_FLOAT_RATE_PET_XP_KILL,
CONFIG_FLOAT_RATE_XP_KILL,
CONFIG_FLOAT_RATE_XP_QUEST,
CONFIG_FLOAT_RATE_XP_EXPLORE,
Expand Down
2 changes: 2 additions & 0 deletions src/mangosd/mangosd.conf.dist.in
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,7 @@ Visibility.AIRelocationNotifyDelay = 1000
# Drop rates (items by quality and money)
# Default: 1
#
# Rate.Pet.XP.Kill
# Rate.XP.Kill
# Rate.XP.Quest
# Rate.XP.Explore
Expand Down Expand Up @@ -1432,6 +1433,7 @@ Rate.Drop.Item.Legendary = 1
Rate.Drop.Item.Artifact = 1
Rate.Drop.Item.Referenced = 1
Rate.Drop.Money = 1
Rate.Pet.XP.Kill = 1
Rate.XP.Kill = 1
Rate.XP.Quest = 1
Rate.XP.Explore = 1
Expand Down

0 comments on commit 0b47b50

Please sign in to comment.