Quantcast

all scripts have been updated using SC importer last version

Sidoine De Wispelaere [09-24-12 - 21:24]
all scripts have been updated using SC importer last version
DeadIn returned nil on boss target dummy
predicted aura on current spell cast was not always correct
getticklength was not working if tick was not set in spellinfo
bug with prediction and nil elements

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@563 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCompile.lua
OvaleCondition.lua
OvaleData.lua
OvaleFrame.lua
OvaleState.lua
defaut/Chaman.lua
defaut/Chasseur.lua
defaut/Chevalier.lua
defaut/Demoniste.lua
defaut/Druide.lua
defaut/Guerrier.lua
defaut/Mage.lua
defaut/Moine.lua
defaut/Pretre.lua
defaut/Voleur.lua
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 2ee03dc..17be368 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -150,11 +150,11 @@ local function ParseFunction(prefix, func, params)
 		func = prefix
 	end

-	if string.find(func, "Target") == 1 then
-		if not paramList.target then
+	if not paramList.target then
+		if string.find(func, "Target") == 1 then
 			paramList.target = "target"
+			func = string.sub(func, 7)
 		end
-		func = string.sub(func, 7)
 	end

 	if customFunctions[func] then
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index 7ea1717..587e32a 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -380,15 +380,15 @@ local function getTargetDead(target)
 		end
 	end
 	if not lastSPD[target] or lastSPD[target]<=0 then
-		return nil
+		return OvaleState.currentTime + 3600
 	end
 	-- Rough estimation
 	local duration = newHealth * lastSPD[target]
-	if duration < 10000 then
+	--if duration < 10000 then
 		return OvaleState.maintenant + duration
-	else
-		return nil
-	end
+	--else
+--		return nil
+	--end
 end

 local function isSameSpell(spellIdA, spellIdB, spellNameB)
diff --git a/OvaleData.lua b/OvaleData.lua
index e94389f..90f1b8b 100644
--- a/OvaleData.lua
+++ b/OvaleData.lua
@@ -545,11 +545,11 @@ end

 function OvaleData:GetTickLength(spellId, spellHaste)
 	local si = self.spellInfo[spellId]
-	if si and si.tick then
+	if si then
 		if si.haste ~= "spell" then
-			return si.tick
+			return si.tick or 3
 		else
-			return si.tick / spellHaste
+			return (si.tick or 3) / spellHaste
 		end
 	else
 		return nil
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index 3a701c3..c3b3a71 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -256,7 +256,10 @@ do
 							if Ovale.trace then
 								Ovale:Print("****Second icon " .. start)
 							end
-							local spellTarget = element.params.target
+							local spellTarget
+							if element then
+								spellTarget = element.params.target
+							end
 							if spellTarget == "target" or not spellTarget then
 								spellTarget = target
 							end
diff --git a/OvaleState.lua b/OvaleState.lua
index 8880243..29934e9 100644
--- a/OvaleState.lua
+++ b/OvaleState.lua
@@ -317,6 +317,7 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 								newAura.ending = 0
 								newAura.stacks = 0
 							elseif stacks == "refresh" then
+								Ovale:Log("Aura is refreshed")
 								newAura.start = previousAura.start
 								newAura.stacks = previousAura.stacks
 								if isDoT then
@@ -328,8 +329,9 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 								else
 									newAura.ending = endCast + duration
 								end
-							elseif newAura.ending then
+							elseif newAura.ending and newAura.ending >= endCast then
 								if stacks < 0 then
+									Ovale:Log("Aura lose stacks")
 									--Buff are immediatly removed when the cast ended, do not need to do it again
 									if filter ~= "HELPFUL" or target ~= "player" or endCast >= self.maintenant then
 										newAura.stacks = newAura.stacks + stacks
@@ -343,7 +345,8 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 											newAura.ending = 0
 										end
 									end
-								elseif newAura.ending >= endCast then
+								else
+									Ovale:Log("Aura gain stacks")
 									if isDoT then
 										local tickLength = OvaleData:GetTickLength(auraSpellId, newAura.spellHaste)
 										local k = floor((newAura.ending - endCast) / tickLength)
