Quantcast

- localization

Sidoine De Wispelaere [01-18-09 - 20:37]
- localization
- better default scripts

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@5 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Locale-enUS.lua
Locale-frFR.lua
OvaleCompile.lua
defaut/Chaman.lua
defaut/Chasseur.lua
defaut/Demoniste.lua
defaut/Druide.lua
defaut/Guerrier.lua
defaut/Paladin.lua
defaut/Pretre.lua
diff --git a/Condition.lua b/Condition.lua
index 745752e..9155db4 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -136,6 +136,15 @@ Ovale.conditions=
 		local points = GetComboPoints("player")
 		return compare(points, condition[1], condition[2])
 	end,
+	HasShield = function(condition)
+		local _,_,id = string.find(GetInventoryItemLink("player",GetInventorySlotInfo("SecondaryHandSlot")) or "","(item:%d+:%d+:%d+:%d+)")
+		local _,_,_,_,_,_,_,_,itemLoc = GetItemInfo(id)
+		if (itemLoc=="INVTYPE_SHIELD") then
+			return 0
+		else
+			return nil
+		end
+	end,
 	-- Compare with the player level
 	-- 1 : "less" or "more"
 	-- 2 : the limit
diff --git a/Locale-enUS.lua b/Locale-enUS.lua
index 2d7b3b8..ecf0531 100644
--- a/Locale-enUS.lua
+++ b/Locale-enUS.lua
@@ -8,4 +8,8 @@ L["La hauteur des icônes"] = "The icon height"
 L["Afficher en combat uniquement"] = "Show in combat only"
 L["Code"] = "Code"
 L["Compiler"] = "Compile"
-L["BUGTEXT"] = "Sometimes the button won't highlight when you try to confirm changes and the text will scroll if you click. Please, put the cursor at the bottom of the text before accepting the changes."
\ No newline at end of file
+L["BUGTEXT"] = "Sometimes the button won't highlight when you try to confirm changes and the text will scroll if you click. Please, put the cursor at the bottom of the text before accepting the changes."
+L["AOE"] = "AOE"
+L["None"] = "None"
+L["Blood"] = true
+L["Melee"] = true
\ No newline at end of file
diff --git a/Locale-frFR.lua b/Locale-frFR.lua
index c486b4e..afa98bf 100644
--- a/Locale-frFR.lua
+++ b/Locale-frFR.lua
@@ -8,4 +8,8 @@ L["La hauteur des icônes"] = true
 L["Afficher en combat uniquement"] = true
 L["Code"] = true
 L["Compiler"] = true
-L["BUGTEXT"] = "Parfois passer la souris sur le bouton de confirmation en bas de la fenêtre ne l'éclairera pas et cliquer sélectionnera du texte. Placez d'abord le curseur en bas du texte avant de confirmer les changements."
\ No newline at end of file
+L["BUGTEXT"] = "Parfois passer la souris sur le bouton de confirmation en bas de la fenêtre ne l'éclairera pas et cliquer sélectionnera du texte. Placez d'abord le curseur en bas du texte avant de confirmer les changements."
+L["AOE"] = "Multicible"
+L["None"] = "Aucun"
+L["Blood"] = "Saignement"
+L["Melee"] = "Corps-à-corps"
\ No newline at end of file
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 2a20800..e284904 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -1,3 +1,5 @@
+local L = LibStub("AceLocale-3.0"):GetLocale("Ovale")
+
 local node={}
 local defines = {}

@@ -138,6 +140,21 @@ local function ParseCanStopChannelling(text)
 	else
 		Ovale:Print("CanStopChannelling with unknown spell "..text)
 	end
+	return ""
+end
+
+local function ParseSpellName(text)
+	local spell = Ovale:GetSpellInfoOrNil(text)
+	if (spell) then
+		return '"'..spell..'"'
+	else
+		Ovale:Print("SpellName of "..text.." unknown")
+		return nil
+	end
+end
+
+local function ParseL(text)
+	return '"'..L[text]..'"'
 end

 function Ovale:Compile(text)
@@ -157,11 +174,14 @@ function Ovale:Compile(text)
 		text = string.gsub(text, "([^%w])"..k.."([^%w])", "%1"..v.."%2")
 	end

+	-- Fonctions
+	text = string.gsub(text, "SpellName%s*%(%s*(%w+)%s*%)", ParseSpellName)
+	text = string.gsub(text, "L%s*%(%s*(%w+)%s*%)", ParseL)
+
 	-- Options diverses
 	Ovale.canStopChannelling = {}
 	text = string.gsub(text, "CanStopChannelling%s*%(%s*(%w+)%s*%)", ParseCanStopChannelling)
