comparison Degaine.lua @ 33:b59da9bd1df7

Aaaand back to whitelist again...
author contrebasse
date Sat, 08 Jan 2011 15:17:11 +0100
parents 64a266eaf0ef
children 6f99c7f30f15
comparison
equal deleted inserted replaced
32:64a266eaf0ef 33:b59da9bd1df7
31 local InCombatLockdown = InCombatLockdown 31 local InCombatLockdown = InCombatLockdown
32 local ToggleSheath = ToggleSheath 32 local ToggleSheath = ToggleSheath
33 local UnitName = UnitName 33 local UnitName = UnitName
34 local IsMounted = IsMounted 34 local IsMounted = IsMounted
35 local GetNumCompanions, GetCompanionInfo = GetNumCompanions, GetCompanionInfo 35 local GetNumCompanions, GetCompanionInfo = GetNumCompanions, GetCompanionInfo
36 local UnitCastingInfo = UnitCastingInfo
36 37
37 38
38 --------------------------------------------------------------- 39 ---------------------------------------------------------------
39 -- Local vars 40 -- Local vars
40 --------------------------------------------------------------- 41 ---------------------------------------------------------------
47 local t_left = -1 48 local t_left = -1
48 local isGossipClosed = true 49 local isGossipClosed = true
49 local wasGossipOpened = false 50 local wasGossipOpened = false
50 local t_lastGossipClosed = 0 51 local t_lastGossipClosed = 0
51 local wasMounted = IsMounted() -- handle mounts with UNIT_AURA 52 local wasMounted = IsMounted() -- handle mounts with UNIT_AURA
53 local isTradeSkill = false
52 54
53 55
54 --------------------------------------------------------------- 56 ---------------------------------------------------------------
55 -- Some stuff... 57 -- Some stuff...
56 --------------------------------------------------------------- 58 ---------------------------------------------------------------
112 } 114 }
113 local events1player = { -- the first arg is "player" 115 local events1player = { -- the first arg is "player"
114 UNIT_SPELLCAST_FAILED = true, 116 UNIT_SPELLCAST_FAILED = true,
115 UNIT_SPELLCAST_INTERRUPTED = true, 117 UNIT_SPELLCAST_INTERRUPTED = true,
116 UNIT_SPELLCAST_SUCCEEDED = true, 118 UNIT_SPELLCAST_SUCCEEDED = true,
119 UNIT_SPELLCAST_START = true, -- to ckeck tradeskill
117 } 120 }
118 local SpellWhiteList = { -- Spells that do steath weapons (works with events1player) 121 local SpellWhiteList = { -- Spells that do steath weapons (works with events1player)
119 -- Every recipe should be added... Automatically ? 122 -- True recipes are treated separately
120 [8690] = true, -- Heartstone 123 [8690] = true, -- Heartstone
121 [818] = true, -- Basic Campfire 124 [818] = true, -- Basic Campfire
125 [13262] = true, -- Disenchant
126 [51005] = true, -- Milling
127
128 -- Critters (exceptions)
129 [55068] = true, -- Mr Chilly
130
131 -- Mounts (exceptions)
132 [48778] = true, -- Acherus Deathcharger
133
122 } 134 }
123 135
124 local SpellBlackList = { -- spells that don't stealth weapons (works with events1player) 136 local SpellBlackList = { -- spells that don't stealth weapons (works with events1player)
125 -- All vanity pets should be added... Automatically ? 137 -- All vanity pets and mount are added at PLAYER_LOGIN
138
139 --
126 [1784] = true, -- Stealth (Rogue) 140 [1784] = true, -- Stealth (Rogue)
127 [58984] = true, -- Shadowmeld (Nightelf stealth) 141 [58984] = true, -- Shadowmeld (Nightelf stealth)
142
143 -- DK presences
144 [48263] = true, -- Blood
145 [48266] = true, -- Frost
146 [48265] = true, -- Unholy
147
148 [3714] = true, -- Path of Frost
149
128 150
129 -- Tradeskill spells 151 -- Tradeskill spells
130 [2259] = true, -- Alchemy 152 [2259] = true, -- Alchemy
131 [45357] = true, -- Inscription 153 [45357] = true, -- Inscription
132 [3908] = true, -- Tailoring 154 [3908] = true, -- Tailoring
252 if type(events[event])~="function" or events[event]() then 274 if type(events[event])~="function" or events[event]() then
253 start() 275 start()
254 end 276 end
255 elseif events1player[event] then 277 elseif events1player[event] then
256 if arg1=="player" then 278 if arg1=="player" then
257 --if arg5 and SpellWhiteList[arg5] then -- arg5 is SpellID 279 if event == "UNIT_SPELLCAST_START" then
258 if arg5 and not SpellBlackList[arg5] then -- arg5 is SpellID 280 --name, nameSubtext, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo("unit")
259 start() 281 isTradeSkill = select(7,UnitCastingInfo("player"))
282 --DEFAULT_CHAT_FRAME:AddMessage(name)
283 --DEFAULT_CHAT_FRAME:AddMessage(isTradeSkill and "True" or "False")
284 --if isTradeSkill then
285
286 --end
287 --elseif arg5 and not SpellBlackList[arg5] then -- arg5 is SpellID
288 elseif (arg5 and SpellWhiteList[arg5]) or isTradeSkill then -- arg5 is SpellID
289 isTradeSkill = false -- for next time
290 start(0.5)
260 end 291 end
261 end 292 end
262 elseif events2playername[event] then 293 elseif events2playername[event] then
263 if arg2==playername then 294 if arg2==playername then
264 start() 295 start()