aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-03 16:35:33 +0200
committerQAston <none@none>2009-08-03 16:35:33 +0200
commit7569bb343a532ca6d080ad48bcb8275b3a182ddb (patch)
tree4d2111fce42ae760a1feabea207eb2f3c089b911
parentb4a2ece56cf0ea04f972d73982e8a3af33c62135 (diff)
*Add Rate.RepairCost config option - by MaXiMiUS
*Apply tc sql coding style to 4737_world_TDB.sql - by Drahy *Fix build with MAP_BASED_RAND_GEN option. --HG-- branch : trunk
-rw-r--r--sql/updates/4737_world_TDB.sql32
-rw-r--r--src/game/Object.h10
-rw-r--r--src/game/Player.cpp3
-rw-r--r--src/trinitycore/trinitycore.conf.dist4
4 files changed, 27 insertions, 22 deletions
diff --git a/sql/updates/4737_world_TDB.sql b/sql/updates/4737_world_TDB.sql
index 5ba64b8fd13..df24155cb04 100644
--- a/sql/updates/4737_world_TDB.sql
+++ b/sql/updates/4737_world_TDB.sql
@@ -1,16 +1,16 @@
-REPLACE INTO gameobject_template VALUES (178364,1,5773,"Horde Banner","",84,0,1,0,1479,196608,180101,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (178365,1,5771,"Alliance Banner","",83,0,1,0,1479,196608,180100,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (178925,1,5651,"Alliance Banner","",83,0,1,0,1479,196608,180421,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (178940,1,5653,"Contested Banner","",83,0,1,0,1479,196608,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (178943,1,5652,"Horde Banner","",84,0,1,0,1479,196608,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (179286,1,5772,"Contested Banner","",83,0,1,0,1479,196608,180102,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (179287,1,5774,"Contested Banner","",84,0,1,0,1479,0,180102,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (179435,1,5654,"Contested Banner","",84,0,1,0,1479,196608,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180100,6,2232,"Alliance Banner Aura","",0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180101,6,1311,"Horde Banner Aura","",0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180102,6,266,"Neutral Banner Aura","",0,0,2,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180418,1,6211,"Snowfall Banner","",0,0,1,0,1479,196608,180100,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180421,6,2232,"Alliance Banner Aura, Large","",0,0,5,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180422,6,1311,"Horde Banner Aura, Large","",0,0,5,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180423,6,266,"Neutral Banner Aura, Large","",0,0,5,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
-REPLACE INTO gameobject_template VALUES (180424,0,3751,"Alterac Valley Gate","",100,0,3.5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"");
+REPLACE INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `ScriptName`) VALUES
+(178365, 1, 5771, 'Alliance Banner', '', '', '', 83, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 180100, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(178925, 1, 5651, 'Alliance Banner', '', '', '', 83, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 180421, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(178940, 1, 5653, 'Contested Banner', '', '', '', 83, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(178943, 1, 5652, 'Horde Banner', '', '', '', 84, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(179286, 1, 5772, 'Contested Banner', '', '', '', 83, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 180102, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(179287, 1, 5774, 'Contested Banner', '', '', '', 84, 0, 1, 0, 0, 0, 0, 0, 1479, 0, 180102, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(179435, 1, 5654, 'Contested Banner', '', '', '', 84, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180100, 6, 2232, 'Alliance Banner Aura', '', '', '', 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180101, 6, 1311, 'Horde Banner Aura', '', '', '', 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180102, 6, 266, 'Neutral Banner Aura', '', '', '', 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180418, 1, 6211, 'Snowfall Banner', '', '', '', 0, 0, 1, 0, 0, 0, 0, 0, 1479, 196608, 180100, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180421, 6, 2232, 'Alliance Banner Aura, Large', '', '', '', 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180422, 6, 1311, 'Horde Banner Aura, Large', '', '', '', 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180423, 6, 266, 'Neutral Banner Aura, Large', '', '', '', 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
+(180424, 0, 3751, 'Alterac Valley Gate', '', '', '', 100, 0, 3.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
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