Jump to content

[10317][Patch] Editing rogue's energy rate in mangos.conf


lasyan3

Recommended Posts

Hi everyone, this is my first post, I hesitated to post it here or in the "core modifications" section, so don't ban me too fast :P

What bug does the patch fix? What features does the patch add?

No bug fix. The patch simply adds a "Rate" value in the "SERVER RATES" section of mangos.conf. It allows one to change the rate of the energy of the rogue, the same way than the rate of the mana for example.

For which repository revision was the patch created?

I created it with the revision 10313.

Who has been writing this patch?

Me.

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9faf816..e357b95 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -2123,8 +2123,11 @@ void Player::Regenerate(Powers power, uint32 diff)
            addvalue = 20 * RageDecreaseRate;               // 2 rage by tick (= 2 seconds => 1 rage/sec)
        }   break;
        case POWER_ENERGY:                                  // Regenerate energy (rogue)
-            addvalue = 20;
+        {
+            float EnergyRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_ENERGY);
+            addvalue = 20 * EnergyRate;
            break;
+        }
        case POWER_RUNIC_POWER:
        {
            float RunicPowerDecreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_RUNICPOWER_LOSS);
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 28393bd..13036df 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -446,6 +446,7 @@ void World::LoadConfigSettings(bool reload)
    setConfig(CONFIG_FLOAT_RATE_POWER_RUNICPOWER_INCOME, "Rate.RunicPower.Income", 1.0f);
    setConfigPos(CONFIG_FLOAT_RATE_POWER_RUNICPOWER_LOSS,   "Rate.RunicPower.Loss",   1.0f);
    setConfig(CONFIG_FLOAT_RATE_POWER_FOCUS,          "Rate.Focus", 1.0f);
+    setConfig(CONFIG_FLOAT_RATE_POWER_ENERGY,          "Rate.Energy", 1.0f);
    setConfigPos(CONFIG_FLOAT_RATE_SKILL_DISCOVERY,      "Rate.Skill.Discovery",      1.0f);
    setConfigPos(CONFIG_FLOAT_RATE_DROP_ITEM_POOR,       "Rate.Drop.Item.Poor",       1.0f);
    setConfigPos(CONFIG_FLOAT_RATE_DROP_ITEM_NORMAL,     "Rate.Drop.Item.Normal",     1.0f);
diff --git a/src/game/World.h b/src/game/World.h
index 6aadc0d..d23c616 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -204,6 +204,7 @@ enum eConfigFloatValues
    CONFIG_FLOAT_RATE_POWER_RUNICPOWER_INCOME,
    CONFIG_FLOAT_RATE_POWER_RUNICPOWER_LOSS,
    CONFIG_FLOAT_RATE_POWER_FOCUS,
+    CONFIG_FLOAT_RATE_POWER_ENERGY,
    CONFIG_FLOAT_RATE_SKILL_DISCOVERY,
    CONFIG_FLOAT_RATE_DROP_ITEM_POOR,
    CONFIG_FLOAT_RATE_DROP_ITEM_NORMAL,
diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
index f464eb8..cfd767a 100644
--- a/src/mangosd/mangosd.conf.dist.in
+++ b/src/mangosd/mangosd.conf.dist.in
@@ -1139,6 +1139,7 @@ Visibility.Distance.Grey.Object = 10
#    Rate.RunicPower.Income
#    Rate.RunicPower.Loss
#    Rate.Focus
+#    Rate.Energy (Rogue)
#        Health and power regeneration and rage income from damage.
#        Default: 1
#
@@ -1272,6 +1273,7 @@ Rate.Rage.Loss = 1
Rate.RunicPower.Income = 1
Rate.RunicPower.Loss = 1
Rate.Focus = 1
+Rate.Energy = 1
Rate.Skill.Discovery = 1
Rate.Drop.Item.Poor = 1
Rate.Drop.Item.Normal = 1

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use