Quantcast

- added Stealthed function

Sidoine De Wispelaere [01-09-10 - 14:46]
- added Stealthed function
- some tweaks to Shaman, Hunter, Priest, and Druid scripts

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@192 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
defaut/Chaman.lua
defaut/Chasseur.lua
defaut/Druide.lua
defaut/Pretre.lua
diff --git a/Condition.lua b/Condition.lua
index 5972f98..a7f5591 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -189,6 +189,33 @@ local function nilstring(text)
 	end
 end

+local function GetManaTime(mana, withBerserker)
+	local _,className = UnitClass("player")
+	if (className == "ROGUE" or (className == "DRUID" and GetShapeshiftForm(true) == 3)) then
+		local current = Ovale.state.mana
+		local rate= 10
+		if (className == "ROGUE") then
+			local rush = Ovale:GetSpellInfoOrNil(13750)
+			if UnitBuff("player", rush) then
+				rate = rate * 2
+			end
+		elseif withBerserker then
+			local berserk = Ovale:GetSpellInfoOrNil(50334)
+			if UnitBuff("player", berserk) then
+				mana = mana/2
+			end
+		end
+		local limit = math.ceil((mana - current) / rate + Ovale.currentTime)
+		return limit
+	else
+		if Ovale.state.mana>=mana then
+			return Ovale.currentTime
+		else
+			return nil
+		end
+	end
+end
+

 -- Recherche un aura sur la cible et récupère sa durée et le nombre de stacks
 -- return start, ending, stacks
@@ -415,6 +442,14 @@ Ovale.conditions=
 		local timeBefore = avecHate(condition[2], condition.haste)
 		return start, addTime(ending, -timeBefore)
 	end,
+	EffectiveMana = function(condition)
+		local limit = GetManaTime(condition[2], true)
+		if condition[1]=="more" then
+			return limit, nil
+		else
+			return 0,limit
+		end
+	end,
 	Glyph = function(condition)
 		local present = false
 		for i = 1, GetNumGlyphSockets() do
@@ -484,34 +519,12 @@ Ovale.conditions=
 	-- 1 : "less" or "more"
 	-- 2 : the mana/energy/rage... limit
 	Mana = function(condition)
-		if (condition[1] == "more") then
-			local _,className = UnitClass("player")
-			if (className == "ROGUE" or (className == "DRUID" and GetShapeshiftForm(true) == 3)) then
-				local current = Ovale.state.mana
-				if (current > condition[2]) then
-					if condition[1]=="more"  then
-						return 0
-					else
-						return nil
-					end
-				else
-					local rate= 10
-					if (className == "ROGUE") then
-						local rush = Ovale:GetSpellInfoOrNil(13750)
-						if UnitBuff("player", rush) then
-							rate = rate * 2
-						end
-					end
-					local limit = math.ceil((condition[2] - current) / rate + Ovale.maintenant)
-					if condition[1]=="more" then
-						return limit
-					else
-						return 0, limit
-					end
-				end
-			end
+		local limit = GetManaTime(condition[2], false)
+		if condition[1]=="more" then
+			return limit, nil
+		else
+			return 0,limit
 		end
-		return compare(Ovale.state.mana, condition[1], condition[2])
 	end,
 	ManaPercent = function(condition)
 		return compare(UnitPower("player")/UnitPowerMax("player"), condition[1], condition[2]/100)
@@ -616,6 +629,9 @@ Ovale.conditions=
 			return nil
 		end
 	end,
+	Stealthed = function(condition)
+		return testbool(IsStealthed(), condition[1])
+	end,
 	-- Test how many talent points has been spent in a talent
 	-- 1 : the talent identifier (use /script print(Ovale.talentNameToId["Talent name"]) to retreive)
 	-- 2 : "more" or "less"
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index 1f58a07..03f1945 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -19,11 +19,11 @@ Define(FERALSPIRIT 51533)
 Define(HEROISM 32182)
 Define(BLOODLUST 2825)
 Define(TALENTFLURRY 602)