-
-
+
 	-- On vire les espaces en trop
 	text = string.gsub(text, "\n", " ")
 	text = string.gsub(text, "%s+", " ")
diff --git a/defaut/Chaman.lua b/defaut/Chaman.lua
index 5b31760..aa11db7 100644
--- a/defaut/Chaman.lua
+++ b/defaut/Chaman.lua
@@ -1,17 +1,41 @@
 Ovale.defaut["SHAMAN"] =
-[[AddCheckBox(chain "Chaîne d'éclairs")
-
+[[
 Define(CHAINLIGHTNING 421)
 Define(LIGHTNINGBOLT 403)
 Define(LAVABURST 51505)
 Define(WATERSHIELD 52127)
 Define(FLAMESHOCK 8050)
 Define(FLAMETHONG 8024)
+Define(EARTHSHOCK 8042)
+Define(STORMSTRIKE 17364)
+Define(LAVALASH 60103)
+Define(LIGHTNINGSHIELD 324)
+Define(MAELSTROMWEAPON 53817)
+
+AddCheckBox(chain SpellName(CHAINLIGHTNING))
+AddCheckBox(melee L(Melee))
+
+AddIcon
+{
+	unless CheckBoxOn(melee)
+	{
+		if BuffExpires(FLAMETHONG 2) Spell(FLAMETHONG)
+		if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD)
+		if TargetDebuffExpires(FLAMESHOCK 0) Spell(FLAMESHOCK)
+		Spell(LAVABURST doNotRepeat=1)
+		if CheckBoxOn(chain) Spell(CHAINLIGHTNING doNotRepeat=1)
+		Spell(LIGHTNINGBOLT)
+	}
+	if CheckBoxOn(melee)
+	{
+		if TargetDebuffExpires(FLAMESHOCK 0) Spell(FLAMESHOCK)
+		if TargetDebuffPresent(FLAMESHOCK) Spell(EARTHSHOCK)
+		if BuffExpires(LIGHTNINGSHIELD 0) Spell(LIGHTNINGSHIELD)
+		Spell(STORMSTRIKE)
+		Spell(LAVALASH)
+		if CheckBoxOn(chain) and BuffPresent(MAELSTROMWEAPON stacks=5) Spell(CHAINLIGHTNING doNotRepeat=1)
+		if BuffPresent(MAELSTROMWEAPON stacks=5) Spell(LIGHTNINGBOLT doNotRepeat=1)
+	}
+}

-if BuffExpires(FLAMETHONG 2) Spell(FLAMETHONG)
-if BuffExpires(WATERSHIELD 2) Spell(WATERSHIELD)
-if TargetDebuffExpires(FLAMESHOCK 0) Spell(FLAMESHOCK)
-Spell(LAVABURST doNotRepeat=1)
-if CheckBoxOn(chain) Spell(CHAINLIGHTNING doNotRepeat=1)
-Spell(LIGHTNINGBOLT)
 ]]
\ No newline at end of file
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index e69de29..f116855 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -0,0 +1,33 @@
+Ovale.defaut["HUNTER"] =
+[[
+Define(SERPENTSTING 1978)
+Define(ARCANESHOT 3044)
+Define(AIMEDSHOT 19434)
+Define(MULTISHOT 2643)
+Define(STEADYSHOT 56641)
+Define(EXPLOSIVESHOT 53301)
+Define(KILLSHOT 53351)
+Define(RAPIDFIRE 3045)
+Define(KILLCOMMAND 34026)
+Define(BESTIALWRATH 19574)
+
+AddCheckBox(multi SpellName(MULTISHOT))
+
+AddIcon
+{
+	if TargetDebuffExpires(SERPENTSTING 0) Spell(SERPENTSTING)
+	Spell(ARCANESHOT)
+	#Spell(AIMEDSHOT)
+	if CheckBoxOn(multi) Spell(MULTISHOT)
+	Spell(EXPLOSIVESHOT)
+	if TargetLifePercent(less 20) Spell(KILLSHOT)
+	Spell(STEADYSHOT)
+}
+
+AddIcon
+{
+	Spell(BESTIALWRATH usable=1)
+	Spell(KILLCOMMAND usable=1)
+	Spell(RAPIDFIRE)
+}
+]]
\ No newline at end of file
diff --git a/defaut/Demoniste.lua b/defaut/Demoniste.lua
index 7974f5e..3e2c968 100644
--- a/defaut/Demoniste.lua
+++ b/defaut/Demoniste.lua
@@ -1,11 +1,5 @@
 Ovale.defaut["WARLOCK"]=
-[[AddListItem(curse recklessness "Malédiction de témérité")
-AddListItem(curse elements "Malédiction des éléments")
-AddListItem(curse agony "Malédiction d'agonie")
-AddListItem(curse doom "Malédiction funeste")
-AddListItem(curse tongues "Malédiction des langages")
-AddListItem(curse weakness "Malédiction de faiblesse")
-
+[[
 Define(CURSERECKLESSNESS 704)
 Define(CURSEELEMENTS 1490)
 Define(CURSEAGONY 980)
@@ -26,22 +20,32 @@ Define(HAUNT 48181)
 Define(TALENTBACKDRAFT 1888)
 Define(CONFLAGRATE 17962)
 Define(DRAINSOUL 47855)
+Define(SHADOWEMBRACE 32391)
+Define(TALENTSHADOWEMBRACE 1763)
+
+AddListItem(curse recklessness SpellName(CURSERECKLESSNESS))
+AddListItem(curse elements SpellName(CURSEELEMENTS))
+AddListItem(curse agony SpellName(CURSEAGONY))
+AddListItem(curse doom SpellName(CURSEDOOM))
+AddListItem(curse tongues SpellName(CURSETONGUES))
+AddListItem(curse weakness SpellName(CURSEWEAKNESS))

 AddIcon
 {
+if TalentPoints(TALENTSHADOWEMBRACE more 0) and TargetDebuffExpires(SHADOWEMBRACE 0) Spell(SHADOWBOLT)
+if TargetDebuffExpires(HAUNT 1.5 mine=1) Spell(HAUNT doNotRepeat=1)
+if TargetDebuffExpires(UNSTABLEAFFLICTION 1.5 mine=1) Spell(UNSTABLEAFFLICTION doNotRepeat=1)
+if TalentPoints(TALENTBACKDRAFT more 0) and TargetDebuffExpires(IMMOLATE 3 mine=1)
+   and TargetDebuffPresent(IMMOLATE mine=1) Spell(CONFLAGRATE doNotRepeat=1)
+if TargetDebuffExpires(IMMOLATE 1.5 mine=1) and TargetLifePercent(more 25) Spell(IMMOLATE doNotRepeat=1)
 if List(curse recklessness) and TargetDebuffExpires(CURSERECKLESSNESS 2) Spell(CURSERECKLESSNESS)
 if List(curse elements) and TargetDebuffExpires(CURSEELEMENTS 2) Spell(CURSEELEMENTS)
 if List(curse doom) and TargetDebuffExpires(CURSEDOOM 0 mine=1) Spell(CURSEDOOM)
 if List(curse tongues) and TargetDebuffExpires(CURSETONGUES 2) Spell(CURSETONGUES)
 if List(curse weakness) and TargetDebuffExpires(CURSEWEAKNESS 2) Spell(CURSEWEAKNESS)
-if TargetDebuffExpires(HAUNT 1.5 mine=1) Spell(HAUNT doNotRepeat=1)
 if List(curse agony) and TargetDebuffExpires(CURSEAGONY 0 mine=1) Spell(CURSEAGONY)
-if TargetDebuffExpires(SHIPHONLIFE 0 mine=1) Spell(SHIPHONLIFE)
-if TargetDebuffExpires(UNSTABLEAFFLICTION 1.5 mine=1) Spell(UNSTABLEAFFLICTION doNotRepeat=1)
 if TargetDebuffExpires(CORRUPTION 0 mine=1) Spell(CORRUPTION)
-if TalentPoints(TALENTBACKDRAFT more 0) and TargetDebuffExpires(IMMOLATE 3 mine=1)
-   and TargetDebuffPresent(IMMOLATE mine=1) Spell(CONFLAGRATE doNotRepeat=1)
-if TargetDebuffExpires(IMMOLATE 1.5 mine=1) and TargetLifePercent(more 25) Spell(IMMOLATE doNotRepeat=1)
+if TargetDebuffExpires(SHIPHONLIFE 0 mine=1) Spell(SHIPHONLIFE)

 if TargetLifePercent(less 25) and Level(more 76) Spell(DRAINSOUL)

diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 8c8548a..c9ba67a 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -1,9 +1,5 @@
 Ovale.defaut["DRUID"] =
-[[AddCheckBox(multi "Multicible")
-AddCheckBox(blood "Saignement")
-AddCheckBox(demo "Rugissement démoralisant")
-AddCheckBox(lucioles "Lucioles")
-
+[[
 Define(FAERIEFIRE 770)
 Define(FAERIEFERAL 16857)
 Define(MANGLEBEAR 33878)
@@ -22,6 +18,11 @@ Define(ECLIPSESTARFIRE 48518)
 Define(ECLIPSEWRATH 48517)
 Define(TIGERSFURY 5217)

+AddCheckBox(multi L(AOE))
+AddCheckBox(blood L(Blood))
+AddCheckBox(demo SpellName(DEMOROAR))
+AddCheckBox(lucioles SpellName(FAERIEFIRE))
+
 AddIcon
 {
   if Stance(1)
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 3af89b9..dbe443b 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -1,11 +1,5 @@
 Ovale.defaut["WARRIOR"] =
-[[AddCheckBox(multi "Multicible")
-AddCheckBox(demo "Cri démoralisant")
-AddCheckBox(tourbillon "Tourbillon")
-AddListItem(cri aucun "Aucun cri")
-AddListItem(cri guerre "Cri de guerre")
-AddListItem(cri commandement "Cri de commandement")
-
+[[
 Define(THUNDERCLAP 6343)
 Define(SHOCKWAVE 46968)
 Define(DEMOSHOUT 1160)
@@ -29,13 +23,20 @@ Define(CONCUSSIONBLOW 12809)
 Define(REND 772)
 Define(OVERPOWER 7384)

+AddCheckBox(multi L(AOE))
+AddCheckBox(demo SpellName(DEMOSHOUT))
+AddCheckBox(whirlwind SpellName(WHIRLWIND))
+AddListItem(shout none L(None))
+AddListItem(shout battle SpellName(BATTLESHOUT))
+AddListItem(shout command SpellName(COMMANDSHOUT))
+
 AddIcon
 {
-     if List(cri commandement) and
+     if List(shout command) and
        BuffExpires(COMMANDSHOUT 3)
           Spell(COMMANDSHOUT)

-     if List(cri guerre) and BuffExpires(BATTLESHOUT 3)
+     if List(shout battle) and BuffExpires(BATTLESHOUT 3)
           Spell(BATTLESHOUT)

      if TargetClassification(worldboss)
@@ -68,12 +69,12 @@ AddIcon
        # if TargetLifePercent(less 20) Spell(EXECUTE)
         Spell(EXECUTE usable=1)

-        Spell(SHIELDSLAM usable=1)
+        if HasShield() Spell(SHIELDSLAM)
         Spell(SHOCKWAVE)
         Spell(CONCUSSIONBLOW)

         Spell(BLOODTHIRST)
-        if CheckBoxOn(tourbillon) Spell(WHIRLWIND)
+        if CheckBoxOn(whirlwind) Spell(WHIRLWIND)
         if BuffPresent(SLAMBUFF) Spell(SLAM)
         Spell(MORTALSTRIKE)
         Spell(DEVASTATE)
diff --git a/defaut/Paladin.lua b/defaut/Paladin.lua
index fdefc99..0988a0b 100644
--- a/defaut/Paladin.lua
+++ b/defaut/Paladin.lua
@@ -1,34 +1,58 @@
 Ovale.defaut["PALADIN"] =
-[[AddListItem(sceau piete "Sceau de piété")
-AddListItem(sceau autorite "Sceau d'autorité")
-AddListItem(sceau martyr "Sceau de martyr/sang")
-AddListItem(sceau vengeance "Sceau de vengeance/corruption")
-AddListItem(jugement lumiere "Jugement de lumière")
-AddListItem(jugement sagesse "Jugement de sagesse")
-AddCheckBox(consecration "Consécration")
-AddCheckBox(tempete "Tempête divine")
+[[
+Define(SEALRIGHTEOUSNESS 21084)
+Define(SEALCOMMAND 20375)
+Define(SEALBLOOD 31892)
+Define(SEALMARTYR 53720)
+Define(SEALVENGEANCE 31801)
+Define(SEALCORRUPTION 53736)
+Define(JUDGELIGHT 20271)
+Define(JUDGEWISDOM 53408)
+Define(CONSECRATE 26573)
+Define(DIVINESTORM 53385)
+Define(HAMMEROFWRATH 24275)
+Define(INQUISITION 35395)
+Define(HOLYSHOCK 20473)
+Define(THEARTOFWAR 59578)
+Define(FLASHOFLIGHT 19750)
+Define(EXORCISM 879)
+Define(AVENGINGWRATH 31884)
+
+AddListItem(sceau piete SpellName(SEALRIGHTEOUSNESS))
+AddListItem(sceau autorite SpellName(SEALCOMMAND))
+AddListItem(sceau martyr SpellName(SEALMARTYR))
+AddListItem(sceau vengeance SpellName(SEALVENGEANCE))
+AddListItem(jugement lumiere SpellName(JUDGELIGHT))
+AddListItem(jugement sagesse SpellName(JUDGEWISDOM))
+AddCheckBox(consecration SpellName(CONSECRATE))
+AddCheckBox(tempete SpellName(DIVINESTORM))

 AddIcon
 {
-     if List(sceau piete) and BuffExpires(21084 3) Spell(21084)
-     if List(sceau autorite) and BuffExpires(20375 3) Spell(20375)
+     if List(sceau piete) and BuffExpires(SEALRIGHTEOUSNESS 3) Spell(SEALRIGHTEOUSNESS)
+     if List(sceau autorite) and BuffExpires(SEALCOMMAND 3) Spell(SEALCOMMAND)
      if List(sceau martyr)
      {
-          if BuffExpires(53720 3) Spell(53720)
-          if BuffExpires(31892 3) Spell(31892)
+          if BuffExpires(SEALMARTYR 3) Spell(SEALMARTYR)
+          if BuffExpires(SEALBLOOD 3) Spell(SEALBLOOD)
      }
      if List(sceau vengeance)
      {
-          if BuffExpires(31801 3) Spell(31801)
-          if BuffExpires(53736 3) Spell(53736)
+          if BuffExpires(SEALVENGEANCE 3) Spell(SEALVENGEANCE)
+          if BuffExpires(SEALCORRUPTION 3) Spell(SEALCORRUPTION)
      }
-     if List(jugement lumiere) Spell(20271)
-     if List(jugement sagesse) Spell(53408)
-     if TargetLifePercent(less 35) Spell(24275)
-     Spell(35395) #Inquisition
-     if CheckBoxOn(tempete) Spell(53385)
-     if CheckBoxOn(consecration) Spell(26573)
-     Spell(20473) #Horion sacré
-     if BuffPresent(59578) Spell(19750 priority=2)
+     if List(jugement lumiere) Spell(JUDGELIGHT)
+     if List(jugement sagesse) Spell(JUDGEWISDOM)
+     if TargetLifePercent(less 35) Spell(HAMMEROFWRATH)
+     Spell(INQUISITION)
+     if CheckBoxOn(tempete) Spell(DIVINESTORM)
+     if CheckBoxOn(consecration) Spell(CONSECRATE)
+     Spell(HOLYSHOCK)
+     Spell(EXORCISM usable=1)
+     if BuffPresent(THEARTOFWAR) Spell(FLASHOFLIGHT priority=2)
+}
+AddIcon
+{
+     Spell(AVENGINGWRATH)
 }
 ]]
diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua
index 49c17d0..525b24d 100644
--- a/defaut/Pretre.lua
+++ b/defaut/Pretre.lua
@@ -1,7 +1,5 @@
 Ovale.defaut["PRIEST"] =
-[[AddCheckBox(etreinte "Étreinte vampirique")
-AddCheckBox(mort "Mot de l'ombre : Mort")
-
+[[
 Define(DEATH 32379)
 Define(FORTITUDE 1243)
 Define(PRAYERFORTITUDE 21562)
@@ -17,13 +15,14 @@ Define(SMITE 585)
 Define(DEVOURINGPLAGUE 2944)
 Define(SHADOWWEAVE 15332)

+AddCheckBox(etreinte SpellName(VAMPIRICEMBRACE))
+AddCheckBox(mort SpellName(DEATH))
+
 CanStopChannelling(MINDFLAY)

 AddIcon
 {
-     # Mot de pouvoir : Robustesse
      if BuffExpires(FORTITUDE 5) and BuffExpires(PRAYERFORTITUDE 5) Spell(FORTITUDE)
-     # Forme d'ombre
      if BuffExpires(SHADOWFORM 0) Spell(SHADOWFORM)

      if CheckBoxOn(etreinte) and TargetDebuffExpires(VAMPIRICEMBRACE 0 mine=1)