Quantcast

Recount score bug fixes and added spells in default script

Sidoine De Wispelaere [10-10-10 - 11:14]
Recount score bug fixes and added spells in default script

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@266 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
defaut/Chaman.lua
defaut/Chasseur.lua
defaut/Chevalier.lua
defaut/Demoniste.lua
defaut/Druide.lua
defaut/Guerrier.lua
defaut/Mage.lua
defaut/Paladin.lua
defaut/Pretre.lua
defaut/Voleur.lua
diff --git a/Ovale.lua b/Ovale.lua
index 3f75e9d..cf71228 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -3,43 +3,72 @@
 Ovale = LibStub("AceAddon-3.0"):NewAddon("Ovale", "AceEvent-3.0", "AceConsole-3.0")
 local Recount = Recount

+--Default scripts (see "defaut" directory)
 Ovale.defaut = {}
-Ovale.action = {}
+--The table of check boxes definition
 Ovale.casesACocher = {}
+--key: spell name / value: action icon id
 Ovale.actionSort = {}
-Ovale.listeTalents = {}
+--key: talentId / value: points in this talent
 Ovale.pointsTalent = {}
+--key: talentId / value: talent name (not used)
 Ovale.talentIdToName = {}
+--key: talent name / value: talent id
 Ovale.talentNameToId = {}
+--allows to do some initialization the first time the addon is enabled
 Ovale.firstInit = false
-Ovale.Inferieur = 1
-Ovale.Superieur = 2
+--allows to fill the player talent tables on first use
 Ovale.listeTalentsRemplie = false
+--the frame with the icons
 Ovale.frame = nil
+--check boxes GUI items
 Ovale.checkBoxes = {}
+--drop down GUI items
 Ovale.dropDowns = {}
+--master nodes of the current script (one node for each icon)
 Ovale.masterNodes = nil
+--set it if there was a bug, traces will be enabled on next frame
 Ovale.bug = false
+--trace next script function calls
+Ovale.trace=false
+--in combat?
 Ovale.enCombat = false
+--current computed spell haste
 Ovale.spellHaste = 0
+--current computed melee haste TODO: why I don't use character sheet value anyway?
 Ovale.meleeHaste = 0
+--current auras
 Ovale.aura = { player = {}, target = {}}
+--allow to track the current target
 Ovale.targetGUID = nil
+--spell info from the current script
 Ovale.spellInfo = {}
-Ovale.spellStack = {}
+--track when a buff was applied (used for the old eclipse mechanism, maybe this could be removed?)
 Ovale.buff = {}
+--player class
 Ovale.className = nil
+--the state in the current frame
+--TODO: really, the simulator should be in its own class
 Ovale.state = {rune={}, cd = {}}
+--spells that count for scoring
 Ovale.scoreSpell = {}
+--tracks debuffs on the units that are not the current target
 Ovale.otherDebuffs = {}
+--score in current combat
 Ovale.score = 0
+--maximal theoric score in current combat
 Ovale.maxScore = 0
+--increased at each frame, allows to know if the aura was updated this frame
+--TODO: aura should be tracked using combat log events or something like that
+--and it should be in its own class
 Ovale.serial = 0
+--spell counter (see Counter function)
 Ovale.counter = {}
+--the spells that the player has casted but that did not reach their target
+--the result is computed by the simulator, allowing to ignore lag or missile travel time
 Ovale.lastSpell = {}

-Ovale.arbre = {}
-
+--Key bindings
 BINDING_HEADER_OVALE = "Ovale"
 BINDING_NAME_OVALE_CHECKBOX0 = L["Inverser la boîte à cocher "].."(1)"
 BINDING_NAME_OVALE_CHECKBOX1 = L["Inverser la boîte à cocher "].."(2)"
@@ -47,10 +76,7 @@ BINDING_NAME_OVALE_CHECKBOX2 = L["Inverser la boîte à cocher "].."(3)"
 BINDING_NAME_OVALE_CHECKBOX3 = L["Inverser la boîte à cocher "].."(4)"
 BINDING_NAME_OVALE_CHECKBOX4 = L["Inverser la boîte à cocher "].."(5)"