+Define(FIRENOVA 1535)

 #Fire
 Define(TOTEMOFWRATH 30706)
 Define(FIREELEMENTALTOTEM 2894)
-Define(FIRENOVATOTEM 1535)
 Define(FLAMETONGTOTEM 8227)
 Define(FROSTRESISTANCETOTEM 8181)
 Define(MAGMATOTEM 8190)
@@ -44,24 +44,8 @@ Define(STRENGTHOFEARTHTOTEM 8075)
 Define(TREMORTOTEM 8143)

 AddCheckBox(aoe L(AOE))
-AddCheckBox(chain SpellName(CHAINLIGHTNING))
-AddListItem(fire wrath SpellName(TOTEMOFWRATH))
-AddListItem(fire nova SpellName(FIRENOVATOTEM))
-AddListItem(fire tong SpellName(FLAMETONGTOTEM))
-AddListItem(fire frost SpellName(FROSTRESISTANCETOTEM))
-AddListItem(fire magma SpellName(MAGMATOTEM) default)
-AddListItem(fire searing SpellName(SEARINGTOTEM))
-AddListItem(water clean SpellName(CLEANSINGTOTEM))
-AddListItem(water fire SpellName(FIRERESISTANCETOTEM))
-AddListItem(water heal SpellName(HEALINGSTREAMTOTEM))
-AddListItem(water mana SpellName(MANASPRINGTOTEM))
-AddListItem(air ground SpellName(GROUNDINGTOTEM))
-AddListItem(air nature SpellName(NATURERESISTANCETOTEM))
-AddListItem(air wind SpellName(WINDFURYTOTEM))
-AddListItem(air wrath SpellName(WRATHOFAIRTOTEM))
-AddListItem(earth stone SpellName(STONESKINTOTEM))
-AddListItem(earth strength SpellName(STRENGTHOFEARTHTOTEM))
-AddListItem(earth tremor SpellName(TREMORTOTEM))
+AddCheckBox(chain SpellName(CHAINLIGHTNING) default)
+AddCheckBox(firenova SpellName(MAGMATOTEM))

 SpellInfo(LAVABURST cd=8)
 SpellInfo(CHAINLIGHTNING cd=6)
@@ -76,6 +60,8 @@ SpellAddBuff(LIGHTNINGSHIELD LIGHTNINGSHIELD=600)
 SpellAddBuff(WATERSHIELD WATERSHIELD=600)
 SpellInfo(LAVALASH cd=6)
 SpellInfo(STORMSTRIKE cd=8)
+SpellInfo(FIRENOVA cd=10)
+SpellInfo(MAGMATOTEM cd=20)

 AddIcon help=main
 {
@@ -83,18 +69,19 @@ AddIcon help=main
 	{
 		if WeaponEnchantExpires(mainhand 2) Spell(FLAMETHONG)
 		if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD)
+		if CheckBoxOn(firenova)
+		{
+			if TotemExpires(fire) Spell(MAGMATOTEM)
+			unless TotemExpires(fire) Spell(FIRENOVA)
+			if ManaPercent(less 90) Spell(THUNDERSTORM)
+		}
+		if CheckBoxOn(aoe) Spell(CHAINLIGHTNING)
 		if TargetDebuffExpires(FLAMESHOCK 0 mine=1) Spell(FLAMESHOCK)
 		unless TargetDebuffExpires(FLAMESHOCK 1.6 haste=spell mine=1) Spell(LAVABURST)
-		if CheckBoxOn(aoe)
-			Spell(CHAINLIGHTNING)

-		if CheckBoxOn(chain)
-		{
-			unless 1.4s before Spell(LAVABURST) Spell(LIGHTNINGBOLT)
-
-			Spell(CHAINLIGHTNING)
-		}
-		if CheckBoxOff(chain) Spell(LIGHTNINGBOLT)
+		if CheckBoxOn(chain) and 1.4s before Spell(LAVABURST)
+				Spell(CHAINLIGHTNING)
+		Spell(LIGHTNINGBOLT)
 	}
 	if TalentPoints(TALENTFLURRY more 0)
 	{
@@ -106,7 +93,11 @@ AddIcon help=main
 		if TargetDebuffPresent(STORMSTRIKE) Spell(EARTHSHOCK)
 		Spell(STORMSTRIKE)
 		Spell(EARTHSHOCK)
-		if TotemExpires(fire) and List(fire magma) Spell(MAGMATOTEM)
+		if CheckBoxOn(firenova)
+		{
+			if TotemExpires(fire) Spell(MAGMATOTEM)
+			unless TotemExpires(fire) Spell(FIRENOVA)
+		}
 		if BuffExpires(LIGHTNINGSHIELD 0) Spell(LIGHTNINGSHIELD)
 		Spell(LAVALASH)
 		if CheckBoxOn(aoe) and BuffPresent(MAELSTROMWEAPON stacks=3) Spell(CHAINLIGHTNING priority=2)
@@ -137,36 +128,4 @@ AddIcon size=small
 	Spell(BLOODLUST)
 }

