- bug fixes in warrior and feral druid scripts (with dots)
- added TargetLife and TargetMana functions (not percentage based, can be used to prevent doting bellow a certain life value)
- target can be specified for Spell function (range will be computed to the specified target, e.g. Spell(123 target=focus) will show the range to your focus, useful for Polymorph and other CC)
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@94 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/Condition.lua b/Condition.lua
index 59dbb81..6a88c17 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -555,6 +555,10 @@ Ovale.conditions=
TargetIsCasting = function(condition)
return testbool(UnitCastingInfo(getTarget(condition.target)), condition[1])
end,
+ TargetLife = function(condition)
+ local target = getTarget(condition.target)
+ return compare(UnitHealth(target), condition[1], condition[2])
+ end,
-- Test if the target life is bellow/above a given value in percent
-- 1 : "less" or "more"
-- 2 : the limit, in percents
@@ -562,6 +566,10 @@ Ovale.conditions=
local target = getTarget(condition.target)
return compare(UnitHealth(target)/UnitHealthMax(target), condition[1], condition[2]/100)
end,
+ TargetMana = function(condition)
+ local target = getTarget(condition.target)
+ return compare(UnitPower(target), condition[1], condition[2])
+ end,
-- Test the target level difference with the player
-- 1 : "less" or "more"
-- 2 : [target level]-[player level] limit
diff --git a/Ovale.lua b/Ovale.lua
index f3b6ad4..2cd3f37 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -1,4 +1,4 @@
-local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
+local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
Ovale = LibStub("AceAddon-3.0"):NewAddon("Ovale", "AceEvent-3.0", "AceConsole-3.0")
@@ -677,13 +677,18 @@ function Ovale:CalculerMeilleureAction(element)
local action
local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration,
actionUsable, actionShortcut, actionIsCurrent, actionEnable
-
+
+ local target = element.params.target
+ if (not target) then
+ target = "target"
+ end
+
if (element.func == "Spell" ) then
local sort = self:GetSpellInfoOrNil(element.params[1])
action = self.actionSort[sort]
if (not action or not GetActionTexture(action)) then
actionTexture = GetSpellTexture(sort)
- actionInRange = IsSpellInRange(sort, "target")
+ actionInRange = IsSpellInRange(sort, target)
actionCooldownStart, actionCooldownDuration, actionEnable = GetSpellCooldown(sort)
actionUsable = IsUsableSpell(sort)
actionShortcut = nil
@@ -714,7 +719,7 @@ function Ovale:CalculerMeilleureAction(element)
action = self.actionObjet[itemId]
if (not action or not GetActionTexture(action)) then
actionTexture = GetItemIcon(itemId)
- actionInRange = IsItemInRange(itemId, "target")
+ actionInRange = IsItemInRange(itemId, target)
actionCooldownStart, actionCooldownDuration, actionEnable = GetItemCooldown(itemId)
actionShortcut = nil
actionIsCurrent = nil
@@ -723,7 +728,7 @@ function Ovale:CalculerMeilleureAction(element)
if (action and not actionTexture) then
actionTexture = GetActionTexture(action)
- actionInRange = IsActionInRange(action, "target")
+ actionInRange = IsActionInRange(action, target)
actionCooldownStart, actionCooldownDuration, actionEnable = GetActionCooldown(action)
if (actionUsable == nil) then
actionUsable = IsUsableAction(action)
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 7b56824..d93b32d 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -23,9 +23,10 @@ Define(SAVAGEROAR 52610)
Define(FEROCIOUSBITE 22568)
Define(BERSERK 50334)
Define(CLEARCASTING 16870)
+Define(CLAW 16827)
AddCheckBox(multi L(AOE))
-AddCheckBox(blood L(Blood))
+AddCheckBox(mangle SpellName(MANGLECAT))
AddCheckBox(demo SpellName(DEMOROAR))
AddCheckBox(lucioles SpellName(FAERIEFIRE))
AddCheckBox(wrath SpellName(WRATH))
@@ -42,7 +43,7 @@ AddIcon
Spell(MANGLEBEAR)
- if CheckBoxOn(blood) and Mana(more 10) and TargetDebuffExpires(LACERATE 4 stacks=5)
+ if Mana(more 10) and TargetDebuffExpires(LACERATE 4 stacks=5)
Spell(LACERATE)
if CheckBoxOn(multi)
@@ -59,7 +60,7 @@ AddIcon
if ComboPoints(more 4) and Mana(more 70)
{
if BuffExpires(SAVAGEROAR 5) Spell(SAVAGEROAR)
- if TargetDebuffExpires(RIP 0) Spell(RIP)
+ if TargetDebuffExpires(RIP 0 mine=1) Spell(RIP)
}
if {3s between BuffExpires(SAVAGEROAR 0) and TargetDebuffExpires(RIP 0)} and ComboPoints(more 2)
@@ -68,16 +69,16 @@ AddIcon
if ComboPoints(less 5)
{
if Mana(less 30) Spell(TIGERSFURY)
- if TargetDebuffExpires(MANGLECAT 0)
+ if TargetDebuffExpires(MANGLECAT 0 mine=1) and CheckBoxOn(mangle)
Spell(MANGLECAT)
- if TargetDebuffExpires(RAKE 0)
+ if TargetDebuffExpires(RAKE 0 mine=1)
Spell(RAKE)
Spell(SHRED)
}
if BuffPresent(CLEARCASTING) Spell(SHRED)
- if ComboPoints(more 4) and BuffPresent(SAVAGEROAR 8) and TargetDebuffPresent(RIP 8)
+ if ComboPoints(more 4) and BuffPresent(SAVAGEROAR 8) and TargetDebuffPresent(RIP 8 mine=1)
Spell(FEROCIOUSBITE)
}
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index ab283dd..c06a693 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -85,7 +85,6 @@ AddIcon
{
Spell(WHIRLWIND)
Spell(BLOODTHIRST)
- if BuffPresent(SLAMBUFF) and Mana(more 29) Spell(SLAM)
Spell(EXECUTE)
}
@@ -108,7 +107,7 @@ AddIcon
if Stance(1) #combat
{
Spell(VICTORY usable=1)
- if TargetDebuffExpires(REND 0) Spell(REND)
+ if TargetDebuffExpires(REND 0 mine=1) Spell(REND)
if BuffPresent(SUDDENDEATH) or TargetLifePercent(less 20) Spell(EXECUTE)
Spell(MORTALSTRIKE)
Spell(OVERPOWER usable=1)