@@ -355,6 +358,7 @@ function OvaleState:AddSpellToStack(spellId, startCast, endCast, nextCast, nocd,
 									newAura.stacks = newAura.stacks + stacks
 								end
 							else
+								Ovale:Log("New aura at " .. endCast)
 								newAura.start = endCast
 								newAura.ending = endCast + duration
 								newAura.stacks = stacks
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index f082b2b..212688a 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -45,7 +45,9 @@ Define(lightning_bolt 403)
 Define(lightning_shield 324)
   SpellInfo(lightning_shield duration=3600 )
   SpellAddBuff(lightning_shield lightning_shield=1)
-Define(maelstrom_weapon 51530)
+Define(maelstrom_weapon 53817)
+  SpellInfo(maelstrom_weapon duration=30 )
+  SpellAddBuff(maelstrom_weapon maelstrom_weapon=1)
 Define(magma_totem 8187)
 Define(searing_totem 3599)
   SpellInfo(searing_totem duration=60 )
@@ -86,11 +88,11 @@ AddIcon mastery=1 help=main

 	{
 		if TalentPoints(unleashed_fury_talent) and not BuffPresent(ascendance) Spell(unleash_elements)
-		if not BuffPresent(ascendance) and {not target.DebuffPresent(flame_shock) or TicksRemain(flame_shock) <2 or {{BuffPresent(bloodlust_aura any=1) or BuffPresent(elemental_mastery) } and TicksRemain(flame_shock) <3 } } Spell(flame_shock)
+		if not BuffPresent(ascendance) and {not target.DebuffPresent(flame_shock) or target.TicksRemain(flame_shock) <2 or {{BuffPresent(bloodlust any=1) or BuffPresent(elemental_mastery) } and target.TicksRemain(flame_shock) <3 } } Spell(flame_shock)
 		if target.DebuffRemains(flame_shock) >CastTime(lava_burst) and {BuffPresent(ascendance) or SpellCooldown(lava_burst) } Spell(lava_burst)
 		if TalentPoints(elemental_blast_talent) and not BuffPresent(ascendance) Spell(elemental_blast)
-		if BuffPresent(lightning_shield) ==0 Spell(earth_shock)
-		if BuffPresent(lightning_shield) >3 and target.DebuffRemains(flame_shock) >SpellCooldown(earth_shock) and target.DebuffRemains(flame_shock) <SpellCooldown(earth_shock) +TickTime(flame_shock) Spell(earth_shock)
+		if BuffStacks(lightning_shield) ==0 Spell(earth_shock)
+		if BuffStacks(lightning_shield) >3 and target.DebuffRemains(flame_shock) >SpellCooldown(earth_shock) and target.DebuffRemains(flame_shock) <SpellCooldown(earth_shock) +TickTime(flame_shock) Spell(earth_shock)
 		if not TotemPresent(fire) Spell(searing_totem)
 		Spell(lightning_bolt)
 	}
@@ -130,12 +132,12 @@ AddIcon mastery=1 help=cd
 	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(bloodlust)

 	{
-		if {{SpellCooldown(ascendance) >10 or Level() <87 } and SpellCooldown(fire_elemental_totem) >10 } or BuffPresent(ascendance) or BuffPresent(bloodlust) or TotemPresent(fire)  { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
-		if BuffPresent(bloodlust_aura any=1) or BuffPresent(ascendance) or {{SpellCooldown(ascendance) >10 or Level() <87 } and SpellCooldown(fire_elemental_totem) >10 } Spell(blood_fury)
-		if TalentPoints(elemental_mastery_talent) and TimeInCombat() >15 and {{not BuffPresent(bloodlust_aura any=1) and TimeInCombat() <120 } or {not BuffPresent(berserking) and not BuffPresent(bloodlust_aura any=1) and BuffPresent(ascendance) } or {TimeInCombat() >=200 and {SpellCooldown(ascendance) >30 or Level() <87 } } } Spell(elemental_mastery)
+		if {{SpellCooldown(ascendance) >10 or Level() <87 } and SpellCooldown(fire_elemental_totem) >10 } or BuffPresent(ascendance) or BuffPresent(bloodlust any=1) or TotemPresent(fire)  { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
+		if BuffPresent(bloodlust any=1) or BuffPresent(ascendance) or {{SpellCooldown(ascendance) >10 or Level() <87 } and SpellCooldown(fire_elemental_totem) >10 } Spell(blood_fury)
+		if TalentPoints(elemental_mastery_talent) and TimeInCombat() >15 and {{not BuffPresent(bloodlust any=1) and TimeInCombat() <120 } or {not BuffPresent(berserking) and not BuffPresent(bloodlust any=1) and BuffPresent(ascendance) } or {TimeInCombat() >=200 and {SpellCooldown(ascendance) >30 or Level() <87 } } } Spell(elemental_mastery)
 		if not TotemPresent(fire) Spell(fire_elemental_totem)
-		if target.DebuffRemains(flame_shock) >0 and {target.DeadIn() <20 or BuffPresent(bloodlust_aura any=1) or TimeInCombat() >=180 } Spell(ascendance)
-		if not and SpellCooldown(fire_elemental_totem) >=50 Spell(earth_elemental_totem)
+		if target.DebuffRemains(flame_shock) >0 and {target.DeadIn() <20 or BuffPresent(bloodlust any=1) or TimeInCombat() >=180 } Spell(ascendance)
+		if not TotemPresent(earth) and SpellCooldown(fire_elemental_totem) >=50 Spell(earth_elemental_totem)
 		Spell(spiritwalkers_grace)
 	}
 	if Enemies() >1
@@ -147,7 +149,7 @@ AddIcon mastery=2 help=main
 {
 	if not InCombat()
 	{
-		main.Spell(windfury_weapon)
+		if WeaponEnchantExpires(mainhand) main.Spell(windfury_weapon)
 		if WeaponEnchantExpires(offhand) off.Spell(flametongue_weapon)
 		if not BuffPresent(lightning_shield) Spell(lightning_shield)
 	}
@@ -156,31 +158,31 @@ AddIcon mastery=2 help=main
 		if not TotemPresent(fire) Spell(searing_totem)
 		if TalentPoints(unleashed_fury_talent) Spell(unleash_elements)
 		if TalentPoints(elemental_blast_talent) Spell(elemental_blast)
-		if BuffPresent(maelstrom_weapon) ==5 or {ArmorSetParts(T13 more 4) ==1 and BuffPresent(maelstrom_weapon) >=4 and False() } Spell(lightning_bolt)
+		if BuffStacks(maelstrom_weapon) ==5 or {ArmorSetParts(T13 more 4) ==1 and BuffStacks(maelstrom_weapon) >=4 and False() } Spell(lightning_bolt)
 		Spell(stormblast)
 		if BuffPresent(unleash_flame) and not target.DebuffPresent(flame_shock) Spell(flame_shock)
 		Spell(stormstrike)
 		Spell(lava_lash)
 		Spell(unleash_elements)
-		if BuffPresent(maelstrom_weapon) >=3 and target.DebuffPresent(unleashed_fury_ft) and not BuffPresent(ascendance) Spell(lightning_bolt)
+		if BuffStacks(maelstrom_weapon) >=3 and target.DebuffPresent(unleashed_fury_ft) and not BuffPresent(ascendance) Spell(lightning_bolt)
 		if BuffPresent(ancestral_swiftness) Spell(lightning_bolt)
 		if BuffPresent(unleash_flame) and target.DebuffRemains(flame_shock) <=3 Spell(flame_shock)
 		Spell(earth_shock)
-		if BuffPresent(maelstrom_weapon) >1 and not BuffPresent(ascendance) Spell(lightning_bolt)
+		if BuffStacks(maelstrom_weapon) >1 and not BuffPresent(ascendance) Spell(lightning_bolt)
 	}
 	if Enemies() >1
 	{
 		if not TotemPresent(fire) Spell(searing_totem)
 		if {DebuffCount(flame_shock) ==Enemies() } or DebuffCount(flame_shock) >=5 Spell(fire_nova)
 		if target.DebuffPresent(flame_shock) Spell(lava_lash)
-		if Enemies() >2 and BuffPresent(maelstrom_weapon) >=3 Spell(chain_lightning)
+		if Enemies() >2 and BuffStacks(maelstrom_weapon) >=3 Spell(chain_lightning)
 		Spell(unleash_elements)
 		if not target.DebuffPresent(flame_shock) Spell(flame_shock)
 		Spell(stormblast)
 		Spell(stormstrike)
-		if BuffPresent(maelstrom_weapon) ==5 and SpellCooldown(chain_lightning) >=2 Spell(lightning_bolt)
-		if Enemies() >2 and BuffPresent(maelstrom_weapon) >1 Spell(chain_lightning)
-		if BuffPresent(maelstrom_weapon) >1 Spell(lightning_bolt)
+		if BuffStacks(maelstrom_weapon) ==5 and SpellCooldown(chain_lightning) >=2 Spell(lightning_bolt)
+		if Enemies() >2 and BuffStacks(maelstrom_weapon) >1 Spell(chain_lightning)
+		if BuffStacks(maelstrom_weapon) >1 Spell(lightning_bolt)
 	}
 }
 AddIcon mastery=2 help=offgcd
@@ -188,7 +190,7 @@ AddIcon mastery=2 help=offgcd
 	if target.IsInterruptible() Spell(wind_shear)

 	{
-		if TalentPoints(ancestral_swiftness_talent) and BuffPresent(maelstrom_weapon) <2 Spell(ancestral_swiftness)
+		if TalentPoints(ancestral_swiftness_talent) and BuffStacks(maelstrom_weapon) <2 Spell(ancestral_swiftness)
 	}
 	if Enemies() >1
 	{
@@ -203,17 +205,17 @@ AddIcon mastery=2 help=cd
 	{
 		Spell(blood_fury)
 		if TalentPoints(elemental_mastery_talent) Spell(elemental_mastery)
-		if not TotemPresent(fire) and {BuffPresent(bloodlust_aura any=1) or BuffPresent(elemental_mastery) or target.DeadIn() <=0 +10 or {TalentPoints(elemental_mastery_talent) and {SpellCooldown(elemental_mastery) ==0 or SpellCooldown(elemental_mastery) >80 } or TimeInCombat() >=60 } } Spell(fire_elemental_totem)
+		if not TotemPresent(fire) and {BuffPresent(bloodlust any=1) or BuffPresent(elemental_mastery) or target.DeadIn() <=0 +10 or {TalentPoints(elemental_mastery_talent) and {SpellCooldown(elemental_mastery) ==0 or SpellCooldown(elemental_mastery) >80 } or TimeInCombat() >=60 } } Spell(fire_elemental_totem)
 		if SpellCooldown(strike) >=3 Spell(ascendance)
 		Spell(feral_spirit)
-		if not and SpellCooldown(fire_elemental_totem) >=50 Spell(earth_elemental_totem)
+		if not TotemPresent(earth) and SpellCooldown(fire_elemental_totem) >=50 Spell(earth_elemental_totem)
 		Spell(spiritwalkers_grace)
 	}
 	if Enemies() >1
 	{
 		Spell(blood_fury)
 		if SpellCooldown(strike) >=3 Spell(ascendance)
-		if not TotemPresent(fire) and {BuffPresent(bloodlust_aura any=1) or BuffPresent(elemental_mastery) or target.DeadIn() <=0 +10 or {TalentPoints(elemental_mastery_talent) and {SpellCooldown(elemental_mastery) ==0 or SpellCooldown(elemental_mastery) >80 } or TimeInCombat() >=60 } } Spell(fire_elemental_totem)
+		if not TotemPresent(fire) and {BuffPresent(bloodlust any=1) or BuffPresent(elemental_mastery) or target.DeadIn() <=0 +10 or {TalentPoints(elemental_mastery_talent) and {SpellCooldown(elemental_mastery) ==0 or SpellCooldown(elemental_mastery) >80 } or TimeInCombat() >=60 } } Spell(fire_elemental_totem)
 		Spell(feral_spirit)
 	}
 }
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index 7c2a320..81ed184 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -93,7 +93,7 @@ AddIcon mastery=1 help=main
 	if not InCombat()
 	{
 		if target.DeadIn() >=21 and not target.DebuffPresent(ranged_vulnerability any=1) Spell(hunters_mark)
-		Spell(call_pet_1)
+		unless pet.Present() Spell(call_pet_1)
 	}
 	if BuffStacks(pet_frenzy any=1)>4 Spell(focus_fire)
 	if not target.DebuffPresent(serpent_sting_aura) Spell(serpent_sting)
@@ -105,7 +105,7 @@ AddIcon mastery=1 help=main
 	if SpellUsable(barrage) Spell(barrage)
 	if SpellUsable(powershot) Spell(powershot)
 	if SpellUsable(blink_strike) Spell(blink_strike)
-	if BuffPresent(thrill_of_the_hunt) Spell(arcane_shot)
+	if BuffStacks(thrill_of_the_hunt) Spell(arcane_shot)
 	if not target.DebuffPresent(focus_fire) and not BuffPresent(beast_within) if BuffStacks(pet_frenzy any=1)>4 Spell(focus_fire)
 	if target.DebuffRemains(serpent_sting_aura) <6 Spell(cobra_shot)
 	if Focus() >=61 or BuffPresent(beast_within) Spell(arcane_shot)
@@ -141,7 +141,7 @@ AddIcon mastery=2 help=main
 	if not InCombat()
 	{
 		if target.DeadIn() >=21 and not target.DebuffPresent(ranged_vulnerability any=1) Spell(hunters_mark)
-		Spell(call_pet_1)
+		unless pet.Present() Spell(call_pet_1)
 	}
 	if SpellUsable(powershot) Spell(powershot)
 	if SpellUsable(barrage) Spell(barrage)
@@ -152,10 +152,10 @@ AddIcon mastery=2 help=main
 	if SpellUsable(dire_beast) Spell(dire_beast)
 	if PreviousSpell(steady_shot) and BuffRemains(steady_focus) <3 Spell(steady_shot)
 	if target.HealthPercent(less 20) Spell(kill_shot)
-	if BuffPresent(master_marksman_fire) Spell(aimed_shot)
-	if BuffPresent(thrill_of_the_hunt) Spell(arcane_shot)
-	if target.HealthPercent() >90 or BuffPresent(rapid_fire) or BuffPresent(bloodlust) Spell(aimed_shot)
-	if {Focus() >=66 or SpellCooldown(chimera_shot) >=5 } and {target.HealthPercent() <90 and not BuffPresent(rapid_fire) and not BuffPresent(bloodlust) } Spell(arcane_shot)
+	if BuffStacks(master_marksman_fire) Spell(aimed_shot)
+	if BuffStacks(thrill_of_the_hunt) Spell(arcane_shot)
+	if target.HealthPercent() >90 or BuffPresent(rapid_fire) or BuffStacks(bloodlust any=1) Spell(aimed_shot)
+	if {Focus() >=66 or SpellCooldown(chimera_shot) >=5 } and {target.HealthPercent() <90 and not BuffPresent(rapid_fire) and not BuffStacks(bloodlust any=1) } Spell(arcane_shot)
 	if SpellUsable(fervor) and Focus() <=50 Spell(fervor)
 	Spell(steady_shot)
 }
@@ -188,10 +188,10 @@ AddIcon mastery=3 help=main
 	if not InCombat()
 	{
 		if target.DeadIn() >=21 and not target.DebuffPresent(ranged_vulnerability any=1) Spell(hunters_mark)
-		Spell(call_pet_1)
+		unless pet.Present() Spell(call_pet_1)
 	}
 	if SpellUsable(blink_strike) Spell(blink_strike)
-	if BuffPresent(lock_and_load) Spell(explosive_shot)
+	if BuffStacks(lock_and_load) Spell(explosive_shot)
 	if SpellUsable(powershot) Spell(powershot)
 	if SpellUsable(barrage) Spell(barrage)
 	if Enemies() >2 Spell(cobra_shot)
@@ -221,7 +221,7 @@ AddIcon mastery=3 help=aoe
 {
 	Spell(explosive_trap)
 	Spell(multi_shot)
-	if BuffPresent(thrill_of_the_hunt) Spell(multi_shot)
+	if BuffStacks(thrill_of_the_hunt) Spell(multi_shot)
 }
 AddIcon mastery=3 help=cd
 {
diff --git a/defaut/Chevalier.lua b/defaut/Chevalier.lua
index 6ee62d5..f0b8785 100644
--- a/defaut/Chevalier.lua
+++ b/defaut/Chevalier.lua
@@ -84,11 +84,11 @@ AddIcon mastery=2 help=main
 	if target.HealthPercent() <=35 or {{target.HealthPercent() -3 *{target.HealthPercent() /target.DeadIn() } } <=35 } Spell(soul_reaper)
 	if not target.DebuffPresent(frost_fever) Spell(howling_blast)
 	if not target.DebuffPresent(blood_plague) Spell(plague_strike)
-	if TalentPoints(plague_leech_talent) and not {{BuffPresent(killing_machine) and RunicPower() <10 } or {RuneCount(unholy) ==2 or RuneCount(frost) ==2 or RuneCount(death) ==2 } } Spell(plague_leech)
-	if BuffPresent(rime) Spell(howling_blast)
+	if TalentPoints(plague_leech_talent) and not {{BuffStacks(killing_machine) and RunicPower() <10 } or {RuneCount(unholy) ==2 or RuneCount(frost) ==2 or RuneCount(death) ==2 } } Spell(plague_leech)
+	if BuffStacks(rime) Spell(howling_blast)
 	if RunicPower() >=88 Spell(frost_strike)
-	if BuffPresent(killing_machine) Spell(frost_strike)
-	if BuffPresent(killing_machine) and RunicPower() <10 Spell(obliterate)
+	if BuffStacks(killing_machine) Spell(frost_strike)
+	if BuffStacks(killing_machine) and RunicPower() <10 Spell(obliterate)
 	if {RuneCount(unholy) ==2 or RuneCount(frost) ==2 or RuneCount(death) ==2 } Spell(obliterate)
 	Spell(howling_blast)
 	Spell(frost_strike)
@@ -130,7 +130,7 @@ AddIcon mastery=3 help=main
 	if RuneCount(unholy) ==2 and RunicPower() <90 Spell(scourge_strike)
 	if RuneCount(blood) ==2 and RuneCount(frost) ==2 and RunicPower() <90 Spell(festering_strike)
 	if RunicPower() >90 Spell(death_coil)
-	if BuffPresent(sudden_doom) Spell(death_coil)
+	if BuffStacks(sudden_doom) Spell(death_coil)
 	Spell(scourge_strike)
 	Spell(festering_strike)
 	if SpellCooldown(summon_gargoyle) >8 Spell(death_coil)
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index e97d18b..05f02f8 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -137,9 +137,9 @@ AddIcon mastery=1 help=main
 	if not InFlightToTarget(haunt) and target.DebuffRemains(haunt) <TickTime(haunt) +1 +CastTime(haunt) and SoulShards() Spell(haunt)
 	if Enemies() >1 and TimeInCombat() <10 and Glyph(56226) Spell(soul_swap)
 	if not InFlightToTarget(haunt) and target.DebuffRemains(haunt) <TickTime(haunt) +1 +CastTime(haunt) and SoulShards() >1 Spell(haunt)
-	if TicksRemain(agony) <Ticks(agony) /2 and target.DeadIn() >=8 Spell(agony)
-	if TicksRemain(corruption) <Ticks(corruption) /2 and target.DeadIn() >=6 Spell(corruption)
-	if TicksRemain(unstable_affliction) <Ticks(unstable_affliction) /2 +1 and target.DeadIn() >=5 Spell(unstable_affliction)
+	if target.TicksRemain(agony) <Ticks(agony) /2 and target.DeadIn() >=8 Spell(agony)
+	if target.TicksRemain(corruption) <Ticks(corruption) /2 and target.DeadIn() >=6 Spell(corruption)
+	if target.TicksRemain(unstable_affliction) <Ticks(unstable_affliction) /2 +1 and target.DeadIn() >=5 Spell(unstable_affliction)
 	if target.HealthPercent() <=20 Spell(drain_soul)
 	if ManaPercent() <35 Spell(life_tap)
 	Spell(malefic_grasp)
@@ -197,11 +197,11 @@ AddIcon mastery=2 help=main
 		Spell(life_tap)
 	}
 	if {not target.DebuffPresent(corruption) or target.DebuffRemains(corruption) <TickTime(corruption) } and target.DeadIn() >=6 Spell(corruption)
-	if {not target.DebuffPresent(doom) or target.DebuffRemains(doom) <TickTime(doom) or {TicksRemain(doom) +1 <{target.TicksRemain(doom) + Ticks(doom) } and BuffPresent(dark_soul) } } and target.DeadIn() >=30 Spell(doom)
+	if {not target.DebuffPresent(doom) or target.DebuffRemains(doom) <TickTime(doom) or {target.TicksRemain(doom) +1 <{target.TicksRemain(doom) + Ticks(doom) } and BuffPresent(dark_soul) } } and target.DeadIn() >=30 Spell(doom)
 	if target.DebuffRemains(corruption) >20 and BuffExpires(dark_soul) and DemonicFury() <=750 and target.DeadIn() >30 if Stance(1) cancel.Texture(Spell_shadow_demonform)
 	if not InFlightToTarget(hand_of_guldan) and target.DebuffRemains(shadowflame) <1 +CastTime(shadow_bolt) Spell(hand_of_guldan)
 	if target.DebuffRemains(corruption) <20 Spell(touch_of_chaos)
-	if BuffPresent(molten_core) Spell(soul_fire)
+	if BuffStacks(molten_core) Spell(soul_fire)
 	Spell(touch_of_chaos)
 	if ManaPercent() <50 Spell(life_tap)
 	Spell(shadow_bolt)
@@ -265,7 +265,7 @@ AddIcon mastery=3 help=main
 	}
 	if Enemies() >1 focus.Spell(havoc)
 	if BurningEmbers() if target.HealthPercent(less 20) Spell(shadowburn)
