From 49068b462627db756a70ab55f0169646ac680f61 Mon Sep 17 00:00:00 2001
From: Bunny <glisa825@gmail.com>
Date: Fri, 9 Oct 2020 01:18:42 -0400
Subject: [PATCH] Tune cunning talent scaling

---
 .../tome/data/talents/cunning/artifice.lua     |  2 +-
 .../tome/data/talents/cunning/dirty.lua        |  4 ++--
 .../tome/data/talents/cunning/poisons.lua      | 18 +++++++++---------
 .../tome/data/talents/cunning/scoundrel.lua    | 10 +++++-----
 .../tome/data/talents/cunning/shadow-magic.lua |  2 +-
 .../tome/data/talents/cunning/stealth.lua      |  2 +-
 .../tome/data/talents/cunning/tactical.lua     |  4 ++--
 .../tome/data/talents/cunning/traps.lua        |  4 ++--
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/game/modules/tome/data/talents/cunning/artifice.lua b/game/modules/tome/data/talents/cunning/artifice.lua
index 3f50741943..25bb7e9fa7 100644
--- a/game/modules/tome/data/talents/cunning/artifice.lua
+++ b/game/modules/tome/data/talents/cunning/artifice.lua
@@ -668,7 +668,7 @@ newTalent{
 	type = {"cunning/tools", 1},
 	mode = "passive",
 	points = 1,
-	getSlow = function(self, t) return self:combatTalentLimit(self:getTalentFromId(self.T_MASTER_ARTIFICER), 50, 15, 40)/100 end,
+	getSlow = function(self, t) return self:combatTalentLimit(self:getTalentFromId(self.T_MASTER_ARTIFICER), 50, 20, 40)/100 end,
 	short_info = function(self, t)
 		return ([[Your darts ignore poison and sleep immunity and waking targets are slowed by %d%% for 4 turns.]]):tformat(t.getSlow(self, t)*100)
 	end,
diff --git a/game/modules/tome/data/talents/cunning/dirty.lua b/game/modules/tome/data/talents/cunning/dirty.lua
index a59c62cbbe..55d2c9b850 100644
--- a/game/modules/tome/data/talents/cunning/dirty.lua
+++ b/game/modules/tome/data/talents/cunning/dirty.lua
@@ -65,7 +65,7 @@ newTalent{
 	points = 5,
 	require = cuns_req2,
 	getDamageBoost = function(self, t) return self:combatTalentScale(t, 4, 10) end,
-	getDisableChance = function(self, t) return self:combatTalentLimit(t, 30, 1, 5) end, -- Limit < 30%
+	getDisableChance = function(self, t) return self:combatTalentLimit(t, 30, 2.5, 7.5) end, -- Limit < 30%
 	callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam)
 		if target and hitted and dam > 0 then
 			local nb = 0
@@ -127,7 +127,7 @@ newTalent{
 		return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
 	getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 3, 5)) end,
-	getSlow = function(self, t) return self:combatTalentLimit(t, 90, 15, 30) end, -- Limit < 90% speed loss
+	getSlow = function(self, t) return self:combatTalentLimit(t, 90, 35, 70) end, -- Limit < 90% speed loss
 	getAcc = function(self, t) return math.ceil(self:combatTalentScale(t, 8, 24, 0.75)) end,
 	action = function(self, t)
 		local tg = self:getTalentTarget(t)
diff --git a/game/modules/tome/data/talents/cunning/poisons.lua b/game/modules/tome/data/talents/cunning/poisons.lua
index 648317af2a..0a97c934ee 100644
--- a/game/modules/tome/data/talents/cunning/poisons.lua
+++ b/game/modules/tome/data/talents/cunning/poisons.lua
@@ -132,7 +132,7 @@ newTalent{
 	},
 	sustain_stamina = 10,
 	getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 4, 7)) end,
-	getChance = function(self,t) return self:combatTalentLimit(t, 100, 25, 45) end,
+	getChance = function(self,t) return self:combatTalentLimit(t, 100, 30, 50) end,
 	getDamage = function(self, t) return 8 + self:combatTalentStatDamage(t, "cun", 10, 60) * 0.6 end,
 	ApplyPoisons = function(self, t, target, weapon) -- apply poison(s) to a target
 		if self:knowTalent(self.T_VULNERABILITY_POISON) then -- apply vulnerability first