-AddIcon size=small nocd=1
-{
-	if TotemExpires(fire)
-	{
-		if List(fire wrath) Spell(TOTEMOFWRATH)
-		if List(fire nova) Spell(FIRENOVATOTEM)
-		if List(fire tong) Spell(FLAMETONGTOTEM)
-		if List(fire frost) Spell(FROSTRESISTANCETOTEM)
-		if List(fire magma) Spell(MAGMATOTEM)
-		if List(fire searing) Spell(SEARINGTOTEM)
-	}
-	if TotemExpires(water)
-	{
-		if List(water clean) Spell(CLEANSINGTOTEM)
-		if List(water fire) Spell(FIRERESISTANCETOTEM)
-		if List(water heal) Spell(HEALINGSTREAMTOTEM)
-		if List(water mana) Spell(MANASPRINGTOTEM)
-	}
-	if TotemExpires(air)
-	{
-		if List(air ground) Spell(GROUNDINGTOTEM)
-		if List(air nature) Spell(NATURERESISTANCETOTEM)
-		if List(air wind) Spell(WINDFURYTOTEM)
-		if List(air wrath) Spell(WRATHOFAIRTOTEM)
-	}
-	if TotemExpires(earth)
-	{
-		if List(earth stone) Spell(STONESKINTOTEM)
-		if List(earth strength) Spell(STRENGTHOFEARTHTOTEM)
-		if List(earth tremor) Spell(TREMORTOTEM)
-	}
-}
 ]]
\ No newline at end of file
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index 47f2d6b..be99ce6 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -13,10 +13,12 @@ Define(BESTIALWRATH 19574)
 Define(HUNTERSMARK 53338)
 Define(BLACKARROW 3674)
 Define(LOCKANDLOAD 56453)
-Define(TALENTEXPLOSIVESHOT 2145)
+Define(TALENTCHIMSHOT 2135)
+Define(TALENTEXPLOSHOT 2145)
 Define(CALLOFTHEWILD 53434)
 Define(CHIMERASHOT 53209)
 Define(READINESS 23989)
+Define(SILENCINGSHOT 34490)

 Define(TALENTTRACKING 1623)
 Define(TRACKBEASTS 1494)
@@ -49,17 +51,17 @@ AddIcon help=main
 	if TalentPoints(TALENTTRACKING more 0) and Tracking(TRACKBEASTS no) and Tracking(TRACKDEMONS no) and Tracking(TRACKDRAGONKIN no)
 			and Tracking(TRACKELEMENTALS no) and Tracking(TRACKGIANTS no) and Tracking(TRACKHUMANOIDS no) and Tracking(TRACKUNDEAD no)
 				Spell(TRACKBEASTS)
