From 43f11104dd3c0e3b62c0e5b7cce981215a5d0f09 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 21 Nov 2011 01:40:02 +0000
Subject: [PATCH] All talents in the cold/storm/fire drake trees increase their
 respective resistance by 1%, passively. All talents in the sand drake tree
 increase physical resistance by 0.5%, passively.

git-svn-id: http://svn.net-core.org/repos/t-engine4@4658 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../tome/data/talents/gifts/cold-drake.lua    | 20 +++++++++++++++----
 .../tome/data/talents/gifts/fire-drake.lua    | 20 +++++++++++++++----
 .../tome/data/talents/gifts/sand-drake.lua    | 20 +++++++++++++++----
 .../tome/data/talents/gifts/storm-drake.lua   | 20 +++++++++++++++----
 4 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/game/modules/tome/data/talents/gifts/cold-drake.lua b/game/modules/tome/data/talents/gifts/cold-drake.lua
index 4c5d841c3f..ec17c34779 100644
--- a/game/modules/tome/data/talents/gifts/cold-drake.lua
+++ b/game/modules/tome/data/talents/gifts/cold-drake.lua
@@ -30,6 +30,8 @@ newTalent{
 	range = 1,
 	tactical = { ATTACK = { COLD = 2 } },
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) - 1 end,
 	action = function(self, t)
 		local tg = {type="hit", range=self:getTalentRange(t)}
 		local x, y, target = self:getTarget(tg)
@@ -40,7 +42,8 @@ newTalent{
 	end,
 	info = function(self, t)
 		return ([[You call upon the mighty claw of a cold drake, doing %d%% weapon damage as cold damage.
-		At level 4 the attack becomes pure ice, giving a chance to freeze the target.]]):format(100 * (1.4 + self:getTalentLevel(t) / 8))
+		At level 4 the attack becomes pure ice, giving a chance to freeze the target.
+		Each point in cold drake talents also increases your cold resistance by 1%%.]]):format(100 * (1.4 + self:getTalentLevel(t) / 8))
 	end,
 }
 
@@ -54,6 +57,8 @@ newTalent{
 	sustain_equilibrium = 30,
 	range = 10,
 	tactical = { ATTACK = { COLD = 1 }, DEFEND = 2 },
+	on_learn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) - 1 end,
 	activate = function(self, t)
 		return {
 			onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.COLD]=5 * self:getTalentLevel(t)}),
@@ -66,7 +71,8 @@ newTalent{
 		return true
 	end,
 	info = function(self, t)
-		return ([[Your skin forms icy scales, damaging all that hit you for %0.2f cold damage and increasing your armor by %d.]]):format(damDesc(self, DamageType.COLD, 5 * self:getTalentLevel(t)), 4 * self:getTalentLevel(t))
+		return ([[Your skin forms icy scales, damaging all that hit you for %0.2f cold damage and increasing your armor by %d.
+		Each point in cold drake talents also increases your cold resistance by 1%%.]]):format(damDesc(self, DamageType.COLD, 5 * self:getTalentLevel(t)), 4 * self:getTalentLevel(t))
 	end,
 }
 
@@ -81,6 +87,8 @@ newTalent{
 	range = 10,
 	tactical = { DISABLE = 2 },
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) - 1 end,
 	action = function(self, t)
 		local tg = {type="bolt", range=self:getTalentRange(t), nolock=true, talent=t}
 		local x, y = self:getTarget(tg)
@@ -117,7 +125,8 @@ newTalent{
 		return true
 	end,
 	info = function(self, t)
-		return ([[Summons an icy wall for %d turns. Ice walls are transparent.]]):format(4 + self:getTalentLevel(t))
+		return ([[Summons an icy wall for %d turns. Ice walls are transparent.
+		Each point in cold drake talents also increases your cold resistance by 1%%.]]):format(4 + self:getTalentLevel(t))
 	end,
 }
 
@@ -135,6 +144,8 @@ newTalent{
 	radius = function(self, t) return 4 + self:getTalentLevelRaw(t) end,
 	direct_hit = true,
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) - 1 end,
 	target = function(self, t)
 		return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