@@ -196,7 +196,7 @@ newTalent{
 	points = 5,
 	mode = "passive",
 	require = cuns_req2,
-	getRadius = function(self, t) return math.floor(self:combatTalentLimit(t, 10, 1.5, 3.5)) end,
+	getRadius = function(self, t) return math.floor(self:combatTalentLimit(t, 10, 2, 5)) end,
 	on_kill = function(self, t, target)
 		local poisons = {}
 		local to_spread  = 0
@@ -300,7 +300,7 @@ newTalent{
 	getDamage = function (self, t) return self:combatTalentWeaponDamage(t, 1.2, 2.1) end,
 	getSecondaryDamage = function (self, t) return self:combatTalentStatDamage(t, "cun", 50, 550) end,
 	getNb = function(self, t) return math.floor(self:combatTalentScale(t, 1, 4, "log")) end,
-	getPower = function(self, t) return self:combatTalentLimit(t, 50, 10, 30)/100 end,
+	getPower = function(self, t) return self:combatTalentLimit(t, 50, 20, 35)/100 end,
 	tactical = function(self, t, aitarget)
 		local tacs = { attack = {NATURE = self:isTalentActive(self.T_INSIDIOUS_POISON) and 3 or 2},
 			__wt_cache_turns=1}
@@ -414,7 +414,7 @@ newTalent{
 	poison_tactics = { disable = {poison = 1.5}, defend = {poison = -0.5}},
 	tactical_imp = poisonTactics,
 	no_unlearn_last = true,
-	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 35, 10, 20) end, -- Limit effect to <35%
+	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 35, 15, 25) end, -- Limit effect to <35%
 	activate = function(self, t)
 		cancelPoisons(self)
 		self.vile_poisons = self.vile_poisons or {}
@@ -446,7 +446,7 @@ newTalent{
 	poison_tactics = {attack = {poison = 1.5}, disable = {poison = 0.5}},
 	tactical_imp = poisonTactics,
 	no_unlearn_last = true,
-	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 150, 45, 70) end, -- Limit -healing effect to <150%
+	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 150, 50, 75) end, -- Limit -healing effect to <150%
 	activate = function(self, t)
 		cancelPoisons(self)
 		self.vile_poisons = self.vile_poisons or {}
@@ -478,7 +478,7 @@ newTalent{
 	poison_tactics = {disable = {poison = 2}},
 	tactical_imp = poisonTactics,
 	no_unlearn_last = true,
-	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 35, 10, 20) end, --	Limit chance to < 35%
+	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 35, 15, 25) end, --	Limit chance to < 35%
 	activate = function(self, t)
 		cancelPoisons(self)
 		self.vile_poisons = self.vile_poisons or {}
@@ -510,7 +510,7 @@ newTalent{
 	poison_tactics = {heal = {poison = -2}}, -- heals if a HOSTILE target is affected by the poison
 	tactical_imp = poisonTactics,
 	no_unlearn_last = true,
-	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 100, 10, 40) end, -- limit < 50%
+	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 100, 18, 40) end, -- limit < 50%
 	activate = function(self, t)
 		cancelPoisons(self)
 		self.vile_poisons = self.vile_poisons or {}
@@ -547,7 +547,7 @@ newTalent{
 		end
 	end,
 	no_unlearn_last = true,
-	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 100, 15, 50) end, --	Limit effect to < 100%
+	getEffect = function(self, t) return self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 100, 22, 50) end, --	Limit effect to < 100%
 	activate = function(self, t)
 		cancelPoisons(self)
 		self.vile_poisons = self.vile_poisons or {}
@@ -608,7 +608,7 @@ newTalent{
 	vile_poison = true,
 	getDuration = function(self, t) return math.floor(self:combatTalentScale(self:getTalentLevel(self.T_VILE_POISONS), 6, 8)) end,
 	getDOT = function(self, t) return 8 + self:combatTalentStatDamage(self.T_VILE_POISONS, "cun", 10, 30) * 0.4 end,
-	stoneTime = function(self, t) return math.ceil(self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 1, 10, 5.6)) end, -- Time to stone target, always > 1 turn
+	stoneTime = function(self, t) return math.ceil(self:combatTalentLimit(self:getTalentLevel(self.T_VILE_POISONS), 1, 7, 2)) end, -- Time to stone target, always > 1 turn
 	getEffect = function(self, t) return math.floor(self:combatTalentScale(self:getTalentLevel(self.T_VILE_POISONS), 3, 4)) end,
 	on_learn = function(self, t)
 		table.set(self, "__show_special_talents", t.id, true)