-	if TargetDebuffExpires(HUNTERSMARK 0) and TargetDeadIn(more 8) Spell(HUNTERSMARK)
+	if TargetDebuffExpires(HUNTERSMARK 0) and TargetDeadIn(more 15) Spell(HUNTERSMARK)
 	if TargetDebuffExpires(BLACKARROW 0 mine=1) Spell(BLACKARROW)
 	if TargetDebuffExpires(SERPENTSTING 0 mine=1) and TargetDeadIn(more 8) Spell(SERPENTSTING)
 	if TargetDebuffExpires(EXPLOSIVESHOT 0 mine=1) Spell(EXPLOSIVESHOT)
-	if TargetDebuffPresent(SERPENTSTING) Spell(CHIMERASHOT)
 	Spell(AIMEDSHOT)
+	if TargetDebuffPresent(SERPENTSTING) Spell(CHIMERASHOT)
 	if CheckBoxOn(multi) Spell(MULTISHOT)
-	unless TalentPoints(TALENTEXPLOSIVESHOT more 0) Spell(ARCANESHOT)
+	unless TalentPoints(TALENTEXPLOSHOT more 0) or TalentPoints(TALENTCHIMSHOT more 0) Spell(ARCANESHOT)
 	if TargetLifePercent(less 20) Spell(KILLSHOT)
-	if TargetDebuffExpires(HUNTERSMARK 2) Spell(HUNTERSMARK nored=1)
-	unless 1.5s before Spell(EXPLOSIVESHOT) Spell(STEADYSHOT)
+	if TargetDebuffExpires(HUNTERSMARK 2) and TargetDeadIn(more 20) Spell(HUNTERSMARK nored=1)
+	unless 1.5s before Spell(EXPLOSIVESHOT) or 0.25s before Spell(CHIMERASHOT) Spell(STEADYSHOT)
 }

 AddIcon help=cd
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index b0a8c4f..7f21581 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -84,39 +84,43 @@ AddIcon help=main

 	if Stance(3) # cat
 	{
-		if ComboPoints(more 0) and BuffExpires(SAVAGEROAR 2) Spell(SAVAGEROAR)
+		if ComboPoints(more 0) and BuffExpires(SAVAGEROAR 2) Spell(SAVAGEROAR priority=4)

 		if CheckBoxOn(lucioles) and	TargetDebuffExpires(FAERIEFERAL 2) and TargetDeadIn(more 15)
 			Spell(FAERIEFERAL)
-
-		unless BuffPresent(BERSERK) if Mana(less 40) Spell(TIGERSFURY)
-
-		if ComboPoints(more 0) and BuffExpires(SAVAGEROAR 1) Spell(SAVAGEROAR)
-
+
+		#De-synchronize Roar and Rip
+		if ComboPoints(more 2) and BuffExpires(SAVAGEROAR 6) and less than 6s between BuffExpires(ROAR) and TargetDebuffExpires(RIP mine=1 forceduration=22)
+		{
+			unless TargetDebuffExpires(RIP 6 mine=1) Spell(SAVAGEROAR priority=4)
+		}
+
+		#Extends Rip with shred if glyph
+		if Glyph(GLYPHOFRIP) and TargetDebuffPresent(RIP mine=1) and TargetDebuffExpires(RIP 4 mine=1) and Counter(ripshreds less 3) Spell(SHRED)
+
 		if ComboPoints(more 4)
 		{
-			if BuffExpires(SAVAGEROAR 6) and Mana(more 70) and TargetDebuffPresent(RIP 5 mine=1) Spell(SAVAGEROAR)
-			if TargetDebuffExpires(RIP 0 mine=1) and TargetDeadIn(more 6) Spell(RIP)
-
-			if Mana(more 34)
+			if TargetDeadIn(less 7) Spell(FEROCIOUSBITE priority=4)
+			if TargetDebuffExpires(RIP 0 mine=1) Spell(RIP priority=4)
+			if TargetDebuffPresent(RIP 10 mine=1) and BuffPresent(SAVAGEROAR 6)
 			{
-				unless BuffPresent(BERSERK) and {BuffExpires(SAVAGEROAR 8) or TargetDebuffExpires(RIP 10 mine=1)}
-					Spell(FEROCIOUSBITE)
-				if TargetDeadIn(less 7)
+				if BuffExpires(BERSERK 0) or {BuffPresent(BERSERK) and Mana(less 20)}
 					Spell(FEROCIOUSBITE)
 			}
 		}

 		if TargetDebuffExpires(MANGLECAT 0) and TargetDebuffExpires(MANGLEBEAR 0) and TargetDebuffExpires(TRAUMA 0) and CheckBoxOn(mangle)
 			Spell(MANGLECAT)
-		if TargetDebuffExpires(RAKE 0 mine=1) and Mana(more 34) and TargetDeadIn(more 10)
+		if TargetDebuffExpires(RAKE 0 mine=1) and TargetDeadIn(more 10)
 			Spell(RAKE)

 		if CheckBoxOn(shred)
 		{
-			if Mana(more 69) or BuffPresent(CLEARCASTING) or TargetDeadIn(less 10) or BuffPresent(BERSERK)
+			if Mana(more 69) Spell(SHRED priority=2)
+			if BuffPresent(CLEARCASTING) or TargetDeadIn(less 10) or BuffPresent(BERSERK)
 					Spell(SHRED)
 			if ComboPoints(less 5) and TargetDebuffExpires(RIP 3 mine=1) Spell(SHRED)
+			if ComboPoints(less 1) and BuffExpires(SAVAGEROAR 2) Spell(SHRED)
 		}
 	}

