Quantcast

- some bug fixes

Sidoine De Wispelaere [11-29-09 - 01:29]
- some bug fixes
- added spell description for paladin

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@142 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Ovale.lua
defaut/Druide.lua
defaut/Guerrier.lua
defaut/Paladin.lua
diff --git a/Condition.lua b/Condition.lua
index 3c5265a..e7851cc 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -211,7 +211,7 @@ local function GetTargetAura(condition, filter, target)
 	if (not condition.mine or aura.mine) and aura.stacks>=stacks then
 		return aura.start, aura.ending
 	else
-		return nil, 0
+		return 0,0
 	end
 end

@@ -508,7 +508,7 @@ Ovale.conditions=
 			local minTime
 			for k,v in pairs(otherDebuff) do
 				local diff = v
-				if diff<-maxTime then
+				if Ovale.maintenant-maxTime>diff then
 					-- Ovale:Print("enlève obsolète sur "..k)
 					otherDebuff[k] = nil
 				elseif k~=UnitGUID("target") and (not minTime or diff<minTime) then
@@ -521,6 +521,7 @@ Ovale.conditions=
 			minTime = minTime - timeBefore
 			return minTime
 		end
+		return nil
 	end,
 	OtherDebuffPresent = function(condition)
 		Ovale:EnableOtherDebuffs()
diff --git a/Ovale.lua b/Ovale.lua
index ffa6ff0..9763592 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -831,7 +831,7 @@ function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast)
 	self.attenteFinCast = nextCast
 	self.currentSpellName = spellName
 	self.startCast = startCast
-	self.currentTime = nextCast
+	self.currentTime = startCast+0.1

 	if Ovale.trace then
 		Ovale:Print("add spell "..spellName.." at "..startCast.." currentTime = "..nextCast)
@@ -989,6 +989,15 @@ function Ovale:GetGCD(spellName)
 	end
 end

+
+local function nilstring(text)
+	if text == nil then
+		return "nil"
+	else
+		return text
+	end
+end
+
 function Ovale:GetActionInfo(element)
 	if not element then
 		return nil
@@ -1040,9 +1049,10 @@ function Ovale:GetActionInfo(element)
 		else
 			local _,_,id = string.find(GetInventoryItemLink("player",GetInventorySlotInfo(element.params[1])) or "","item:(%d+):%d+:%d+:%d+")
 			itemId = tonumber(id)
-		end
+		end
+
 		if (Ovale.trace) then
-			self:Print("Item "..itemId)
+			self:Print("Item "..nilstring(itemId))
 		end

 		spellName = GetItemSpell(itemId)
@@ -1085,13 +1095,6 @@ function Ovale:GetActionInfo(element)
 					actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, target, element.params.nored
 end

-local function nilstring(text)
-	if text == nil then
-		return "nil"
-	else
-		return text
-	end
-end

 local function addTime(time1, duration)
 	if not time1 then
@@ -1213,24 +1216,30 @@ function Ovale:CalculerMeilleureAction(element)
 		end
 		local tempsA = Ovale:CalculerMeilleureAction(element.a)
 		if (tempsA==nil) then
+			if Ovale.trace then Ovale:Print(element.type.." return nil") end
 			return nil
 		end
 		local tempsB = Ovale:CalculerMeilleureAction(element.b)
 		if (tempsB==nil) then
+			if Ovale.trace then Ovale:Print(element.type.." return nil") end
 			return nil
 		end
 		if (tempsA>tempsB and tempsA-tempsB<element.time) then
+			if Ovale.trace then Ovale:Print(element.type.." return 0") end
 			return 0
 		elseif (tempsB>tempsA and tempsB-tempsA<element.time) then
+			if Ovale.trace then Ovale:Print(element.type.." return 0") end
 			return 0
 		end
 		return nil
 	elseif (element.type == "and" or element.type == "if") then
 		if (Ovale.trace) then
