From 1ebf3d9d056a1642af7014f4e3ef94a4a127f9a1 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Sat, 26 Apr 2014 23:44:29 +0200
Subject: [PATCH] Unlearning Shivgoroth Form while transformed correctly works

---
 game/modules/tome/data/talents/spells/water.lua | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/game/modules/tome/data/talents/spells/water.lua b/game/modules/tome/data/talents/spells/water.lua
index 5102e31172..f63eaba13a 100644
--- a/game/modules/tome/data/talents/spells/water.lua
+++ b/game/modules/tome/data/talents/spells/water.lua
@@ -158,6 +158,11 @@ newTalent{
 	getDuration = function(self, t) return 4 + math.ceil(self:getTalentLevel(t)) end,
 	getPower = function(self, t) return util.bound(50 + self:combatTalentSpellDamage(t, 50, 450), 0, 500) / 500 end,
 	on_pre_use = function(self, t, silent) if self:attr("is_shivgoroth") then if not silent then game.logPlayer(self, "You are already a Shivgoroth!") end return false end return true end,
+	on_unlearn = function(self, t)
+		if self:getTalentLevel(t) == 0 then
+			self:removeEffect(self.EFF_SHIVGOROTH_FORM, true, true)
+		end
+	end,
 	action = function(self, t)
 		self:setEffect(self.EFF_SHIVGOROTH_FORM, t.getDuration(self, t), {power=t.getPower(self, t), lvl=self:getTalentLevelRaw(t)})
 		game:playSoundNear(self, "talents/tidalwave")
-- 
GitLab