From da671f7b91d9677470ba3a261eb81cb6b927f106 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Tue, 30 Dec 2014 16:55:30 +0100
Subject: [PATCH] ogre fury loses a stack every 7 turns

---
 game/modules/tome/data/talents/misc/races.lua    |  2 +-
 game/modules/tome/data/timed_effects/magical.lua | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/game/modules/tome/data/talents/misc/races.lua b/game/modules/tome/data/talents/misc/races.lua
index 0960301a49..f938e62dbf 100644
--- a/game/modules/tome/data/talents/misc/races.lua
+++ b/game/modules/tome/data/talents/misc/races.lua
@@ -942,7 +942,7 @@ newTalent{
 	end,
 	info = function(self, t)
 		return ([[You enter an ogric wrath for %d turns.
-		Whenever you miss a melee attack or any damage you deal is reduced by a damage shield or similar effect you gain a charge of Ogre Fury(up to 5 charges).
+		Whenever you miss a melee attack or any damage you deal is reduced by a damage shield or similar effect you gain a charge of Ogre Fury(up to 5 charges, each lasts 7 turns).
 		Each charge grants 10%% stun and confusion resistance, 20%% critical damage power and 5%% critical strike chance.
 		You loose a charge each time you deal a critical strike.
 		The duration will increase with your Strength.]]):format(t.getduration(self))
diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua
index 14491d6d80..32e0f1de00 100644
--- a/game/modules/tome/data/timed_effects/magical.lua
+++ b/game/modules/tome/data/timed_effects/magical.lua
@@ -3178,7 +3178,7 @@ newEffect{
 		if self.turn_procs.ogric_wrath then return end
 
 		self.turn_procs.ogric_wrath = true
-		self:setEffect(self.EFF_OGRE_FURY, 1, {})
+		self:setEffect(self.EFF_OGRE_FURY, 7, {})
 	end,
 	callbackOnMeleeAttack = function(self, eff, target, hitted, crit, weapon, damtype, mult, dam)
 		if hitted then return true end
@@ -3194,7 +3194,7 @@ newEffect{
 	name = "OGRE_FURY", image = "effects/ogre_fury.png",
 	desc = "Ogre Fury",
 	long_desc = function(self, eff) return ("Increases stun and confusion resistances by %d%%, crit chance by %d%% and critical power by %d%%. %d charge(s)."):format(eff.stacks * 10, eff.stacks * 5, eff.stacks * 20, eff.stacks) end,
-	type = "magical", decrease = 0,
+	type = "magical",
 	subtype = { runic=true },
 	status = "beneficial",
 	parameters = { stacks=1, max_stacks=5 },
@@ -3232,6 +3232,13 @@ newEffect{
 	deactivate = function(self, eff, e)
 		e.do_effect(self, eff, false)
 	end,
+	on_timeout = function(self, eff, e)
+		if eff.stacks > 1 and eff.dur <= 1 then
+			eff.stacks = eff.stacks - 1
+			eff.dur = 7
+			e.do_effect(self, eff, false)
+		end
+	end
 }
 
 newEffect{
-- 
GitLab