--- Ovale.trace=true
-local nouvelleCondition
-local nouveauSort
-
+--GUI option
 local options =
 {
 	type = "group",
@@ -260,8 +286,6 @@ local options =
 					set = function(info,v)
 						Ovale.db.profile.code = v
 						Ovale.needCompile = true
-						-- Ovale:UpdateFrame()
-						-- Ovale:Print("code change")
 					end,
 					width = "full"
 				}
@@ -391,7 +415,6 @@ function Ovale:FirstInit()
 	self:RemplirActionIndexes()
 	self:RemplirListeTalents()
 	self:ChercherNomsBuffs()
-	-- self:InitEcranOption()

 	local playerClass, englishClass = UnitClass("player")
 	self.className = englishClass
@@ -400,8 +423,6 @@ function Ovale:FirstInit()
 			self.state.rune[i] = {}
 		end
 	end
-	-- OvaleFrame_Update(OvaleFrame)
-	-- OvaleFrame:Show()

 	self:ChargerDefaut()

@@ -507,20 +528,25 @@ function Ovale:PLAYER_TALENT_UPDATE()
 --	self:Print("PLAYER_TALENT_UPDATE")
 end

+--The user learnt a new spell
 function Ovale:SPELLS_CHANGED()
 	-- self:RemplirActionIndexes()
 	-- self:RemplirListeTalents()
 	self.needCompile = true
 end

+--Called when the user changed his key bindings
 function Ovale:UPDATE_BINDINGS()
 	self:RemplirActionIndexes()
 end

+--Called for each combat log event
 function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 	local time, event, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
 	--self:Print("event="..event.." source="..nilstring(sourceName).." destName="..nilstring(destName).." " ..GetTime())
 	if sourceName == UnitName("player") then
+		--Called when a missile reached or missed its target
+		--Update lastSpell accordingly
 		if string.find(event, "SPELL_CAST_SUCCESS") == 1 or string.find(event, "SPELL_DAMAGE")==1
 				or string.find(event, "SPELL_MISSED") == 1
 				or string.find(event, "SPELL_CAST_FAILED") == 1 then
@@ -535,6 +561,7 @@ function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 			end
 		end
 		if self.otherDebuffsEnabled then
+			--Track debuffs on units that are not the current target
 			if string.find(event, "SPELL_AURA_") == 1 then
 				local spellId, spellName, spellSchool, auraType = select(9, ...)
 				if auraType == "DEBUFF" and self.spellInfo[spellName] and self.spellInfo[spellName].duration then
@@ -555,6 +582,7 @@ function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 	end
 	if self.otherDebuffsEnabled then
 		if event == "UNIT_DIED" then
+			--Remove any dead unit from otherDebuffs
 			for k,v in pairs(self.otherDebuffs) do
 				for j,w in pairs(v) do
 					if j==destGUID then
@@ -566,10 +594,16 @@ function Ovale:COMBAT_LOG_EVENT_UNFILTERED(event, ...)
 	end
 end

+--Called when the player target change
+--Used to update the visibility e.g. if the user chose
+--to hide Ovale if a friendly unit is targeted
 function Ovale:PLAYER_TARGET_CHANGED()
 	self:UpdateVisibility()
 end

+--Called when a new aura is added to an unit
+--At this time it is not used to keep the aura list (may be used in the future for optimization)
+--It is only used to update haste
 function Ovale:UNIT_AURA(event, unit)
 	if (unit == "player") then
 		local hateBase = GetCombatRatingBonus(18)
@@ -599,6 +633,8 @@ function Ovale:UNIT_AURA(event, unit)
 			self.buff[name].lastSeen = Ovale.maintenant
 			self.buff[name].present = true

+			--TODO: need to be updated to 4.0.0, altought I doubt computing haste is necessary
+			--because there is no longer any risk to clip DOTs
 			if (name == self.RETRIBUTION_AURA or name == self.MOONKIN_AURA) then
 				hateCommune = 3
 			elseif (name == self.WRATH_OF_AIR_TOTEM) then
