Quantcast

Add dummy TimeToBloodlust() condition to match SimC's time_to_bloodlust.

Johnny C. Lam [04-06-14 - 18:45]
Add dummy TimeToBloodlust() condition to match SimC's time_to_bloodlust.

Currently doesn't do anything than return 1 hour into the future.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1265 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
conditions/TimeToBloodlust.lua
conditions/conditions.xml
diff --git a/conditions/TimeToBloodlust.lua b/conditions/TimeToBloodlust.lua
new file mode 100644
index 0000000..d2264d2
--- /dev/null
+++ b/conditions/TimeToBloodlust.lua
@@ -0,0 +1,37 @@
+--[[--------------------------------------------------------------------
+    Ovale Spell Priority
+    Copyright (C) 2013 Johnny C. Lam
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License in the LICENSE
+    file accompanying this program.
+--]]--------------------------------------------------------------------
+
+local _, Ovale = ...
+
+do
+	local OvaleCondition = Ovale.OvaleCondition
+	local OvaleState = Ovale.OvaleState
+
+	local Compare = OvaleCondition.Compare
+	local ParseCondition = OvaleCondition.ParseCondition
+	local TestValue = OvaleCondition.TestValue
+	local state = OvaleState.state
+
+	--- Get the time in seconds until the next scheduled Bloodlust cast.
+	-- Not implemented, always returns 3600 seconds.
+	-- @name TimeToBloodlust
+	-- @paramsig number or boolean
+	-- @param operator Optional. Comparison operator: less, atMost, equal, atLeast, more.
+	-- @param number Optional. The number to compare against.
+	-- @return The number of seconds.
+	-- @return A boolean value for the result of the comparison.
+
+	local function TimeToBloodlust(condition)
+		local comparator, limit = condition[1], condition[2], condition[3]
+		local value = 3600
+		return Compare(value, comparator, limit)
+	end
+
+	OvaleCondition:RegisterCondition("timetobloodlust", false, TimeToBloodlust)
+end
\ No newline at end of file
diff --git a/conditions/conditions.xml b/conditions/conditions.xml
index e5b5a63..7bf9f3b 100644
--- a/conditions/conditions.xml
+++ b/conditions/conditions.xml
@@ -95,6 +95,7 @@
 	<Script file="TicksAdded.lua" />
 	<Script file="TicksRemain.lua" />
 	<Script file="TimeInCombat.lua" />
+	<Script file="TimeToBloodlust.lua" />
 	<Script file="TimeToMaxEnergy.lua" />
 	<Script file="TimeToPowerFor.lua" />
 	<Script file="TimeWithHaste.lua" />