# HG changeset patch # User contrebasse # Date 1294496231 -3600 # Node ID b59da9bd1df7a021d97413b34d78cdbf9fcbcb4d # Parent 64a266eaf0efb4a56e4fa25dbbcc4207d89a8a66 Aaaand back to whitelist again... diff -r 64a266eaf0ef -r b59da9bd1df7 Degaine.lua --- 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