diff --git a/game/modules/tome/data/talents/cunning/poisons.lua b/game/modules/tome/data/talents/cunning/poisons.lua index 52fc8bbf0b80bca42000920cd689bac173661f78..1318e0b9525131511a2833de2c87794484e55ce0 100644 --- a/game/modules/tome/data/talents/cunning/poisons.lua +++ b/game/modules/tome/data/talents/cunning/poisons.lua @@ -198,16 +198,8 @@ newTalent{ stamina = 14, require = cuns_req4, requires_target = true, - on_learn = function(self, t) - if self:knowTalent(self.T_THROWING_KNIVES) and not self:knowTalent(self.T_VENOMOUS_THROW) then - self:learnTalent(self.T_VENOMOUS_THROW, true, nil, {no_unlearn=true}) - end - end, - on_unlearn = function(self, t) - if self:knowTalent(self.T_VENOMOUS_THROW) then - self:unlearnTalent(self.T_VENOMOUS_THROW) - end - end, + on_learn = venomous_throw_check, + on_unlearn = venomous_throw_check, 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, diff --git a/game/modules/tome/data/talents/techniques/techniques.lua b/game/modules/tome/data/talents/techniques/techniques.lua index 6390ea2c5fb21cdc9175b94caa671dc6b7710437..ec540848cef67ce68218a2258f068d007cea05b8 100644 --- a/game/modules/tome/data/talents/techniques/techniques.lua +++ b/game/modules/tome/data/talents/techniques/techniques.lua @@ -299,14 +299,26 @@ end -- Use the appropriate amount of stamina. Return false if we don't have enough. use_stamina = function(self, cost) - cost = cost * (1 + self:combatFatigue() * 0.01) - local available = self:getStamina() - if self:hasEffect("EFF_ADRENALINE_SURGE") then - available = available + self.life - end - if cost > available then return end - self:incStamina(-cost) - return true + cost = cost * (1 + self:combatFatigue() * 0.01) + local available = self:getStamina() + if self:hasEffect("EFF_ADRENALINE_SURGE") then + available = available + self.life + end + if cost > available then return end + self:incStamina(-cost) + return true +end + +venomous_throw_check = function(self) + if not self:knowTalent(self.T_VENOMOUS_THROW) then + if self:knowTalent(self.T_VENOMOUS_STRIKE) and self:knowTalent(self.T_THROWING_KNIVES) then + self:learnTalent(self.T_VENOMOUS_THROW, true, nil, {no_unlearn=true}) + end + else + if not self:knowTalent(self.T_VENOMOUS_STRIKE) or not self:knowTalent(self.T_THROWING_KNIVES) then + self:unlearnTalent(self.T_VENOMOUS_THROW) + end + end end load("/data/talents/techniques/2hweapon.lua") diff --git a/game/modules/tome/data/talents/techniques/throwing-knives.lua b/game/modules/tome/data/talents/techniques/throwing-knives.lua index 1de04cce2658e310cdfba4613ada7f2645d7d066..d832bc64408672813b911a1edd4d73130228cc53 100644 --- a/game/modules/tome/data/talents/techniques/throwing-knives.lua +++ b/game/modules/tome/data/talents/techniques/throwing-knives.lua @@ -104,16 +104,12 @@ newTalent{ level = function(level) return 0 + (level-1) * 8 end, }, on_learn = function(self, t) - if self:knowTalent(self.T_VENOMOUS_STRIKE) and not self:knowTalent(self.T_VENOMOUS_THROW) then - self:learnTalent(self.T_VENOMOUS_THROW, true, nil, {no_unlearn=true}) - end + venomous_throw_check(self) local max = self:callTalent(self.T_THROWING_KNIVES, "getNb") self:setEffect(self.EFF_THROWING_KNIVES, 1, {stacks=max, max_stacks=max }) end, on_unlearn = function(self, t) - if self:knowTalent(self.T_VENOMOUS_THROW) then - self:unlearnTalent(self.T_VENOMOUS_THROW) - end + venomous_throw_check(self) self:removeEffect(self.EFF_THROWING_KNIVES) end, speed = "throwing",