aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Object.h10
-rw-r--r--src/game/Player.cpp3
-rw-r--r--src/trinitycore/trinitycore.conf.dist4
3 files changed, 11 insertions, 6 deletions
diff --git a/src/game/Object.h b/src/game/Object.h
index e8f9d9aafd7..98103384ac7 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -560,11 +560,11 @@ class TRINITY_DLL_SPEC WorldObject : public Object
bool IsTempWorldObject;
#ifdef MAP_BASED_RAND_GEN
- int32 irand(int32 min, int32 max) const { int32 (GetMap()->mtRand.randInt(max - min)) + min; }
- uint32 urand(uint32 min, uint32 max) const { GetMap()->mtRand.randInt(max - min) + min}
- int32 rand32() const { GetMap()->mtRand.randInt()}
- double rand_norm() const { GetMap()->mtRand.randExc()}
- double rand_chance() const { GetMap()->mtRand.randExc(100.0)}
+ int32 irand(int32 min, int32 max) const { return int32 (GetMap()->mtRand.randInt(max - min)) + min; }
+ uint32 urand(uint32 min, uint32 max) const { return GetMap()->mtRand.randInt(max - min) + min;}
+ int32 rand32() const { return GetMap()->mtRand.randInt();}
+ double rand_norm() const { return GetMap()->mtRand.randExc();}
+ double rand_chance() const { return GetMap()->mtRand.randExc(100.0);}
#endif
protected:
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index a319bf4317e..2da613aab8e 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -20,6 +20,7 @@
#include "Common.h"
#include "Language.h"
+#include "Config/ConfigEnv.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
#include "Opcodes.h"
@@ -4531,7 +4532,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class,ditemProto->SubClass)];
uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod));
- costs = uint32(costs * discountMod);
+ costs = uint32(costs * discountMod) * sConfig.GetFloatDefault("Rate.RepairCost", 1);
if (costs==0) //fix for ITEM_QUALITY_ARTIFACT
costs = 1;
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index cbc2ee54f3d..44c1199c277 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -1179,6 +1179,9 @@ Visibility.Distance.Grey.Object = 10
# XP needed per level past 70 (Rates below 1 not recommended)
# Default: 1
#
+# Rate.RepairCost
+# Repair cost rate (1 - standard, 2 - double cost, 0.5 - half cost, etc)
+#
# Rate.Rest.InGame
# Rate.Rest.Offline.InTavernOrCity
# Rate.Rest.Offline.InWilderness
@@ -1298,6 +1301,7 @@ Rate.XP.Kill = 1
Rate.XP.Quest = 1
Rate.XP.Explore = 1
Rate.XP.PastLevel70 = 1
+Rate.RepairCost = 1
Rate.Rest.InGame = 1
Rate.Rest.Offline.InTavernOrCity = 1
Rate.Rest.Offline.InWilderness = 1