-	if TicksRemain(immolate) <Ticks(immolate) /2 and target.DeadIn() >=5 Spell(immolate)
+	if target.TicksRemain(immolate) <Ticks(immolate) /2 and target.DeadIn() >=5 Spell(immolate)
 	if BurningEmbers() and {BuffStacks(backdraft) <3 or Level() <86 } and {BurningEmbers() >3.5 or BuffRemains(dark_soul) >CastTime(chaos_bolt) } and ManaPercent() <=80 Spell(chaos_bolt)
 	Spell(conflagrate)
 	Spell(incinerate)
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 067871c..b2ec0d0 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -123,7 +123,7 @@ AddIcon mastery=1 help=moving
 	if not target.DebuffPresent(sunfire) Spell(moonfire)
 	if not target.DebuffPresent(moonfire) Spell(sunfire)
 	if BuffStacks(wild_mushroom) <5 Spell(wild_mushroom)
-	if BuffPresent(shooting_stars) Spell(starsurge)
+	if BuffStacks(shooting_stars) Spell(starsurge)
 	if BuffPresent(lunar_eclipse) Spell(moonfire)
 	Spell(sunfire)
 }
@@ -164,8 +164,8 @@ AddIcon mastery=2 help=main
 	if target.DeadIn() >=8.5 and BuffPresent(dream_of_cenarius_damage) and {LastSpellDamageMultiplier(rake) <=DamageMultiplier(rake) } and not PreviousSpell(rake) Spell(rake)
 	if target.DeadIn() >=8.5 and target.DebuffRemains(rake) <9.0 and not TalentPoints(dream_of_cenarius_talent) and BuffPresent(tigers_fury) and {LastSpellDamageMultiplier(rake) <DamageMultiplier(rake) } Spell(rake)
 	if target.DeadIn() >=8.5 and target.DebuffRemains(rake) <3.0 and {BuffPresent(berserk) or {SpellCooldown(tigers_fury) +0.8 } >=target.DebuffRemains(rake) } Spell(rake)
