Quantcast

- stacks for BuffPresent

Sidoine De Wispelaere [01-05-09 - 22:55]
- stacks for BuffPresent

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@3 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.lua
OvaleFrame.xml
defaut/Demoniste.lua
defaut/Guerrier.lua
diff --git a/Condition.lua b/Condition.lua
index fc80373..745752e 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -82,6 +82,7 @@ Ovale.conditions=
 	end,
 	-- Test if a buff is active
 	-- 1 : the buff spell id
+	-- stacks : minimum number of stacks
 	BuffPresent = function(condition)
 		if (not condition[1]) then
 			return nil
@@ -94,7 +95,15 @@ Ovale.conditions=
 				break
 			end
 			if (name == buffName and icon==buffIcon) then
-				return 0
+				if (condition.stacks) then
+					if (count>=condition.stacks) then
+						return 0
+					else
+						return nil
+					end
+				else
+					return 0
+				end
 			end
 			i = i + 1;
 		end
@@ -127,6 +136,12 @@ Ovale.conditions=
 		local points = GetComboPoints("player")
 		return compare(points, condition[1], condition[2])
 	end,
+	-- Compare with the player level
+	-- 1 : "less" or "more"
+	-- 2 : the limit
+	Level = function(condition)
+		return compare(UnitLevel("player"), condition[1], condition[2])
+	end,
 	-- Test if the player life is bellow/above a given value in percent
 	-- 1 : "less" or "more"
 	-- 2 : the limit, in percent
diff --git a/Ovale.lua b/Ovale.lua
index 23c5d04..7e54ac6 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -35,6 +35,25 @@ local options =
 	type = "group",
 	args =
 	{
+		apparence =
+		{
+			name = "Apparence",
+			type = "group",
+			args =
+			{
+				combatUniquement =
+				{
+					type = "toggle",
+					name = "Afficher en combat uniquement",
+					get = function(info)
+						return Ovale.db.profile.apparence.enCombat
+					end,
+					set = function(info, v)
+						Ovale.db.profile.apparence.enCombat = v
+					end
+				}
+			}
+		},
 		code =
 		{
 			name = "Code",
@@ -170,9 +189,15 @@ function Ovale:OnEnable()
 end

 function Ovale:PLAYER_REGEN_ENABLED()
+	if (self.db.profile.apparence.enCombat) then
+		self.frame:Hide()
+	end
 end

 function Ovale:PLAYER_REGEN_DISABLED()
+	if (self.db.profile.apparence.enCombat) then
+		self.frame:Show()
+	end
 end

 function Ovale:OnDisable()
@@ -576,7 +601,8 @@ function Ovale:ChargerDefaut()
 			left = 0,
 			top = 0,
 			check = {},
-			list = {}
+			list = {},
+			apparence = {enCombat=false}
 		}
 	})
 end
diff --git a/OvaleFrame.xml b/OvaleFrame.xml
deleted file mode 100644
index 1b70ed4..0000000
--- a/OvaleFrame.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
-  <Frame name="OvaleFrame" parent="UIParent" movable="true" hidden="false">
-    <Anchors>
-      <Anchor point="TOPLEFT" relativeTo="UIParent">
-        <Offset>
-          <AbsDimension x="200" y="-100"/>
-        </Offset>
-      </Anchor>
-    </Anchors>
-    <Size>
-      <AbsDimension x="64" y="64"/>
-    </Size>
-    <!--
-    <Layers>
-      <Layer level="ARTWORK">
-        <FontString name="$parent_Title" inherits="GameFontNormal" hidden="false" text="RaidStatus">
-          <Anchors>
-            <Anchor point="TOP">
-              <Offset>
-                <AbsDimension x="0" y="-5"/>
-              </Offset>
-            </Anchor>
-          </Anchors>
-          <Size>
-            <AbsDimension x="300" y="50"/>
-          </Size>
-        </FontString>
-      </Layer>
-    </Layers>
-    -->
-    <Scripts>
-      <OnMouseDown>OvaleFrame_OnMouseDown(self,button);</OnMouseDown>
-      <OnMouseUp>OvaleFrame_OnMouseUp(self,button);</OnMouseUp>
-      <OnLoad>OvaleFrame_OnLoad(self);</OnLoad>
-     <!-- <OnEvent>OvaleFrame_OnEvent(self,event);</OnEvent>-->
-      <OnUpdate>OvaleFrame_OnUpdate(self);</OnUpdate>
-    </Scripts>
-    <Frames>
-      <Button name="$parentOption" text="$parentType">
-        <Size>
-          <AbsDimension x="15" y="15" />
-        </Size>
-        <Anchors>
-          <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" />
-        </Anchors>
-        <Scripts>
-          <OnLoad>
-            self:SetNormalTexture("Interface\\Icons\\INV_Misc_Wrench_01")
-            self:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square")
-          </OnLoad>
-          <OnClick>Ovale:AfficherConfig()</OnClick>
-        </Scripts>
-      </Button>
-    </Frames>
-   </Frame>
-</Ui>
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index 957d537..bfbb77c 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -25,6 +25,7 @@ Define(SHADOWBOLT 686)
 Define(HAUNT 48181)
 Define(TALENTBACKDRAFT 1888)
 Define(CONFLAGRATE 17962)
