Quantcast

ret pal: added hand of light buff

Sidoine De Wispelaere [10-19-10 - 20:05]
ret pal: added hand of light buff
fixed a bug where some spells were ignored (like aimed shot)


git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@313 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
Ovale.toc
defaut/Paladin.lua
diff --git a/Ovale.lua b/Ovale.lua
index d46aad0..c2d4453 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -14,6 +14,7 @@ Ovale.actionSort = {}
 Ovale.pointsTalent = {}
 --key: talentId / value: talent name (not used)
 Ovale.talentIdToName = {}
+Ovale.spellList = {}
 --key: talent name / value: talent id
 Ovale.talentNameToId = {}
 --allows to do some initialization the first time the addon is enabled
@@ -498,6 +499,7 @@ function Ovale:FirstInit()
 	self:RemplirActionIndexes()
 	self:RemplirListeTalents()
 	self:ChercherNomsBuffs()
+	self:FillSpellList()

 	local playerClass, englishClass = UnitClass("player")
 	self.className = englishClass
@@ -621,6 +623,7 @@ end
 function Ovale:SPELLS_CHANGED()
 	-- self:RemplirActionIndexes()
 	-- self:RemplirListeTalents()
+	self:FillSpellList()
 	self.needCompile = true
 end

@@ -829,7 +832,7 @@ function Ovale:AddSpellToList(spellId, lineId, startTime, endTime, channeled)
 	newSpell.channeled = channeled

 	self.lastSpell[#self.lastSpell+1] = newSpell
-	--self:Print("on ajoute "..spellId..": ".. newSpell.start.." to "..newSpell.stop.." ("..self.maintenant..")")
+	--self:Print("on ajoute "..spellId..": ".. newSpell.start.." to "..newSpell.stop.." ("..self.maintenant..")" ..#self.lastSpell)

 	if self.spellInfo[spellId] then
 		local si = self.spellInfo[spellId]
@@ -978,6 +981,22 @@ function Ovale:RemplirActionIndexes()
 	end
 end

+function Ovale:FillSpellList()
+	self.spellList = {}
+	local i=1
+	while true do
+		local skillType, spellId = GetSpellBookItemInfo(i, BOOKTYPE_SPELL)
+		if not spellId then
+			break
+		end
+		if skillType~="FUTURESPELL" then
+			local spellName = GetSpellBookItemName(i, BOOKTYPE_SPELL)
+			self.spellList[spellId] = spellName
+		end
+		i = i + 1
+	end
+end
+
 function Ovale:RemplirListeTalents()
 	local numTabs = GetNumTalentTabs();
 	for t=1, numTabs do
@@ -1325,6 +1344,8 @@ function Ovale:InitCalculerMeilleureAction()
 				self:Log("self.maintenant = " ..self.maintenant.." spellId="..v.spellId.." v.stop="..v.stop)
 				if self.maintenant - v.stop<5 then
 					self:AddSpellToStack(v.spellId, v.start, v.stop, v.stop, v.nocd)
+				else
+					table.remove(self.lastSpell, i)
 				end
 			end
 		end
@@ -1431,18 +1452,18 @@ function Ovale:GetActionInfo(element)
 	end

 	if (element.func == "Spell" ) then
-		--Test spell availability
-		local spellName = self:GetSpellInfoOrNil(spellId)
-		if not self:GetSpellInfoOrNil(spellName) then
+		if not self.spellList[spellId] then
+			self:Log("Spell "..spellId.." not learnt")
 			return nil
 		end
+
 		--Get spell info
 		action = self.actionSort[spellId]
 		actionCooldownStart, actionCooldownDuration, actionEnable = self:GetComputedSpellCD(spellId)

 		--if (not action or not GetActionTexture(action)) then
+			spellName = self.spellList[spellId]
 			actionTexture = GetSpellTexture(spellId)
-			local spellName = GetSpellInfo(spellId)
 			actionInRange = IsSpellInRange(spellName, target)
 			actionUsable = IsUsableSpell(spellId)
 			actionShortcut = nil
diff --git a/Ovale.toc b/Ovale.toc
index 9dbcf60..824a67c 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: 4.0.10
+## Version: 4.0.11
 ## OptionalDeps: Ace3, ButtonFacade, Recount, Skada, LibBabble-CreatureType-3.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index b5f0685..e8aea5c 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -39,6 +39,7 @@ Define(ZEALOTRY 85696)
 #Buff
 Define(THEARTOFWAR 59578)
 Define(JUDGEMENTSOFTHEPURE 53655)
+Define(HANDOFLIGHT 90174)

 ScoreSpells(SHIELDOFTHERIGHTEOUS JUDGEMENT AVENGERSSHIELD HAMMEROFTHERIGHTEOUS CONSECRATE HOLYWRATH
 	ZEALOTRY  INQUISITION TEMPLARSVERDICT DIVINESTORM EXORCISM HAMMEROFWRATH JUDGEMENT CRUSADERSTRIKE)
@@ -99,10 +100,13 @@ AddIcon help=main mastery=3
 		if BuffExpires(SEALRIGHTEOUSNESS 400) and BuffExpires(SEALOFTRUTH 400) Spell(SEALOFTRUTH)
 	}

-	if HolyPower(more 2) and TargetDeadIn(more 20) Spell(ZEALOTRY)
-    if HolyPower(more 0) and BuffExpires(INQUISITION) Spell(INQUISITION)
-    if CheckBoxOff(aoe) and HolyPower(more 2) Spell(TEMPLARSVERDICT)
-    if CheckBoxOn(aoe) and HolyPower(more 2) Spell(DIVINESTORM)
+	if HolyPower(more 2) and BuffExpires(HANDOFLIGHT) and TargetDeadIn(more 20) Spell(ZEALOTRY)
+    if {HolyPower(more 0) or BuffPresent(HANDOFLIGHT)} and BuffExpires(INQUISITION) Spell(INQUISITION)
+	if  HolyPower(more 2) or BuffPresent(HANDOFLIGHT)
+	{
+		if CheckBoxOff(aoe)  Spell(TEMPLARSVERDICT)
+		if CheckBoxOn(aoe) Spell(DIVINESTORM)
+	}
     Spell(CRUSADERSTRIKE)
     unless 0.5s before Spell(CRUSADERSTRIKE)
 	{