-	if BuffPresent(omen_of_clarity) Spell(ravage usable=1)
-	if BuffPresent(omen_of_clarity) Spell(shred)
+	if BuffStacks(omen_of_clarity) Spell(ravage usable=1)
+	if BuffStacks(omen_of_clarity) Spell(shred)
 	if {target.DeadIn() <=4 and ComboPoints() >=5 } or target.DeadIn() <=1 Spell(ferocious_bite)
 	if BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {{{ComboPoints() >=5 and target.DebuffRemains(rip) >={8.0 +SpellCooldown(healing_touch) } and BuffRemains(savage_roar) >={SpellCooldown(healing_touch) } } } } Spell(healing_touch)
 	if ComboPoints() >=5 and target.DebuffRemains(rip) >=8.0 and BuffPresent(savage_roar) Spell(ferocious_bite)
@@ -183,12 +183,12 @@ AddIcon mastery=2 help=main
 }
 AddIcon mastery=2 help=offgcd
 {
-	if Energy() <=35 and not BuffPresent(omen_of_clarity) Spell(tigers_fury)
+	if Energy() <=35 and not BuffStacks(omen_of_clarity) Spell(tigers_fury)
 	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and TalentPoints(natures_swiftness_talent) and {{{ComboPoints() >=5 and target.DebuffRemains(rip) >SpellCooldown(healing_touch) and target.HealthPercent() <=25 } } } Spell(natures_swiftness)
 	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and TalentPoints(natures_swiftness_talent) and target.HealthPercent() >25 and {{{ComboPoints() >=5 and target.DeadIn() >={6 +SpellCooldown(healing_touch) } and target.DebuffRemains(rip) <{2 +SpellCooldown(healing_touch) } and {BuffPresent(berserk) or target.DebuffRemains(rip) <=SpellCooldown(tigers_fury) } } } } Spell(natures_swiftness)
 	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {target.HealthPercent() <=25 or {target.DebuffRemains(rip) >4 and ArmorSetParts(T14 more 4) } } and {{{target.DeadIn() >={8.5 +SpellCooldown(healing_touch) } and BuffPresent(tigers_fury) } } } Spell(natures_swiftness)
 	if not BuffPresent(predatory_swiftness) and TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and {target.HealthPercent() <=25 or {target.DebuffRemains(rip) >4 and ArmorSetParts(T14 more 4) } } and {{{target.DeadIn() >={8.5 +SpellCooldown(healing_touch) } and target.DebuffRemains(rake) <{3.0 +SpellCooldown(healing_touch) } and {BuffRemains(berserk) >SpellCooldown(healing_touch) or {SpellCooldown(tigers_fury) +0.8 } >=target.DebuffRemains(rake) } } } } Spell(natures_swiftness)
-	if BuffPresent(omen_of_clarity) and target.DebuffRemains(thrash) <3 Spell(thrash)
+	if BuffStacks(omen_of_clarity) and target.DebuffRemains(thrash) <3 Spell(thrash)
 }
 AddIcon mastery=2 help=cd
 {
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index c7ef7a4..517bbe4 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -140,13 +140,13 @@ AddIcon mastery=2 help=main
 		unless Stance(1) Spell(battle_stance)
 	}
 	if not {target.HealthPercent() <20 and target.DebuffPresent(colossus_smash) and Rage() >=30 } Spell(bloodthirst)