+Define(DRAINSOUL 47855)


 if List(curse recklessness) and TargetDebuffExpires(CURSERECKLESSNESS 2) Spell(CURSERECKLESSNESS)
@@ -40,6 +41,8 @@ if TargetDebuffExpires(CORRUPTION 0 mine=1) Spell(CORRUPTION)
 if TalentPoints(TALENTBACKDRAFT more 0) and TargetDebuffExpires(IMMOLATE 3 mine=1)
    and TargetDebuffPresent(IMMOLATE mine=1) Spell(CONFLAGRATE doNotRepeat=1)
 if TargetDebuffExpires(IMMOLATE 1.5 mine=1) Spell(IMMOLATE doNotRepeat=1)
+
+if TargetLifePercent(less 25) and Level(more 76) Spell(DRAINSOUL)

 if TalentPoints(TALENTEMBERSTORM more 0) Spell(SOULFIRE)
 Spell(SHADOWBOLT)
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index f4688ec..549f4eb 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -25,6 +25,9 @@ Define(SLAMTALENT 2233)
 Define(CLEAVE 845)
 Define(HEROICSTRIKE 78)
 Define(SUNDER 7386)
+Define(CONCUSSIONBLOW 12809)
+Define(REND 772)
+Define(OVERPOWER 7384)

 if List(cri commandement) and BuffExpires(COMMANDSHOUT 3)
     Spell(COMMANDSHOUT)
@@ -57,7 +60,12 @@ if Stance(3) #berserker
 {
    Spell(VICTORY usable=1)

-   if TargetLifePercent(less 20) Spell(EXECUTE)
+  # if TargetLifePercent(less 20) Spell(EXECUTE)
+   Spell(EXECUTE usable=1)
+
+   Spell(SHIELDSLAM usable=1)
+   Spell(SHOCKWAVE)
+   Spell(CONCUSSIONBLOW)

    Spell(BLOODTHIRST)
    if CheckBoxOn(tourbillon) Spell(WHIRLWIND)
@@ -65,20 +73,23 @@ if Stance(3) #berserker
    Spell(MORTALSTRIKE)
    Spell(DEVASTATE)

-   if Talent(SLAMTALENT more 1) and AfterWhiteHit(0.2)
-       Spell(SLAM)
-
-   #todo execute par talent
+   if TalentPoints(SLAMTALENT more 1) and AfterWhiteHit(0.2)
+       Spell(SLAM)
 }

 if Stance(1) #combat
 {
    Spell(VICTORY usable=1)
-   if TargetLifePercent(less 20) Spell(EXECUTE)
+   Spell(OVERPOWER usable=1)
    Spell(MORTALSTRIKE)
-   Spell(DEVASTATE)

-   #todo
+   Spell(REND)
+
+   Spell(SHIELDSLAM usable=1)
+   Spell(SHOCKWAVE)
+   Spell(CONCUSSIONBLOW)
+
+   Spell(DEVASTATE)
 }

 if Mana(more 50)