@@ -628,18 +664,20 @@ function Ovale:UNIT_AURA(event, unit)
 	end
 end

+--Called when a glyph has been added
+--The script needs to be compiled
 function Ovale:GLYPH_ADDED(event)
-	-- self:Print("GLYPH_ADDED")
-	-- self:CompileAll()
 	self.needCompile = true
 end

+--Called when a glyph has been updated
+--The script needs to be compiled
 function Ovale:GLYPH_UPDATED(event)
-	-- self:Print("GLYPH_UPDATED")
-	-- self:CompileAll()
 	self.needCompile = true
 end

+--Called if the player interrupted early his cast
+--The spell is removed from the lastSpell table
 function Ovale:UNIT_SPELLCAST_INTERRUPTED(event, unit, name, rank)
 	if unit=="player" then
 		for i,v in ipairs(self.lastSpell) do
@@ -652,9 +690,11 @@ function Ovale:UNIT_SPELLCAST_INTERRUPTED(event, unit, name, rank)
 	end
 end

+--Called when a spell finished its cast
 function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target)
 	-- self:Print("UNIT_SPELLCAST_SENT"..event.." unit="..unit.." name="..name.." tank="..rank.." target="..target)
 	if unit=="player" then
+		--The spell is added to the lastSpell table
 		local newSpell = {}
 		newSpell.name = name
 		-- local spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo("player")
@@ -678,6 +718,7 @@ function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target)

 	if unit=="player" and self.enCombat then
 		if self.spellInfo[name] then
+			--Increase or reset the counter that is used by the Counter function
 			if self.spellInfo[name].resetcounter then
 				self.counter[self.spellInfo[name].resetcounter] = 0
 			end
@@ -690,6 +731,7 @@ function Ovale:UNIT_SPELLCAST_SENT(event,unit,name,rank,target)
 			end
 		end
 		if (not self.spellInfo[name] or not self.spellInfo[name].toggle) and self.scoreSpell[name] then
+			--Compute the player score
 			local scored = self.frame:GetScore(name)
 			if scored~=nil then
 				self.score = self.score + scored
@@ -868,12 +910,10 @@ end

 function Ovale:RemplirListeTalents()
 	local numTabs = GetNumTalentTabs();
-	self.listeTalents = {}
 	for t=1, numTabs do
 		local numTalents = GetNumTalents(t);
 		for i=1, numTalents do
 			local nameTalent, icon, tier, column, currRank, maxRank= GetTalentInfo(t,i);
-			self.listeTalents[nameTalent] = nameTalent
 			local link = GetTalentLink(t,i)
 			local a, b, talentId = string.find(link, "talent:(%d+)");
 			-- self:Print("talent = "..nameTalent.." id = ".. talentId)
@@ -1169,7 +1209,6 @@ function Ovale:InitCalculerMeilleureAction()
 	self.currentTime = Ovale.maintenant
 	self.currentSpellName = nil
 	self.attenteFinCast = Ovale.maintenant
-	self.spellStack.length = 0
 	self.state.combo = GetComboPoints("player")
 	self.state.mana = UnitPower("player")
 	self.state.eclipse = UnitPower("player", 8)
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index 683bd97..ceaf339 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -64,6 +64,9 @@ Define(STONESKINTOTEM 8071)
 Define(STRENGTHOFEARTHTOTEM 8075)
 Define(TREMORTOTEM 8143)

+ScoreSpells(LIGHTNINGSHIELD CHAINLIGHTNING FLAMESHOCK LAVABURST EARTHSHOCK LIGHTNINGBOLT
+			STORMSTRIKE LAVALASH)
+
 AddCheckBox(aoe L(AOE))
 AddCheckBox(chain SpellName(CHAINLIGHTNING) default mastery=1)

diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index 8f433f5..733ee7e 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -62,7 +62,9 @@ Define(TRACKHUMANOIDS 19883)
 Define(TRACKUNDEAD 19884)

 AddCheckBox(multi SpellName(MULTISHOT))