-	if BuffPresent(bloodsurge) and target.HealthPercent() >=20 and SpellCooldown(bloodthirst) <=1 Spell(wild_strike)
+	if BuffStacks(bloodsurge) and target.HealthPercent() >=20 and SpellCooldown(bloodthirst) <=1 Spell(wild_strike)
 	if not {target.HealthPercent() <20 and target.DebuffPresent(colossus_smash) and Rage() >=30 } and SpellCooldown(bloodthirst) <=1 if CheckBoxOn(showwait) Texture(Spell_nature_timestop)
 	Spell(colossus_smash)
 	if target.HealthPercent(less 20) Spell(execute)
 	if TalentPoints(storm_bolt_talent) Spell(storm_bolt)
-	if BuffPresent(raging_blow_aura) Spell(raging_blow)
-	if BuffPresent(bloodsurge) and target.HealthPercent() >=20 Spell(wild_strike)
+	if BuffStacks(raging_blow_aura) Spell(raging_blow)
+	if BuffStacks(bloodsurge) and target.HealthPercent() >=20 Spell(wild_strike)
 	Spell(heroic_throw)
 	if Rage() <70 and not target.DebuffPresent(colossus_smash) Spell(battle_shout)
 	if target.DebuffPresent(colossus_smash) and target.HealthPercent() >=20 Spell(wild_strike)
