Quantcast

- added buffs to warlock script

Sidoine De Wispelaere [01-10-10 - 11:47]
- added buffs to warlock script
- added CastTime(spellid more/less time) function

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@194 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.toc
defaut/Chaman.lua
defaut/Demoniste.lua
diff --git a/Condition.lua b/Condition.lua
index a7f5591..89eeb89 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -396,12 +396,19 @@ Ovale.conditions=
 		if (not spell) then
 			return nil
 		end
-		if (Ovale:GetSpellInfoOrNil(condition[1])==spell) then
+		if Ovale:GetSpellInfoOrNil(condition[1])==spell then
 			return start/1000, ending/1000
 		else
 			return nil
 		end
 	end,
+	CastTime = function(condition)
+		local name, rank, icon, cost, isFunnel, powerType, castTime = Ovale:GetSpellInfoOrNil(condition[1])
+		if Ovale.trace then
+			Ovale:Print("castTime/1000 = " .. (castTime/1000) .. " " .. condition[2] .. " " .. condition[3])
+		end
+		return compare(castTime/1000, condition[2], condition[3])
+	end,
 	-- Test if a list of checkboxes is off
 	-- 1,... : the checkboxes names
 	CheckBoxOff = function(condition)
@@ -787,7 +794,7 @@ Ovale.conditions=
 				return 0
 			end
 			mainHandExpiration = mainHandExpiration/1000
-			if (condition[2] >= mainHandExpiration) then
+			if ((condition[2] or 0) >= mainHandExpiration) then
 				return 0
 			else
 				return Ovale.maintenant + mainHandExpiration - condition[2]
@@ -797,7 +804,7 @@ Ovale.conditions=
 				return 0
 			end
 			offHandExpiration = offHandExpiration/1000
-			if (condition[2] >= offHandExpiration) then
+			if ((condition[2] or 0) >= offHandExpiration) then
 				return 0
 			else
 				return Ovale.maintenant + offHandExpiration - condition[2]
diff --git a/Ovale.toc b/Ovale.toc
index d4ef706..b5940e7 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -3,7 +3,7 @@
 ## Notes: Show the icon of the next spell to cast
 ## Notes-frFR: Affiche l'icône du prochain sort à lancer
 ## Author: Sidoine
-## Version: 3.3.13
+## Version: 3.3.14
 ## OptionalDeps: Ace3, ButtonFacade, Recount, LibBabble-CreatureType-3.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index 03f1945..1652d1a 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -1,7 +1,7 @@
 Ovale.defaut["SHAMAN"] =
 [[
 Define(CHAINLIGHTNING 421)
-Define(LIGHTNINGBOLT 403)
+Define(LIGHTNINGBOLT 548)
 Define(LAVABURST 51505)
 Define(WATERSHIELD 52127)
 Define(FLAMESHOCK 8050)
@@ -79,7 +79,7 @@ AddIcon help=main
 		if TargetDebuffExpires(FLAMESHOCK 0 mine=1) Spell(FLAMESHOCK)
 		unless TargetDebuffExpires(FLAMESHOCK 1.6 haste=spell mine=1) Spell(LAVABURST)

-		if CheckBoxOn(chain) and 1.4s before Spell(LAVABURST)
+		if CheckBoxOn(chain) and 1.4s before Spell(LAVABURST) and CastTime(LIGHTNINGBOLT more 1.5)
 				Spell(CHAINLIGHTNING)
 		Spell(LIGHTNINGBOLT)
 	}
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index f189771..aab2345 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -29,6 +29,9 @@ Define(DECIMATION 63167)
 Define(CHAOSBOLT 50796)
 Define(MOLTENCORE 47383)
 Define(GLYPHOFCONFLAGRATE 56235)
+Define(FELARMOR 28176)
+Define(FIRESTONE 6366)
+Define(SPELLSTONE 2362)

 AddListItem(curse elements SpellName(CURSEELEMENTS))
 AddListItem(curse agony SpellName(CURSEAGONY))
@@ -56,6 +59,13 @@ ScoreSpells(CURSEELEMENTS SHADOWBOLT HAUNT UNSTABLEAFFLICTION IMMOLATE CONFLAGRA

 AddIcon help=main
 {
+if BuffExpires(FELARMOR) Spell(FELARMOR)
+if WeaponEnchantExpires(mainhand 5)
+{
+	if TalentPoints(TALENTEMBERSTORM more 0) Spell(FIRESTONE)
+	Spell(SPELLSTONE)
+	Spell(FIRESTONE)
+}
 if List(curse elements) and TargetDebuffExpires(CURSEELEMENTS 2) and TargetDeadIn(more 8) Spell(CURSEELEMENTS)
 if TalentPoints(TALENTSHADOWEMBRACE more 0) and TargetDebuffExpires(SHADOWEMBRACE 0) Spell(SHADOWBOLT)
 if TargetDebuffExpires(HAUNT 1.5 mine=1) Spell(HAUNT)