-ScoreSpells(HUNTERSMARK BLACKARROW SERPENTSTING CHIMERASHOT AIMEDSHOT MULTISHOT ARCANESHOT KILLSHOT STEADYSHOT)
+ScoreSpells(FOCUSFIRE KILLCOMMAND ARCANESHOT KILLSHOT STEADYSHOT SERPENTSTING
+			CHIMERASHOT AIMEDSHOT
+			BLACKARROW EXPLOSIVESHOT)

 AddIcon help=main mastery=1
 {
diff --git a/defaut/Chevalier.lua b/defaut/Chevalier.lua
index d0cf4f6..5924b72 100644
--- a/defaut/Chevalier.lua
+++ b/defaut/Chevalier.lua
@@ -73,6 +73,7 @@ Define(FROSTFEVER 59921)
 Define(KILLINGMACHINE 51124)

 AddCheckBox(rolldes SpellName(GLYPHDISEASE) default glyph=GLYPHDISEASE)
+AddCheckBox(horn SpellName(HORNOFWINTER))

 ScoreSpells(HOWLINGBLAST HEARTSTRIKE BLOODSTRIKE DEATHSTRIKE SCOURGESTRIKE OBLITERATE HEARTSTRIKE
 				PESTILENCE ICYTOUCH PLAGUESTRIKE FROSTSTRIKE DEATHCOIL)
@@ -81,7 +82,7 @@ AddIcon help=main mastery=1
 {
 	Spell(DANCINGRUNEWEAPON usable=1)

-	if BuffExpires(strengthagility 2) Spell(HORNOFWINTER)
+	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)

 	if CheckBoxOn(rolldes) and Glyph(GLYPHDISEASE)
 		and TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) and
@@ -100,12 +101,12 @@ AddIcon help=main mastery=1
 	if PetPresent(no) Spell(RAISEDEAD)
 	Spell(RUNESTRIKE usable=1)
 	if Mana(more 39) Spell(DEATHCOIL usable=1)
-	Spell(HORNOFWINTER priority=2)
+	if CheckBoxOn(horn) Spell(HORNOFWINTER priority=2)
 }

 AddIcon help=main mastery=2
 {
-	if BuffExpires(strengthagility 2) Spell(HORNOFWINTER)
+	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)

 	if CheckBoxOn(rolldes) and Glyph(GLYPHDISEASE)
 		and TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) and
@@ -128,7 +129,7 @@ AddIcon help=main mastery=2
 	if TargetDebuffExpires(BLOODPLAGUE 0 mine=1) and Runes(unholy 1) Spell(PLAGUESTRIKE)
 	Spell(FROSTSTRIKE usable=1)
 	if PetPresent(no) Spell(RAISEDEAD)
-	Spell(HORNOFWINTER priority=2)
+	if CheckBoxOn(horn) Spell(HORNOFWINTER priority=2)
 	unless Runes(frost 1) and Runes(unholy 1) Spell(BLOODTAP)
 	if Runes(blood 2 nodeath=1)
 	{
@@ -139,17 +140,16 @@ AddIcon help=main mastery=2

 AddIcon help=main mastery=3
 {
-	if BuffExpires(strengthagility 2) Spell(HORNOFWINTER)
+	if BuffExpires(strengthagility 2) and CheckBoxOn(horn) Spell(HORNOFWINTER)

 	if CheckBoxOn(rolldes) and Glyph(GLYPHDISEASE)
 		and TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1) and
 		{TargetDebuffExpires(FROSTFEVER 3 mine=1) or TargetDebuffExpires(BLOODPLAGUE 3 mine=1)}
 			Spell(PESTILENCE)

-			if TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1)
+	if TargetDebuffPresent(FROSTFEVER mine=1) and TargetDebuffPresent(BLOODPLAGUE mine=1)
 	{
-		if Runes(unholy 1) and Runes(frost 1)
-			Spell(SCOURGESTRIKE)
+		if Runes(unholy 1) Spell(SCOURGESTRIKE)
 		if Runes(unholy 1 nodeath=1) and Runes(frost 1 nodeath=1) Spell(OBLITERATE)
 		if Runes(blood 1) and {CheckBoxOff(rolldes) or Runes(blood 2)} Spell(BLOODSTRIKE)
 	}