@@ -157,7 +157,7 @@ AddIcon mastery=2 help=main
 AddIcon mastery=2 help=offgcd
 {
 	if TalentPoints(bloodbath_talent) and {{{SpellCooldown(recklessness) >=10 or BuffPresent(recklessness) } or {target.HealthPercent() >=20 and {target.DeadIn() <=165 or {target.DeadIn() <=315 and not ArmorSetParts(T14 more 4) } } and target.DeadIn() >75 } } or target.DeadIn() <=19 } Spell(bloodbath)
-	if not {BuffPresent(enrage) or {BuffPresent(raging_blow_aura) ==2 and target.HealthPercent() >=20 } } Spell(berserker_rage)
+	if not {BuffStacks(enrage) or {BuffStacks(raging_blow_aura) ==2 and target.HealthPercent() >=20 } } Spell(berserker_rage)
 	if target.DebuffPresent(colossus_smash) if CheckBoxOn(heroic_leap_check) Spell(heroic_leap)
 	if Rage() >=40 Spell(deadly_calm)
 	if {{{target.DebuffPresent(colossus_smash) and Rage() >=40 } or {BuffPresent(deadly_calm) and Rage() >=30 } } and target.HealthPercent() >=20 } or Rage() >=110 Spell(heroic_strike)
diff --git a/defaut/Mage.lua b/defaut/Mage.lua
index 46bb4d2..d212387 100644
--- a/defaut/Mage.lua
+++ b/defaut/Mage.lua
@@ -112,7 +112,7 @@ AddIcon mastery=1 help=main
 	if BuffExpires(rune_of_power) and BuffExpires(alter_time) Spell(rune_of_power)
 	if not target.DebuffPresent(nether_tempest) Spell(nether_tempest)
 	if ManaPercent() >92 Spell(arcane_blast)
-	if BuffPresent(arcane_missiles_aura) and {SpellCooldown(alter_time_activate) >4 or target.DeadIn() <10 } Spell(arcane_missiles)
+	if BuffStacks(arcane_missiles_aura) and {SpellCooldown(alter_time_activate) >4 or target.DeadIn() <10 } Spell(arcane_missiles)
 	if BuffPresent(arcane_charge) and BuffExpires(arcane_power) and BuffExpires(alter_time) and target.DeadIn() >25 and {SpellCooldown(mana_gem) >10 or ItemCharges(36799) ==0 } Spell(arcane_barrage)
 	if BuffStacks(arcane_charge) >=4 and BuffExpires(arcane_missiles_aura) and target.DeadIn() >25 Spell(arcane_barrage)
 	Spell(arcane_blast)
@@ -147,9 +147,9 @@ AddIcon mastery=2 help=main
 		Spell(molten_armor)
 	}
 	if ItemCharges(36799) <3 and False() Spell(conjure_mana_gem)
-	if BuffPresent(pyroblast_aura) and {SpellCooldown(alter_time_activate) >4 or BuffPresent(heating_up) } Spell(pyroblast)
+	if BuffStacks(pyroblast_aura) and {SpellCooldown(alter_time_activate) >4 or BuffStacks(heating_up) } Spell(pyroblast)
 	if BuffPresent(presence_of_mind) and SpellCooldown(alter_time_activate) >4 Spell(pyroblast)
-	if BuffPresent(heating_up) and BuffExpires(pyroblast_aura) Spell(inferno_blast)
+	if BuffStacks(heating_up) and BuffExpires(pyroblast_aura) Spell(inferno_blast)
 	if not target.DebuffPresent(nether_tempest) Spell(nether_tempest)
 	Spell(fireball)
 }
@@ -161,7 +161,7 @@ AddIcon mastery=2 help=offgcd
 	if ArmorSetParts(T14 more 4) and target.DebuffPresent(ignite) and target.DebuffPresent(pyroblast_aura) Spell(combustion)
 	if not ArmorSetParts(T14 more 4) and LastSpellDamage(ignite) >=12000 and target.DebuffPresent(pyroblast_aura) Spell(combustion)
 	if ManaPercent() <84 and BuffExpires(alter_time) Spell(mana_gem)