@@ -149,7 +160,8 @@ newTalent{
 	end,
 	info = function(self, t)
 		return ([[You breathe ice in a frontal cone of radius %d. Any target caught in the area will take %0.2f cold damage and has a 25%% to be frozen for a few turns(higher rank enemies will be frozen for a shorter time).
-		The damage will increase with the Strength stat]]):format(self:getTalentRadius(t), damDesc(self, DamageType.COLD, self:combatTalentStatDamage(t, "str", 30, 430)))
+		The damage will increase with the Strength stat.
+		Each point in cold drake talents also increases your cold resistance by 1%%.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.COLD, self:combatTalentStatDamage(t, "str", 30, 430)))
 	end,
 }
 
diff --git a/game/modules/tome/data/talents/gifts/fire-drake.lua b/game/modules/tome/data/talents/gifts/fire-drake.lua
index 6fc1026356..306e25a2bd 100644
--- a/game/modules/tome/data/talents/gifts/fire-drake.lua
+++ b/game/modules/tome/data/talents/gifts/fire-drake.lua
@@ -27,6 +27,8 @@ newTalent{
 	equilibrium = 3,
 	cooldown = 20,
 	range = 0,
+	on_learn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 1 end,
 	radius = function(self, t)
 		return 2 + self:getTalentLevelRaw(t)
 	end,
@@ -46,7 +48,8 @@ newTalent{
 	end,
 	info = function(self, t)
 		local radius = self:getTalentRadius(t)
-		return ([[You let out a powerful roar that sends your foes into utter confusion for 3 turns in a radius of %d.]]):format(radius)
+		return ([[You let out a powerful roar that sends your foes into utter confusion for 3 turns in a radius of %d.
+		Each point in fire drake talents also increases your fire resistance by 1%%.]]):format(radius)
 	end,
 }
 
@@ -59,6 +62,8 @@ newTalent{
 	equilibrium = 7,
 	cooldown = 10,
 	range = 0,
+	on_learn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 1 end,
 	radius = function(self, t)
 		return 4 + self:getTalentLevelRaw(t)
 	end,
@@ -78,7 +83,8 @@ newTalent{
 	end,
 	info = function(self, t)
 		return ([[You summon a powerful gust of wind, knocking back your foes within a radius of %d up to 4 tiles away and damaging them for %d.
-		The damage will increase with the Strength stat]]):format(self:getTalentRadius(t), self:combatTalentStatDamage(t, "str", 15, 90))
+		The damage will increase with the Strength stat.
+		Each point in fire drake talents also increases your fire resistance by 1%%.]]):format(self:getTalentRadius(t), self:combatTalentStatDamage(t, "str", 15, 90))
 	end,
 }
 
@@ -95,6 +101,8 @@ newTalent{
 	radius = 2,
 	direct_hit = true,
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 1 end,
 	target = function(self, t)
 		return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
 	end,
@@ -129,7 +137,8 @@ newTalent{
 		local radius = self:getTalentRadius(t)
 		local duration = t.getDuration(self, t)
 		return ([[Spit a cloud of flames doing %0.2f fire damage in a radius of %d each turn for %d turns.
-		The damage will increase with the Willpower stat]]):format(damDesc(self, DamageType.FIRE, dam), radius, duration)
+		The damage will increase with the Willpower stat.
+		Each point in fire drake talents also increases your fire resistance by 1%%.]]):format(damDesc(self, DamageType.FIRE, dam), radius, duration)
 	end,
 }
 
@@ -147,6 +156,8 @@ newTalent{
 	radius = function(self, t) return 4 + self:getTalentLevelRaw(t) end,
 	direct_hit = true,
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 1 end,
 	target = function(self, t)
 		return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
@@ -161,6 +172,7 @@ newTalent{
 	end,
 	info = function(self, t)
 		return ([[You breathe fire in a frontal cone of radius %d. Any target caught in the area will take %0.2f fire damage over 3 turns.
-		The damage will increase with the Strength stat]]):format(self:getTalentRadius(t), damDesc(self, DamageType.FIRE, self:combatTalentStatDamage(t, "str", 30, 550)))
+		The damage will increase with the Strength stat.
+		Each point in fire drake talents also increases your fire resistance by 1%%.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.FIRE, self:combatTalentStatDamage(t, "str", 30, 550)))
 	end,
 }