@@ -159,7 +159,7 @@ AddIcon help=main mastery=3
 	if PetPresent(no) Spell(RAISEDEAD)
 	if Mana(more 39) Spell(DEATHCOIL usable=1)

-	Spell(HORNOFWINTER priority=2)
+	if CheckBoxOn(horn) Spell(HORNOFWINTER priority=2)
 	unless Runes(frost 1) and Runes(unholy 1) Spell(BLOODTAP)
 	if Runes(blood 2 nodeath=1)
 	{
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index f238327..2637dd2 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -64,7 +64,7 @@ AddListItem(bane agony SpellName(BANEOFAGONY))
 AddListItem(bane doom SpellName(BANEOFDOOM))
 AddListItem(bane havoc SpellName(BANEOFHAVOC))

-ScoreSpells(CURSEELEMENTS SHADOWBOLT HAUNT UNSTABLEAFFLICTION IMMOLATE CONFLAGRATE BANEOFDOOM CURSETONGUES CURSEWEAKNESS
+ScoreSpells(CURSEELEMENTS SHADOWBOLT HAUNT UNSTABLEAFFLICTION IMMOLATE CONFLAGRATE CURSEWEAKNESS
 	BANEOFAGONY CORRUPTION SOULFIRE DRAINSOUL INCINERATE SHADOWBOLT CHAOSBOLT)

 AddIcon help=main mastery=1
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 04ba82b..8c5fc7b 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -79,7 +79,8 @@ AddCheckBox(shred SpellName(SHRED) default mastery=2)

 ScoreSpells(FAERIEFERAL DEMOROAR MANGLEBEAR LACERATE SAVAGEROAR RIP
 		MANGLECAT RAKE SHRED FEROCIOUSBITE INSECTSWARM MOONFIRE
-		WRATH STARFIRE)
+		WRATH STARFIRE STARSURGE SUNFIRE PULVERIZE MAUL
+		CLAW)

 AddIcon help=main mastery=1
 {
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 1843cc8..660f4d6 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -83,7 +83,8 @@ AddListItem(shout none L(None))
 AddListItem(shout battle SpellName(BATTLESHOUT))
 AddListItem(shout command SpellName(COMMANDINGSHOUT))

-ScoreSpells(WHIRLWIND BLOODTHIRST SLAM REND MORTALSTRIKE EXECUTE SHIELDSLAM REVENGE)
+ScoreSpells(DEADLYCALM COLOSSUSSMASH RAGINGBLOW OVERPOWER VICTORYRUSH BLOODTHIRST SLAM REND MORTALSTRIKE EXECUTE SHIELDSLAM REVENGE
+				DEVASTATE)

 AddIcon help=main mastery=1
 {
diff --git a/defaut/Mage.lua b/defaut/Mage.lua
index e957958..ee12fcc 100644
--- a/defaut/Mage.lua
+++ b/defaut/Mage.lua
@@ -45,7 +45,8 @@ Define(FIRESTARTERTALENT 1849)
 AddCheckBox(scorch SpellName(SCORCH) default talent=TALENTIMPROVEDSCORSH)
 AddCheckBox(abarr SpellName(ARCANEBARRAGE) default talent=TALENTARCANEBARRAGE)

-ScoreSpells(SCORCH PYROBLAST LIVINGBOMB FROSTFIREBOLT FIREBALL SUMMONWATERELEMENTAL FROSTBOLT ARCANEBLAST ARCANEMISSILES)
+ScoreSpells(SCORCH PYROBLAST LIVINGBOMB FROSTFIREBOLT FIREBALL SUMMONWATERELEMENTAL FROSTBOLT ARCANEBLAST ARCANEMISSILES ARCANEBARRAGE
+			DEEPFREEZE ICELANCE)

 AddIcon help=main mastery=1
 {
diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index beb666f..04252a5 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -36,6 +36,9 @@ Define(ZEALOTRY 85696)
 #Buff
 Define(THEARTOFWAR 59578)

+ScoreSpells(SHIELDOFTHERIGHTEOUS JUDGEMENT AVENGERSSHIELD HAMMEROFTHERIGHTEOUS CONSECRATE HOLYWRATH
+	ZEALOTRY  INQUISITION TEMPLARSVERDICT DIVINESTORM EXORCISM HAMMEROFWRATH JUDGEMENT CRUSADERSTRIKE)
+
 AddCheckBox(aoe L(AOE))

 AddIcon help=main mastery=2
@@ -48,8 +51,8 @@ AddIcon help=main mastery=2
 	Spell(HAMMEROFTHERIGHTEOUS)
 	if CheckBoxOn(aoe)
 	{
-		Spell(CONSECRATE)
 		Spell(HOLYWRATH)
+		Spell(CONSECRATE)
 	}
 }

diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index adbe274..56b5d78 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -47,7 +47,6 @@ AddIcon help=main mastery=3
 		if BuffExpires(VAMPIRICEMBRACE 400)
 			Spell(VAMPIRICEMBRACE)
 	}
-

 	if TargetDebuffExpires(SHADOWWORDPAIN 2 mine=1) and TargetDeadIn(more 6) Spell(SHADOWWORDPAIN)
 	if TargetDebuffExpires(VAMPIRICTOUCH 3 mine=1 haste=spell) and TargetDeadIn(more 8) Spell(VAMPIRICTOUCH)
diff --git a/defaut/Voleur.lua b/defaut/Voleur.lua
index ce4def8..79841e2 100644
--- a/defaut/Voleur.lua
+++ b/defaut/Voleur.lua
@@ -1,40 +1,52 @@
 Ovale.defaut["ROGUE"] =
 [[
-Define(ENVENOM 32645)
-Define(TALENTVILEPOISONS 682)
-Define(TALENTCUTTOTHECHASE 2070)
-Define(SLICEANDDICE 5171)
-Define(RUPTURE 1943)
-Define(DEEPWOUNDS 12721)
-Define(GARROTE 703)
-Define(REND 772)
-Define(RIP 1079)
-Define(HUNGERFORBLOOD 51662)
-Define(EVISCERATE 2098)
-Define(MUTILATE 1329)
-Define(SINISTERSTRIKE 1752)
+#Abilities
 Define(ADRENALINERUSH 13750)
-Define(KILLINGSPREE 51690)
+	SpellInfo(ADRENALINERUSH cd=180)
+	SpellAddBuff(ADRENALINERUSH ADRENALINERUSH=15)
 Define(BLADEFLURRY 13877)
+	SpellAddBuff(BLADEFLURRY BLADEFLURRY=15 cd=30)
+Define(CLOACKOFSHADOWS 31224)
+	SpellInfo(CLOACKOFSHADOWS cd=90)
 Define(COLDBLOOD 14177)
+	SpellInfo(COLDBLOOD cd=120)
+Define(ENVENOM 32645)
+	SpellInfo(ENVENOM combo=-5)
+Define(EVISCERATE 2098)
+	SpellInfo(EVISCERATE combo=-5)
+Define(KILLINGSPREE 51690)
+	SpellInfo(KILLINGSPREE cd=120)
+	SpellAddBuff(KILLINGSPREE KILLINGSPREE=2)
+Define(GARROTE 703)
+	SpellAddTargetDebuff(GARROTE GARROTE=18)
+Define(MUTILATE 1329)
+	SpellInfo(MUTILATE combo=1)
 Define(PREPARATION 14185)
+	SpellInfo(PREPARATION cd=300)
+Define(RUPTURE 1943)
+	SpellInfo(RUPTURE combo=-5)
+	SpellAddTargetDebuff(RUPTURE RUPTURE=8)
+Define(SINISTERSTRIKE 1752)
+	SpellInfo(SINISTERSTRIKE combo=1)
+Define(SLICEANDDICE 5171)
+	SpellInfo(SLICEANDDICE combo=-5)
+	SpellAddBuff(SLICEANDDICE SLICEANDDICE=10)
 Define(TRICKSOFTHETRADE 57934)
-Define(CLOACKOFSHADOWS 31224)
+	SpellInfo(TRICKSOFTHETRADE cd=30)
+Define(VENDETTA 79140)
+	SpellInfo(VENDETTA cd=120)
+	SpellAddTargetDebuff(VENDETTA VENDETTA=30)
+
+#Talents
+Define(TALENTCUTTOTHECHASE 2070)

 ScoreSpells(SLICEANDDICE HUNGERFORBLOOD ENVENOM RUPTURE EVISCERATE MUTILATE SINISTERSTRIKE)

-AddIcon help=main
+AddIcon help=main mastery=1
 {
-	unless BuffPresent(SLICEANDDICE)
-	{
-		if ComboPoints(more 2)
-			Spell(SLICEANDDICE)
-	}
+	unless BuffPresent(SLICEANDDICE) if ComboPoints(more 0)	Spell(SLICEANDDICE)
+	if TargetDebuffExpires(VENDETTA) and TargetDeadIn(more 20) Spell(VENDETTA)

-	if {TargetDebuffPresent(RUPTURE) or TargetDebuffPresent(DEEPWOUNDS) or TargetDebuffPresent(REND)
-		or TargetDebuffPresent(RIP) or TargetDebuffPresent(GARROTE)} and BuffExpires(HUNGERFORBLOOD 2)
-		Spell(HUNGERFORBLOOD)
-
 	if ComboPoints(more 3) and Mana(more 69)
 	{
 		if BuffExpires(SLICEANDDICE 12)
@@ -43,20 +55,43 @@ AddIcon help=main
 				Spell(ENVENOM)
 			Spell(SLICEANDDICE)
 		}
-
 		if TargetDebuffExpires(RUPTURE 0) and TargetDeadIn(more 6)
 			Spell(RUPTURE)
+		Spell(ENVENOM)
+	}
+	if ComboPoints(less 4) Spell(MUTILATE)
+}
+
+AddIcon help=main mastery=2
+{
+	unless BuffPresent(SLICEANDDICE) if ComboPoints(more 0)	Spell(SLICEANDDICE)
+
+	if ComboPoints(more 3) and Mana(more 69)
+	{
+		if BuffExpires(SLICEANDDICE 12) Spell(SLICEANDDICE)

-		if TalentPoints(TALENTVILEPOISONS more 0)
-			Spell(ENVENOM)
+		if TargetDebuffExpires(RUPTURE 0) and TargetDeadIn(more 6)
+			Spell(RUPTURE)
 		Spell(EVISCERATE)
 	}

-	if ComboPoints(less 4)
+	if ComboPoints(less 4) Spell(SINISTERSTRIKE)
+}
+
+AddIcon help=main mastery=3
+{
+	unless BuffPresent(SLICEANDDICE) if ComboPoints(more 0)	Spell(SLICEANDDICE)
+
+	if ComboPoints(more 3) and Mana(more 69)
 	{
-		Spell(MUTILATE)
-		Spell(SINISTERSTRIKE)
-	}
+		if BuffExpires(SLICEANDDICE 12) Spell(SLICEANDDICE)
+
+		if TargetDebuffExpires(RUPTURE 0) and TargetDeadIn(more 6)
+			Spell(RUPTURE)
+		Spell(EVISCERATE)
+	}
+
+	if ComboPoints(less 4) Spell(SINISTERSTRIKE)
 }

 AddIcon help=cd
@@ -64,7 +99,7 @@ AddIcon help=cd
 	unless BuffPresent(KILLINGSPREE) Spell(ADRENALINERUSH)
 	unless BuffPresent(ADRENALINERUSH) Spell(KILLINGSPREE)
 	Spell(BLADEFLURRY)
-	Spell(COLDBLOOD)
+	if Mana(less 70) Spell(COLDBLOOD)
 	Item(Trinket0Slot usable=1)
 	Item(Trinket1Slot usable=1)
 	Spell(PREPARATION)