-	if BuffExpires(alter_time) and BuffPresent(pyroblast_aura) and BuffRemains(invocation) >6 Spell(alter_time)
+	if BuffExpires(alter_time) and BuffStacks(pyroblast_aura) and BuffRemains(invocation) >6 Spell(alter_time)
 }
 AddIcon mastery=2 help=moving
 {
@@ -196,9 +196,9 @@ AddIcon mastery=3 help=main
 	if target.DeadIn() >=4 and BuffStacks(fingers_of_frost_aura) <2 and SpellCooldown(icy_veins) <GCD() and BuffRemains(invocation) >20 and BuffExpires(alter_time) Spell(frozen_orb)
 	if BuffPresent(fingers_of_frost_aura) and BuffRemains(fingers_of_frost_aura) <2 Spell(ice_lance)
 	if target.DebuffStacks(frostbolt) <3 Spell(frostbolt)
-	if BuffPresent(brain_freeze) and {BuffPresent(alter_time) or SpellCooldown(alter_time_activate) >4 } Spell(frostfire_bolt)
-	if BuffPresent(brain_freeze) and {BuffPresent(alter_time) or SpellCooldown(alter_time_activate) >4 } Spell(ice_lance)
-	if BuffPresent(fingers_of_frost_aura) Spell(ice_lance)
+	if BuffStacks(brain_freeze) and {BuffPresent(alter_time) or SpellCooldown(alter_time_activate) >4 } Spell(frostfire_bolt)
+	if BuffStacks(brain_freeze) and {BuffPresent(alter_time) or SpellCooldown(alter_time_activate) >4 } Spell(ice_lance)
+	if BuffStacks(fingers_of_frost_aura) Spell(ice_lance)
 	if target.DeadIn() >=4 and BuffStacks(fingers_of_frost_aura) <2 Spell(frozen_orb)
 	Spell(frostbolt)
 }
@@ -212,8 +212,8 @@ AddIcon mastery=3 help=offgcd
 	if target.HealthPercent() <25 or TimeInCombat() >5 Spell(time_warp)
 	if BuffExpires(alter_time) and BuffStacks(fingers_of_frost_aura) <2 Spell(water_elemental_freeze)
 	if not target.DebuffPresent(frost_bomb) Spell(frost_bomb)
-	if BuffExpires(alter_time) and BuffPresent(brain_freeze) and BuffPresent(fingers_of_frost_aura) and BuffRemains(invocation) >6 Spell(alter_time)
-	if BuffExpires(alter_time) and BuffPresent(brain_freeze) and BuffPresent(fingers_of_frost_aura) Spell(alter_time)
+	if BuffExpires(alter_time) and BuffStacks(brain_freeze) and BuffStacks(fingers_of_frost_aura) and BuffRemains(invocation) >6 Spell(alter_time)
+	if BuffExpires(alter_time) and BuffStacks(brain_freeze) and BuffStacks(fingers_of_frost_aura) Spell(alter_time)
 	if ManaPercent() <84 and BuffExpires(alter_time) Spell(mana_gem)
 }
 AddIcon mastery=3 help=moving
diff --git a/defaut/Moine.lua b/defaut/Moine.lua
index f960b66..4a56bd8 100644
--- a/defaut/Moine.lua
+++ b/defaut/Moine.lua
@@ -64,25 +64,25 @@ AddIcon mastery=3 help=main
 		if BuffStacks(tiger_power) <3 or BuffRemains(tiger_power) <=3 or {BuffRemains(tiger_power) <=6 and SpellCooldown(fists_of_fury) <=1 } Spell(tiger_palm)
 		Spell(rising_sun_kick)
 		if not BuffPresent(energizing_brew) and Energy() <=65 and BuffRemains(tiger_power) >=6.5 Spell(fists_of_fury)
-		if BuffPresent(combo_breaker_bok) Spell(blackout_kick)
-		if BuffPresent(combo_breaker_tp) and {Energy() <=90 or {BuffPresent(energizing_brew) and Energy() <=80 } or {BuffPresent(combo_breaker_tp) and BuffRemains(combo_breaker_tp) <=3 } } Spell(tiger_palm)
+		if BuffStacks(combo_breaker_bok) Spell(blackout_kick)
+		if BuffStacks(combo_breaker_tp) and {Energy() <=90 or {BuffPresent(energizing_brew) and Energy() <=80 } or {BuffPresent(combo_breaker_tp) and BuffRemains(combo_breaker_tp) <=3 } } Spell(tiger_palm)
 		if {Chi() <=2 and SpellCooldown(power_strikes) } or {Chi() <=1 and not SpellCooldown(power_strikes) } Spell(jab)
 		if {BuffPresent(energizing_brew) and Energy() >=20 } or Energy() >=30 Spell(blackout_kick)
 	}
 }
 AddIcon mastery=3 help=offgcd
 {
-	if TalentPoints(power_strikes_talent) and BuffPresent(chi_sphere) and Chi() <4 Spell(chi_sphere)
+	if TalentPoints(power_strikes_talent) and BuffStacks(chi_sphere) and Chi() <4 Spell(chi_sphere)
 	if Enemies() >5
 	{
-		if not BuffPresent(tigereye_brew_use) and BuffPresent(tigereye_brew) ==10 Spell(tigereye_brew_use)
-		if not BuffPresent(tigereye_brew_use) and {BuffPresent(tigereye_brew) >=7 and {SpellCooldown(energizing_brew) <=2 or BuffPresent(energizing_brew) } } Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and BuffStacks(tigereye_brew) ==10 Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and {BuffStacks(tigereye_brew) >=7 and {SpellCooldown(energizing_brew) <=2 or BuffPresent(energizing_brew) } } Spell(tigereye_brew_use)
 		if Energy() <=35 Spell(energizing_brew)
 	}

 	{
-		if not BuffPresent(tigereye_brew_use) and BuffPresent(tigereye_brew) ==10 Spell(tigereye_brew_use)
-		if not BuffPresent(tigereye_brew_use) and {BuffPresent(tigereye_brew) >=7 and {SpellCooldown(energizing_brew) <=2 or BuffPresent(energizing_brew) } } Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and BuffStacks(tigereye_brew) ==10 Spell(tigereye_brew_use)
+		if not BuffPresent(tigereye_brew_use) and {BuffStacks(tigereye_brew) >=7 and {SpellCooldown(energizing_brew) <=2 or BuffPresent(energizing_brew) } } Spell(tigereye_brew_use)
 		if not BuffPresent(tigereye_brew_use) and SpellCooldown(energizing_brew) >=45 and SpellCooldown(energizing_brew) <=48 Spell(tigereye_brew_use)
 		if Energy() <=35 Spell(energizing_brew)
 	}
diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index ce9f07d..65cd983 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -60,13 +60,13 @@ AddIcon mastery=3 help=main
 	if {not target.DebuffPresent(vampiric_touch) or target.DebuffRemains(vampiric_touch) <CastTime(vampiric_touch) +TickTime(vampiric_touch) } Spell(vampiric_touch)
 	if ShadowOrbs() ==3 Spell(devouring_plague)
 	Spell(halo_damage)
-	if BuffPresent(surge_of_darkness) Spell(mind_spike)
+	if BuffStacks(surge_of_darkness) Spell(mind_spike)
 	Spell(mind_flay)
 }
 AddIcon mastery=3 help=moving
 {
 	if target.HealthPercent(less 20) Spell(shadow_word_death)
-	if BuffPresent(divine_insight_shadow) and SpellCooldown(mind_blast) Spell(mind_blast)
+	if BuffStacks(divine_insight_shadow) and SpellCooldown(mind_blast) Spell(mind_blast)
 	Spell(shadow_word_pain)
 }
 AddIcon mastery=3 help=aoe
