Quantcast

toc update

Sidoine De Wispelaere [04-15-09 - 18:11]
toc update

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@26 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.lua
Ovale.toc
OvaleSwing.lua
defaut/Chasseur.lua
defaut/Guerrier.lua
diff --git a/Condition.lua b/Condition.lua
index ad8b695..e0ccac3 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -48,7 +48,8 @@ Ovale.conditions=
 {
 	-- Test if a white hit just occured
 	-- 1 : maximum time after a white hit
-	AfterWhiteHit = function(condition)
+	-- Not useful anymore. No widely used spell reset swing timer anyway
+	--[[AfterWhiteHit = function(condition)
 		local debut = OvaleSwing.starttime
 		local fin = OvaleSwing.duration + debut
 		local maintenant = GetTime()
@@ -59,7 +60,7 @@ Ovale.conditions=
 		else
 			return 0.1
 		end
-	end,
+	end,]]
 	-- Test how many armor set parts are equiped by the player
 	-- 1 : set number
 	-- 2 : "more" or "less"
diff --git a/Ovale.lua b/Ovale.lua
index d033a70..99b9832 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -26,6 +26,9 @@ Ovale.bug = false
 Ovale.enCombat = false
 Ovale.spellHaste = 0
 Ovale.meleeHaste = 0
+Ovale.aura = { player = {}, target = {}}
+Ovale.possibleAura = { player = {}, target = {}}
+

 Ovale.arbre = {}

@@ -211,6 +214,32 @@ function Ovale:UPDATE_BINDINGS()
 	self:RemplirActionIndexes()
 end

+function Ovale:SaveAura(unit, filter)
+	local i=1
+
+	for k, v in pairs(Ovale.aura[unit]) do
+		v.dispelled = true
+		v.isMine = false
+	end
+
+	while (true) do
+		local name, rank, icon, count, debuffType, duration, expirationTime, isMine = UnitAura(unit, i, filter)
+
+		if (not name) then
+			break
+		end
+
+		if (not Ovale.aura[unit][name].isMine or not isMine) then
+			Ovale.aura[unit][name].icon = icon
+			Ovale.aura[unit][name].count = count
+			Ovale.aura[unit][name].duration = duration
+			Ovale.aura[unit][name].expirationTime = expirationTime
+			Ovale.aura[unit][name].isMine = isMine
+		end
+	end
+end
+
+
 function Ovale:UNIT_AURA(event, unit)
 	if (unit == "player") then
 		local hateBase = GetCombatRatingBonus(18)
@@ -220,11 +249,14 @@ function Ovale:UNIT_AURA(event, unit)
 		local hateHero = 0
 		local hateClasse = 0
 		local i=1;
+
+
 		while (true) do
 			local name =  UnitBuff("player", i);
 			if (not name) then
 				break
 			end
+
 			if (name == self.RETRIBUTION_AURA or name == self.MOONKIN_AURA) then
 				hateCommune = 3
 			elseif (name == self.WRATH_OF_AIR_TOTEM) then
diff --git a/Ovale.toc b/Ovale.toc
index bbde3ed..5d60fbd 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -1,4 +1,4 @@
-## Interface: 30000
+## Interface: 30100
 ## Title: Ovale
 ## Notes: Show the icon of the next spell to cast
 ## Notes-frFR: Affiche l'icône du prochain sort à lancer
@@ -19,7 +19,6 @@ Condition.lua
 OvaleIcone.lua
 OvaleIcone.xml
 OvaleFrame.lua
-OvaleSwing.lua
 OvaleCompile.lua
 defaut\Chaman.lua
 defaut\Chasseur.lua
diff --git a/OvaleSwing.lua b/OvaleSwing.lua
index 1937d1f..8baaa26 100644
--- a/OvaleSwing.lua
+++ b/OvaleSwing.lua
@@ -18,16 +18,19 @@
 	Modifed for Ovale
 ]]