diff --git a/game/modules/tome/data/talents/gifts/sand-drake.lua b/game/modules/tome/data/talents/gifts/sand-drake.lua
index 1270c2fb79..3a4f6eb9b1 100644
--- a/game/modules/tome/data/talents/gifts/sand-drake.lua
+++ b/game/modules/tome/data/talents/gifts/sand-drake.lua
@@ -29,6 +29,8 @@ newTalent{
 	tactical = { ATTACK = { NATURE = 0.5 }, EQUILIBRIUM = 0.5},
 	requires_target = true,
 	no_npc_use = true,
+	on_learn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) + 0.5 end,
+	on_unlearn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) - 0.5 end,
 	action = function(self, t)
 		local tg = {type="hit", range=self:getTalentRange(t)}
 		local x, y, target = self:getTarget(tg)
@@ -54,7 +56,8 @@ newTalent{
 	end,
 	info = function(self, t)
 		return ([[Attack the target for %d%% nature weapon damage.
-		If the attack brings your target below %d%% life (or kills it) you can try to swallow it, killing it automatically and regaining life and equilibrium depending on its level.]]):
+		If the attack brings your target below %d%% life (or kills it) you can try to swallow it, killing it automatically and regaining life and equilibrium depending on its level.
+		Each point in sand drake talents also increases your physical resistance by 0.5%%.]]):
 		format(100 * self:combatTalentWeaponDamage(t, 1, 1.5), 10 + 3 * self:getTalentLevel(t))
 	end,
 }
@@ -70,6 +73,8 @@ newTalent{
 	cooldown = 30,
 	tactical = { ATTACKAREA = { PHYSICAL = 2 }, DISABLE = { knockback = 2 } },
 	range = 10,
+	on_learn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) + 0.5 end,
+	on_unlearn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) - 0.5 end,
 	radius = function(self, t)
 		return 2 + self:getTalentLevel(t) / 2
 	end,
@@ -89,7 +94,8 @@ newTalent{
 		return ([[You slam your foot onto the ground, shaking the area around you in a radius of %d.
 		Creatures caught by the quake will be damaged for %d and knocked back up to 4 titles away.
 		The terrain will also be moved around within the quake's radius.
-		The damage will increase with the Strength stat.]]):format(radius, dam)
+		The damage will increase with the Strength stat.
+		Each point in sand drake talents also increases your physical resistance by 0.5%%.]]):format(radius, dam)
 	end,
 }
 
@@ -102,12 +108,15 @@ newTalent{
 	cooldown = 30,
 	range = 10,
 	tactical = { CLOSEIN = 0.5, ESCAPE = 0.5 },
+	on_learn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) + 0.5 end,
+	on_unlearn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) - 0.5 end,
 	action = function(self, t)
 		self:setEffect(self.EFF_BURROW, 5 + self:getTalentLevel(t) * 3, {})
 		return true
 	end,
 	info = function(self, t)
-		return ([[Allows you to burrow into walls for %d turns.]]):format(5 + self:getTalentLevel(t) * 3)
+		return ([[Allows you to burrow into walls for %d turns.
+		Each point in sand drake talents also increases your physical resistance by 0.5%%.]]):format(5 + self:getTalentLevel(t) * 3)
 	end,
 }
 
@@ -125,6 +134,8 @@ newTalent{
 	radius = function(self, t) return 4 + self:getTalentLevelRaw(t) end,
 	direct_hit = true,
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) + 0.5 end,
+	on_unlearn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) - 0.5 end,
 	target = function(self, t)
 		return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
@@ -147,7 +158,8 @@ newTalent{
 		local damage = t.getDamage(self, t)
 		local duration = t.getDuration(self, t)
 		return ([[You breathe sand in a frontal cone of radius %d. Any target caught in the area will take %0.2f physical damage and be blinded for %d turns.
-		The damage will increase with the Strength stat]]):format(self:getTalentRadius(t), damDesc(self, DamageType.PHYSICAL, damage), duration)
+		The damage will increase with the Strength stat.
+		Each point in sand drake talents also increases your physical resistance by 0.5%%.]]):format(self:getTalentRadius(t), damDesc(self, DamageType.PHYSICAL, damage), duration)
 	end,
 }
 