diff --git a/game/modules/tome/data/talents/cunning/scoundrel.lua b/game/modules/tome/data/talents/cunning/scoundrel.lua
index f70ae0fc89..752081ac5f 100644
--- a/game/modules/tome/data/talents/cunning/scoundrel.lua
+++ b/game/modules/tome/data/talents/cunning/scoundrel.lua
@@ -26,7 +26,7 @@ newTalent{
 	require = cuns_req1,
 	mode = "passive",
 	no_break_stealth = true,
-	getChance = function(self,t) return self:combatTalentLimit(t, 70, 20, 55) end, --Limit < 50%
+	getChance = function(self,t) return self:combatTalentLimit(t, 70, 25, 55) end, --Limit < 50%
 	callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam)
 		if not (target and hitted and dam > 0) or self:reactionToward(target) >= 0 then return nil end
 		if rng.percent(t.getChance(self, t)) and target:canBe("cut") then
@@ -58,9 +58,9 @@ newTalent{
 	require = cuns_req2,
 	mode = "passive",
 	points = 5,
-	getCritPenalty = function(self,t) return self:combatTalentLimit(t, 100, 20, 60) end,
+	getCritPenalty = function(self,t) return self:combatTalentLimit(t, 100, 25, 60) end,
 	getDuration = function(self,t) return 4 end,
-	getChance = function(self, t) return self:combatTalentLimit(t, 100, 8, 35) end, -- Limit < 100%
+	getChance = function(self, t) return self:combatTalentLimit(t, 100, 12, 35) end, -- Limit < 100%
 	callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam)
 		if not (target and hitted and dam > 0) or self:reactionToward(target) >=0 then return nil end
 		target:setEffect(target.EFF_SCOUNDREL, 5, {src=self, power=t.getCritPenalty(self,t) })