diff --git a/defaut/Voleur.lua b/defaut/Voleur.lua
index c45b61b..79b5b86 100644
--- a/defaut/Voleur.lua
+++ b/defaut/Voleur.lua
@@ -40,7 +40,7 @@ Define(preparation 14185)
   SpellInfo(preparation cd=300 )
 Define(revealing_strike 84617)
   SpellInfo(revealing_strike duration=18 energy=40 combo=1 )
-  SpellAddBuff(revealing_strike revealing_strike=1)
+  SpellAddTargetDebuff(revealing_strike revealing_strike=1)
 Define(rupture 1943)
   SpellInfo(rupture duration=4 combo=0 energy=25 )
   SpellAddTargetDebuff(rupture rupture=1)
@@ -51,7 +51,7 @@ Define(shadow_dance 51713)
   SpellInfo(shadow_dance duration=8 cd=60 )
   SpellAddBuff(shadow_dance shadow_dance=1)
 Define(sinister_strike 1752)
-  SpellInfo(sinister_strike energy=40 combo=0 )
+  SpellInfo(sinister_strike energy=40 combo=1 )
 Define(slice_and_dice 5171)
   SpellInfo(slice_and_dice duration=6 combo=0 energy=25 )
   SpellAddBuff(slice_and_dice slice_and_dice=1)
@@ -79,7 +79,7 @@ AddIcon mastery=1 help=main
 	if BuffRemains(slice_and_dice) <2 Spell(slice_and_dice)
 	if target.TicksRemain(rupture) <2 and Energy() >90 Spell(dispatch usable=1)
 	if target.TicksRemain(rupture) <2 and Energy() >90 Spell(mutilate)
-	if TicksRemain(rupture) <2 or {ComboPoints() ==5 and TicksRemain(rupture) <3 } Spell(rupture)
+	if target.TicksRemain(rupture) <2 or {ComboPoints() ==5 and target.TicksRemain(rupture) <3 } Spell(rupture)
 	if ComboPoints() >=4 and BuffRemains(envenom) <1 Spell(envenom)
 	if ComboPoints() >4 Spell(envenom)
 	if ComboPoints() >=2 and BuffRemains(slice_and_dice) <3 Spell(envenom)
@@ -101,7 +101,7 @@ AddIcon mastery=1 help=cd
 	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
 	Spell(berserking)
 	if TimeInCombat() >10 and not BuffPresent(stealthed) and not BuffPresent(shadow_blades) Spell(vanish)
-	if {BuffPresent(bloodlust) or TimeInCombat() >60 } and BuffRemains(slice_and_dice) >=12000 Spell(shadow_blades)
+	if {BuffStacks(bloodlust any=1) or TimeInCombat() >60 } and BuffRemains(slice_and_dice) >=12000 Spell(shadow_blades)
 	Spell(vendetta)
 }
 AddIcon mastery=2 help=main
@@ -112,10 +112,10 @@ AddIcon mastery=2 help=main
 	}
 	Spell(ambush usable=1)
 	if BuffRemains(slice_and_dice) <2 or {BuffRemains(slice_and_dice) <15 and BuffStacks(bandits_guile) ==11 and ComboPoints() >=4 } Spell(slice_and_dice)
-	if TicksRemain(rupture) <2 and ComboPoints() ==5 and BuffPresent(deep_insight) and target.DeadIn() >10 Spell(rupture)
+	if target.TicksRemain(rupture) <2 and ComboPoints() ==5 and BuffPresent(deep_insight) and target.DeadIn() >10 Spell(rupture)
 	if {ComboPoints() ==5 and BuffPresent(deep_insight) } or BuffStacks(anticipation) >=4 Spell(eviscerate)
-	if TicksRemain(rupture) <2 and ComboPoints() ==5 and target.DeadIn() >10 Spell(rupture)
-	if {{BuffExpires(deep_insight) and BuffStacks(anticipation) <5 } or {BuffPresent(deep_insight) and ComboPoints() <5 } } and TicksRemain(revealing_strike) <2 Spell(revealing_strike)
+	if target.TicksRemain(rupture) <2 and ComboPoints() ==5 and target.DeadIn() >10 Spell(rupture)
+	if {{BuffExpires(deep_insight) and BuffStacks(anticipation) <5 } or {BuffPresent(deep_insight) and ComboPoints() <5 } } and target.TicksRemain(revealing_strike) <2 Spell(revealing_strike)
 	if {BuffExpires(deep_insight) and BuffStacks(anticipation) <5 } or {BuffPresent(deep_insight) and ComboPoints() <5 } Spell(sinister_strike)
 }
 AddIcon mastery=2 help=offgcd
@@ -133,7 +133,7 @@ AddIcon mastery=2 help=cd
 	 { Item(Trinket0Slot usable=1) Item(Trinket1Slot usable=1) }
 	Spell(berserking)
 	if TimeInCombat() >10 and not BuffPresent(shadow_blades) and not BuffPresent(adrenaline_rush) and Energy() <20 and {{BuffPresent(deep_insight) and ComboPoints() <4 } or BuffStacks(anticipation) <4 } Spell(vanish)
-	if {BuffPresent(bloodlust) or TimeInCombat() >60 } and BuffRemains(slice_and_dice) >=12000 Spell(shadow_blades)
+	if {BuffStacks(bloodlust any=1) or TimeInCombat() >60 } and BuffRemains(slice_and_dice) >=12000 Spell(shadow_blades)
 	if Energy() <35 and BuffRemains(slice_and_dice) >4 and BuffExpires(adrenaline_rush) Spell(killing_spree)
 	if Energy() <35 or BuffPresent(shadow_blades) Spell(adrenaline_rush)
 }