diff --git a/game/modules/tome/data/talents/gifts/storm-drake.lua b/game/modules/tome/data/talents/gifts/storm-drake.lua
index 81a46dfe62..19d7b1e26d 100644
--- a/game/modules/tome/data/talents/gifts/storm-drake.lua
+++ b/game/modules/tome/data/talents/gifts/storm-drake.lua
@@ -29,6 +29,8 @@ newTalent{
 	range = 10,
 	tactical = { CLOSEIN = 2, ESCAPE = 2 },
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) - 1 end,
 	action = function(self, t)
 		self:setEffect(self.EFF_LIGHTNING_SPEED, math.ceil(1 + self:getTalentLevel(t) * 0.3), {power=400 + self:getTalentLevel(t) * 70})
 		return true
@@ -37,7 +39,8 @@ newTalent{
 		return ([[You transform into pure lightning, moving %d%% faster for %d game turns.
 		Also provides 30%% physical damage resistance and 100%% lightning resistance.
 		Any actions other than moving will stop this effect.
-		Note: since you will be moving very fast, game turns will pass very slowly.]]):format(400 + self:getTalentLevel(t) * 70, math.ceil(1 + self:getTalentLevel(t) * 0.3))
+		Note: since you will be moving very fast, game turns will pass very slowly.
+		Each point in storm drake talents also increases your lightning resistance by 1%%.]]):format(400 + self:getTalentLevel(t) * 70, math.ceil(1 + self:getTalentLevel(t) * 0.3))
 	end,
 }
 
@@ -52,6 +55,8 @@ newTalent{
 	radius = 1,
 	tactical = { ATTACKAREA = { instakill = 5 } },
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) - 1 end,
 	target = function(self, t)
 		return {type="ball", radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
@@ -80,7 +85,8 @@ newTalent{
 		local percent = t.getPercent(self, t)
 		return ([[Generate an electrical field around you in a radius of 1. Any creature caught inside will lose %d%% of its current life.
 		This effect can not kill creatures.
-		Life loss will increase with the Willpower stat.]]):format(percent)
+		Life loss will increase with the Willpower stat.
+		Each point in storm drake talents also increases your lightning resistance by 1%%.]]):format(percent)
 	end,
 }
 
@@ -95,6 +101,8 @@ newTalent{
 	tactical = { ATTACK = { LIGHTNING = 2 }, DISABLE = { stun = 2 } },
 	range = function(self, t) return 4 + math.floor(self:getTalentLevel(t)) end,
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) - 1 end,
 	action = function(self, t)
 		local tg = {type="hit", range=self:getTalentRange(t), nolock=true, talent=t}
 		local x, y = self:getTarget(tg)
@@ -148,7 +156,8 @@ newTalent{
 		Any foe caught in its path take %0.2f lightning damage.
 		When it reaches its target it explodes in a radius of 1 for %0.2f lightning damage, %0.2f physical damage. All affected creatures will be knocked back and the targeted creature will be stunned for 4 turns.
 		The tornado will last for %d turns or until it reaches its target.
-		Damage will increase with your Willpower.]]):format(
+		Damage will increase with your Willpower.
+		Each point in storm drake talents also increases your lightning resistance by 1%%.]]):format(
 			damDesc(self, DamageType.LIGHTNING, self:combatTalentMindDamage(t, 10, 60)),
 			damDesc(self, DamageType.LIGHTNING, self:combatTalentMindDamage(t, 15, 130)),
 			damDesc(self, DamageType.PHYSICAL, self:combatTalentMindDamage(t, 15, 130)),
@@ -171,6 +180,8 @@ newTalent{
 	radius = function(self, t) return 4 + self:getTalentLevelRaw(t) end,
 	direct_hit = true,
 	requires_target = true,
+	on_learn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) + 1 end,
+	on_unlearn = function(self, t) self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) - 1 end,
 	target = function(self, t)
 		return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
@@ -190,7 +201,8 @@ newTalent{
 	info = function(self, t)
 		local damage = t.getDamage(self, t)
 		return ([[You breathe lightning in a frontal cone of radius %d. Any target caught in the area will take %0.2f to %0.2f lightning damage and can be dazed for 3 turns.
-		The damage will increase with the Strength stat]]):format(
+		The damage will increase with the Strength stat.
+		Each point in storm drake talents also increases your lightning resistance by 1%%.]]):format(
 			self:getTalentRadius(t),
 			damDesc(self, DamageType.LIGHTNING, damage / 3),
 			damDesc(self, DamageType.LIGHTNING, damage)
-- 
GitLab