@@ -118,7 +118,7 @@ newTalent{
 	require = cuns_req3,
 	mode = "passive",
 	getDuration = function(self, t) return self:combatTalentLimit(t, 100, 30, 55) end, --limit < 100%
-	getChance = function(self, t) return self:combatTalentLimit(t, 50, 10, 35) end, --limit < 100%
+	getChance = function(self, t) return self:combatTalentLimit(t, 50, 15, 35) end, --limit < 100%
 	getDefense = function(self, t) return self:combatTalentStatDamage(t, "cun", 15, 60) end,
 	passives = function(self, t, p)
 		self:talentTemporaryValue(p, "combat_def", t.getDefense(self, t))
@@ -164,7 +164,7 @@ newTalent{
 	mode = "passive",
 	points = 5,
 	getDamage = function(self, t) return self:combatTalentStatDamage(t, "cun", 25, 400) end,
-	getStacks = function(self,t) return math.floor(self:combatTalentLimit(t, 20, 3, 15)) end,
+	getStacks = function(self,t) return math.floor(self:combatTalentLimit(t, 20, 5, 15)) end,
 	callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam)
 		if not (target and hitted and dam > 0) or self:reactionToward(target) >=0 then return nil end
 		local dam = t.getDamage(self, t)
diff --git a/game/modules/tome/data/talents/cunning/shadow-magic.lua b/game/modules/tome/data/talents/cunning/shadow-magic.lua
index 89dd03892b..30d2550bac 100644
--- a/game/modules/tome/data/talents/cunning/shadow-magic.lua
+++ b/game/modules/tome/data/talents/cunning/shadow-magic.lua
@@ -81,7 +81,7 @@ newTalent{
 	sustain_mana = 20,
 	require = cuns_req3,
 	tactical = { BUFF = 2 },
-	getManaRegen = function(self, t) return self:combatTalentLimit(t, 1, 0.3, 0.8) * (1+t.getAtkSpeed(self, t)/100) end,
+	getManaRegen = function(self, t) return self:combatTalentLimit(t, 1, 0.45, 0.8) * (1+t.getAtkSpeed(self, t)/100) end,
 	getAtkSpeed = function(self, t) return self:combatTalentScale(t, 2.2, 15) end,
 	activate = function(self, t)
 		local speed = t.getAtkSpeed(self, t)/100
diff --git a/game/modules/tome/data/talents/cunning/stealth.lua b/game/modules/tome/data/talents/cunning/stealth.lua
index 09cd1fc82a..035717ca19 100644
--- a/game/modules/tome/data/talents/cunning/stealth.lua
+++ b/game/modules/tome/data/talents/cunning/stealth.lua
@@ -39,7 +39,7 @@ Talents.stealthDetection = stealthDetection
 
 -- radius of detection for stealth talents
 local function stealthRadius(self, t, fake)
-	local base = math.ceil(self:combatTalentLimit(t, 0, 8.9, 4.6)) -- Limit to range >= 1
+	local base = math.ceil(self:combatTalentLimit(t, 0, 8.5, 4)) -- Limit to range >= 1
 	local sooth = self:callTalent(self.T_SOOTHING_DARKNESS, "getRadius", fake)
 	local final = math.max(0, base - sooth)
 	if fake then return base, final
diff --git a/game/modules/tome/data/talents/cunning/tactical.lua b/game/modules/tome/data/talents/cunning/tactical.lua
index 30b9b4fc1c..b0627cecc1 100644
--- a/game/modules/tome/data/talents/cunning/tactical.lua
+++ b/game/modules/tome/data/talents/cunning/tactical.lua
@@ -33,7 +33,7 @@ newTalent{
 	mode = "passive",
 	points = 5,
 	getDefense = function(self, t) return self:combatStatScale("cun", 5, 15, 0.75) end,
-	getMaximum = function(self, t) return t.getDefense(self, t) * self:combatTalentLimit(t, 8, 1, 5) end, -- Limit to 8x defense bonus
+	getMaximum = function(self, t) return t.getDefense(self, t) * self:combatTalentLimit(t, 8, 2, 5) end, -- Limit to 8x defense bonus
 	do_tact_update = function (self, t)
 		local nb_foes = 0
 		local act
@@ -153,7 +153,7 @@ newTalent{
 	sustain_stamina = 30,
 	tactical = { BUFF = 2 },
 	speed = "combat",
-	getReductionMax = function(self, t) return 5 * math.floor(self:combatTalentLimit(t, 20, 1.4, 7.1)) end, -- Limit to 95%
+	getReductionMax = function(self, t) return 5 * math.floor(self:combatTalentLimit(t, 20, 3.5, 10)) end, -- Limit to 95%
 	do_weakness = function(self, t, target)
 		target:setEffect(target.EFF_WEAKENED_DEFENSES, 3, {inc = - 5, max = - t.getReductionMax(self, t)})
 	end,
diff --git a/game/modules/tome/data/talents/cunning/traps.lua b/game/modules/tome/data/talents/cunning/traps.lua
index 78925bff0c..f8a3fdf2b7 100644
--- a/game/modules/tome/data/talents/cunning/traps.lua
+++ b/game/modules/tome/data/talents/cunning/traps.lua
@@ -675,9 +675,9 @@ newTalent{
 	no_break_stealth = true,
 	require = cuns_req2,
 	no_npc_use = true,
-	range = function(self, t) return math.floor(self:combatTalentLimit(t, 10, 2, 5.5)) end, -- limit < 10
+	range = function(self, t) return math.floor(self:combatTalentLimit(t, 10, 3, 7)) end, -- limit < 10
 	getDuration = function(self,t) return math.floor(self:combatTalentScale(t, 5, 13)) end,
-	getLife = function(self, t) return self:getCun()*self:combatTalentLimit(t, 5, 1, 2) end,
+	getLife = function(self, t) return self:getCun()*self:combatTalentLimit(t, 5, 1.5, 2.5) end,
 	getArmor = function(self, t) return math.floor(self:combatTalentScale(t, 10, 25)) end,
 	getResist = function(self, t) return self:combatTalentLimit(t, 90, 65, 75) end,
 	speed = "combat",
-- 
GitLab