diff --git a/Spell_dbc_patch.txt b/Spell_dbc_patch.txt index d3f63d6..2d0aec3 100644 --- a/Spell_dbc_patch.txt +++ b/Spell_dbc_patch.txt @@ -1,11 +1,11 @@ ;IdColumnIndex=0 -455001:0=455001,3=15,4=218104064,6=524288,7=262144,34=131752,35=20,40=3,73=6,81=-31,82=-201,95=42,96=54,97=290,116=455101,131=121,133=2283,136="Trauma: Eye",186=16712188,187="Chance to hit reduced. Cannot crit.#13#10Damage may cause blindness.",203=16712188 -455002:0=455002,3=15,4=218104064,6=524288,7=262144,28=1,34=131752,35=20,40=3,46=1,71=6,72=6,73=6,74=1,75=1,76=1,81=-36,82=-36,86=1,87=1,95=42,96=33,97=192,116=455102,131=121,133=138,136="Trauma: Limb",186=16712188,187="Movement speed and attack speed reduced.#13#10Damage may cause debilitation.",203=16712188 -455003:0=455003,3=15,4=218104064,5=1032,6=524288,7=262144,28=1,34=131752,35=33,40=3,71=6,72=6,73=6,74=1,75=1,76=1,81=-41,82=-31,86=1,87=1,95=42,96=33,97=133,116=455103,131=121,133=243,136="Trauma: Body",186=16712188,187="Maximum health and movement speed reduced.#13#10Damage may cause heavy bleeding.",203=16712188 -455004:0=455004,3=15,4=218104064,6=524288,7=262144,28=1,34=131752,35=20,40=3,71=6,72=6,73=6,74=1,75=1,76=1,81=-51,82=-51,86=1,87=1,95=42,96=33,97=252,116=455104,131=121,133=2636,136="Trauma: Head",186=16712188,187="All speeds reduced.#13#10Damage may cause unconsciousness.",203=16712188 -455005:0=455005,3=15,4=218104064,6=524288,7=262144,34=131752,35=50,40=3,71=6,72=6,74=1,75=1,81=9,87=1,95=42,96=87,111=127,116=455105,131=121,133=499,136="Trauma: Innards",186=16712188,187="Damage taken increased.#13#10Damage may cause fraility.",203=16712188 -455101:0=455101,3=12,4=1140850944,7=65536,40=35,71=6,72=6,74=1,75=1,80=-61,86=1,87=1,95=33,96=5,131=9231,133=48,136="Blindness",169=16712188,186=16712190,187="Disoriented.",203=16712190 -455102:0=455102,3=12,4=1140850944,7=65536,40=35,46=1,72=6,74=1,86=1,87=1,95=26,96=60,131=9020,133=2770,136="Debilitation",186=16712188,187="Stunned.",203=16712190 -455103:0=455103,3=15,4=67108864,7=65536,40=28,49=100,95=89,98=1000,131=10808,133=500,136="Heavy Bleeding",170="Losing 1% health per second. Stacks.",186=16712190,187="Bleeding.",203=16712190 -455104:0=455104,3=12,4=1140850944,5=394240,7=65536,9=8,40=32,80=-1,87=1,95=4,96=12,131=12600,133=15,136="Unconsciousness",186=16712188,187="Stunned.",203=16712188 -455105:0=455105,3=15,4=67109120,7=65536,40=9,49=20,80=4,86=1,95=87,131=10808,133=153,136="Fraility",169=16712188,186=16712190,187="Damage taken increased.",203=16712190 +455001:0=455001,3=15,4=218104064,6=524288,7=262144,28=1,34=131752,35=20,40=3,71=6,72=6,73=6,75=1,76=1,81=-31,82=-201,86=1,87=1,88=1,95=42,96=54,97=290,116=455101,131=121,133=2283,136="Trauma: Eye",169=16712188,186=16712188,187="Chance to hit reduced. Cannot crit.#13#10Damage may cause blindness.",203=16712188,225=1 +455002:0=455002,3=15,4=218104064,6=524288,7=262144,28=1,34=131752,35=20,40=3,46=1,71=6,72=6,73=6,74=1,75=1,76=1,81=-36,82=-36,86=1,87=1,88=1,95=42,96=33,97=192,116=455102,131=121,133=138,136="Trauma: Limb",169=16712188,186=16712188,187="Movement speed and attack speed reduced.#13#10Damage may cause debilitation.",203=16712188,225=1 +455003:0=455003,3=15,4=218104064,5=1032,6=524288,7=262144,28=1,34=131752,35=33,40=3,46=1,71=6,72=6,73=6,74=1,75=1,76=1,81=-41,82=-31,86=1,87=1,88=1,95=42,96=33,97=133,116=455103,131=121,133=243,136="Trauma: Body",169=16712188,186=16712188,187="Maximum health and movement speed reduced.#13#10Damage may cause heavy bleeding.",203=16712188,225=1 +455004:0=455004,3=15,4=218104064,6=524288,7=262144,28=1,34=131752,35=20,40=3,46=1,71=6,72=6,73=6,74=1,75=1,76=1,81=-51,82=-51,86=1,87=1,88=1,95=42,96=33,97=252,116=455104,131=121,133=2636,136="Trauma: Head",169=16712188,186=16712188,187="All speeds reduced.#13#10Damage may cause unconsciousness.",203=16712188,225=1 +455005:0=455005,3=15,4=218104064,6=524288,7=262144,28=1,34=131752,35=50,40=3,46=1,71=6,72=6,74=1,75=1,81=9,86=1,87=1,95=42,96=87,111=127,116=455105,131=121,133=499,136="Trauma: Innards",169=16712188,186=16712188,187="Damage taken increased.#13#10Damage may cause fraility.",203=16712188,225=1 +455101:0=455101,3=12,4=1140850944,7=65536,28=1,35=101,40=35,46=1,71=6,72=6,74=1,75=1,80=-61,86=1,87=1,95=33,96=5,131=9231,133=48,136="Blindness",169=16712188,186=16712190,187="Disoriented.",203=16712190,225=1 +455102:0=455102,3=12,4=1140850944,7=65536,28=1,35=101,40=35,46=1,71=6,72=6,74=1,86=1,87=1,95=26,96=60,131=9020,133=2770,136="Debilitation",169=16712188,186=16712188,187="Cannot move, attack or cast spells.",203=16712190,225=1 +455103:0=455103,3=15,4=67108864,7=65536,28=1,35=101,40=28,46=1,49=5,71=6,74=1,86=1,95=89,98=1000,131=10808,133=500,136="Heavy Bleeding",169=16712188,170="Losing 1% health per second. Stacks.",186=16712190,187="Bleeding $s1% of maximum health per second.",203=16712190,225=1 +455104:0=455104,3=12,4=1140850944,5=394240,7=65536,9=8,28=1,35=101,40=32,46=1,71=6,72=6,74=1,80=-1,86=1,87=1,95=4,96=12,131=12600,133=15,136="Unconsciousness",169=16712188,186=16712188,187="Stunned.",203=16712188,225=1 +455105:0=455105,3=15,4=67109120,7=65536,28=1,35=101,40=9,46=1,49=20,71=6,74=1,80=4,86=1,95=87,110=127,131=10808,133=153,136="Fraility",169=16712188,186=16712190,187="All damage taken increased by $s1%.",203=16712190,225=1 diff --git a/traumas2020.patch b/traumas.patch similarity index 91% rename from traumas2020.patch rename to traumas.patch index 1354150..da588e9 100644 --- a/traumas2020.patch +++ b/traumas.patch @@ -1,20 +1,20 @@ -From 368de2b69a44a4ca396a188b0e64dcb70378fdd7 Mon Sep 17 00:00:00 2001 +From 5656b9d19ebae5d1cf6c82511dab0301a8a29de6 Mon Sep 17 00:00:00 2001 From: trickerer -Date: Tue, 2 Feb 2021 21:35:12 +0700 -Subject: [PATCH] traumas2020 +Date: Fri, 19 Feb 2021 19:21:09 +0700 +Subject: [PATCH] traumas --- - src/server/game/Entities/Unit/Unit.cpp | 5 + - src/server/game/Scripting/ScriptMgr.cpp | 5 + - src/server/game/Scripting/ScriptMgr.h | 4 + - src/server/scripts/Custom/custom_script_loader.cpp | 2 + - src/server/scripts/Custom/traumas.cpp | 314 +++++++++++++++++++++ - src/server/worldserver/worldserver.conf.dist | 126 +++++++++ - 6 files changed, 456 insertions(+) + src/server/game/Entities/Unit/Unit.cpp | 5 + + src/server/game/Scripting/ScriptMgr.cpp | 5 + + src/server/game/Scripting/ScriptMgr.h | 4 + + .../scripts/Custom/custom_script_loader.cpp | 2 + + src/server/scripts/Custom/traumas.cpp | 300 ++++++++++++++++++ + src/server/worldserver/worldserver.conf.dist | 126 ++++++++ + 6 files changed, 442 insertions(+) create mode 100644 src/server/scripts/Custom/traumas.cpp diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp -index 0d5ff0e..6de679c 100644 +index b2fa0d6..97a09e2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -694,6 +694,11 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons @@ -85,10 +85,10 @@ index 9e5e9ba..3a2fbb4 100644 } diff --git a/src/server/scripts/Custom/traumas.cpp b/src/server/scripts/Custom/traumas.cpp new file mode 100644 -index 0000000..9fe4635 +index 0000000..bf2761f --- /dev/null +++ b/src/server/scripts/Custom/traumas.cpp -@@ -0,0 +1,314 @@ +@@ -0,0 +1,300 @@ +/* + * Copyright (C) 2020-2021 trickerer + */ @@ -99,7 +99,7 @@ index 0000000..9fe4635 +#include "SpellAuraEffects.h" + +//version -+#define TRAUMAS_REVISION 62 ++static constexpr uint32 TRAUMAS_REVISION = 64; + +//config +bool _Tenabled; @@ -134,8 +134,8 @@ index 0000000..9fe4635 + TRAUMA_INTERNAL = 5 +}; + -+#define TRAUMA_NONE 0 -+#define MAX_TRAUMAS 5 ++static constexpr uint32 TRAUMA_NONE = 0; ++static constexpr uint32 MAX_TRAUMAS = 5; + +enum TraumaBaseSpells +{ @@ -146,7 +146,7 @@ index 0000000..9fe4635 + SPELL_TRAUMA_BASE_INTERNAL = 455005 +}; + -+static const uint32 SPELL_TRAUMA_BASE[MAX_TRAUMAS] = ++static constexpr uint32 SPELL_TRAUMA_BASE[MAX_TRAUMAS] = +{ + SPELL_TRAUMA_BASE_EYE, + SPELL_TRAUMA_BASE_LIMB, @@ -155,7 +155,6 @@ index 0000000..9fe4635 + SPELL_TRAUMA_BASE_INTERNAL +}; + -+//traits - no c++11+ +namespace trauma_traits +{ +template struct Is_viable { enum { value = true }; }; @@ -171,34 +170,21 @@ index 0000000..9fe4635 +/*Totem*/ NOT_VIABLE_ALL(CREATURE_TYPE_TOTEM) +/*Gas Cloud*/ NOT_VIABLE_ALL(CREATURE_TYPE_GAS_CLOUD) +} -+template ::value> -+struct Trauma { static bool IsViable() { return is_viable; } }; + +struct TraumaViability +{ -+ explicit TraumaViability(TraumaTypes t, CreatureType c, bool val) : t_type(t), c_type(c), my_val(val) { } -+ -+ TraumaTypes ttype() const { return t_type; } -+ CreatureType ctype() const { return c_type; } -+ bool viable() const { return my_val; } -+ -+private: -+ TraumaTypes t_type; -+ CreatureType c_type; -+ bool my_val; ++ const TraumaTypes t_type; ++ const bool viable; +}; + -+typedef std::multimap TraumaViabilityMap; ++typedef std::multimap TraumaViabilityMap; +typedef std::pair TraumaViabilityRange; +typedef TraumaViabilityMap::value_type TraumaViabilityPair; + -+#define Tpair(t,c) TraumaViabilityPair(c,TraumaViability(t,c, Trauma::IsViable())) ++#define Tpair(t,c) TraumaViabilityPair(c, TraumaViability{t, trauma_traits::Is_viable::value}) +#define Tpairs(t) Tpair(t,CREATURE_TYPE_BEAST), Tpair(t,CREATURE_TYPE_DRAGONKIN), Tpair(t,CREATURE_TYPE_DEMON), Tpair(t,CREATURE_TYPE_ELEMENTAL), Tpair(t,CREATURE_TYPE_GIANT), Tpair(t,CREATURE_TYPE_UNDEAD), Tpair(t,CREATURE_TYPE_HUMANOID), Tpair(t,CREATURE_TYPE_CRITTER), Tpair(t,CREATURE_TYPE_MECHANICAL), Tpair(t,CREATURE_TYPE_NOT_SPECIFIED), Tpair(t,CREATURE_TYPE_TOTEM), Tpair(t,CREATURE_TYPE_NON_COMBAT_PET), Tpair(t,CREATURE_TYPE_GAS_CLOUD) + -+static const TraumaViabilityPair tviaarr[] = -+{ Tpairs(TRAUMA_EYE), Tpairs(TRAUMA_LIMB), Tpairs(TRAUMA_BODY), Tpairs(TRAUMA_HEAD), Tpairs(TRAUMA_INTERNAL) }; -+ -+static const TraumaViabilityMap TraumasMap(tviaarr, tviaarr + sizeof(tviaarr) / sizeof(tviaarr[0])); ++const TraumaViabilityMap TraumasMap = { Tpairs(TRAUMA_EYE), Tpairs(TRAUMA_LIMB), Tpairs(TRAUMA_BODY), Tpairs(TRAUMA_HEAD), Tpairs(TRAUMA_INTERNAL) }; + +//scripts +class traumas_config : public WorldScript @@ -222,7 +208,7 @@ index 0000000..9fe4635 + TC_LOG_INFO("server.loading", ">> Traumas config %s.", reload ? "re-loaded" : "loaded"); + + if (_Tenabled) -+ TC_LOG_INFO("server.loading", ">> Traumas system enabled (rev %u)", (uint32)TRAUMAS_REVISION); ++ TC_LOG_INFO("server.loading", ">> Traumas system enabled (rev %u)", TRAUMAS_REVISION); + } + + void _LoadConfig() @@ -388,8 +374,8 @@ index 0000000..9fe4635 + + TraumaViabilityRange v_range = TraumasMap.equal_range(CreatureType(unit->GetCreatureType())); + for (TraumaViabilityMap::const_iterator it = v_range.first; it != v_range.second; ++it) -+ if (it->second.viable()) -+ vt_types.push_back(it->second.ttype()); ++ if (it->second.viable) ++ vt_types.push_back(it->second.t_type); + + if (!vt_types.empty()) + return vt_types.size() == 1 ? vt_types.front() : Trinity::Containers::SelectRandomContainerElement(vt_types); @@ -404,7 +390,7 @@ index 0000000..9fe4635 + new script_traumas(); +} diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist -index 6a51d91..b01168b 100644 +index 0a79664..e2fbc30 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -4089,3 +4089,129 @@ Metric.OverallStatusInterval = 1 @@ -538,5 +524,5 @@ index 6a51d91..b01168b 100644 +# +################################################################################################### -- -2.10.0.windows.1 +2.30.1.windows.1 diff --git a/world_spell_linked_spell2020.sql b/world_spell_linked_spell.sql similarity index 100% rename from world_spell_linked_spell2020.sql rename to world_spell_linked_spell.sql diff --git a/world_spell_proc.sql b/world_spell_proc.sql new file mode 100644 index 0000000..fd23451 --- /dev/null +++ b/world_spell_proc.sql @@ -0,0 +1,8 @@ +REPLACE INTO `spell_proc` +(`SpellId`,`Chance`,`Cooldown`) +VALUES +('455001','20','4000'), +('455002','20','4000'), +('455003','33','1000'), +('455004','20','4000'), +('455005','50','250'); diff --git a/world_spell_proc_event2020.sql b/world_spell_proc_event2020.sql deleted file mode 100644 index 3b99dab..0000000 --- a/world_spell_proc_event2020.sql +++ /dev/null @@ -1,8 +0,0 @@ -REPLACE INTO `spell_proc` -(`SpellId`,`ProcsPerMinute`,`Cooldown`) -VALUES -('455001','5','4000'), -('455002','5','4000'), -('455003','5','4000'), -('455004','5','4000'), -('455005','5','4000');