+			if Ovale.trace then Ovale:Print(element.type.." return nil") end
 			self:Print(element.type)
 		end
 		local startA, endA = Ovale:CalculerMeilleureAction(element.a)
 		if (startA==nil) then
+			if Ovale.trace then Ovale:Print(element.type.." return nil") end
 			return nil
 		end
 		local startB, endB, prioriteB, elementB = Ovale:CalculerMeilleureAction(element.b)
@@ -1256,10 +1265,12 @@ function Ovale:CalculerMeilleureAction(element)
 		local startB, endB, prioriteB, elementB = Ovale:CalculerMeilleureAction(element.b)

 		if isBefore(startA, startB) and isAfter(endA, endB) then
+			if Ovale.trace then Ovale:Print(element.type.." return nil") end
 			return nil
 		end

 		if isAfter(startA, startB) and isBefore(endA, endB) then
+			if Ovale.trace then Ovale:Print(element.type.." return "..nilstring(endA)..","..nilstring(endB)) end
 			return endA, endB, prioriteB, elementB
 		end

@@ -1271,6 +1282,7 @@ function Ovale:CalculerMeilleureAction(element)
 			startB = endA
 		end

+		if Ovale.trace then Ovale:Print(element.type.." return "..nilstring(startB)..","..nilstring(endB)) end
 		return startB, endB, prioriteB, elementB
 	elseif (element.type == "or") then
 		if (Ovale.trace) then
@@ -1298,7 +1310,7 @@ function Ovale:CalculerMeilleureAction(element)

 		for k, v in ipairs(element.nodes) do
 			local newStart, newEnd, priorite, nouveauElement = Ovale:CalculerMeilleureAction(v)
-			if newStart and newStart<Ovale.currentTime then
+			if newStart~=nil and newStart<Ovale.currentTime then
 				newStart = Ovale.currentTime
 			end

@@ -1331,6 +1343,11 @@ function Ovale:CalculerMeilleureAction(element)
 					end
 				end
 				if (remplacer) then
+					if not nouveauElement then
+						self.bug = true
+						self:Print("Internal error: bestElement=nil and newStart="..newStart)
+						return nil
+					end
 					meilleurTempsFils = newStart
 					meilleurePrioriteFils = priorite
 					bestElement = nouveauElement
@@ -1341,14 +1358,19 @@ function Ovale:CalculerMeilleureAction(element)

 		if (meilleurTempsFils) then
 			if (Ovale.trace) then
-				self:Print("Best action "..bestElement.params[1].." remains "..meilleurTempsFils)
+				if bestElement then
+					self:Print("group best action "..bestElement.params[1].." remains "..meilleurTempsFils)
+				else
+					self:Print("group no best action")
+				end
 			end
 			return meilleurTempsFils, bestEnd, meilleurePrioriteFils, bestElement
 		else
-			if (Ovale.trace) then printTime(nil) end
+			if (Ovale.trace) then self:Print("group return nil") end
 			return nil
 		end
 	end
+	if (Ovale.trace) then self:Print("unknown element "..element.type..", return nil") end
 	return nil
 end

diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 8df86c1..8248dd7 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -37,6 +37,15 @@ ScoreSpells(FAERIEFERAL DEMOROAR MANGLEBEAR LACERATE SAVAGEROAR RIP
 		WRATH STARFIRE)

 SpellInfo(MAUL toggle=1)
