changeset 33:b59da9bd1df7

Aaaand back to whitelist again...
author contrebasse
date Sat, 08 Jan 2011 15:17:11 +0100
parents 64a266eaf0ef
children 6f99c7f30f15
files Degaine.lua
diffstat 1 files changed, 36 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Degaine.lua	Sat Jan 08 12:22:31 2011 +0100
+++ b/Degaine.lua	Sat Jan 08 15:17:11 2011 +0100
@@ -33,6 +33,7 @@
 local UnitName = UnitName
 local IsMounted = IsMounted
 local GetNumCompanions, GetCompanionInfo = GetNumCompanions, GetCompanionInfo
+local UnitCastingInfo = UnitCastingInfo
 
 
 ---------------------------------------------------------------
@@ -49,6 +50,7 @@
 local wasGossipOpened = false
 local t_lastGossipClosed = 0
 local wasMounted = IsMounted() -- handle mounts with UNIT_AURA
+local isTradeSkill = false
 
 
 ---------------------------------------------------------------
@@ -114,18 +116,38 @@
 	UNIT_SPELLCAST_FAILED = true,
 	UNIT_SPELLCAST_INTERRUPTED = true,
 	UNIT_SPELLCAST_SUCCEEDED = true,
+	UNIT_SPELLCAST_START = true, -- to ckeck tradeskill
 }
 local SpellWhiteList = { -- Spells that do steath weapons (works with events1player)
-	-- Every recipe should be added... Automatically ?
+	-- True recipes are treated separately
 	[8690] = true, -- Heartstone
 	[818] = true, -- Basic Campfire
+	[13262] = true, -- Disenchant
+	[51005] = true, -- Milling
+
+	-- Critters (exceptions)
+	[55068] = true, -- Mr Chilly
+
+	-- Mounts (exceptions)
+	[48778] = true, -- Acherus Deathcharger
+
 }
 
 local SpellBlackList = { -- spells that don't stealth weapons (works with events1player)
-	-- All vanity pets should be added... Automatically ?
+	-- All vanity pets and mount are added at PLAYER_LOGIN
+
+	--
 	[1784] = true,  -- Stealth (Rogue)
 	[58984] = true, -- Shadowmeld (Nightelf stealth)
 
+	-- DK presences
+	[48263] = true, -- Blood
+	[48266] = true, -- Frost
+	[48265] = true, -- Unholy
+
+	[3714] = true, -- Path of Frost
+
+
 	-- Tradeskill spells
 	[2259] = true,  -- Alchemy
 	[45357] = true, -- Inscription
@@ -254,9 +276,18 @@
 		end
 	elseif events1player[event] then
 		if arg1=="player" then
-			--if arg5 and SpellWhiteList[arg5] then -- arg5 is SpellID
-			if arg5 and not SpellBlackList[arg5] then -- arg5 is SpellID
-				start()
+			if event == "UNIT_SPELLCAST_START" then
+				--name, nameSubtext, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo("unit")
+				isTradeSkill = select(7,UnitCastingInfo("player"))
+				--DEFAULT_CHAT_FRAME:AddMessage(name)
+				--DEFAULT_CHAT_FRAME:AddMessage(isTradeSkill and "True" or "False")
+				--if isTradeSkill then
+
+				--end
+			--elseif arg5 and not SpellBlackList[arg5] then -- arg5 is SpellID
+			elseif (arg5 and SpellWhiteList[arg5]) or isTradeSkill then -- arg5 is SpellID
+				isTradeSkill = false -- for next time
+				start(0.5)
 			end
 		end
 	elseif events2playername[event] then