From 7394c378e39ce3410d6035ba7a84632eb27b5804 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 4 Dec 2012 23:13:33 +0000
Subject: [PATCH] Spectral Shield now requires having cast 100 spells

git-svn-id: http://svn.net-core.org/repos/t-engine4@5925 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua           |  7 +++++++
 game/modules/tome/class/Player.lua          |  1 +
 game/modules/tome/data/talents/uber/mag.lua | 14 ++++----------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index d61a13f7a5..354706900d 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -3547,6 +3547,13 @@ function _M:postUseTalent(ab, ret)
 
 	self.changed = true
 
+	if self.talent_kind_log then 
+		if ab.is_spell then self.talent_kind_log.spell = (self.talent_kind_log.spell or 0) + 1 end
+		if ab.is_summon then self.talent_kind_log.summon = (self.talent_kind_log.summon or 0) + 1 end
+		if ab.is_mind then self.talent_kind_log.mind = (self.talent_kind_log.mind or 0) + 1 end
+		if ab.is_nature then self.talent_kind_log.nature = (self.talent_kind_log.nature or 0) + 1 end
+	end
+
 	-- Handle inscriptions (delay it so it does not affect current inscription)
 	game:onTickEnd(function()
 		if ab.type[1] == "inscriptions/infusions" then
diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua
index f4ffb3c187..c12561c816 100644
--- a/game/modules/tome/class/Player.lua
+++ b/game/modules/tome/class/Player.lua
@@ -93,6 +93,7 @@ function _M:init(t, no_default)
 	self.puuid = self.puuid or util.uuid()
 
 	self.damage_log = self.damage_log or {weapon={}}
+	self.talent_kind_log = self.talent_kind_log or {}
 end
 
 function _M:onBirth(birther)
diff --git a/game/modules/tome/data/talents/uber/mag.lua b/game/modules/tome/data/talents/uber/mag.lua
index d4c6265a31..23aaf3eb1a 100644
--- a/game/modules/tome/data/talents/uber/mag.lua
+++ b/game/modules/tome/data/talents/uber/mag.lua
@@ -20,20 +20,17 @@
 uberTalent{
 	name = "Spectral Shield",
 	mode = "passive",
-	require = { special={desc="Block talent, have mana and a block value over 200.", fct=function(self)
-		return self:knowTalent(self.T_BLOCK) and self:getTalentFromId(self.T_BLOCK).getBlockValue(self) >= 200 and self:getMaxMana() >= 70
+	require = { special={desc="Block talent, have cast at least 100 spells and a block value over 200.", fct=function(self)
+		return self:knowTalent(self.T_BLOCK) and self:getTalentFromId(self.T_BLOCK).getBlockValue(self) >= 200 and self.talent_kind_log and self.talent_kind_log.spell and self.talent_kind_log.spell >= 100
 	end} },
 	on_learn = function(self, t)
 		self:attr("spectral_shield", 1)
-		self:attr("max_mana", -70)
 	end,
 	on_unlearn = function(self, t)
 		self:attr("spectral_shield", -1)
-		self:attr("max_mana", 70)
 	end,
 	info = function(self, t)
-		return ([[Infusing your shield with raw magic your Block can now block any damage type
-		Your maximum mana will be premanently reduced by 70 to create the effect.]])
+		return ([[Infusing your shield with raw magic your Block can now block any damage type.]])
 		:format()
 	end,
 }
@@ -46,18 +43,15 @@ uberTalent{
 	end} },
 	on_learn = function(self, t)
 		local ret = {}
-		self:attr("max_mana", -70)
 		self:talentTemporaryValue(ret, "force_use_resist", DamageType.ARCANE)
 		self:talentTemporaryValue(ret, "force_use_resist_percent", 50)
 		return ret
 	end,
 	on_unlearn = function(self, t)
-		self:attr("max_mana", 70)
 	end,
 	info = function(self, t)
 		return ([[Create a thin layer of aether all around you. Any attack passing through will check arcane resistance instead of the incomming damage resistance.
-		In effect all your resistances are equal to 50%% of your arcane resistance.
-		Your maximum mana will be premanently reduced by 70 to create the effect.]])
+		In effect all your resistances are equal to 50%% of your arcane resistance.]])
 		:format()
 	end,
 }
-- 
GitLab