+SpellAddTargetDebuff(FAERIEFERAL FAERIEFERAL=300)
+SpellAddTargetDebuff(FAERIEFIRE FAERIEFIRE=300)
+SpellAddTargetDebuff(DEMOROAR DEMOROAR=30)
+SpellAddBuff(SAVAGEROAR SAVAGEROAR=14)
+SpellAddTargetDebuff(RIP RIP=12)
+SpellAddTargetDebuff(MANGLECAT MANGLECAT=12)
+SpellAddTargetDebuff(RAKE RAKE=9)
+SpellAddTargetDebuff(INSECTSWARM INSECTSWARM=12)
+SpellAddTargetDebuff(MOONFIRE MOONFIRE=12)

 AddIcon help=main
 {
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 1024c34..2f24ab9 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -45,6 +45,8 @@ AddListItem(shout command SpellName(COMMANDSHOUT))
 SpellAddTargetDebuff(THUNDERCLAP THUNDERCLAP=30)
 SpellAddTargetDebuff(DEMOSHOUT DEMOSHOUT=45)
 SpellAddTargetDebuff(REND REND=15)
+SpellAddTargetDebuff(DEVASTATE SUNDER=30)
+SpellAddTargetDebuff(SUNDER SUNDER=30)
 SpellAddBuff(BATTLESHOUT BATTLESHOUT=120)
 SpellAddBuff(COMMANDSHOUT COMMANDSHOUT=120)
 SpellAddBuff(SLAM SLAMBUFF=0)
@@ -115,7 +117,7 @@ AddIcon help=main
         {
 			if BuffExpires(SLAMBUFF 2)
       			Spell(SLAM nored=1)
-      		Spell(SLAM priority=2)
+      		Spell(SLAM priority=2 nored=1)
       	}

         Spell(MORTALSTRIKE)
@@ -149,11 +151,11 @@ AddIcon help=main
      {
 		if TargetDebuffPresent(SUNDER)
 		{
-			Spell(DEVASTATE)
-			Spell(SUNDER)
+			Spell(DEVASTATE nored=1)
+			Spell(SUNDER nored=1)
 		}
-	    Spell(DEVASTATE priority=2)
-		Spell(SUNDER priority=2)
+	    Spell(DEVASTATE priority=2 nored=1)
+		Spell(SUNDER priority=2 nored=1)
      }
 }

diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index dddd396..1bbe324 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -32,6 +32,27 @@ AddCheckBox(tempete SpellName(DIVINESTORM) checked)
 AddCheckBox(coleredivine SpellName(HOLYWRATH))
 ScoreSpells(SEALRIGHTEOUSNESS SEALCOMMAND SEALVENGEANCE SEALCORRUPTION HOLYSHIELD HAMMEROFTHERIGHTEOUS CRUSADERSTRIKE
 	HAMMEROFWRATH JUDGELIGHT JUDGEWISDOM DIVINESTORM CONSECRATE EXORCISM HOLYWRATH HOLYSHOCK SHIELDOFRIGHTEOUSNESS)
+
+SpellAddBuff(EXORCISM THEARTOFWAR=0)
+SpellInfo(JUDGELIGHT cd=8)
+SpellInfo(JUDGEWISDOM cd=8)
+SpellInfo(HOLYSHIELD cd=10)
+SpellAddBuff(HOLYSHIELD HOLYSHIELD=10)
+SpellAddBuff(SEALVENGEANCE SEALVENGEANCE=1800)
+SpellAddBuff(SEALRIGHTEOUSNESS SEALRIGHTEOUSNESS=1800)
+SpellAddBuff(SEALCOMMAND SEALCOMMAND=1800)
+SpellAddBuff(SEALCORRUPTION SEALCORRUPTION=1800)
+SpellInfo(HAMMEROFTHERIGHTEOUS cd=6)
+SpellInfo(CRUSADERSTRIKE cd=4)
+SpellInfo(HAMMEROFWRATH cd=6)
+SpellInfo(DIVINESTORM cd=10)
+SpellInfo(SHIELDOFRIGHTEOUSNESS cd=6)
+SpellInfo(DIVINEPLEA cd=60)
+SpellAddBuff(DIVINEPLEA DIVINEPLEA=15)
+SpellInfo(CONSECRATE cd=8)
+SpellInfo(HOLYWRATH cd=30)
+SpellInfo(HOLYSHOCK cd=6)
+SpellInfo(AVENGINGWRATH cd=180)

 AddIcon help=main
 {