@@ -161,6 +165,7 @@ AddIcon help=cd
 	unless Stance(1) or Stance(3) Spell(STARFALL)
 	Spell(FORCEOFNATURE)
 	Spell(BERSERK)
+	unless BuffPresent(BERSERK) if Mana(less 40) Spell(TIGERSFURY)
 	Item(Trinket0Slot usable=1)
 	Item(Trinket1Slot usable=1)
 }
diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index be66904..5108e20 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -13,6 +13,8 @@ Define(IF 48168) # Inner Fire
 Define(Focus 14751) # Inner Focus
 Define(Dispersion 47585)
 Define(Shadowfiend 34433)
+Define(Bloodlust 2825)
+Define(Heroism 32182)

 AddCheckBox(multidot L(multidot))

@@ -46,6 +48,9 @@ unless BuffPresent(SF)
 # Refresh inner fire
 if BuffExpires(IF 60)
     Spell(IF)
+
+if BuffExpires(VE 60)
+	Spell(VE)

 #if inner focus is active, cast mind blast
 if BuffPresent(Focus)
@@ -61,12 +66,13 @@ if BuffPresent(SW stacks=5) and TargetDebuffExpires(SWP 0 mine=1) and TargetDead
 #Refresh VT
 unless CheckBoxOn(multidot) and OtherDebuffPresent(VT)
 {
-	if TargetDebuffExpires(VT 1.4 mine=1 haste=spell) and TargetDeadIn(more 8)
+	if TargetDebuffExpires(VT 1 mine=1 haste=spell) and TargetDeadIn(more 8)
 		Spell(VT)
 }

 #cast MB if up
-Spell(MB)
+unless BuffPresent(Heroism) or BuffPresent(Bloodlust)
+	Spell(MB)

 #Refresh devouring plague
 unless CheckBoxOn(multidot) and OtherDebuffPresent(DP)
@@ -104,7 +110,6 @@ if Mana(less 4000) and PetPresent(no)
 }

 # Add icons to monitor debuffs (will show up 5 secs before elapsed)
-AddIcon size=small nocd=1 {if TargetDebuffExpires(VE 1 mine=1) Spell(VE) } # Vampiric Embrace
 AddIcon size=small nocd=1 {if TargetDebuffExpires(VT 1.4 mine=1 haste=spell) Spell(VT) } # Vampiric Touch
 AddIcon size=small nocd=1 {if TargetDebuffExpires(SWP 1 mine=1) Spell(SWP) } # Shadow Word: Pain
 AddIcon size=small nocd=1 {if TargetDebuffExpires(DP 1 mine=1) Spell(DP) }