Quantcast

Add a new SpellInfo() parameter "if_spell=SPELL"

Johnny C. Lam [11-30-12 - 03:07]
Add a new SpellInfo() parameter "if_spell=SPELL"

Adding "if_spell=SPELL" causes the SpellInfo() line to be ignored
if the given SPELL isn't in the player's spellbook, e.g,:

  Define(mangle 33876)
    Spellinfo(mangle combo=1 energy=35 inccounter=ripshreds)
    SpellInfo(mangle critcombo=1 if_spell=primal_fury)
  Define(primal_fury 16961)

This causes the critcombo=1 to apply only if Primal Fury is in the
spellbook (druid is at least level 30).

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@648 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCompile.lua
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 11ef51c..cbe4ba3 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -96,6 +96,11 @@ local function TestConditions(paramList)
 			return false
 		end
 	end
+	if paramList.if_spell then
+		if not OvaleData.spellList[paramList.if_spell] then
+			return false
+		end
+	end
 	if paramList.talent and not HasTalent(paramList.talent) then
 		return false
 	end