+--[[ Not useful anymore
+
 local autoshotname = GetSpellInfo(75)
 local resetspells = {
 	[GetSpellInfo(845)] = true, -- Cleave
 	[GetSpellInfo(78)] = true, -- Heroic Strike
 	[GetSpellInfo(6807)] = true, -- Maul
 	[GetSpellInfo(2973)] = true, -- Raptor Strike
+}
+local delayspells = {
 	[GetSpellInfo(1464)] = true, -- Slam
 }
 local resetautoshotspells = {
-	[GetSpellInfo(19434)] = true, -- Aimed Shot
 }
 local _, playerclass = UnitClass('player')
 local unpack = unpack
@@ -39,6 +42,7 @@ OvaleSwing = LibStub("AceAddon-3.0"):NewAddon("OvaleSwing", "AceEvent-3.0")
 OvaleSwing.swingmode=nil -- nil is none, 0 is meleeing, 1 is autoshooting
 OvaleSwing.starttime=0
 OvaleSwing.duration=0
+OvaleSwing.startdelay=0

 local BOOKTYPE_SPELL = BOOKTYPE_SPELL

@@ -52,7 +56,10 @@ function OvaleSwing:OnEnable()

 	self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

+	self:RegisterEvent("UNIT_SPELLCAST_START")
 	self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
+	self:RegisterEvent("UNIT_SPELLCAST_FAILED", "UNIT_SPELLCAST_INTERRUPTED")
+	self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")

 	self:RegisterEvent("UNIT_ATTACK")
 end
@@ -109,11 +116,30 @@ do
 	end
 end

+function OvaleSwing:UNIT_SPELLCAST_START(unit, spell)
+	if self.swingmode == 0 then
+		if delayspells[spell] then
+			self.startdelay = GetTime()
+		end
+	end
+end
+
+function OvaleSwing:UNIT_SPELLCAST_INTERRUPTED(unit, spell)
+	if self.swingmode == 0 then
+		if delayspells[spell] then
+			self.duration = self.duration + GetTime() - self.startdelay
+		end
+	end
+end
+
 function OvaleSwing:UNIT_SPELLCAST_SUCCEEDED(unit, spell)
 	if self.swingmode == 0 then
 		if resetspells[spell] then
 			self:MeleeSwing()
 		end
+		if delayspells[spell] then
+			self.duration = self.duration +
+		end
 	elseif self.swingmode == 1 then
 		if spell == autoshotname then
 			self:Shoot()
@@ -146,3 +172,4 @@ function OvaleSwing:Shoot()
 	self.duration = UnitRangedDamage('player')
 	self.starttime = GetTime()
 end
+]]
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index 7f87d63..b7f4c13 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -10,17 +10,20 @@ Define(KILLSHOT 53351)
 Define(RAPIDFIRE 3045)
 Define(KILLCOMMAND 34026)
 Define(BESTIALWRATH 19574)
+Define(HUNTERSMARK 53338)

 AddCheckBox(multi SpellName(MULTISHOT))

 AddIcon
 {
+	if TargetDebuffExpires(HUNTERSMARK 0) Spell(HUNTERSMARK)
 	if TargetDebuffExpires(SERPENTSTING 0) Spell(SERPENTSTING)
-	Spell(EXPLOSIVESHOT)
-	Spell(ARCANESHOT)
-	#Spell(AIMEDSHOT)
+	if TargetDebuffExpires(EXPLOSIVESHOT 0) Spell(EXPLOSIVESHOT)
+	Spell(AIMEDSHOT)
 	if CheckBoxOn(multi) Spell(MULTISHOT)
+	Spell(ARCANESHOT)
 	if TargetLifePercent(less 20) Spell(KILLSHOT)
+	if TargetDebuffExpires(HUNTERSMARK 2) Spell(HUNTERSMARK)
 	Spell(STEADYSHOT)
 }

diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 39094a6..200448b 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -29,6 +29,9 @@ Define(DEATHWISH 12292)
 Define(RECKLESSNESS 1719)
 Define(BLADESTORM 46924)

+Define(DEMORALIZINGROAR 48560)
+Define(CURSEOFWEAKNESS 50511)
+
 AddCheckBox(multi L(AOE))
 AddCheckBox(demo SpellName(DEMOSHOUT))
 AddCheckBox(whirlwind SpellName(WHIRLWIND))
@@ -48,6 +51,8 @@ AddIcon
      if TargetClassification(worldboss)
             and CheckBoxOn(demo)
             and TargetDebuffExpires(DEMOSHOUT 2)
+            and TargetDebuffExpires(DEMORALIZINGROAR 0)
+            and TargetDebuffExpires(CURSEOFWEAKNESS 0)
           Spell(DEMOSHOUT)

      if Stance(2) #Defense
@@ -64,6 +69,7 @@ AddIcon

         Spell(REVENGE usable=1)
         Spell(SHIELDSLAM)
+	Spell(BLOODTHIRST)

         if Mana(more 10) Spell(DEVASTATE priority=2)
      }