· 8 years ago · Aug 17, 2018, 11:28 PM
1Printd("SM_extend.lua loaded OK!")
2MB_autodelete=false
3MB_tanklist={"Goodbeef","Chaylax","Vasu","Tankchay","Iamthedanger","Empada","Crymeariver"}
4MB_healer_priority= {"Holyhertha","Chaylex","Chaylixx","Shizzer","Syphia","Evilemil","Sspikeyy","Hqn","Sunchi"}
5MB_toonlist = { "Chaylen","Chaylixx","Chaylox","Chaylux","Holyhertha","Chayfin","Chaylex","Goodbeef","Syphia","Promagez","Shizzer","Mbfive","Mbone","Mbtwo","Maleek","Ulixxes","Laana","Evilemil","Anatomic","Chaylax","Mouxlas","Latella","Parisienne","Memphis","Karzinom","Wuups","Tankchay","Orgasmoo","Sspikeyy","Iamthedanger","Empada","Hqn","Sunchi","Fallenstar","Prowarriorz","Leeka","Littlelaana","Aylar","Hunterotto","arcfirefrost"}
6MB_followlist = { "Testshamenh", "Cashme"}
7function FindInTable(table,string)
8 if not table then return end
9 for i,v in table do
10 if v==string then return i end
11 end
12 return nil
13end
14function IsAlive(id)
15 if not id then return end
16 if UnitName(id) and (not UnitIsDead(id) and not UnitIsGhost(id) and UnitIsConnected(id)) then return true end
17end
18function RaidID(qname)
19 --Print("RaidID qname == ")
20 --Print(qname)
21--Very useful function that returns the UnitId (raid1, raid4,raidpet4, etc) of the named toon.
22 if not UnitInRaid("player") then return PartyID(qname) end
23 --if not UnitInRaid("player") then Print("Not in raid, calling PartyID") return PartyID(qname) end
24 for i=1,GetNumRaidMembers() do
25 --Print("checking raid"..i)
26 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
27 --Print("checking name "..name)
28 if name==qname then return "raid"..i end
29 end
30end
31function PartyID(qname)
32--Very useful function that returns the UnitId (party1, party4,partypet4, etc) of the named toon.
33 if qname==UnitName("player") then return "player" end
34 for i=1,GetNumPartyMembers() do
35 local name=UnitName("party"..i)
36 if name==qname then return "party"..i end
37 end
38end
39
40MB_My_cc_target=nil
41MB_My_heal_target=nil
42MB_My_ot_target={}
43MB_dedicated_healers={}
44MB_raid_damage={}
45MB_prev_reagent_count={}
46MB_tradeopen=false
47MB_last_buff=""
48MB_last_target=""
49MB_my_lock_pet=nil
50MB_bestmagewater={}
51MB_mywater={[4]="Conjured Water",[10]="Conjured Fresh Water",[20]="Conjured Purified Water",[30]="Conjured Spring Water",[40]="Conjured Mineral Water",[50]="Conjured Sparkling Water",[60]="Conjured Crystal Water"}
52MB_raidtargetnames={[8]="Skull",[7]="Cross",[6]="Square",[5]="Moon",[4]="Triangle",[3]="Diamond",[2]="Condom",[1]="Star"}
53MB_dher={Cuppycake="berber",Raigore="Shamanseis",Raigore="Orinoco",Eversmile="foobar",Komal="Avindra",Furyswipes="Bubbling",Mootalia="Zumwalt"}
54MB_dedicated_targets={Shamanseis="Raigore",Orinoco="Raigore",berber="Cuppycake",foobar="Eversmile",Bubbling="Furyswipes",Avindra="Komal",Zumwalt="Mootalia"}
55MB_dedicated_healers={}
56MB_manacost={["Mark of the Wild"]=60,["Power Word: Fortitude"]=60,["Arcane Intellect"]=60,["Dampen Magic"]=500,["Amplify Magic"]=450,["Prayer of Fortitude"]=3400,["Prayer of Spirit"]=1940,["Gift of the Wild"]=1200,["Prayer of Shadow Protection"]=1300,["Arcane Brilliance"]=3230}
57MB_reagent={["Prayer of Fortitude"]="Sacred Candle",["Prayer of Spirit"]="Sacred Candle",["Gift of the Wild"]="Wild Thornroot",["Prayer of Shadow Protection"]="Sacred Candle",["Arcane Brilliance"]="Arcane Powder"}
58MB_cc_current={Mage=0,Warlock=0,Priest=0,Druid=0}
59MB_slotmap={ [0]="ammo",[1]="head",[2]="neck",[3]="shoulder",[4]="shirt",[5]="chest",[6]="waist",[7]="legs",[8]="feet",[9]="wrist",[10]="hands",[11]="finger 1",[12]="finger 2",[13]="trinket 1",[14]="trinket 2",[15]="back",[16]="main hand",[17]="off hand",[18]="ranged",[19]="tabard"}
60MB_fear_current={Warlock=0,Hunter=0}
61MB_currentraidtarget=1
62MB_ots={}
63for k,tank in pairs(MB_tanklist) do
64 local name, realm=UnitName("player")
65 if IsAlive(RaidID(tank)) and tank~=name then
66 table.insert(MB_ots,tank)
67 table.insert(MB_dedicated_healers,MB_dher[tank])
68 end
69end
70MB_ot_index=1
71MB_tankmsgtimeout=GetTime()
72MB_shmsgtimeout=GetTime()
73MB_chumpmsgtimeout=GetTime()
74MB_tauntmsgtimeout=GetTime()
75MB_classlist={"warrior","mage","shaman","paladin","priest","rogue","druid","hunter","warlock"}
76MB_msgcd=GetTime()
77MB_prev_msg=""
78MB_CC_spell={Priest="Shackle Undead",Mage="Polymorph",Warlock="Banish",Druid="Hibernate"}
79MB_Fear_spell={Warlock="Fear",Hunter="Scare Beast"}
80MB_cooldowns={}
81--Add pallys to this resurrect spell list if needed
82MB_rez_spells = { Paladin="Redemption",Priest="Resurrection", Shaman="Ancestral Spirit" }
83--This is a critical table--it is a list of who heals each of the top "n" damaged players, where "n" is the number of available healers
84MB_party_healer_list = {}
85MB_levelingparties= { Central={"Kilimanjaro", "Healuraz", "Jyssyj", "Skankia"},
86Bubbleplanet={ "Bubblemad", "Holybabe", "Bubblemama", "Bubblebrave"},
87Bubblemania={ "Bubblesong", "Bubblewin", "Bubblenator", "Bubblefame"},
88Bubblebootie={ "Bubblefail", "Bubblescum", "Zombiewife", "Bridesmage"}
89}
90--This is for future use--it should be populated with every spellname equal to GetTime() at initialization
91--It will be used to force cooldowns on certain spells with no cooldown that you don't want to spam
92MB_cooldown_cast={}
93MB_totem_table = {
94 air_totems = {"Grace of Air Totem","Nature Resistance Totem","Windwall Totem","Windfury Totem"},
95 earth_totems= { "Stoneskin Totem","Strength of Earth Totem","Earthbind Totem"},
96 fire_totems= {"Flametongue Totem","Fire Nova Totem","Magma Totem","Searing Totem","Frost Resistance Totem","Tremor Totem" } ,
97 water_totems={ "Mana Spring Totem","Fire Resistance Totem","Healing Stream Totem" }
98 }
99--This table is a list of all toons you might want to bubble with a priest. Probably should get rid of
100--
101--NON-CLASS-SPECIFIC and HOUSEKEEPING FUNCTIONS FOLLOW HERE
102--SOME CLASS-SPECIFIC HELPER SUB-FUNCTIONS HERE
103--
104function clearmacros()
105 MB_macronamestodelete={"init","buff","multi","aoe","turbo","single","fearbreak","int","cc","party","clearot","cleartargs","sortraid","preheal","sheep","ot","clean","foc","leave","reload","feign","focus","resetinst","hearth","dance","pent","line","rezemall","smartdrink","void","imp","succ","felhunt","tos","wall"}
106 for k,macname in pairs(MB_macronamestodelete) do
107 while (GetMacroIndexByName(macname))>0 do
108 local index=GetMacroIndexByName(macname)
109 DeleteMacro(index)
110 end
111 end
112end
113function printmacnames()
114 local gen,toon=GetNumMacros()
115 for k=1,gen do
116 local name=GetMacroInfo(k)
117 Print(k..": "..name)
118 end
119 for k=19,toon+18 do
120 name=GetMacroInfo(k)
121 Print(k..": "..name)
122 end
123end
124function init()
125--Run this function with /init to create all macros and keybinds!
126--MAAAAAGIC!!!!
127 clearmacros()
128 local class=UnitClass("player")
129 SetActionBarToggles(1,1,1,1,1)
130 SHOW_MULTI_ACTIONBAR_1=1
131 SHOW_MULTI_ACTIONBAR_2=1
132 SHOW_MULTI_ACTIONBAR_3=1
133 SHOW_MULTI_ACTIONBAR_4=1
134 ALWAYS_SHOW_MULTI_ACTIONBAR=1
135 MultiActionBar_Update()
136 local index=CreateMacro("init",188,"/script init()",1,nil)
137-- CREATE INITIAL MACRO
138PickupMacro(index)
139PlaceAction(12)
140PickupMacro(index)
141PlaceAction(84)
142PickupMacro(index)
143PlaceAction(96)
144PickupMacro(index)
145PlaceAction(108)
146PickupMacro(index)
147PlaceAction(120)
148 local index=CreateMacro("buff",327,"/script setup()",1,1)
149 PickupMacro(index)
150 PlaceAction(1)
151 PickupMacro(index)
152 PlaceAction(73)
153 PickupMacro(index)
154 PlaceAction(85)
155 PickupMacro(index)
156 PlaceAction(97)
157 PickupMacro(index)
158 PlaceAction(109)
159 index=CreateMacro("single",134,"/script single()",1,1)
160 PickupMacro(index)
161 PlaceAction(2)
162 PickupMacro(index)
163 PlaceAction(74)
164 PickupMacro(index)
165 PlaceAction(86)
166 PickupMacro(index)
167 PlaceAction(98)
168 PickupMacro(index)
169 PlaceAction(110)
170 index=CreateMacro("multi",149,"/script multi()",1,1)
171 PickupMacro(index)
172 PlaceAction(3)
173 PickupMacro(index)
174 PlaceAction(75)
175 PickupMacro(index)
176 PlaceAction(87)
177 PickupMacro(index)
178 PlaceAction(99)
179 PickupMacro(index)
180 PlaceAction(111)
181 index=CreateMacro("turbo",291,"/script turbo()",1,1)
182 PickupMacro(index)
183 PlaceAction(4)
184 PickupMacro(index)
185 PlaceAction(76)
186 PickupMacro(index)
187 PlaceAction(88)
188 PickupMacro(index)
189 PlaceAction(100)
190 PickupMacro(index)
191 PlaceAction(112)
192 index=CreateMacro("aoe",210,"/script aoe()",1,1)
193 PickupMacro(index)
194 PlaceAction(5)
195 PickupMacro(index)
196 PlaceAction(77)
197 PickupMacro(index)
198 PlaceAction(89)
199 PickupMacro(index)
200 PlaceAction(101)
201 PickupMacro(index)
202 PlaceAction(113)
203 index=CreateMacro("reload",239,"/script ReloadUI()",1,nil)
204 PickupMacro(index)
205 PlaceAction(36)
206 index=CreateMacro("resetinst",482,"/script ResetInstances()",1,nil)
207 PickupMacro(index)
208 PlaceAction(35)
209 index=CreateMacro("hearth",352,"/use hearthstone\r/script Stuck()",1,nil)
210 PickupMacro(index)
211 PlaceAction(34)
212 index=CreateMacro("leave",398,"/script LeaveParty()",1,nil)
213 PickupMacro(index)
214 PlaceAction(48)
215 index=CreateMacro("foc",9,"/tarfocus",1,nil)
216 PickupMacro(index)
217 PlaceAction(47)
218 index=CreateMacro("dance",24,"/dance",1,nil)
219 PickupMacro(index)
220 PlaceAction(46)
221 index=CreateMacro("void",510,"/script SetLockPet(\"Voidwalker\")",1,nil)
222 PickupMacro(index)
223 PlaceAction(45)
224 index=CreateMacro("imp",507,"/script SetLockPet(\"Imp\")",1,nil)
225 PickupMacro(index)
226 PlaceAction(44)
227 index=CreateMacro("succ",509,"/script SetLockPet(\"Succubus\")",1,nil)
228 PickupMacro(index)
229 PlaceAction(43)
230 index=CreateMacro("felhunt",506,"/script SetLockPet(\"Felhunter\")",1,1)
231 PickupMacro(index)
232 PlaceAction(42)
233 index=CreateMacro("tos",486,"/script SetLockPet(nil)",1,1)
234 PickupMacro(index)
235 PlaceAction(41)
236 index=CreateMacro("fearbreak",489,"/script fearbreak()",1,1)
237 PickupMacro(index)
238 PlaceAction(62)
239 index=CreateMacro("int",25,"/script interrupt_boss()",1,1)
240 PickupMacro(index)
241 PlaceAction(63)
242 PickupAction(51)
243 ClearCursor()
244 if class=="Warlock" or class=="Mage" or class=="Priest" or class=="Druid" then
245 index=CreateMacro("sheep",394,"/script CC()",1,1)
246 PickupMacro(index)
247 PlaceAction(51)
248 end
249 PickupAction(8)
250 ClearCursor()
251 PickupAction(80)
252 ClearCursor()
253 PickupAction(92)
254 ClearCursor()
255 PickupAction(104)
256 ClearCursor()
257 PickupAction(116)
258 ClearCursor()
259 if class=="Shaman" or class=="Priest" or class=="Druid" then
260 index=CreateMacro("rezemall",303,"/script rezemall()",1,1)
261 PickupMacro(index)
262 PlaceAction(8)
263 PickupMacro(index)
264 PlaceAction(80)
265 PickupMacro(index)
266 PlaceAction(92)
267 PickupMacro(index)
268 PlaceAction(104)
269 PickupMacro(index)
270 PlaceAction(116)
271 end
272 if class=="Priest" or class=="Druid" then
273 index=CreateMacro("preheal",292,"/script preheal_tanks()",1,1)
274 PickupAction(50)
275 ClearCursor()
276 PickupMacro(index)
277 PlaceAction(50)
278 end
279 index=CreateMacro("cc",395,"/script MB_assign_cc()",1,1)
280 PickupAction(49)
281 ClearCursor()
282 PickupMacro(index)
283 PlaceAction(49)
284 index=CreateMacro("ot",98,"/script MB_assign_ot()",1,nil)
285 PickupMacro(index)
286 PlaceAction(52)
287 index=CreateMacro("smartdrink",339,"/script smartdrink()",1,1)
288 PickupMacro(index)
289 PlaceAction(53)
290 index=CreateMacro("line",294,"/script MakeALine()",1,nil)
291 PickupMacro(index)
292 PlaceAction(60)
293 PickupAction(59)
294 ClearCursor()
295 index=CreateMacro("pent",366,"/script Pentagram()",1,nil)
296 PickupMacro(index)
297 PlaceAction(59)
298 index=CreateMacro("clearot",133,"/script MB_clearraidtarget()",1,nil)
299 PickupMacro(index)
300 PlaceAction(54)
301 index=CreateMacro("cleartargs",138,"/script clearraidtargs()",1,nil)
302 PickupMacro(index)
303 PlaceAction(55)
304 index=CreateMacro("focus",1,"/script focusme()",1,1)
305 PickupMacro(index)
306 PlaceAction(58)
307 index=CreateMacro("sortraid",63,"/script SortRaid()",1,1)
308 PickupMacro(index)
309 PlaceAction(11)
310 PickupMacro(index)
311 PlaceAction(83)
312 PickupMacro(index)
313 PlaceAction(95)
314 PickupMacro(index)
315 PlaceAction(108)
316 PickupMacro(index)
317 PlaceAction(119)
318 index=CreateMacro("party",320,"/script partyup()",1,nil)
319 PickupMacro(index)
320 PlaceAction(10)
321 PickupMacro(index)
322 PlaceAction(82)
323 PickupMacro(index)
324 PlaceAction(94)
325 PickupMacro(index)
326 PlaceAction(107)
327 PickupMacro(index)
328 PlaceAction(118)
329 PickupAction(61)
330 ClearCursor()
331 if class=="Hunter" then
332 index=CreateMacro("feign",124,"/script fd()",1,1)
333 PickupMacro(index)
334 PlaceAction(61)
335 end
336 if class=="Warrior" then
337 PickupSpell(SpellNum("Shoot Bow"),BOOKTYPE_SPELL)
338 PlaceAction(61)
339 end
340 if class=="Druid" then
341 PickupSpell(SpellNum("Faerie Fire"),BOOKTYPE_SPELL)
342 PlaceAction(61)
343 end
344 PickupAction(6)
345 ClearCursor()
346 PickupAction(78)
347 ClearCursor()
348 PickupAction(90)
349 ClearCursor()
350 PickupAction(103)
351 ClearCursor()
352 PickupAction(114)
353 ClearCursor()
354 if class=="Warrior" then
355 index=CreateMacro("wall",165,"/script WarriorSurvive()",1,1)
356 PickupMacro(index)
357 PlaceAction(6)
358 PickupMacro(index)
359 PlaceAction(78)
360 PickupMacro(index)
361 PlaceAction(90)
362 PickupMacro(index)
363 PlaceAction(103)
364 PickupMacro(index)
365 PlaceAction(114)
366 end
367 if class=="Priest" or class=="Mage" or class=="Warlock" then
368 PickupSpell(SpellNum("Shoot"),BOOKTYPE_SPELL)
369 PlaceAction(72)
370 elseif class=="Hunter" then
371 PickupSpell(SpellNum("Auto Shot"),BOOKTYPE_SPELL)
372 PlaceAction(72)
373 PickupSpell(1,BOOKTYPE_SPELL)
374 PlaceAction(71)
375 PickupSpell(SpellNum("Freezing Trap"),BOOKTYPE_SPELL)
376 PlaceAction(64)
377 else
378 PickupSpell(SpellNum("Attack"),BOOKTYPE_SPELL)
379 PlaceAction(72)
380 end
381 LoadBindings(1)
382 SetBinding("SHIFT-1","MULTIACTIONBAR1BUTTON1")
383 SetBinding("SHIFT-2","MULTIACTIONBAR1BUTTON2")
384 SetBinding("SHIFT-3","MULTIACTIONBAR1BUTTON3")
385 SetBinding("SHIFT-4","MULTIACTIONBAR1BUTTON4")
386 SetBinding("SHIFT-5","MULTIACTIONBAR1BUTTON5")
387 SetBinding("SHIFT-6","MULTIACTIONBAR1BUTTON6")
388 SetBinding("SHIFT-7","MULTIACTIONBAR1BUTTON7")
389 SetBinding("SHIFT-8","MULTIACTIONBAR1BUTTON8")
390 SetBinding("SHIFT-9","MULTIACTIONBAR1BUTTON9")
391 SetBinding("SHIFT-0","MULTIACTIONBAR1BUTTON10")
392 SetBinding("SHIFT--","MULTIACTIONBAR1BUTTON11")
393 SetBinding("SHIFT-=","MULTIACTIONBAR1BUTTON12")
394 SetBinding("F1","MULTIACTIONBAR2BUTTON1")
395 SetBinding("F2","MULTIACTIONBAR2BUTTON2")
396 SetBinding("F3","MULTIACTIONBAR2BUTTON3")
397 SetBinding("F4","MULTIACTIONBAR2BUTTON4")
398 SetBinding("F5","MULTIACTIONBAR2BUTTON5")
399 SetBinding("F6","MULTIACTIONBAR2BUTTON6")
400 SetBinding("F7","MULTIACTIONBAR2BUTTON7")
401 SetBinding("F8","MULTIACTIONBAR2BUTTON8")
402 SetBinding("F9","MULTIACTIONBAR2BUTTON9")
403 SetBinding("F10","MULTIACTIONBAR2BUTTON10")
404 SetBinding("F11","MULTIACTIONBAR2BUTTON11")
405 SetBinding("F12","MULTIACTIONBAR2BUTTON12")
406 SetBinding("SHIFT-F1","MULTIACTIONBAR2BUTTON1")
407 SetBinding("SHIFT-F2","MULTIACTIONBAR2BUTTON2")
408 SetBinding("SHIFT-F3","MULTIACTIONBAR2BUTTON3")
409 SetBinding("SHIFT-F4","MULTIACTIONBAR2BUTTON4")
410 SetBinding("SHIFT-F5","MULTIACTIONBAR2BUTTON5")
411 SetBinding("SHIFT-F6","MULTIACTIONBAR2BUTTON6")
412 SetBinding("SHIFT-F7","MULTIACTIONBAR2BUTTON7")
413 SetBinding("SHIFT-F8","MULTIACTIONBAR2BUTTON8")
414 SetBinding("SHIFT-F9","MULTIACTIONBAR2BUTTON9")
415 SetBinding("SHIFT-F0","MULTIACTIONBAR2BUTTON10")
416 SetBinding("SHIFT-F11","MULTIACTIONBAR2BUTTON11")
417 SetBinding("SHIFT-F12","MULTIACTIONBAR2BUTTON12")
418 SetBinding("BUTTON3","MOVEBACKWARD")
419 SetBinding("CTRL-1")
420 SetBinding("CTRL-2")
421 SetBinding("CTRL-3")
422 SetBinding("CTRL-4")
423 SetBinding("CTRL-5")
424 SetBinding("CTRL-6")
425 SetBinding("CTRL-7")
426 SetBinding("CTRL-8")
427 SetBinding("CTRL-9")
428 SetBinding("CTRL-0")
429 SetBinding("CTRL--")
430 SetBinding("CTRL-=")
431 SetBinding("SHIFT-UP")
432 SetBinding("SHIFT-DOWN")
433 SetBinding("SHIFT-MOUSEWHEELUP")
434 SetBinding("SHIFT-MOUSEWHEELDOWN")
435 SetBinding("B","OPENALLBAGS")
436 SetBinding("G","DCRCLEAN")
437 SaveBindings(1)
438 ClearTutorials()
439 ReloadUI()
440end
441function clearraidtargs()
442MB_cooldowns={}
443MB_My_cc_target=nil
444MB_ot_index=1
445MB_My_ot_target={}
446MB_cc_current={Mage=0,Warlock=0,Priest=0,Druid=0}
447MB_fear_current={Warlock=0,Hunter=0}
448MB_currentraidtarget=1
449SetRaidTarget("target", 1)
450SetRaidTarget("target", 2)
451SetRaidTarget("target", 3)
452SetRaidTarget("target", 4)
453SetRaidTarget("target", 5)
454SetRaidTarget("target", 6)
455SetRaidTarget("target", 7)
456SetRaidTarget("target", 8)
457SetRaidTarget("target", 9)
458end
459function table.invert( tbl )
460 local rv = {}
461 for key,val in pairs( tbl ) do rv[ val ] = key end
462 return rv
463end
464function MB_Find(item)
465 if item=="" then Print("Usage /find <classname or all or nothing> <wearing> item slot or string") return end
466 local class="all"
467 local _,_,key=string.find(item,"(%a+)%s*")
468 key=string.lower(key)
469 if FindInTable(MB_classlist,key) then
470 class=key
471 _,_,item=string.find(item,"%a+%s(.*)")
472 if not item then
473 item=key
474 else
475 Print("Checking class "..key)
476 _,_,key=string.find(item,"(%a+)%s*")
477 end
478 end
479 if key=="all" then
480 _,_,item=string.find(item,"%a+%s(.*)")
481 _,_,key=string.find(item,"(%a+)%s*")
482 end
483 if key=="wearing" or key=="crapgear" then
484 _,_,item=string.find(item,"%a+%s(.*)")
485 end
486 local myClass=string.lower(UnitClass("player"))
487 if key=="crapgear" then
488 if class~="all" and class~=myClass then return end
489 Print("Finding crappy gear.")
490 for inv=1,16 do
491 if inv~=4 then
492 local itemLink = GetInventoryItemLink("player",inv)
493 local quality=GetInventoryItemQuality("player",inv)
494 if not quality then
495 MB_msg("MISSING: slot "..MB_slotmap[inv])
496 elseif quality<3 then
497 local bsnum=string.gsub(itemLink,".-\124H([^\124]*)\124h.*", "%1")
498 local itemName, itemNo, itemRarity, itemReqLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemIcon = GetItemInfo(bsnum)
499 MB_msg("CRAP: "..itemEquipLoc.." "..inv.." "..itemLink)
500 end
501 end
502 end
503 return
504 end
505 if key=="wearing" then
506 if not item then Print("You need to name an item or slot") return end
507 Print("Finding "..class.." wearing "..item)
508 if class~="all" and class~=myClass then return end
509 for inv=1,19 do
510 local itemLink = GetInventoryItemLink("player",inv)
511 local quality=GetInventoryItemQuality("player",inv)
512 if itemLink then
513 local bsnum=string.gsub(itemLink,".-\124H([^\124]*)\124h.*", "%1")
514 local itemName, itemNo, itemRarity, itemReqLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemIcon = GetItemInfo(bsnum)
515 --if string.find(itemLink,"Hoodoo") then
516 --Print(bsnum)
517 --if not itemName then itemName="na" end
518 --if not itemNo then itemNo="na" end
519 --if not itemRarity then itemRarity="na" end
520 --if not itemReqLevel then itemReqLevel="na" end
521 --if not itemType then itemType="na" end
522 --if not itemSubType then itemSubType="na" end
523 --if not itemCount then itemCount="na" end
524 --if not itemEquipLoc then itemEquipLoc="na" end
525 --if not itemIcon then itemIcon="na" end
526 --Print(itemName..","..itemNo..","..itemRarity..","..itemReqLevel..","..itemType..","..itemSubType..","..itemCount..","..itemEquipLoc..","..itemIcon)
527 --end
528 local match=nil
529 links=string.lower(itemLink)
530 items=string.lower(item)
531 --Print(links)
532 match = string.find(links, items)
533 if itemEquipLoc then
534 itemEquipLoc=string.lower(itemEquipLoc)
535 match= match or string.find(itemEquipLoc,items)
536 end
537 if itemType then
538 itemType=string.lower(itemType)
539 match= match or string.find(itemType,items)
540 end
541 if itemSubType then
542 itemSubType=string.lower(itemSubType)
543 match= match or string.find(itemSubType,items)
544 end
545 if match then
546 MB_msg("Found "..itemLink.." in slot "..MB_slotmap[inv])
547 end
548 end
549 end
550 return
551 else
552 if not item then Print("You need to name an item or slot") return end
553 Print("Finding item "..item)
554 if class~="all" and class~=myClass then return end
555 for bag=0,11 do for slot=1,GetContainerNumSlots(bag) do
556 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
557 if texture then
558 local link=GetContainerItemLink(bag,slot)
559 local bsnum=string.gsub(link,".-\124H([^\124]*)\124h.*", "%1")
560 local itemName, itemNo, itemRarity, itemReqLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemIcon = GetItemInfo(bsnum)
561 _,itemCount=GetContainerItemInfo(bag,slot)
562 --if not itemName then itemName="na" end
563 --if not itemNo then itemNo="na" end
564 --if not itemRarity then itemRarity="na" end
565 --if not itemReqLevel then itemReqLevel="na" end
566 --if not itemType then itemType="na" end
567 --if not itemSubType then itemSubType="na" end
568 --if not itemCount then itemCount="na" end
569 --if not itemEquipLoc then itemEquipLoc="na" end
570 --if not itemIcon then itemIcon="na" end
571 --Print(itemName..","..itemNo..","..itemRarity..","..itemReqLevel..","..itemType..","..itemSubType..","..itemCount..","..itemEquipLoc..","..itemIcon)
572 local match=nil
573 link=GetContainerItemLink(bag,slot)
574 links=string.lower(link)
575 items=string.lower(item)
576 match = string.find(links, items)
577 if itemEquipLoc then
578 itemEquipLoc=string.lower(itemEquipLoc)
579 match= match or string.find(itemEquipLoc,items)
580 end
581 if itemType then
582 itemType=string.lower(itemType)
583 match= match or string.find(itemType,items)
584 end
585 if itemSubType then
586 itemSubType=string.lower(itemSubType)
587 match= match or string.find(itemSubType,items)
588 end
589 if match then
590 if UnitInRaid("player") then
591 MB_msg("Found "..link.."x"..itemCount.." in bag "..bag.." slot "..slot)
592 end
593 end
594 end
595 end
596 end
597 end
598end
599function SetLockPet(lockpet)
600 if not IAmFocus() and lockpet then
601 if not SpellExists("Summon "..lockpet) then
602 MB_msg("I don't know how to summon a "..lockpet..". Pick something else.")
603 return
604 end
605 end
606 if IAmFocus() then
607 if UnitInRaid("player") then
608 SendAddonMessage(MB_RAID.."LPET ",lockpet,"RAID")
609 else
610 SendAddonMessage(MB_RAID.."LPET ",lockpet)
611 end
612 else
613 if lockpet then
614 MB_msg("Setting my current pet to "..lockpet..".")
615 else
616 MB_msg("Setting myself to sacrifice spec.")
617 end
618 MB_my_lock_pet=lockpet
619 end
620end
621function MB_msg(msg)
622 local time=GetTime()
623 if MB_prev_msg==msg and MB_msgcd+2>time then return end
624 MB_prev_msg=msg
625 MB_msgcd=time
626 if UnitInRaid("player") then
627 RunLine("/raid "..msg) return
628 else
629 RunLine("/party "..msg) return
630 end
631 Print(msg)
632end
633function MakeALine()
634--Each person in the raid follows a specific person in order, creating a single file line. Hilarious.
635--Useful for setting up raid in a semi circle in prep for a boss fight
636 local name, realm = UnitName("player")
637 local myspot=FindInTable(MB_followorder,name)
638 if myspot>1 then
639 TargetByName(MB_followorder[myspot-1],1)
640 FollowUnit("target")
641 TargetUnit("playertarget")
642 end
643end
644function Pentagram()
645--Each person in the raid follows a specific person in order, creating a single file line. Hilarious.
646--Useful for setting up raid in a semi circle in prep for a boss fight
647 local name,realm=UnitName("player")
648 if name=="Shamantres" then TargetByName("Shamanseis",1) end
649 if name=="Shamansiete" then TargetByName("Shamanuno",1) end
650 if name=="Shamanquatro" then TargetByName("Shamanocho",1) end
651 if name=="Shamanseis" then TargetByName("Shamancinco",1) end
652 if name=="Shamanuno" then TargetByName("Shamantres",1) end
653 if name=="Shamanocho" then TargetByName("Shamansiete",1) end
654 if name=="Shamancinco" then TargetByName("Shamanquatro",1) end
655 if name=="Shamantres" then TargetByName("Shamansiete",1) end
656 if name=="Shamansiete" then TargetByName("Shamanquatro",1) end
657 if name=="Shamanquatro" then TargetByName("Shamanseis",1) end
658 if name=="Shamanseis" then TargetByName("Shamanuno",1) end
659 if name=="Shamanuno" then TargetByName("Shamanocho",1) end
660 if name=="Shamanocho" then TargetByName("Shamancinco",1) end
661 if name=="Shamancinco" then TargetByName("Shamantres",1) end
662 if name=="Shamantres" then TargetByName("Shamanquatro",1) end
663 if name=="Shamansiete" then TargetByName("Shamanseis",1) end
664 if name=="Shamanquatro" then TargetByName("Shamanuno",1) end
665 if name=="Shamanseis" then TargetByName("Shamanocho",1) end
666 if name=="Shamanuno" then TargetByName("Shamancinco",1) end
667 if name=="Shamanocho" then TargetByName("Shamantres",1) end
668 if name=="Shamancinco" then TargetByName("Shamansiete",1) end
669 cast("Chain Heal(Rank 1)")
670end
671function SortRaid()
672--Every raid needs to put its toons in specific groups to control buff sharing
673--This function does that. Put it in slot 0 along with the raid invite function
674--The numbers refer to which group those guys go in.
675 local fury20manorder = {
676 Shamanquatro=1,
677 Furyswipes=1,
678 Brutalic=1,
679 Bubbling=1,
680 Monterey=1,
681 Shamancinco=2,
682 Cuppycake=2,
683 Crookshanks=2,
684 Kimboslicer=2,
685 Cashme=2,
686 Shamanseis=3,
687 Silza=3,
688 Badlands=3,
689 Brutalium=3,
690 Brutaliar=3,
691 Shamanuno=4,
692 Zillazee=4,
693 Punchingbear=4,
694 Icefloes=4,
695 Flameshocked=4
696 }
697 local moot20manorder = {
698 Shamanquatro=1,
699 Furyswipes=1,
700 Brutalic=1,
701 Bubbling=1,
702 Monterey=1,
703 Shamancinco=2,
704 Mootalia=2,
705 Crookshanks=2,
706 Kimboslicer=2,
707 Cashme=2,
708 Shamanseis=3,
709 Silza=3,
710 Badlands=3,
711 Brutalium=3,
712 Brutaliar=3,
713 Shamanuno=4,
714 Zillazee=4,
715 Punchingbear=4,
716 Icefloes=4,
717 Flameshocked=4
718 }
719 local cuppy20manorder = {
720 Shamanquatro=1,
721 Eversmile=1,
722 Brutalic=1,
723 Bubbling=1,
724 Monterey=1,
725 Shamancinco=2,
726 Cuppycake=2,
727 Crookshanks=2,
728 Kimboslicer=2,
729 Cashme=2,
730 Shamanseis=3,
731 Silza=3,
732 Badlands=3,
733 Brutalium=3,
734 Brutaliar=3,
735 Shamanuno=4,
736 Zillazee=4,
737 Punchingbear=4,
738 Icefloes=4,
739 Flameshocked=4
740 }
741 local komal20manorder = {
742 Shamanocho=1,
743 Komal=1,
744 Yellowstone=1,
745 Brutalia=1,
746 Avindra=1,
747 Shamansiete=2,
748 Eversmile=2,
749 Toshredsusay=2,
750 Stabsya=2,
751 Refill=2,
752 Calypsa=3,
753 Merazza=3,
754 Jenjja=3,
755 Zumwalt=3,
756 Barie=3,
757 Shamantres =4,
758 Everglades=4,
759 Orinoco=4,
760 Olympic=4,
761 Brutalio=4
762 }
763 local full40manorder = {
764 Shamanocho=1,
765 Komal=1,
766 Eversmile=1,
767 Brutalic=1,
768 Bubbling=1,
769 Shamancinco =2,
770 Cuppycake=2,
771 Furyswipes=2,
772 Brutalia=2,
773 Toshredsusay=2,
774 Shamanseis=3,
775 Zumwalt=3,
776 Badlands=3,
777 Olympic=3,
778 Everglades=3,
779 Shamanquatro=4,
780 Monterey=4,
781 Yellowstone=4,
782 Mootalia=4,
783 Refill=4,
784 Shamanuno=5,
785 Flameshocked=5,
786 Brutalium=5,
787 Jenjja=5,
788 Cashme=5,
789 Shamantres=6,
790 Avindra=6,
791 Brutaliar=6,
792 Barie=6,
793 Orinoco=6,
794 Silza=7,
795 Zillazee=7,
796 Brutalio=7,
797 Calypsa=7,
798 Icefloes=7,
799 Shamansiete = 8,
800 Stabsya=8,
801 Punchingbear=8,
802 Crookshanks=8,
803 Kimboslicer=8
804 }
805 if GetNumRaidMembers()>20 then
806 raidgrouporder=full40manorder
807 elseif RaidID("Furyswipes") and RaidID("Mootalia") then
808 raidgrouporder=moot20manorder
809 elseif RaidID("Furyswipes") then
810 raidgrouporder=fury20manorder
811 elseif RaidID("Eversmile") and RaidID("Cuppycake") then
812 raidgrouporder=cuppy20manorder
813 elseif RaidID("Komal") then
814 raidgrouporder=komal20manorder
815 end
816 local raidnames= {}
817 for i=1,GetNumRaidMembers() do
818 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
819 raidnames[name]=i
820 end
821 for name,idx in raidnames do
822 local subgroup=WhichSubgroup(name)
823 TargetByName(name,1)
824 local online=UnitIsConnected("target")
825 if not raidgrouporder[name] or not online then
826 if not raidgrouporder[name] then Print("ERROR! "..name.." is not in the raidgrouporder list! This will mess up raid order!") end
827 if not online then Print("ERROR! "..name.." is offline. I cannot move him in raid automatically.") end
828 else
829 local targetgroup=raidgrouporder[name]
830 if subgroup~=targetgroup then
831 if RoomInGroup(targetgroup) then SetRaidSubgroup(idx,targetgroup)
832 else
833 for othername,otheridx in raidnames do
834 local othersubgroup=WhichSubgroup(othername)
835 if othername~=name and othersubgroup==targetgroup and othersubgroup~=raidgrouporder[othername] then
836 SwapPos(raidnames,idx,otheridx)
837 end
838 end
839 end
840 end
841 end
842 end
843end
844function buystacks()
845 local itemlists={["Roasted Quail"]="Hunter",["Jagged Arrow"]="Hunter",["Accurate Slugs"]="Hunter",["Flash Powder"]="Rogue",["Wild Thornroot"]="Druid",["Ironwood Seed"]="Druid",["Sacred Candle"]="Priest",Ankh="Shaman",["Arcane Powder"]="Mage",["Rune of Portals"]="Mage",["Rune of Teleportation"]="Mage"}
846 local limits={["Roasted Quail"]={320,5},["Jagged Arrow"]={16,200},["Accurate Slugs"]={16,200},["Flash Powder"]={400,1},["Wild Thornroot"]={320,1},["Ironwood Seed"]={60,1},["Sacred Candle"]={640,1},Ankh={30,1},["Arcane Powder"]={320,1},["Rune of Portals"]={80,1},["Rune of Teleportation"]={40,1}}
847 local myclass=UnitClass("player")
848 for item,class in itemlists do
849 if myclass==class then
850 local myitems=HasItem(item)/limits[item][2]
851 --Print("My bullets ="..myitems)
852 local needitems=limits[item][1]/limits[item][2]-myitems
853 if class=="Hunter" and item=="Jagged Arrow" and HasPouch() then if myitems==0 then needitems=1 end end
854 if class=="Hunter" and item=="Accurate Slugs" and HasQuiver() then if myitems==0 then needitems=1 end end
855 --Print("Checking for item "..item)
856 --Print("Have item "..myitems)
857 --Print("Need item "..needitems)
858 if needitems>0 then
859 for itemidx=1,40 do
860 link=GetMerchantItemLink(itemidx)
861 if link then
862 if string.find(link,item) then
863 Print("Buying "..needitems.." "..link)
864 BuyMerchantItem(itemidx,needitems)
865 end
866 end
867 end
868 end
869 end
870 end
871end
872function AutoDelete()
873if not MB_autodelete then return end
874--Delete certain items when beyond a certain number of stacks
875--have to pick food type based on hunter name and pet
876--It only works by STACKS. 1 means you allow 1 stack. 2 means 2 stacks.
877--That could be 1.5 stacks also. Partial stacks count as a stack.
878 local amount=0
879 local TheList={
880 ["Runecloth"]=0,
881 ["Darkmoon Special"]=0,
882 ["Rock Chip"]=0,
883 ["Jagged Axe"]=0,
884 ["Plans: Thorium"]=0,
885 ["Crafted Light Shot"]=0,
886 ["Scarlet Cannonball"]=0,
887 ["Rough Stone"]=0,
888 ["Coarse Blasting"]=0,
889 ["Melon "]=0,
890 ["Bruiseweed"]=0,
891 ["Brocade "]=0,
892 ["Blackrock Pauldrons"]=0,
893 ["Lesser Healing Potion"]=0,
894 ["Gnoll Spittle"]=0,
895 ["Rawhide "]=0,
896 ["Buzzard "]=0,
897 ["Tough Condor "]=0,
898 ["Ivory Boar"]=0,
899 ["Tiny Fang"]=0,
900 ["Linked "]=0,
901 ["Wooden Maul"]=0,
902 ["Short Cutlass"]=0,
903 ["Smooth Pebble"]=0,
904 ["Meat Cleaver"]=0,
905 ["Decomposed "]=0,
906 ["Lifeless Skull"]=0,
907 ["Large Slimy"]=0,
908 ["Bronze Tube"]=0,
909 ["Extinguished Torch"]=0,
910 ["Taut Compound"]=0,
911 ["Broken Arrow"]=0,
912 ["Shadowgem"]=0,
913 ["Linen Cloth"]=0,
914 ["Minor Mana Potion"]=0,
915 ["Broken Boar Tusk"]=0,
916 ["Boar Intestines"]=0,
917 ["Boar Ribs"]=0,
918 ["Ice Cold Milk"]=0,
919 ["Rough Vulture Feathers"]=0,
920 ["Coarse Stone"]=0,
921 ["Goretusk Snout"]=0,
922 ["Goretusk Liver"]=0,
923 ["Severed Talon"]=0,
924 ["Small Egg"]=0,
925 ["Light Feather"]=0,
926 ["Tigerseye"]=0,
927 ["Moss Agate"]=0,
928 ["Kobold Mining Shovel"]=0,
929 ["Minor Healing Potion"]=0,
930 ["Refreshing Spring Water"]=0,
931 ["Shiny Red Apple"]=0,
932 ["Darnassian Bleu"]=0,
933 ["Forest Mushroom Cap"]=0,
934 ["Chipped Boar Tusk"]=0,
935 ["Khadgar's Whisker"]=0,
936 ["Chunk of Boar Meat"]=0,
937 ["Stringy Vulture Meat"]=0,
938 ["Glowing Wax Stick"]=0,
939 ["Large Candle"]=0,
940 ["Haunch of Meat"]=0,
941 ["Gnoll Paw"]=0,
942 ["Gold Dust"]=0,
943 ["Heavy Stone"]=0,
944 ["Copper Ore"]=0,
945 ["Wool Cloth"]=0,
946 ["Cracked Bill"]=0,
947 ["Tin Ore"]=0,
948 ["Vulture Talon"]=0,
949 ["Clam Meat"]=0,
950 ["Dalaran Sharp"]=0,
951 ["Lifeless Stone"]=0,
952 ["Burning Pitch"]=0,
953 ["Primed Musket"]=0,
954 ["Light Plate"]=0,
955 ["Bulky Maul"]=0,
956 ["Brilliant Chromatic Scale"]=0,
957 ["Fiery Gland"]=0,
958 ["Wolf Meat"]=0,
959 ["Splintering Battle Axe"]=0,
960 ["Clout Mace"]=0,
961 ["Fine Pointed Dagger"]=0,
962 ["Blood Scythe"]=0,
963 ["Feathery Wing"]=0,
964 ["Ironfeather"]=0,
965 ["Undamaged Hip"]=0,
966 ["Shimmering Basil"]=0,
967 ["Imperfect Draen"]=0,
968 ["Vibrant Plume"]=0,
969 ["Basilisk Venom"]=0,
970 ["Basilisk Brain"]=0,
971 ["Thick Furry Mane"]=0,
972 ["Coal"]=0,
973 ["Stout War"]=0,
974 ["Solid Stone"]=0,
975 ["Deeprock Stone"]=0,
976 ["Ripped Wing"]=0,
977 ["Journeyman's"]=0,
978 ["Overlinked "]=0,
979 ["Heavy Flint Ax"]=0,
980 ["Sandworm Meat"]=0,
981 ["Slimy Ichor"]=0,
982 ["Gelatinous Goo"]=0,
983 ["Heavy Silith"]=0,
984 ["Armored Chitin"]=0,
985 ["Crochet "]=0,
986 ["Dripping Spider "]=0,
987 ["Thick Leather "]=0,
988 ["Spiked "]=0,
989 ["Greater Mana"]=0,
990 ["Twill "]=0,
991 ["Laminated Scale "]=0,
992 ["Laminate "]=0,
993 ["Smooth Leather "]=0,
994 ["Overlinked Chain"]=0,
995 ["Superior Mana"]=0,
996 ["Tapered Greatsword"]=0,
997 ["Thick Leather Hat"]=0,
998 ["Patch of Fine Fur"]=0,
999 ["Twill Shoulderpads"]=0,
1000 ["Light Plate Belt"]=0,
1001 ["Sharp Shortsword"]=0,
1002 ["Thick Spider's"]=0,
1003 ["Laminated Scale Pants"]=0,
1004 ["Crushing Maul"]=0,
1005 ["Smooth Stone Chip"]=0,
1006 ["Superior Heal"]=0,
1007 ["Light Plate Helmet"]=0,
1008 ["Thick Leather Bracers"]=0,
1009 ["Alterac Swiss"]=0,
1010 ["Heavy War Staff"]=0,
1011 ["Thick Leather Shoulderpads"]=0,
1012 ["Large Bat Fang"]=0,
1013 ["Dripping Spider"]=0,
1014 ["Hard Spider"]=0,
1015 ["Shadow Silk"]=0,
1016 ["Ironweb Spider"]=0,
1017 ["Pattern:"]=0,
1018 ["Brilliant Scale"]=0,
1019 ["Forked Tongue"]=0,
1020 ["Powerful Mojo"]=1,
1021 ["Pristine Raptor Skull"]=0,
1022 ["Crochet Bracers"]=0,
1023 ["Deflecting Tower"]=0,
1024 ["Codex: Prayer of Fortitude"]=0,
1025 ["Frayed Abomination Stitching"]=0,
1026 ["Glowing Scorpid Blood"]=0,
1027 ["Smooth Leather Bracers"]=0,
1028 ["Nightcrawlers"]=0,
1029 ["Mystery Meat"]=0,
1030 ["Overlinked Chain Armor"]=0,
1031 ["Protective Pavise"]=0,
1032 ["Scarlet Cannonball"]=0,
1033 ["Light Plate Boots"]=0,
1034 ["Smooth Stone Chip"]=0,
1035 ["Shiny Polished Stone"]=0,
1036 ["Wicked Claw"]=0,
1037 ["Elder Raptor Feathers"]=0,
1038 ["Trophy Raptor Skull"]=0,
1039 ["Star Ruby"]=0,
1040 ["Scroll of Strength"]=0,
1041 ["Scroll of Protection"]=0,
1042 ["Scroll of Stamina"]=0,
1043 ["Scroll of Spirit"]=0,
1044 ["Scroll of Intellect"]=0,
1045 ["Scroll of Agility"]=0,
1046 ["Dried King"]=0,
1047 ["Sentinel Musket"]=0,
1048 ["Fine Longsword"]=0,
1049 ["Twilight Cultist Robe"]=6,
1050 ["Twilight Cultist Cowl"]=6,
1051 ["Twilight Cultist Mantle"]=6,
1052 ["Homemade Cherry"]=0,
1053 ["Roasted Quail"]=0,
1054 ["Evil Bat Eye"]=0,
1055 ["Morning Glory Dew"]=1,
1056 ["Lockbox"]=0,
1057 ["Sabertooth Fang"]=0,
1058 ["Spider Silk"]=0,
1059 ["Idol of the Moon"]=0,
1060 ["Totem of the Storm"]=0,
1061 ["Patch of fine fur"]=0,
1062 ["Aquamarine"]=0,
1063 ["Tangy Clam"]=0,
1064 ["Silk Cloth"]=0,
1065 ["Mageweave Cloth"]=0,
1066 ["Wool Cloth"]=0,
1067 ["Huge Venom Sac"]=0,
1068 ["Large Scorpid Claw"]=0,
1069 ["Breath of Wind"]=0,
1070 ["Mutton Chop"]=0}
1071 local CrapIGot={}
1072 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
1073 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
1074 if texture then
1075 link=GetContainerItemLink(bag,slot)
1076 for key,limit in TheList do
1077 --Print("link is"..link)
1078 --Print("key is "..key)
1079 --Print("limit is "..limit)
1080 if string.find(link,key) then
1081 if limit==0 then
1082 -- Print("Deleting Container Item "..key.." limit "..limit.." in location"..bag..","..slot)
1083 PickupContainerItem(bag,slot)
1084 DeleteCursorItem()
1085 Accept()
1086 elseif not FindInTable(CrapIGot,key) then
1087 --Print("Limit higher than 0 for "..key.." Initializing to 1")
1088 table.insert(CrapIGot,key)
1089 CrapIGot[key]=1
1090 elseif CrapIGot[key]==limit then
1091 --Print("Deleting Container Item "..key.." limit "..limit.." in location"..bag..","..slot)
1092 PickupContainerItem(bag,slot)
1093 DeleteCursorItem()
1094 Accept()
1095 else
1096 --Print("Adding 1 to CrapIGot for "..key)
1097 CrapIGot[key]=CrapIGot[key]+1
1098 end
1099 end
1100 end
1101 end
1102 end end
1103end
1104function HasQuiver()
1105 for bag=0,4 do
1106 if string.find(GetBagName(bag),"Quiver") then return true end
1107 end
1108end
1109function HasPouch()
1110 for bag=0,4 do
1111 if string.find(GetBagName(bag),"Ammo Pouch") then return true end
1112 end
1113end
1114function SwapPos(raidnames,i1,i2)
1115--Swaps two people in a raid.
1116--Does not work on a full 40 man raid.
1117--Wow 1.12 raid movement commands are VERY flakey.
1118--I'm not sure we can sort 40 man full raids properly.
1119--I use group8 as a holding place for the swaps.
1120--In the end I may have to remove a person in group8 from raid then reinvite to rearrange
1121 for name,idx in raidnames do
1122 if idx==i1 then n1=name end
1123 if idx==i2 then n2=name end
1124 end
1125 g1=WhichSubgroup(n1)
1126 --Print(n1.." is in group "..g1)
1127 g2=WhichSubgroup(n2)
1128 --Print(n2.." is in group "..g2)
1129 SetRaidSubgroup(i1,8)
1130 SetRaidSubgroup(i2,g1)
1131 SetRaidSubgroup(i1,g2)
1132end
1133function SortRaidAlt()
1134--This is just another sortraid for an alternate raid group I like to use.
1135 local raidgrouporder = {
1136 Eversmile=1,
1137 Shamanseis=1,
1138 Shamanocho=1,
1139 Shamansiete=1 }
1140 local raidnames= {}
1141 for i=1,GetNumRaidMembers() do
1142 local name,rank,subgroup=GetRaidRosterInfo(i)
1143 raidnames[name]=i
1144 end
1145 for name,idx in raidnames do
1146 local subgroup=WhichSubgroup(name)
1147 targetgroup=raidgrouporder[name]
1148 Printd(name .. " is in group " .. subgroup .. ", but wants to be in " .. targetgroup)
1149 if subgroup~=targetgroup then
1150 Printd(name .. " wants to move from his group")
1151 if RoomInGroup(targetgroup) then SetRaidSubgroup(idx,targetgroup)
1152 else
1153 for othername,otheridx in raidnames do
1154 local othersubgroup=WhichSubgroup(othername)
1155 if othername~=name and othersubgroup==targetgroup and othersubgroup~=raidgrouporder[othername] then
1156 Printd(othername .. " is in group " .. othersubgroup .. ", but wants to be in " .. raidgrouporder[othername])
1157 Printd("Let's swap indexes " .. idx .. " and " .. otheridx)
1158 SwapPos(raidnames,idx,otheridx)
1159 end
1160 end
1161 end
1162 end
1163 end
1164end
1165function Bubble()
1166--For priests: Bubble (Power Word:Shield) anyone getting attacked by something big or something on a list of threats
1167--Also bubble if health is .2 or less
1168--This uses a lot of mana, so you have to decide if it's worth it for your priests
1169--If the target is on bubble timeout, save him with flash heals rank1s (probably no good)
1170 local BigThreats={
1171 "Gurubashi Axe Thrower",
1172 "Jin'do the Hexxer",
1173 "Gurubashi Blood Drinker",
1174 "High Priestess Arlokk",
1175 "High Priestess Mar'li",
1176 "Gurubashi Berserker"
1177 }
1178 for i=1,30 do
1179 TargetNearestEnemy()
1180 if TargetInCombat() then
1181 local name=UnitName("target")
1182 local hp=UnitHealthMax("target")
1183 if FindInTable(BigThreats,name) or hp>25000 then
1184 local tarname=UnitName("targettarget")
1185 Print("Big Threat ")
1186 Print(name)
1187 Print(" attacking ")
1188 Print(tarname)
1189 if FindInTable(MB_toonlist,tarname) then
1190 TargetByName(tarname,1)
1191 if UnitHealth("target")/UnitHealthMax("target")<.55 and MyMana()>480 and not buffed("Weakened Soul","target") then
1192 cast("Power Word: Shield")
1193 else
1194 if UnitHealth("target")/UnitHealthMax("target")<.20 then QuickHealD("target") end
1195 end
1196 return
1197 end
1198 end
1199 end
1200 end
1201 for i=1,40 do
1202 local health=UnitHealth("raid"..i)
1203 local healthm=UnitHealthMax("raid"..i)
1204 if health~=1 and UnitIsConnected("raid"..i) then
1205 local healthp=health/healthm
1206 if healthp<.2 then
1207 if UnitHealth("target")/UnitHealthMax("target")<.55 and not buffed("Weakened Soul","target") then
1208 cast("Power Word: Shield")
1209 else
1210 QuickHealD("target")
1211 end
1212 end
1213 end
1214 end
1215end
1216function RaidHealth()
1217 if not UnitInRaid("player") then return PartyHealth() end
1218 local raidHP=0
1219 local raidHPM=0
1220 local lowestHP=1
1221 for i=1,GetNumRaidMembers() do
1222 --give mosthurt to first connected player
1223 if UnitIsConnected("raid"..i) and not UnitIsDead("raid"..i) and not UnitIsGhost("raid"..i) then
1224 local mosthurt="raid"..i
1225 lowsetHP=UnitHealth("raid"..i)/UnitHealthMax("raid"..i)
1226 break
1227 end
1228 end
1229 for i=1,GetNumRaidMembers() do
1230 local health=UnitHealth("raid"..i)
1231 local healthm=UnitHealthMax("raid"..i)
1232 if UnitIsConnected("raid"..i) and not UnitIsDead("raid"..i) and not UnitIsGhost("raid"..i) then
1233 local healthp=health/healthm
1234 raidHP=raidHP+health
1235 raidHPM=raidHPM+healthm
1236 if healthp<lowestHP then lowestHP=healthp ; mosthurt="raid"..i end
1237 end
1238 end
1239 return raidHP/raidHPM,mosthurt,lowestHP
1240end
1241function PartyHealth()
1242--This is a party adaptation of RaidHealth().
1243--Returns the percentage, and also the name of the most hurt guy in your raid
1244 local raidHP=0
1245 local raidHPM=0
1246 local lowestHP=UnitHealth("player")
1247 local mosthurt="player"
1248 local lowestHP=UnitHealth("player")/UnitHealthMax("player")
1249 for i=1,4 do
1250 local health=UnitHealth("party"..i)
1251 local healthm=UnitHealthMax("party"..i)
1252 if UnitIsConnected("party"..i) and not UnitIsDead("party"..i) and not UnitIsGhost("party"..i) then
1253 local healthp=health/healthm
1254 raidHP=raidHP+health
1255 raidHPM=raidHPM+healthm
1256 if healthp<lowestHP then lowestHP=healthp ; mosthurt="party"..i end
1257 end
1258 end
1259 return raidHP/raidHPM,mosthurt,lowestHP
1260end
1261function partyup()
1262--I have several flavors of partyup_* functions, meant to send out invites to different raid combinations of toons.
1263--partyup functions are meant to be placed in the 0 slot of your keyboard.
1264--You should alt-4 first to focus everyone on the current window toon.
1265--Then, hit 0 several times to send out invites. The toons invited will also be hitting 0 of course,
1266--and Accept() should also be in the 0 partyup macro.
1267 if IAmFocus() then
1268 for k,toon in pairs(MB_toonlist) do
1269 if UnitName("player")~=toon then Print("Inviting "..toon) InviteByName(toon) end
1270 end
1271 SetLootMethod("freeforall",UnitName("player"))
1272 --SetLootMethod("master",UnitName("player"))
1273 --SetLootThreshold(4)
1274 if RaidID("Raigore") then PromoteToAssistant("Raigore") end
1275 if RaidID("Kelseran") then PromoteToAssistant("Kelseran") end
1276 if RaidID("Silithusboss") then PromoteToAssistant("Silithusboss") end
1277 if RaidID("Mogrina") then PromoteToAssistant("Mogrina") end
1278 if RaidID("Renew") then PromoteToAssistant("Renew") end
1279 if RaidID("Eversmile") then PromoteToAssistant("Eversmile") end
1280 if RaidID("Komal") then PromoteToAssistant("Komal") end
1281 if RaidID("Furyswipes") then PromoteToAssistant("Furyswipes") end
1282 if GetNumPartyMembers()==4 then ConvertToRaid(); end
1283 --SortRaid()
1284 end
1285end
1286function IAmPartyLead()
1287 local player,realm=UnitName("player")
1288 if FindKeyInTable(MB_levelingparties,player) then return 1 end
1289end
1290function leveling_parties()
1291 Accept()
1292 if IAmPartyLead() then
1293 Print("I am a party lead.")
1294 for k,toon in pairs(MB_levelingparties[UnitName("player")]) do
1295 Print(k)
1296 Print(toon)
1297 if UnitName("player")~=toon then Print("Inviting "..toon) InviteByName(toon) end
1298 end
1299 SetLootMethod("freeforall");
1300 end
1301end
1302function Accept()
1303--this accepts party invites automatically--it should be in a macro in the form of /script Accept()
1304 AcceptGroup();
1305 StaticPopup_Hide("PARTY_INVITE")
1306end
1307function follow_assist()
1308--This is meant to be in your alt-4 macro, and gets everyone to follow and assist the focus (meant to be your current window toon)
1309 if not IAmFocus() then
1310 FollowByName(ClassicFocus_CurrentFocus,1)
1311 if TableLength(MB_My_ot_target)==0 then
1312 TargetByName(ClassicFocus_CurrentFocus,1)
1313 AssistUnit("target")
1314 end
1315 end
1316end
1317function MB_Assist()
1318--This is meant to be in your alt-4 macro, and gets everyone to follow and assist the focus (meant to be your current window toon)
1319 if not IAmFocus() then
1320 if TableLength(MB_My_ot_target)==0 then
1321 AssistUnit(TankID())
1322 end
1323 end
1324end
1325function Follow()
1326--Used to make an off tank follow the main tank without losing his target by assisting.
1327--I put it on 1 key with no mod. alt-1 is off tank taunt/main tank no attack and alt-2 is main tank taunt/off tank no attack
1328 if not IAmFocus() then
1329 FollowByName(ClassicFocus_CurrentFocus,1)
1330 end
1331end
1332function Follow_Komal()
1333--Used to make an off tank follow the main tank without losing his target by assisting.
1334--I put it on 1 key with no mod. alt-1 is off tank taunt/main tank no attack and alt-2 is main tank taunt/off tank no attack
1335 if not IAmFocus() then
1336 FollowByName("Komal",1)
1337 end
1338end
1339function Follow_Furyswipes()
1340--Used to make an off tank follow the main tank without losing his target by assisting.
1341--I put it on 1 key with no mod. alt-1 is off tank taunt/main tank no attack and alt-2 is main tank taunt/off tank no attack
1342 if not IAmFocus() then
1343 FollowByName("Furyswipes",1)
1344 end
1345end
1346function FocPoisoned()
1347--Supposedly determines if your focus is poisoned.
1348--I do not think it works.
1349--Uses "trick" to retarget your original target because playertarget updates slow in wowUI
1350 RunLine("/tarfocus")
1351 local i,x
1352 local numpoisoned=0
1353 for x=1,40 do
1354 local name,count,debuffType=UnitDebuff("target",x)
1355 if debuffType=="Poison" then return true end
1356 end
1357 TargetUnit("playertarget")
1358end
1359function FocCursed()
1360--Supposedly determines if your focus is cursed.
1361--I do not think it works.
1362--Uses "trick" to retarget your original target because playertarget updates slow in wowUI
1363 RunLine("/tarfocus")
1364 local i,x
1365 local numpoisoned=0
1366 for x=1,40 do
1367 local name,count,debuffType=UnitDebuff("target",x)
1368 if debuffType=="Curse" then return true end
1369 end
1370 TargetUnit("playertarget")
1371end
1372function ImBusy()
1373 if Zorlen_isCasting() or Zorlen_isChanneling() then return true end
1374end
1375function Sulfuron()
1376 if TankTarget("Sulfuron Harbinger") or TankTarget("Flamewaker Priest") then return true end
1377end
1378function Decurse()
1379 --fucking decursive, it is a piece of SHIT addon. Interrupts all spell casting
1380 --if 1 then return end
1381 if Sulfuron() then return end
1382 if MyMana()<220 then return end
1383 if ImBusy() then return end
1384 if not UnitInRaid("player") then DecurseParty() return end
1385 local y,x
1386 for y=1,40 do
1387 for x=1,16 do
1388 local name,count,debuffType=UnitDebuff("raid"..y,x)
1389 if debuffType=="Curse" and DCR_CAN_CURE_CURSE then Print("Watch out, decursive interrupts") Print(UnitName("raid"..y).." is cursed. Decursing.") RunLine("/decursive") return end
1390 if debuffType=="Magic" and DCR_CAN_CURE_MAGIC then Print("Watch out, decursive interrupts") Print(UnitName("raid"..y).." is magicked. Decursing.") RunLine("/decursive") return end
1391 if debuffType=="Disease" and DCR_CAN_CURE_DISEASE then Print("Watch out, decursive interrupts") Print(UnitName("raid"..y).." is Diseased. Decursing.") RunLine("/decursive") return end
1392 if debuffType=="Poison" and DCR_CAN_CURE_POISON then Print("Watch out, decursive interrupts") Print(UnitName("raid"..y).." is Poisoned. Decursing.") RunLine("/decursive") return end
1393 end
1394 end
1395 TargetUnit("playertarget")
1396end
1397function DecurseParty()
1398 local y,x
1399 for x=1,40 do
1400 local name,count,debuffType=UnitDebuff("player",x)
1401 if debuffType=="Curse" and DCR_CAN_CURE_CURSE then Print("Watch out, decursive interrupts") Print(UnitName("player").." is cursed. Decursing.") RunLine("/decursive") return end
1402 if debuffType=="Magic" and DCR_CAN_CURE_MAGIC then Print("Watch out, decursive interrupts") Print(UnitName("player").." is magicked. Decursing.") RunLine("/decursive") return end
1403 if debuffType=="Disease" and DCR_CAN_CURE_DISEASE then Print("Watch out, decursive interrupts") Print(UnitName("player").." is Diseased. Decursing.") RunLine("/decursive") return end
1404 if debuffType=="Poison" and DCR_CAN_CURE_POISON then Print("Watch out, decursive interrupts") Print(UnitName("player").." is Poisoned. Decursing.") RunLine("/decursive") return end
1405 end
1406 for y=1,4 do
1407 for x=1,16 do
1408 local name,count,debuffType=UnitDebuff("party"..y,x)
1409 if debuffType=="Curse" and DCR_CAN_CURE_CURSE then Print("Watch out, decursive interrupts") Print(UnitName("party"..y).." is cursed. Decursing.") RunLine("/decursive") return end
1410 if debuffType=="Magic" and DCR_CAN_CURE_MAGIC then Print("Watch out, decursive interrupts") Print(UnitName("party"..y).." is magicked. Decursing.") RunLine("/decursive") return end
1411 if debuffType=="Disease" and DCR_CAN_CURE_DISEASE then Print("Watch out, decursive interrupts") Print(UnitName("party"..y).." is Diseased. Decursing.") RunLine("/decursive") return end
1412 if debuffType=="Poison" and DCR_CAN_CURE_POISON then Print("Watch out, decursive interrupts") Print(UnitName("party"..y).." is Poisoned. Decursing.") RunLine("/decursive") return end
1413 end
1414 end
1415 TargetUnit("playertarget")
1416end
1417function FocDiseased()
1418--Supposedly determines if your focus is diseased.
1419--I do not think it works.
1420--Uses "trick" to retarget your original target because playertarget updates slow in wowUI
1421 RunLine("/tarfocus")
1422 local i,x
1423 local numpoisoned=0
1424 for x=1,40 do
1425 local name,count,debuffType=UnitDebuff("target",x)
1426 if debuffType=="Disease" then return true end
1427 end
1428 TargetUnit("playertarget")
1429end
1430function PartyIsPoisoned()
1431--Returns the number of poisoned members of your party
1432--Meant to be used for poison cleansing totem
1433 local i,x
1434 local numpoisoned=0
1435 for i=1,GetNumPartyMembers() do
1436 for x=1,40 do
1437 local name,count,debuffType=UnitDebuff("party"..i,x)
1438 if debuffType=="Poison" then numpoisoned=numpoisoned+1 break end
1439 end
1440 end
1441 for x=1,40 do
1442 local name,count,debuffType=UnitDebuff("player",x)
1443 if debuffType=="Poison" then numpoisoned=numpoisoned+1 break end
1444 end
1445 if debuffType=="Poison" then numpoisoned=numpoisoned+1 end
1446 if numpoisoned>0 then return numpoisoned end
1447end
1448function PartyIsDiseased()
1449--Returns the number of diseased members of your party
1450--Meant to be used for disease cleansing totem
1451 local i,x
1452 local numpoisoned=0
1453 for i=1,GetNumPartyMembers() do
1454 for x=1,40 do
1455 local name,count,debuffType=UnitDebuff("party"..i,x)
1456 if debuffType=="Disease" then numpoisoned=numpoisoned+1 break end
1457 end
1458 end
1459 for x=1,40 do
1460 local name,count,debuffType=UnitDebuff("player",x)
1461 if debuffType=="Disease" then numpoisoned=numpoisoned+1 break end
1462 end
1463 if debuffType=="Disease" then numpoisoned=numpoisoned+1 end
1464 if numpoisoned>0 then return numpoisoned end
1465end
1466function Fade()
1467--Priests fade when any of 20 nearby mobs are attacking them
1468 if OnCooldown("Fade") then return end
1469 for i=1,5 do
1470 TargetNearestEnemy()
1471 if UnitIsEnemy("target","player") and not UnitIsPlayer("target") and TargetInCombat() and UnitIsUnit("targettarget","player") then
1472 MB_msg(UnitName("player").." CASTING FADE BECAUSE OF AGRO FROM "..UnitName("target"))
1473 cast("Fade")
1474 SpellStopCasting()
1475 end
1476 end
1477 TargetUnit("playertarget")
1478end
1479function PetMoveFast()
1480--Used by hunters to tell their pets to dash/dive when they send them
1481 if HasPetSpell("Dash") then PetCast("Dash") end
1482 if HasPetSpell("Dive") then PetCast("Dive") end
1483end
1484function SickemTarget()
1485--Main pet attack function.
1486--if alt key is down pets will return and go passive
1487 --local name,realm=UnitName("player")
1488 --if name=="Olympic" then PetPassiveMode() PetFollow() return end
1489 if UnitHealth("pet")<1 then return end
1490 if (IsAltKeyDown() )then
1491 PetPassiveMode()
1492 PetFollow()
1493 else
1494 if TargetInCombat() or IAmFocus() then PetAttack("target") PetMoveFast() PetDefensiveMode() end
1495 end
1496end
1497function AutoTaunt()
1498--This is an OFF-tank function to automatically taunt any nearby target (in combat) that isn't attacking the tanks
1499 --don't do this for certain bosses where you need multiple tanks
1500 --Only meant to be used in multi-target fights
1501 if UnitName("target")=="Kurinnaxx" then return end
1502 if not OnCooldown("Taunt") or not OnCooldown("Revenge") or not OnCooldown("Mocking Blow") then
1503 for i=1,10 do
1504 TargetNearestEnemy()
1505 local name=UnitName("target")
1506 if not name then return end
1507 local tname=UnitName("targettarget")
1508 --my two tanks are named Furyswipes and Eversmile
1509 if tname and not (tname=="Cuppycake" and tname=="Furyswipes" or tname=="Eversmile" or tname=="Komal") and TargetInCombat() then
1510 cast("Taunt")
1511 cast("Revenge")
1512 if InMeleeRange() then cast("Mocking Blow") end
1513 MB_msg(UnitName("player").." Taunting "..name.." because he's attacking "..tname)
1514 return
1515 end
1516 end
1517 --If you couldn't find anything, target your original target. Uses "trick" in wow UI that updates playertarget slowly,
1518 --so you can do a bunch of target searches then come back to the original
1519 TargetUnit("playertarget")
1520 end
1521end
1522function BufCast(spell)
1523--This cast function only casts if the target is not already buffed with the spell
1524--Useful for spamming harmful or helpful buffs!
1525 local name,realm=UnitName("target")
1526 if not name or not UnitIsConnected("target") or UnitIsDead("target") or UnitIsGhost("target") then return end
1527 --if not buffed(spell,"target") then Print(UnitName("target").." is not buffed with "..spell..". Buffing now.") cast(spell) end
1528 if not buffed(spell,"target") then cast(spell) end
1529end
1530function DotCast(spell)
1531--This cast function only casts if the target is not already buffed with the spell
1532--Useful for spamming harmful or helpful buffs!
1533 local targhp=UnitHealth("target")
1534 if targhp<30000 and UnitLevel("player")>59 then return end
1535 local name,realm=UnitName("target")
1536 if not name or not UnitIsConnected("target") or UnitIsDead("target") or UnitIsGhost("target") then return end
1537 --if not buffed(spell,"target") then Print(UnitName("target").." is not buffed with "..spell..". Buffing now.") cast(spell) end
1538 if not buffed(spell,"target") then cast(spell) end
1539end
1540function StackCast(spell,numstacks)
1541--VERY useful function for stacking a certain number of debuffs (example scorch) on a target and then not casting anymore of that.
1542--I use it to put 5 scorches on mage targets then move on to fireballs
1543--Could also be used for sunder armor
1544 local spell_icon=GetSpellTexture(SpellNum(spell),BOOKTYPE_SPELL)
1545 local count,icon
1546 for i=1,16 do
1547 icon,count,bufftype,duration,expiration,caster = UnitDebuff("target",i)
1548 if icon==spell_icon then
1549 break ; end
1550 end
1551 if not count then count=0 end
1552 if count<numstacks then
1553 if count>=numstacks then CooldownCast(spell,20) else cast(spell) end
1554 end
1555end
1556function OnCooldown(spell)
1557--Important helper function that returns true(actually the duration left) if a spell is on cooldown, nil if not.
1558 if not SpellExists(spell) then return true end
1559 local start,duration,enable = GetSpellCooldown(SpellNum(spell),BOOKTYPE_SPELL)
1560 if duration==0 then
1561 return
1562 else
1563 return duration
1564 end
1565end
1566function CooldownTime(spell)
1567--Experimental helper function that returns how long a spell has been in cooldown
1568 if not SpellExists(spell) then return end
1569 local time=GetTime()
1570 local cdtime
1571 local start,duration,enable = GetSpellCooldown(SpellNum(spell),BOOKTYPE_SPELL)
1572 if duration==0 then cdtime=0
1573 else
1574 cdtime=time-start
1575 end
1576 return cdtime
1577end
1578function PetOnCooldown(spell)
1579--Important helper function that returns true(actually the duration left) if a PET spell is on cooldown, nil if not.
1580 local no=PetSpellNum(spell)
1581 if no then
1582 local start,duration,enable = GetPetActionCooldown(PetSpellNum(spell))
1583 if duration==0 then duration=nil; end
1584 return duration
1585 end
1586end
1587function NumShards()
1588--How many shards do your warlocks have? This function will tell you!
1589 local shards=0
1590 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
1591 local link=GetContainerItemLink(bag,slot)
1592 if link==nil then link="" end
1593 if string.find(link, "Soul Shard") then shards=shards+1 end
1594 end
1595 end
1596 return shards
1597end
1598function MageWater()
1599--How much crappy mage water do you have? This function will tell you--change name below if you have best water
1600--pick up a stack of the best water in your bags
1601 local waterranks=table.invert(MB_mywater)
1602 local bestrank=0
1603 local bestwater=nil
1604 local count=0
1605 local bag,slot,link
1606 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
1607 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
1608 if texture then
1609 link=GetContainerItemLink(bag,slot)
1610 _,stack=GetContainerItemInfo(bag,slot)
1611 local bsnum=string.gsub(link,".-\124H([^\124]*)\124h.*", "%1")
1612 local itemName, itemNo, itemRarity, itemReqLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemIcon = GetItemInfo(bsnum)
1613 if FindInTable(MB_mywater,itemName) then
1614 if waterranks[itemName]>bestrank then
1615 bestwater=itemName
1616 bestrank=waterranks[itemName]
1617 count=stack
1618 elseif waterranks[itemName]==bestrank then
1619 count=count+stack
1620 end
1621 end
1622 end
1623 end end
1624 return count,bestwater
1625end
1626function PickupPetFood()
1627--Used to pick up pet food when feeding pet
1628--have to pick food type based on hunter name and pet
1629 local amount=0
1630 if not CursorHasItem() then
1631 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
1632 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
1633 if texture then
1634 link=GetContainerItemLink(bag,slot)
1635 --Print(link)
1636 if UnitName("pet")=="MainTank" then
1637 if string.find(link, "Deep Fried Plantains") then Print("Picking Up "..bag..","..slot) ; PickupContainerItem(bag,slot) ; return end
1638 else
1639 if string.find(link, "Roasted Quail") then Print("Picking Up "..bag..","..slot) ; PickupContainerItem(bag,slot) ; return end
1640 end
1641 --else
1642 --if string.find(link, "Dried King Bolete") then Print("Picking Up "..bag..","..slot) ; PickupContainerItem(bag,slot) ; return end
1643 --end
1644 end
1645 end
1646 end
1647 end
1648end
1649function HasReagent(spell)
1650--Used to pick up pet food when feeding pet
1651--have to pick food type based on hunter name and pet
1652 count=0
1653 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
1654 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
1655 if texture then
1656 link=GetContainerItemLink(bag,slot)
1657 --Print(link)
1658 if string.find(link,MB_reagent[spell]) then count=count+itemCount end
1659 end
1660 end
1661 end
1662 if count==0 and UnitLevel("player")==60 then
1663 MB_msg("I'm out of "..MB_reagent[spell])
1664 end
1665 return count
1666end
1667function HasItem(item)
1668--Used to pick up pet food when feeding pet
1669--have to pick food type based on hunter name and pet
1670 count=0
1671 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
1672 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
1673 if texture then
1674 link=GetContainerItemLink(bag,slot)
1675 --Print(link)
1676 if string.find(link,item) then count=count+itemCount end
1677 end
1678 end
1679 end
1680 if count==0 then
1681 MB_msg("I'm out of "..item)
1682 end
1683 return count
1684end
1685function scast(spell)
1686 SelfBuff(spell)
1687end
1688function SelfBuff(spell)
1689--Important spell which allows a player to buff themselves without recasting. Only buffs if you don't have buff
1690 if not buffed(spell,"player") then
1691 CastSpellByName(spell,1)
1692 end
1693end
1694function InMeleeRange()
1695--If this returns true, you can whack em with a sword
1696 return CheckInteractDistance("target",3)
1697end
1698function FeedPet()
1699--Hunters:Feed your pet if he's not SUUUUUPER happy.
1700 if GetPetHappiness()~=nil and GetPetHappiness()~=3 then
1701 if not buffed("Feed Pet Effect","pet") then
1702 cast("Feed Pet")
1703 PickupPetFood()
1704 end
1705 end
1706 ResetCursor()
1707end
1708function TankBuff(spell)
1709--Important spell which allows a player to buff themselves without recasting. Only buffs if you don't have buff
1710 for k,tank in pairs(MB_tanklist) do
1711 if RaidID(tank) then
1712 if not buffed(spell,RaidID(tank)) then
1713 TargetUnit(RaidID(tank))
1714 cast(spell)
1715 end
1716 end
1717 end
1718end
1719function InMeleeRange()
1720--If this returns true, you can whack em with a sword
1721 return CheckInteractDistance("target",3)
1722end
1723function FeedPet()
1724--Hunters:Feed your pet if he's not SUUUUUPER happy.
1725 if GetPetHappiness()~=nil and GetPetHappiness()~=3 then
1726 if not buffed("Feed Pet Effect","pet") then
1727 cast("Feed Pet")
1728 PickupPetFood()
1729 end
1730 end
1731 ResetCursor()
1732end
1733function CombatUse(item)
1734--only use an item if you are in combat
1735 if InCombat() then use(item) end
1736end
1737function SummonDemon()
1738--wow 1.12 doesn't tell me anythign about my pet except the name.
1739 if not MB_my_lock_pet then return end
1740 if not UnitExists("pet") and NumShards()==0 then cast("Summon Imp") return end
1741 if not UnitExists("pet") then cast("Summon "..MB_my_lock_pet) end
1742end
1743function SpellNum(spell)
1744--In the wonderful world of 1.12 programming, sometimes just using a spell name isn't enough.
1745--SOMETIMES you need to know what spell NUMBER it is, cause otherwise it doesn't work.
1746--Healthstones and feral spells are like this.
1747 local i = 1
1748 local spellName
1749 while true do
1750 spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL)
1751 if not spellName or spell==spellName then
1752 do break end
1753 end
1754 i = i + 1
1755 end
1756 if spellName == nil then Printd("Error! Spell " .. spell .. " does not exist in spellbook! " ) ; end
1757 return i
1758end
1759function PetSpellNum(spell)
1760--In the wonderful world of 1.12 programming, you can't just say cast("petspell").
1761--You need to cast by number counting left from pet action bar.
1762--Doesn't work if action bar isn't showing--resummon pet
1763 local i
1764 for i=1,20 do
1765 local name,rank,texture,somtin,somtinelse,isAutocast,IsAutocastable=GetPetActionInfo(i)
1766 if name==spell then return i end
1767 end
1768end
1769function HasPetSpell(spell)
1770--Return true if a pet has a spell, say "Growl"
1771 local i
1772 for i=1,20 do
1773 local name,rank,texture,somtin,somtinelse,isAutocast,IsAutocastable=GetPetActionInfo(i)
1774 if name==spell then return true end
1775 end
1776end
1777function PetCast(spell)
1778--Pet spell casting in wow 1.12 is special. You have to cast by number on the bar
1779 if UnitHealth("pet")>1 and HasPetSpell(spell) then CastPetAction(PetSpellNum(spell)) end
1780end
1781function interrupt_boss()
1782--This is a raid winner. I usually put this in shift 3.
1783--Yes, everyone interrupts at the same time, what of it? The best interrupt is ES1
1784--Name your tank in this function
1785 local class=UnitClass("player")
1786 SpellStopCasting()
1787 if TankIsTargeting("Gurubashi Bat Rider") then
1788 if not IAmFocus() then LockonTarget() end
1789 else
1790 TargetByName("High Priestess Jeklik",1)
1791 TargetByName("High Priestess Mar'li",1)
1792 end
1793 if UnitName("target") then RunLine("/yell Interrupting "..UnitName("target")) else Print("Trying to interrupt but have no target!") end
1794 if class=="Shaman" then cast("Earth Shock(Rank 1)") end
1795 if class=="Hunter" then cast("Intimidation") end
1796 if class=="Mage" then cast("Counterspell") end
1797 if class=="Priest" then cast("Silence") end
1798 if class=="Rogue" then cast("Kick") end
1799 if class=="Paladin" then cast("Hammer of Justice") end
1800end
1801function TankTarget(mobname)
1802 --Sometimes we have to know if the tank is targeting a certain boss, so we can do things differently as dps.
1803 --Return nil if you have no focus
1804 if not RaidID(ClassicFocus_CurrentFocus) then
1805 return UnitName("playertarget")==mobname
1806 else
1807 return UnitName(RaidID(ClassicFocus_CurrentFocus).."target")==mobname
1808 end
1809end
1810function TankName()
1811 --Return tanks's name
1812 if not ClassicFocus_CurrentFocus then return end
1813 return UnitName(RaidID(ClassicFocus_CurrentFocus))
1814end
1815function TankID()
1816 --Return tanks's name
1817 if not ClassicFocus_CurrentFocus then return end
1818 return RaidID(ClassicFocus_CurrentFocus)
1819end
1820function AssistTank()
1821 --Some shortcut code to make things more readable
1822 AssistUnit(RaidID(ClassicFocus_CurrentFocus))
1823end
1824function TankTargetHealth()
1825 --Sometimes we have to know if the tank is targeting a certain boss, so we can do things differently as dps.
1826 --Return nil if you have no focus
1827 if not ClassicFocus_CurrentFocus then return end
1828 local health=0
1829 if not UnitIsDead(RaidID(ClassicFocus_CurrentFocus).."target") then
1830 health=UnitHealth(RaidID(ClassicFocus_CurrentFocus).."target")/UnitHealthMax(RaidID(ClassicFocus_CurrentFocus).."target")
1831 end
1832 return health
1833end
1834function Jindo()
1835 tname=UnitName("target")
1836 if (not IAmFocus() and (TankTarget("Powerful Healing Ward") or TankTarget("Shade of Jin'do") or TankTarget("Jin'do the Hexxer") or TankTarget("Brain Wash Totem"))) or tname=="Powerful Healing Ward" or tname=="Shade of Jin'do" or tname=="Jin'do the Hexxer" or tname=="Brain Wash Totem" then return true end
1837end
1838function FastKill()
1839 tname=UnitName("target")
1840 if tname=="Hive'Zara Larva" or tname=="Powerful Healing Ward" or tname=="Shade of Jin'do" or tname=="Brain Wash Totem" then return true end
1841end
1842
1843function LockonTarget()
1844--One of the most important functions in this code.
1845--This is for NON TANKS. Tanks (and even macro-controlled off-tanks) do their own targeting
1846--TARGETING.
1847--Every dps class will use this to chose his target.
1848--There are special routines for known raid bosses.
1849--Mostly, it's just "assist your focus, stupid"
1850--Jin'do targeting not known if working
1851--Mar'li targeting works excellent
1852--
1853 --NOTE:THIS ROUTINE SHOULD NEVER RUN IF THE TOON HAS NO FOCUS. IF IT DOES, SOMETHING WENT WRONG.
1854 if IAmFocus() then MB_msg("I have no focus!") return end
1855
1856 --Jin'do targeting
1857 --Hunters bots focus on the shades.
1858 --local class=UnitClass("player")
1859 --if class=="Hunter" and not IAmFocus() then
1860 --if UnitName("target") then return end
1861 --TargetByName("Shade of Jin'do" ,true)
1862 --if not UnitName("target") then
1863 --local focid=RaidID(ClassicFocus_CurrentFocus)
1864 --if UnitName(focid.."target") then
1865 --TargetUnit(focid.."target")
1866 --else
1867 --TargetNearestEnemy()
1868 --end
1869 --end
1870 --return
1871 --end
1872 --if not IAmFocus() and (TankTarget("Powerful Healing Ward") or TankTarget("Shade of Jin'do") or TankTarget("Jin'do the Hexxer") or TankTarget("Brain Wash Totem")) then
1873if Jindo() then
1874 if not UnitInRaid("player") then return end
1875 local class=UnitClass("player")
1876 if not IAmFocus() then
1877 tname=UnitName("target")
1878 --Stick on an off target till it is dead
1879 --if (tname=="Shade of Jin'do" or tname=="Powerful Healing Ward" or tname=="Brain Wash Totem") and not UnitIsDead("target") then return end
1880 if (tname=="Powerful Healing Ward") and not UnitIsDead("target") then return end
1881 for i=1,10 do
1882 if UnitName("target")=="Powerful Healing Ward" and not UnitIsDead("target") then return end
1883 TargetNearestEnemy()
1884 if UnitName("target")=="Shade of Jin'do" and not UnitIsDead("target") then return end
1885 TargetNearestEnemy()
1886 if UnitName("target")=="Brain Wash Totem" and not UnitIsDead("target") then return end
1887 TargetNearestEnemy()
1888 if UnitName("target")=="Jin'do the Hexxer" and not UnitIsDead("target") then return end
1889 TargetNearestEnemy()
1890 return
1891 end
1892 --ClearTarget()
1893 --TargetByName("Shade of Jin'do" ,true)
1894 --if (UnitHealth("target")>0) then return end
1895 --TargetByName("Powerful Healing Ward" ,true)
1896 --if (UnitHealth("target")>0) then return end
1897 --TargetByName("Brain Wash Totem" ,true)
1898 --if (UnitHealth("target")>0) then return end
1899 --TargetByName("Jin'do the Hexxer" ,true)
1900 end
1901 --if not IAmFocus() and class =="Rogue" then
1902 --TargetByName("Jin'do the Hexxer" ,true)
1903 --return
1904 --end
1905end
1906if TankTarget()=="Ayamiss the Hunter" then
1907 if not IAmFocus() then
1908 tname=UnitName("target")
1909 --Stick on an off target till it is dead
1910 --if (tname=="Shade of Jin'do" or tname=="Powerful Healing Ward" or tname=="Brain Wash Totem") and not UnitIsDead("target") then return end
1911 if (tname=="Hive'Zara Larva") and not UnitIsDead("target") then return end
1912 for i=1,5 do
1913 if UnitName("target")=="Hive'Zara Larva" and not UnitIsDead("target") then return end
1914 TargetNearestEnemy()
1915 end
1916 AssistTank()
1917 return
1918 end
1919end
1920 --if UnitLevel("player")<60 then return end
1921 --if not IAmFocus() and (TankTarget("Powerful Healing Ward") or TankTarget("Shade of Jin'do") or TankTarget("Jin'do the Hexxer") or TankTarget("Brain Wash Totem")) then
1922 --end
1923 --Mar'li targeting
1924 --Kill spiders first and immediately
1925 --
1926 --PRIME DIRECTIVE: IF YOU HAVE A GOOD TARGET THEN DON'T DO THIS CODE! So first line is a check for that and return if true.
1927 if TankTarget("High Priestess Mar'li") and UnitName("target")=="Spawn of Mar'li" and not UnitIsDead("target") then return end
1928 if TankTarget("High Priestess Mar'li") and UnitName("target")=="Witherbark Speaker" and not UnitIsDead("target") then return end
1929 if TankTarget("High Priest Venoxis") and UnitName("target")=="Razzashi Cobra" and not UnitIsDead("target") then return end
1930 --if not UnitIsDead("target") and TargetInCombat() and UnitIsUnit("target",RaidID(ClassicFocus_CurrentFocus).."target") then return end
1931 --
1932 --MARLI
1933 local class=UnitClass("player")
1934 --Melee classes stay on Mar'li, ranged shoots at spiders.
1935 if (class~="Warrior" and class~="Rogue") and TankTarget("High Priestess Mar'li") then
1936 if TankTargetHealth()<.2 then AssistTank() return end
1937 Print("MARLI TARGETING")
1938 for i=1,10 do
1939 if UnitName("target")=="Spawn of Mar'li" and not UnitIsDead("target") then return end
1940 if UnitName("target")=="Witherbark Speaker" and not UnitIsDead("target") then return end
1941 TargetNearestEnemy()
1942 return
1943 end
1944 end
1945 --VENOXIS
1946 if TankTarget("High Priest Venoxis") then
1947 if TankTargetHealth()<.2 then AssistTank() return end
1948 Print("VENOXIS TARGETING")
1949 for i=1,5 do
1950 if UnitName("target")=="Razzashi Cobra" and not UnitIsDead("target") then return end
1951 TargetNearestEnemy()
1952 return
1953 end
1954 end
1955 if TankTarget("Lucifron") or TankTarget("Gehennas") then
1956 if TankTargetHealth()<.2 then AssistTank() return end
1957 Print("Lucifron/Gehennas TARGETING")
1958 for i=1,3 do
1959 if UnitName("target")=="Flamewaker Protector" and not UnitIsDead("target") then return end
1960 TargetNearestEnemy()
1961 return
1962 end
1963 end
1964 --Normal targetting
1965 --MB_msg("Normal targeting, assisting focus")
1966 local focid=RaidID(ClassicFocus_CurrentFocus)
1967 if UnitName(focid.."target") then
1968 TargetUnit(focid.."target")
1969 else
1970 if not UnitIsEnemy("player","target") then TargetNearestEnemy() end
1971 end
1972end
1973function LockonNearest()
1974--ALSO very important--This is used during close combat (_cc) dps routines to get targets near you.
1975 --if UnitIsDead("target") then ClearTarget() end
1976 --for i=1,20 do
1977 --TargetNearestEnemy()
1978 --if TargetInCombat() and InMeleeRange() then return end
1979 --end
1980 LockonTarget()
1981 --If you can't find a target in melee range who is in combat then DON'T SHOOT ANYTHING
1982end
1983function WarriorSurvive()
1984--Warrior last stand/shield wall
1985 if InCombat() and MyHealthPct()<.12 then RunLine("/use Major Healthstone") end
1986 if InCombat() and MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
1987 if InCombat() then
1988 cast("Shield Wall")
1989 end
1990 if InCombat() then
1991 cast("Last Stand")
1992 end
1993end
1994function PallySurvive()
1995 if buffed("player","Divine Shield") or buffed("player","Divine Protection") or buffed("player","Blessing of Protection") then QuickHealD("player") end
1996 if InCombat() and MyHealthPct()<.05 then cast("Divine Shield") end
1997 if InCombat() and MyHealthPct()<.05 then cast("Divine Protection") end
1998 if InCombat() and MyHealthPct()<.05 then cast("Blessing of Protection") end
1999 if InCombat() and MyHealthPct()<.05 then TargetUnit("player") cast("Lay on Hands") TargetUnit("playertarget") end
2000end
2001function UnsilencedCast(spell)
2002--Warrior check to see if should cast an interrupt
2003 if not buffed("Shield Bash","target") and not buffed("Concussion Blow","target") and not buffed("Pummel","target") and not buffed("War Stomp","target") then
2004 cast(spell)
2005 end
2006end
2007function WarriorInterrupt()
2008--Warrior interrupts
2009 if InMeleeRange() then
2010 StanceCast("Defensive Stance")
2011 UnsilencedCast("Pummel")
2012 UnsilencedCast("Shield Bash")
2013 UnsilencedCast("Concussion Blow")
2014 UnsilencedCast("War stomp")
2015 cast("Bloodrage")
2016 else
2017 if not OnCooldown("Intercept") and MyRage()>9 then
2018 StanceCast("Berserker Stance")
2019 cast("Intercept")
2020 end
2021 end
2022end
2023function PallyInterrupt()
2024--Warrior interrupts
2025 if InMeleeRange() then
2026 StanceCast("Defensive Stance")
2027 UnsilencedCast("Pummel")
2028 UnsilencedCast("Shield Bash")
2029 UnsilencedCast("Concussion Blow")
2030 UnsilencedCast("War stomp")
2031 cast("Bloodrage")
2032 else
2033 StanceCast("Berserker Stance")
2034 cast("Intercept")
2035 end
2036end
2037function FeralInterrupt()
2038--Druid interrupts
2039 StanceCast("Dire Bear Form")
2040 cast("Bash")
2041 cast("Enrage")
2042 CloseDistance()
2043end
2044function InCombat()
2045--save some wording, add Jindo exception
2046 return UnitAffectingCombat("player") or Jindo()
2047end
2048function TargetInCombat()
2049--save some wording
2050--Below level 10 ignore this. Return True
2051if UnitLevel("player")<13 then return true end
2052 return (UnitAffectingCombat("target") or Jindo()) and not (buffed("Banish","target") or buffed("Polymorph","target") or buffed("Fear","target") or buffed("Howl of Terror","target") or buffed("Shackle","target") or buffed("Hibernate","target"))
2053end
2054function CloseDistance()
2055--This is warrior druid charge function
2056--You don't want to charge certain bosses when dpsing
2057 if UnitName("target")=="Lava Elemental" or UnitName("target")=="Kurinnaxx" then return end
2058 local class=UnitClass("player")
2059 if class=="Warrior" and SpellExists("Charge") then
2060 if not InCombat() and not InMeleeRange() and not OnCooldown("Charge") and MyRage()<26 then
2061 if MyStance() ~= 1 then StanceCast("Battle Stance"); end
2062 cast("Charge")
2063 elseif (CooldownTime("Charge")==0 or CooldownTime("Charge")>2) and not InMeleeRange() and not OnCooldown("Intercept") then
2064 if (MyRage() < 8 and not OnCooldown("Bloodrage") ) or MyRage() >= 8 then
2065 if not InMeleeRange() then StanceCast("Berserker Stance"); end
2066 if not InMeleeRange() and MyRage() < 8 then cast("Bloodrage") end
2067 if not InMeleeRange() then cast("Intercept") ;end
2068 end
2069 end
2070 end
2071 if class=="Druid" then
2072 if not InMeleeRange() and not OnCooldown("Feral Charge") then
2073 if MyRage()==0 then CancelForm() end
2074 StanceCast("Dire Bear Form")
2075 cast("Feral Charge")
2076 end
2077 end
2078end
2079function CloseDistance_backup()
2080--This is warrior druid charge function
2081--You don't want to charge certain bosses when dpsing
2082 if UnitName("target")=="Kurinnaxx" then return end
2083 local class=UnitClass("player")
2084 if class=="Warrior" then
2085 if not TargetInCombat() and not InCombat() and not InMeleeRange() and not OnCooldown("Charge") and MyRage()<26 then
2086 if MyStance() ~= 1 then StanceCast("Battle Stance"); end
2087 cast("Charge")
2088 elseif (CooldownTime("Charge")==0 or CooldownTime("Charge")>2) and not InMeleeRange() and not OnCooldown("Intercept") then
2089 if (MyRage() < 8 and not OnCooldown("Bloodrage") ) or MyRage() >= 8 then
2090 if not InMeleeRange() then StanceCast("Berserker Stance"); end
2091 if not InMeleeRange() and MyRage() < 8 then cast("Bloodrage") end
2092 if not InMeleeRange() then cast("Intercept") ;end
2093 end
2094 end
2095 end
2096 if class=="Druid" then
2097 if not InMeleeRange() and not OnCooldown("Feral Charge") and TargetInCombat() then
2098 if not InCombat() and MyRage()==0 then CancelAura("Dire Bear Form") end
2099 StanceCast("Dire Bear Form")
2100 cast("Feral Charge")
2101 end
2102 end
2103end
2104function CloseDistanceRegardless()
2105--This is warrior druid charge function
2106--Do it regardless of target or circumstances
2107 local class=UnitClass("player")
2108 if class=="Warrior" then
2109 if not TargetInCombat() and not InCombat() and not InMeleeRange() and not OnCooldown("Charge") and MyRage()<26 then
2110 if MyStance() ~= 1 then StanceCast("Battle Stance"); end
2111 cast("Charge")
2112 elseif (CooldownTime("Charge")==0 or CooldownTime("Charge")>2) and not InMeleeRange() and not OnCooldown("Intercept") then
2113 if (MyRage() < 8 and not OnCooldown("Bloodrage") ) or MyRage() >= 8 then
2114 if not InMeleeRange() then StanceCast("Berserker Stance"); end
2115 if not InMeleeRange() and MyRage() < 8 then cast("Bloodrage") end
2116 if not InMeleeRange() then cast("Intercept") ;end
2117 end
2118 end
2119 end
2120 if class=="Druid" then
2121 if not InMeleeRange() and not OnCooldown("Feral Charge") and TargetInCombat() then
2122 if not InCombat() and MyRage()==0 then CancelAura("Dire Bear Form") end
2123 StanceCast("Dire Bear Form")
2124 cast("Feral Charge")
2125 end
2126 end
2127end
2128function WarriorSnarePlayer()
2129--if your target is an enemy faction player, throw down Hamstring
2130 if UnitIsPlayer("target") and InMeleeRange() then
2131 if MyStance()==1 or MyStance()==3 then
2132 BufCast("Hamstring")
2133 if InMeleeRange() and MyRage() < 8 then if not buffed("Hamstring","target") then cast("Bloodrage") ; end ; end
2134 else
2135 StanceCast("Battle Stance")
2136 if InMeleeRange() and MyRage() >= 8 then BufCast("Hamstring") ; end
2137 if UnitClass("target")=="Rogue" and InMeleeRange() and MyRage() >= 8 then BufCast("Rend") ; end
2138 if InMeleeRange() and MyRage() < 8 then if not buffed("Hamstring","target") then cast("Bloodrage") ; end ; end
2139 end
2140 end
2141end
2142function WhichSubgroup(toonname)
2143--Returns what raid group a given name is in
2144 for i=1,GetNumRaidMembers() do
2145 local name,rank,subgroup=GetRaidRosterInfo(i)
2146 if toonname==name then return subgroup end
2147 end
2148end
2149function RoomInGroup(group)
2150--True if there is an empty slot in a raid group
2151 numingrp=0
2152 for i=1,GetNumRaidMembers() do
2153 local name,rank,subgroup=GetRaidRosterInfo(i)
2154 if subgroup==group then numingrp=numingrp+1 end
2155 end
2156 if numingrp<5 then return true end
2157end
2158function IsPet(unit)
2159--Is that unit a raid or party pet?
2160 for i=1,40 do
2161 if UnitIsUnit("raidpet"..i,unit) or UnitIsUnit("partypet"..i,unit) then
2162 return true
2163 end
2164 end
2165end
2166function BuffTotem(totem)
2167 --Cast a totem that casts a buff on the player
2168 --Don't overwrite stoneclaw or tremor
2169 if FindInTable(MB_totem_table["earth_totems"],totem) and (TotemExists("Stoneclaw Totem") or TotemExists("Tremor Totem")) then return end
2170 SelfBuff(totem)
2171end
2172function TotemExists(totem)
2173 --Check if totem exists in the area.
2174 --Not perfect, won't distingush totems owned by other shammys
2175 --Works though.
2176 local searchtot
2177 if totem=="Disease Cleansing Totem" then searchtot="Cleansing Totem"
2178 else searchtot=totem ; end
2179 --Print("Search Totem is "..totem)
2180 ClearTarget()
2181 TargetByName(searchtot,1)
2182 local targ=UnitName("target")
2183 if targ then
2184 local exist=string.find(targ,"^" .. searchtot)
2185 --Print(exist)
2186 else
2187 local exist=nil
2188 end
2189 --Retarget old target using playertarget slow update trick
2190 TargetUnit("playertarget")
2191 return exist
2192end
2193--space saving functions
2194function MyRage()
2195 return UnitMana("player")
2196end
2197function MyMana()
2198 return UnitMana("player")
2199end
2200function MyManaPct()
2201 return UnitMana("player")/UnitManaMax("player")
2202end
2203function MyHealth()
2204 return UnitHealth("player")
2205end
2206function MyHealthPct()
2207 return UnitHealth("player")/UnitHealthMax("player")
2208end
2209function focus()
2210 return UnitMana("pet")
2211end
2212function MyStance()
2213--Returns a number representing what stance you are in
2214 local currstance
2215 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(1)
2216 if isActive then currstance=1 ; end
2217 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(2)
2218 if isActive then currstance=2 ; end
2219 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(3)
2220 if isActive then currstance=3 ; end
2221 return currstance
2222end
2223function StanceCast(stance)
2224--Changes stances only if you are not already there
2225 local stanceno
2226 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(1)
2227 if isActive then currstance=1 ; end
2228 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(2)
2229 if isActive then currstance=2 ; end
2230 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(3)
2231 if isActive then currstance=3 ; end
2232 if UnitClass("player")=="Warrior" then
2233 if stance=="Battle Stance"
2234 then stanceno=1
2235 elseif stance=="Defensive Stance"
2236 then stanceno=2
2237 elseif stance=="Berserker Stance"
2238 then stanceno=3
2239 end
2240 elseif UnitClass("player")=="Druid" then
2241 if stance=="Dire Bear Form"
2242 then stanceno=1
2243 elseif stance=="Aquatic Form"
2244 then stanceno=2
2245 elseif stance=="Cat Form"
2246 then stanceno=3
2247 elseif stance=="Travel Form"
2248 then stanceno=4
2249 elseif stance=="Moonkin Form"
2250 then stanceno=5
2251 elseif stance=="Tree of Life Form"
2252 then stanceno=6
2253 end
2254 end
2255 if stanceno~=currstance
2256 then cast(stance)
2257 end
2258end
2259function IsInParty(checkclass)
2260 MB_partycomp = {["Mage"]=0,["Paladin"]=0,["Warrior"]=0,["Druid"]=0,["Feral"]=0,["Priest"]=0,["Enhsham"]=0,["Shaman"]=0,["Rogue"]=0,["Warlock"]=0,["Hunter"]=0}
2261 for i=1,5 do
2262 if i==5 then
2263 pclass=UnitClass("player")
2264 pname,realm=UnitName("player")
2265 else
2266 pclass=UnitClass("party"..i)
2267 pname,realm=UnitName("party"..i)
2268 end
2269 if pclass~=nil then
2270 MB_partycomp[pclass] = MB_partycomp[pclass] + 1
2271 end
2272 end
2273 return MB_partycomp[checkclass]
2274end
2275function DruidTankInParty()
2276 for i=1,5 do
2277 if i==5 then
2278 pclass=UnitClass("player")
2279 pname,realm=UnitName("player")
2280 else
2281 pclass=UnitClass("party"..i)
2282 pname,realm=UnitName("party"..i)
2283 end
2284 if pclass=="Druid" and FindInTable(MB_tanklist,pname) then return true end
2285 end
2286end
2287function WarriorTankInParty()
2288 for i=1,5 do
2289 if i==5 then
2290 pclass=UnitClass("player")
2291 pname,realm=UnitName("player")
2292 else
2293 pclass=UnitClass("party"..i)
2294 pname,realm=UnitName("party"..i)
2295 end
2296 if pclass=="Warrior" and FindInTable(MB_tanklist,pname) then return true end
2297 end
2298end
2299function HealersInParty()
2300 count=0
2301 for i=1,5 do
2302 if i==5 then
2303 pclass=UnitClass("player")
2304 pname,realm=UnitName("player")
2305 else
2306 pclass=UnitClass("party"..i)
2307 pname,realm=UnitName("party"..i)
2308 end
2309 if FindInTable(MB_healer_priority,pname) then count=count+1 end
2310 end
2311 return count
2312end
2313function CastersInParty()
2314 count=0
2315 for i=1,5 do
2316 if i==5 then
2317 pclass=UnitClass("player")
2318 pname,realm=UnitName("player")
2319 else
2320 pclass=UnitClass("party"..i)
2321 pname,realm=UnitName("party"..i)
2322 end
2323 if not FindInTable(MB_healer_priority,pname) and (pclass=="Mage" or pclass=="Warlock" or pclass=="Shaman" or pclass=="Priest" ) then count=count+1 end
2324 end
2325 return count
2326end
2327function MeleeDPSInParty()
2328 count=0
2329 for i=1,5 do
2330 if i==5 then
2331 pclass=UnitClass("player")
2332 pname,realm=UnitName("player")
2333 else
2334 pclass=UnitClass("party"..i)
2335 pname,realm=UnitName("party"..i)
2336 end
2337 if not FindInTable(MB_healer_priority,pname) and (pclass=="Warrior" or pclass=="Paladin" or pclass=="Druid" or pclass=="Rogue" or pclass=="Shaman") then count=count+1 end
2338 end
2339 return count
2340end
2341
2342--MB_totem_table = {
2343 --air_totems = {"Grounding Totem","Grace of Air Totem","Nature Resistance Totem","Windwall Totem","Windfury Totem","Sentry Totem","Tranquil Air Totem"},
2344 --earth_totems= { "Stoneclaw Totem","Stoneskin Totem","Strength of Earth Totem","Earthbind Totem","Tremor Totem"},
2345 --fire_totems= {"Flametongue Totem","Fire Nova Totem","Magma Totem","Searing Totem","Frost Resistance Totem","Tremor Totem" } ,
2346 --water_totems={ "Mana Spring Totem","Fire Resistance Totem","Healing Stream Totem","Disease Cleansing Totem","Mana Tide Totem","Poison Cleansing Totem" }
2347 --}
2348function ChooseAirTotem()
2349 if TankTarget("Hakkar") then return "Grounding Totem" end
2350 if TankTarget("Stoneskin Gargoyle") or TankTarget("Lord Skwol") or TankTarget("High Priestess Mar'li") or TankTarget("Spawn of Mar'li") or TankTarget("High Priestess Mar'li") or TankTarget("Witherbark Speaker") or TankTarget("High Priest Venoxis") or TankTarget("Razzashi Cobra") then return "Nature Resistance Totem" end
2351 if DruidTankInParty() or WarriorTankInParty() or (IsInParty("Hunter")>0 and IsInParty("Hunter")>IsInParty("Rogue")) then return "Grace of Air Totem" end
2352 if IsInParty("Rogue")>0 and IsInParty("Rogue")>=IsInParty("Hunter") then return "Windfury Totem" end
2353 return "Tranquil Air Totem"
2354end
2355function ChooseEarthTotem()
2356 if MeleeDPSInParty()>0 then return "Strength of Earth Totem" end
2357
2358 return "Stoneskin Totem"
2359end
2360function ChooseWaterTotem()
2361 if TankTarget("Lord Skwol") or TankTarget("High Priestess Mar'li") or TankTarget("Spawn of Mar'li") or TankTarget("High Priestess Mar'li") or TankTarget("Witherbark Speaker") or TankTarget("High Priest Venoxis") or TankTarget("Razzashi Cobra") then return "Poison Cleansing Totem" end
2362 if TankTarget("Ragnaros") or TankTarget("Baron Geddon") or TankTarget("Flame Imp") or TankTarget("Lava Elemental") or TankTarget("Flamegaurd") or TankTarget("Gehennas") or TankTarget("Firewalker") or TankTarget("Magmadar") or TankTarget("Sulfuron Harbinger") or TankTarget("Flamewaker Priest") then return "Fire Resistance Totem" end
2363
2364 return "Mana Spring Totem"
2365end
2366function party_totems()
2367 CastTotem(ChooseWaterTotem())
2368 CastTotem(ChooseAirTotem())
2369 if not MB_cooldowns["Tremor Totem"] then
2370 CastTotem(ChooseEarthTotem())
2371 end
2372end
2373function CastTotem(totem)
2374 Print("Casting "..totem)
2375 if FindInTable(MB_totem_table["water_totems"],totem) and buffed("Mana Tide","player") then return end
2376 if (totem=="Fire Nova Totem" or totem=="Magma Totem") and (not InMeleeRange() or not InCombat()) then return end
2377 local duration=60
2378 if string.find(totem,"Searing Totem") and not InCombat() then return end
2379 MB_totemtypes = { buff={ "Grace of Air Totem","Nature Resistance Totem","Windwall Totem","Tranquil Air Totem","Stoneskin Totem","Strength of Earth Totem","Frost Resistance Totem","Fire Resistance Totem","Mana Spring Totem","Healing Stream Totem","Mana Tide Totem" },
2380 nobuff= { "Windfury Totem","Grounding Totem","Sentry Totem","Earthbind Totem","Stoneclaw Totem","Fire Nova Totem","Magma Totem","Searing Totem(Rank 1)","Flametongue Totem","Tremor Totem","Poison Cleansing Totem","Disease Cleansing Totem"}
2381 }
2382 if FindInTable(MB_totemtypes.nobuff,totem) then
2383 if totem=="Grounding Totem" then cast("Grounding Totem") return end
2384 CooldownCast(totem,duration)
2385 else
2386 if not buffed(string.gsub(totem," Totem",""),"player") then BuffTotem(totem) end
2387 end
2388end
2389
2390function FlametongueWeapon()
2391--Throws Flametongue on main if not on already
2392 has_enchant_main,mx,mc,has_enchant_off = GetWeaponEnchantInfo()
2393 if not has_enchant_main then
2394 cast("Flametongue Weapon")
2395 RunLine("/use 16")
2396 end
2397end
2398function InstantPoisonMain()
2399 has_enchant_main,mx,mc,has_enchant_off = GetWeaponEnchantInfo()
2400 if not has_enchant_main then
2401 use("Instant Poison VI")
2402 PickupInventoryItem(16)
2403 end
2404 ResetCursor()
2405end
2406function InstantPoisonOff()
2407 has_enchant_main,mx,mc,has_enchant_off = GetWeaponEnchantInfo()
2408 if not has_enchant_off then
2409 use("Instant Poison VI")
2410 --use("Wound Poison IV")
2411 PickupInventoryItem(17)
2412 end
2413 ResetCursor()
2414end
2415function WindfuryWeapon()
2416--Throws Windfury on main if not on already
2417 has_enchant_main,mx,mc,has_enchant_off = GetWeaponEnchantInfo()
2418 if not has_enchant_main then
2419 cast("Windfury Weapon")
2420 RunLine("/use 16")
2421 end
2422end
2423function RockbiterWeapon()
2424--Throws Rockbiter on main if not on already
2425 has_enchant_main,mx,mc,has_enchant_off = GetWeaponEnchantInfo()
2426 if not has_enchant_main then
2427 cast("Rockbiter Weapon")
2428 RunLine("/use 16")
2429 end
2430end
2431function FocHealth()
2432--Return the amount of health your focus has
2433 RunLine("/tarfocus")
2434 if not UnitName("target") then return 1 end
2435 local fochealth=UnitHealth("target")/UnitHealthMax("target")
2436 TargetUnit("playertarget")
2437 return fochealth
2438end
2439function FocHasMortalStrike()
2440--Return the amount of health your focus has
2441 RunLine("/tarfocus")
2442 if not UnitName("target") then return 1 end
2443 has_ms=buffed("Mortal Strike","target")
2444 TargetUnit("playertarget")
2445 return has_ms
2446end
2447function HasMortalStrike(id)
2448--Return the amount of health your focus has
2449 return buffed("Mortal Strike",id)
2450end
2451function Equipped2H()
2452--Returns true if you have the named sword equipped
2453 return string.find(GetInventoryItemLink("player",16), "Manslayer of the Qiraji") or string.find(GetInventoryItemLink("player",16), "Destroyer of Worlds")
2454end
2455function EquippedShield()
2456--Returns true if you have the named shield equipped
2457 if not GetInventoryItemLink("player",17) then return nil end
2458 local shield=string.find(GetInventoryItemLink("player",17), "Aegis of the Blood God") or string.find(GetInventoryItemLink("player",17), "Jagged Obsidian Shield") or string.find(GetInventoryItemLink("player",17), "Stygian Buckler")
2459 return shield
2460end
2461function ManaOf(name)
2462 if not RaidID(name) then return 0 end
2463 return UnitMana(RaidID(name))
2464end
2465function HasMoreMana(name)
2466 if not RaidID(name) then return nil end
2467 return ManaOf(RaidID(name))>MyMana()
2468end
2469function BetterCasterReady()
2470if myname=="Refill" and HasMoreMana("Cashme") then return true end
2471if myname=="Bubbling" and (HasMoreMana("Cashme") or HasMoreMana("Refill")) then return true end
2472if myname=="Avindra" and (HasMoreMana("Cashme") or HasMoreMana("Refill") or HasMoreMana("Bubbling")) then return true end
2473if myname=="Zumwalt" and (HasMoreMana("Avindra") or HasMoreMana("Cashme") or HasMoreMana("Refill") or HasMoreMana("Bubbling")) then return true end
2474if myname=="Silza" and (HasMoreMana("Zumwalt") or HasMoreMana("Avindra") or HasMoreMana("Cashme") or HasMoreMana("Refill") or HasMoreMana("Bubbling")) then return true end
2475if myname=="Flameshocked" and HasMoreMana("Icefloes") then return end
2476if myname=="Calypsa" and (HasMoreMana("Icefloes") or HasMoreMana("Flameshocked")) then return true end
2477if myname=="Zillazee" and (HasMoreMana("Calypsa") or HasMoreMana("Icefloes") or HasMoreMana("Flameshocked")) then return true end
2478if myname=="Merazza" and (HasMoreMana("Zillazee") or HasMoreMana("Calypsa") or HasMoreMana("Icefloes") or HasMoreMana("Flameshocked")) then return true end
2479if myname=="Jenjja" and (HasMoreMana("Merazza") or HasMoreMana("Zillazee") or HasMoreMana("Calypsa") or HasMoreMana("Icefloes") or HasMoreMana("Flameshocked")) then return true end
2480if myname=="Barie" and HasMoreMana("Punchingbear") then return true end
2481if myname=="Orinoco" and (HasMoreMana("Barie") or HasMoreMana("Punchingbear")) then return true end
2482if myname=="Komal" and (HasMoreMana("Orinoco") or HasMoreMana("Barie") or HasMoreMana("Punchingbear")) then return true end
2483if myname=="Furyswipes" and (HasMoreMana("Komal") or HasMoreMana("Orinoco") or HasMoreMana("Barie") or HasMoreMana("Punchingbear")) then return true end
2484end
2485function ReagentCheck(spell)
2486 --Print("MB_prev_reagent_count["..spell.."]="..MB_prev_reagent_count[spell])
2487 --Print("HasReagent("..spell..")="..HasReagent(spell))
2488 if HasReagent(spell) < MB_prev_reagent_count[spell] then
2489 MB_msg("Casted "..spell.." on "..MB_last_target)
2490 return true
2491 end
2492end
2493function RaidBuff(spell)
2494--Print("Casting RaidBuff("..spell..")")
2495if UnitIsDead("player") or UnitIsGhost("player") then return end
2496if not UnitInRaid("player") then PartyBuff(spell) return end
2497if PartyBuff(spell) then return end
2498local myname,myrealm=UnitName("player")
2499if BetterCasterReady() then return end
2500--This is for appying fort/int/gotw.
2501--It works by finding anyone without the buff and landing it on him. Then it checks again.
2502--Randomize someone in raid and start checking raid there. Go through raid and buff them if they don't have it.
2503 local n=GetNumRaidMembers()
2504 i=math.random(n)
2505 for j=i,n do
2506 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(j)
2507 if name then
2508 --Print(name.." "..j)
2509 if not UnitIsGhost("raid"..j) and not UnitIsDead("raid"..j) and UnitIsConnected("raid"..j) then
2510 TargetByName(name,1)
2511 --if not buffed(spell,"raid"..j) and HasReagent(spell) and MyMana()>MB_manacost[spell] then MB_msg("Raid Buffing "..name.." with "..spell) cast(spell) return true end
2512 if not buffed(spell,"raid"..j) and MyMana()>MB_manacost[spell] then cast(spell) end
2513 end
2514 end
2515 end
2516 for j=1,i do
2517 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(j)
2518 if name then
2519 --Print(name.." "..j)
2520 if not UnitIsGhost("raid"..j) and not UnitIsDead("raid"..j) and UnitIsConnected("raid"..j) then
2521 TargetByName(name,1)
2522 --Print("Targeted "..UnitName("target"))
2523 --if not buffed(spell,"raid"..j) and HasReagent(spell) and MyMana()>MB_manacost[spell] then MB_msg("Raid Buffing "..name.." with "..spell) cast(spell) return true end
2524 if not buffed(spell,"raid"..j) and MyMana()>MB_manacost[spell] then cast(spell) end
2525 end
2526 end
2527 end
2528end
2529function PartyBuff(spell)
2530--party version
2531--This is for appying fort/int/gotw.
2532--It works by finding anyone without the buff and landing it on him. Then it checks again.
2533--Randomize someone in raid and start checking raid there. Go through raid and buff them if they don't have it.
2534 --Print("PartyBuff "..spell)
2535 TargetUnit("player")
2536 BufCast(spell)
2537 TargetUnit("playertarget")
2538 local n=GetNumPartyMembers()
2539 if n>0 then
2540 i=math.random(n)
2541 for j=i,n do
2542 if IsAlive("party"..j) then
2543 TargetUnit("party"..j)
2544 if not buffed(spell,"party"..j) and MyMana()>MB_manacost[spell] then cast(spell) end
2545 TargetUnit("playertarget")
2546 end
2547 end
2548 for j=1,i do
2549 --Print(name.." "..j)
2550 if IsAlive("party"..j) then
2551 TargetUnit("party"..j)
2552 if not buffed(spell,"party"..j) and MyMana()>MB_manacost[spell] then cast(spell) end
2553 TargetUnit("playertarget")
2554 end
2555 end
2556 end
2557end
2558function FindATargetStupid()
2559--You've lost all targets because of awesomeness. Get another one if the battle still rages.
2560 if not InCombat() then return end
2561 local name=UnitName("target")
2562 if name then return end
2563 for i=0,10 do
2564 TargetNearestEnemy()
2565 if TargetInCombat() then return end
2566 end
2567 ClearTarget()
2568end
2569function TargetNotOnMe()
2570--If you are holding alt down, any class that has this in his rotation (usually tank) will switch to a target not on the tank
2571--In my case that is Furyswipes or Eversmile
2572--The target WILL be in combat, so no fear of accidentally pulling
2573 if not UnitIsUnit("player","targettarget") then return end
2574 if not UnitName("target") and InCombat() then TargetNearestEnemy() return end
2575 if IsAltKeyDown() then
2576 local name=UnitName("target")
2577 local maxhp=UnitHealthMax("target")
2578 for i=0,10 do
2579 TargetNearestEnemy()
2580 if (TargetInCombat() and
2581 not (UnitName("targettarget")=="Cuppycake" or UnitName("targettarget")=="Komal" or UnitName("targettarget")=="Eversmile" or UnitName("targettarget")=="Furyswipes" ) )
2582 or (TargetInCombat() and UnitHealthMax("target")==maxhp and UnitName("target")==name)
2583 then return end
2584 end
2585 TargetUnit("playertarget")
2586 end
2587end
2588function TargetNotOnTankNoAlt()
2589--Any class that has this in his rotation (usually tank in close combat) will switch to a target not on the tank
2590--every time the button is pressed.
2591--The target WILL be in combat, so no fear of accidentally pulling
2592 if not FindInTable(MB_tanklist,UnitName("targettarget")) then return end
2593 for i=0,10 do
2594 if not UnitName("target") then TargetNearestEnemy() end
2595 if TargetInCombat() and not FindInTable(MB_tanklist,UnitName("targettarget")) then return end
2596 TargetNearestEnemy()
2597 end
2598 TargetUnit("playertarget")
2599end
2600function PartyID(qname)
2601--Very useful function that returns the UnitId (party1, party4,partypet4, etc) of the named toon.
2602 if qname==UnitName("player") then return "player" end
2603 for i=1,GetNumPartyMembers() do
2604 local name=UnitName("party"..i)
2605 if name==qname then return "party"..i end
2606 end
2607end
2608function RaidIdx(qname)
2609--This returns the obscure raid index number of a player. It is a number like raid4 without the raid part.
2610 for i=1,GetNumRaidMembers() do
2611 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
2612 if name==qname then return i end
2613 end
2614end
2615function rezemall_nogood()
2616 Thaliz_StartResurrectionOnPriorityTarget()
2617end
2618function rezemall()
2619--One of my favorites! Put this function in slot 8 of everyone's bar.
2620--When you have at least one rezzer up and a bunch of dead people, start spamming 8
2621--You will rez OTHER REZZERS FIRST. Then, they will start rezzing, and so on!
2622--One button does it all! Also accepts the rez for all toons.
2623--BUG: YOU MUST JUMP after each player rezes to stop the next rez. For some reason,
2624--rezzers always try to rerez the player that just stood up!
2625--I can't get SpellStopCasting() to work to interrupt it.
2626 if not UnitInRaid("player") then return rezparty() end
2627 AcceptResurrect()
2628 if UnitIsDead("player") or UnitIsGhost("player") then return end
2629 if ManaDown()>0 and buffed("Drink","player") then return end
2630 local deadlist={}
2631 local deadlist_rezzers={}
2632 local live_ready_rezzers={}
2633 local rezzer
2634 local myname,realm=UnitName("player")
2635 local myclass=UnitClass("player")
2636 if not (myclass=="Priest" or myclass=="Shaman" ) then return end
2637 if buffed("Drink","player") or ((UnitClass("player")=="Shaman" and UnitMana("player")<1368) or (UnitClass("player")=="Priest" and UnitMana("player")<1077) ) then Print("Not enough mana to rez, or drinking.") return end
2638 if UnitInRaid("player") then
2639 for i=1,GetNumRaidMembers() do
2640 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
2641 if UnitIsConnected("raid"..i) then
2642 if class=="Priest" or class=="Shaman" then rezzer=1 else rezzer=0 end
2643 if isdead then
2644 if rezzer==1 then table.insert(deadlist_rezzers,name) end
2645 if rezzer==0 then table.insert(deadlist,name) end
2646 else
2647 local manaleft=UnitMana(RaidID(name))
2648 if rezzer==1 and not buffed("Drink","raid"..i) and ((UnitClass("raid"..i)=="Shaman" and UnitMana("raid"..i)>1367) or (UnitClass("raid"..i)=="Priest" and UnitMana("raid"..i)>1076) ) or name==myname then table.insert(live_ready_rezzers,name) end
2649 end
2650 end
2651 end
2652 table.sort(deadlist_rezzers)
2653 table.sort(deadlist)
2654 table.sort(live_ready_rezzers)
2655 myorder=FindInTable(live_ready_rezzers,myname)
2656 Print("My rezzing order is "..myorder)
2657 numtorez=TableLength(deadlist_rezzers)
2658 if numtorez>=myorder then
2659 MB_msg("Rezzing "..deadlist_rezzers[myorder])
2660 CastSpellByName(MB_rez_spells[myclass])
2661 SpellTargetUnit(RaidID(deadlist_rezzers[myorder]))
2662 return
2663 end
2664 myorder=FindInTable(live_ready_rezzers,myname)
2665 numtorez=TableLength(deadlist)
2666 if numtorez>=myorder then
2667 CastSpellByName(MB_rez_spells[myclass])
2668 MB_msg("Rezzing "..deadlist[myorder])
2669 SpellTargetUnit(RaidID(deadlist[myorder]))
2670 return
2671 end
2672 end
2673end
2674function rezparty()
2675 AcceptResurrect()
2676 if UnitIsDead("player") or UnitIsGhost("player") then return end
2677 if ManaDown()>0 and buffed("Drink","player") then return end
2678 local deadlist={}
2679 local deadlist_rezzers={}
2680 local live_ready_rezzers={}
2681 local rezzer
2682 local myname,realm=UnitName("player")
2683 local myclass=UnitClass("player")
2684 if not (myclass=="Paladin" or myclass=="Priest" or myclass=="Shaman" ) then return end
2685 for i=1,GetNumPartyMembers() do
2686 local name,realm=UnitName("party"..i)
2687 local class=UnitClass("party"..i)
2688 local isDead=UnitIsDead("party"..i) or UnitIsGhost("party"..i)
2689 if UnitIsConnected("party"..i) then
2690 if class=="Priest" or class=="Shaman" or class=="Paladin" then rezzer=1 else rezzer=0 end
2691 if isDead then
2692 if rezzer==1 then table.insert(deadlist_rezzers,name) end
2693 if rezzer==0 then table.insert(deadlist,name) end
2694 else
2695 local manaleft=UnitMana(PartyID(name))
2696 if rezzer==1 and not buffed("Drink","party"..i) and ((UnitClass("player")=="Paladin" and manaleft>399) or (UnitClass("player")=="Shaman" and manaleft>1367) or (UnitClass("player")=="Priest" and manaleft>1077) ) then table.insert(live_ready_rezzers,name) end
2697 end
2698 end
2699 end
2700 if UnitClass("player")=="Paladin" or UnitClass("player")=="Shaman" or UnitClass("player")=="Priest" then
2701 name,realm=UnitName("player")
2702 table.insert(live_ready_rezzers,name)
2703 end
2704 table.sort(deadlist_rezzers)
2705 table.sort(deadlist)
2706 table.sort(live_ready_rezzers)
2707 myorder=FindInTable(live_ready_rezzers,myname)
2708 numreztorez=TableLength(deadlist_rezzers)
2709 numtorez=TableLength(deadlist)
2710 --Print("myorder")
2711 --Print(myorder)
2712 --Print("num rezzers to rez")
2713 --Print(numreztorez)
2714 if numreztorez>=myorder then
2715 CastSpellByName(MB_rez_spells[myclass])
2716 SpellTargetUnit(PartyID(deadlist_rezzers[myorder]))
2717 end
2718 if numtorez>=myorder then
2719 CastSpellByName(MB_rez_spells[myclass])
2720 SpellTargetUnit(PartyID(deadlist[myorder]))
2721 end
2722end
2723function RaiderHealthP(raidid)
2724 return UnitHealth(raidid)/UnitHealthMax(raidid)
2725end
2726function DHActive(id)
2727 local name,realm=UnitName(id)
2728 if FindInTable(MB_tanklist,name) and IsAlive(RaidID(MB_dher[name])) then
2729 if UnitMana(RaidID(MB_dher[name]))/UnitManaMax(RaidID(MB_dher[name]))>.1 and UnitHealth(RaidID(MB_dher[name]))/UnitHealthMax(RaidID(MB_dher[name]))>.2 then return true end
2730 end
2731end
2732function DedicatedHealing(name)
2733 if not FindInTable(MB_dedicated_healers,name) then return end
2734 if (UnitHealth(RaidID(MB_dedicated_targets[name]))/UnitHealthMax(RaidID(MB_dedicated_targets[name])))==1 then return end
2735 return true
2736end
2737function RaidHeal()
2738 MB_maxheal={Druid=11,Priest=11,Shaman=11,Paladin=11}
2739 if TankTarget("Ragnaros") then QuickHeal() return end
2740 --for parties just quickheal
2741 if GetNumRaidMembers()<6 then QuickHealD() return end
2742 if not buffed("Sprit of Redemption","player") and (UnitIsDead("player") or UnitIsGhost("player")) then return end
2743 if ManaDown()>0 and buffed("Drink","player") then return end
2744 local i,name,dmg
2745 local myname,realm=UnitName("player")
2746 local myclass=UnitClass("player")
2747 local live_ready_healers={}
2748 MB_raid_damage={}
2749 local x=1
2750 local remove_list={}
2751 local healer_mana={}
2752 MB_ots={}
2753 MB_dedicated_healers={}
2754 for k,tank in pairs(MB_tanklist) do
2755 local name, realm=UnitName("player")
2756 if IsAlive(RaidID(tank)) and tank~=name then
2757 table.insert(MB_ots,tank)
2758 table.insert(MB_dedicated_healers,MB_dher[tank])
2759 end
2760 end
2761 if FindInTable(MB_dedicated_healers,myname) and IsAlive(RaidID(MB_dedicated_targets[myname])) then
2762 --MB_msg("I am a dedicated healer, healing "..MB_dedicated_targets[myname])
2763 if (UnitHealth(RaidID(MB_dedicated_targets[myname]))/UnitHealthMax(RaidID(MB_dedicated_targets[myname])))<1 then
2764 TargetUnit(RaidID(MB_dedicated_targets[myname]))
2765 if (UnitHealth("target")/UnitHealthMax("target"))<.55 and not buffed("Weakened Soul","target") then cast("Power Word: Shield") end
2766 --Print("I'm a dedicated")
2767 --if UnitHealth((RaidID(MB_dedicated_targets[myname])))/UnitHealthMax((RaidID(MB_dedicated_targets[myname])))>.5 then MB_msg("Casting Renew on my dedicated target.") BufCast("Renew") end
2768 CastHeal(MB_dedicated_targets[myname])
2769 TargetUnit("playertarget")
2770 return
2771 end
2772 end
2773 --For everyone else, make a list of priority healers who are ready to heal and their mana.
2774 for i=1,TableLength(MB_healer_priority) do
2775 local found=nil
2776 for x=1,GetNumRaidMembers() do
2777 name,realm=UnitName("raid"..x)
2778 --This prevents raid heals on units that have dedicated healers
2779 if name==MB_healer_priority[i] and IsAlive("raid"..x) and RaiderHealthP("raid"..x)>.2 and not buffed ("Drink","raid"..x) and not buffed("Sonic Burst","raid"..x) and not DedicatedHealing(name) and (UnitMana("raid"..x)>500 or name==myname) then healer_mana[name]=UnitMana("raid"..x) break end
2780 end
2781 end
2782 --Create an ordered list of hurt people
2783 for i=1,GetNumRaidMembers() do
2784 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
2785 --this complicated if statement removes dead or disconnected members, AND tanks whose dedicated healer is alive and connected! (DH currently removed)
2786 if IsAlive("raid"..i) and not DHActive("raid"..i) then
2787 local losthealth=UnitHealthMax("raid"..i)-UnitHealth("raid"..i)
2788 MB_raid_damage[name]=losthealth
2789 end
2790 end
2791 i=1
2792 local hurt_list={}
2793 for name,dmg in spairs(MB_raid_damage, function(t,a,b) return t[b] < t[a] end) do
2794 hurt_list[i]=name
2795 i=i+1
2796 end
2797 --Go through each healer in the sorted mana list. If you are the current healer, heal the corresponding hurt guy.
2798 local healer_count=1
2799 i=1
2800 for name,mana in spairs(healer_mana, function(t,a,b) return t[b] < t[a] end) do
2801 --Print("Healers:") Print(name) Print(mana)
2802 if name==myname then CastHeal(hurt_list[i]) return end
2803 i=i+1
2804 end
2805end
2806function CastHeal(name)
2807 --Check for need for prayer of healing
2808 --Check for need for chain healing
2809 --Check for emergency (health under 15%)
2810 local healsize=1
2811 local amount=UnitHealthMax(RaidID(name))-UnitHealth(RaidID(name))
2812 if SpellExists("Nature's Swiftness") and not OnCooldown("Nature's Swiftness") and UnitHealth(RaidID(name))/UnitHealthMax(RaidID(name))<.15 then cast("Nature's Swiftness") end
2813 --if UnitClass("player")=="Priest" and UnitHealth(RaidID(name))/UnitHealthMax(RaidID(name))>.25 and PartyHurt(700,3) then cast("Prayer of Healing") end
2814 if amount<50 then return end
2815 --MB_msg("Casting heal on "..name.." who is down "..amount.." hp.")
2816 QuickHealD(RaidID(name))
2817end
2818function SpellExists(findspell)
2819 for i = 1, MAX_SKILLLINE_TABS do
2820 local name, texture, offset, numSpells = GetSpellTabInfo(i);
2821
2822 if not name then
2823 break;
2824 end
2825
2826 for s = offset + 1, offset + numSpells do
2827 local spell, rank = GetSpellName(s, BOOKTYPE_SPELL);
2828
2829 if rank then
2830 local spell = spell.." "..rank;
2831 end
2832 if string.find(spell,findspell,nil,true) then
2833 return true
2834 end
2835 end
2836end
2837end
2838function MageInGroup()
2839 local mages={}
2840 if UnitInRaid("player") then
2841 for i=1,GetNumRaidMembers() do
2842 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
2843 if class=="Mage" then table.insert(mages,name) end
2844 end
2845 else
2846 local name,realm=UnitName("player")
2847 if UnitClass("player")=="Mage" then table.insert(mages,name) end
2848 for i=1,4 do
2849 class=UnitClass("party"..i)
2850 local name,realm=UnitName("party"..i)
2851 if class=="Mage" then table.insert(mages,name) end
2852 end
2853 end
2854 if TableLength(mages)==0 then
2855 return nil
2856 else
2857 return(mages[math.random(TableLength(mages))])
2858 end
2859end
2860function MyClassOrder()
2861--This sorts the number of toons in a given class in alphabetical order and returns a number
2862--representing which number in that list this toon is.
2863 local myclass=UnitClass("player")
2864 local myname=UnitName("player")
2865 local myclasstoons={}
2866 if UnitInRaid("player") then
2867 for i=1,GetNumRaidMembers() do
2868 local name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
2869 if class==myclass then table.insert(myclasstoons,name) end
2870 end
2871 else
2872 local name,realm=UnitName("player")
2873 table.insert(myclasstoons,name)
2874 for i=1,4 do
2875 class=UnitClass("party"..i)
2876 local name,realm=UnitName("party"..i)
2877 if class==myclass then table.insert(myclasstoons,name) end
2878 end
2879 end
2880 table.sort( myclasstoons )
2881 local order=1
2882 for k,toon in pairs(myclasstoons) do
2883 if toon==myname then return order end
2884 order=order+1
2885 end
2886end
2887function ManaUser()
2888 return UnitPowerType("player")==0
2889end
2890function ManaDown()
2891 if ManaUser() then
2892 return UnitManaMax("player")-UnitMana("player")
2893 else
2894 return 0
2895 end
2896end
2897function IsInGroup(qclass)
2898 local grouplist={}
2899 local idx=0
2900 if UnitInRaid("player") then
2901 for i=1,GetNumRaidMembers() do
2902 name,rank,subgroup,level,class,fileName,zone,online,isdead=GetRaidRosterInfo(i)
2903 if class==qclass then grouplist[idx]=name ; idx = idx+1 end
2904 end
2905 else
2906 for i=1,4 do
2907 class=UnitClass("party"..i)
2908 name,realm=UnitName("party"..i)
2909 if class==qclass then grouplist[idx]=name ; idx=idx+1 end
2910 end
2911 end
2912 return grouplist
2913end
2914function healthdown()
2915 return UnitHealthMax("player")-UnitHealth("player")
2916end
2917function smartdrink()
2918 local class=UnitClass("player")
2919 if class=="Warrior" or class=="Rogue" then return end
2920 if class~="Mage" and MB_tradeopen then
2921 if GetTradeTargetItemLink(1) and string.find(GetTradeTargetItemLink(1), "Conjured.*Water") then AcceptTrade() end
2922 end
2923 if class~="Mage" and not MB_tradeopen then
2924 local mage=MageInGroup()
2925 if mage then
2926 if MageWater()<1 and ManaUser() then
2927 TargetByName(mage,1)
2928 if not buffed("Drink","target") and not MB_tradeopen then InitiateTrade("target") end
2929 end
2930 end
2931 end
2932 if class=="Mage" and MB_tradeopen then
2933 if GetTradePlayerItemLink(1) and string.find(GetTradePlayerItemLink(1), "Conjured.*Water") then AcceptTrade() end
2934 count=MageWater()
2935 if count<22 and MyManaPct()>.2 then cast("Conjure Water") end
2936 --keep 22 water at all times just in case you run out
2937 if MageWater()>21 and PickupWater() then
2938 ClickTradeButton(1)
2939 end
2940 end
2941 if buffed("Evocation","player") then return end
2942 _,mybest=MageWater()
2943 if ManaUser() and ManaDown()>0 and mybest and not buffed("Drink","player") then use(mybest) end
2944 if class=="Mage" and ManaDown()>0 and not mybest and not buffed("Drink","player") then cast("Conjure Water") end
2945end
2946
2947function smartdrink_old()
2948--smartdrink uses the addon TradeDispenser to quickly produce magewater and trade it to
2949--everyone who needs it. 20 at the most. Just assign it to a button (it's in everyone's prep)
2950--and start spamming. The mages will produce 100 water then hand them out by random request 20
2951--at a time.
2952 local class=UnitClass("player")
2953 if class=="Warrior" or class=="Rogue" then return end
2954 for level,water in MB_mywater do
2955 if MyLevel()-level>=0 and MyLevel()-level<=10 then MyWater=water break end
2956 end
2957 if class~="Mage" and GetTradeTargetItemLink(1) and string.find(GetTradeTargetItemLink(1), "Conjured.*Water") then AcceptTrade() end
2958 --Print(class)
2959 --Print("In Smartdrink")
2960 --if UnitName("player")=="Furyswipes" then return end
2961 if class=="Mage" then
2962 if MageWater()<9 then CancelTrade() end
2963 if buffed("Evocation","player") then return end
2964 if buffed("Drink","player") and ManaDown()>0 then return end
2965 if MyManaPct()>.1 then
2966 if MyLevel()==60 and MageWater()<11 and MyManaPct()>.1 then cast("Conjure Water") end
2967 if MyLevel()<60 and MageWater()<20 and MyManaPct()>.1 then cast("Conjure Water") end
2968 end
2969 if ManaDown()>0 and not buffed("Drink","player") then RunLine("/use "..MyWater) end
2970 else
2971 local mage=MageInGroup()
2972 if mage then
2973 if MageWater()<1 and ManaUser() then
2974 TargetByName(mage,1)
2975 if not buffed("Drink","target") then InitiateTrade("target") end
2976 end
2977 else
2978 end
2979 if ManaUser() and ManaDown()>0 and not buffed("Drink","player") then RunLine("/use "..MyWater) end
2980 end
2981end
2982function PartyHurt(hurt,num_party_hurt)
2983 local numhurt=0
2984 local myhurt=UnitHealthMax("player")-UnitHealth("player")
2985 if myhurt>hurt then numhurt=numhurt+1 end
2986 for i=1,GetNumPartyMembers() do
2987 local guyshurt=UnitHealthMax("party"..i)-UnitHealth("party"..i)
2988 if guyshurt>hurt then numhurt=numhurt+1 end
2989 end
2990 if numhurt>=num_party_hurt then return numhurt end
2991end
2992function HealTank(threshold)
2993 for i,tank in MB_tanklist do
2994 local id=RaidID(tank)
2995 if id then
2996 if IsAlive(id) then
2997 tankh=UnitHealth(id)
2998 if UnitClass("player")=="Priest" and UnitHealth(id)/UnitHealthMax(id)<.55 and not buffed("Weakened Soul",id) then TargetUnit(id) cast("Power Word: Shield") TargetUnit("playertarget") end
2999 if tankh<threshold or HasMortalStrike(id) then
3000 InnerFocus()
3001 NS()
3002 TargetUnit(id)
3003 QuickHealD(id)
3004 break
3005 end
3006 end
3007 end
3008 end
3009end
3010function HealSelf(threshold)
3011 if UnitIsDead("player") or UnitIsGhost("player") then return end
3012 local selfh=UnitHealth("player")/UnitHealthMax("player")
3013 if UnitClass("player")=="Priest" and UnitHealth("player")/UnitHealthMax("player")<.55 and not buffed("Weakened Soul","player") then cast("Power Word: Shield",1) end
3014 if selfh<threshold then
3015 InnerFocus()
3016 NS()
3017 QuickHealD("player")
3018 end
3019end
3020function SaveChump(threshold)
3021 if UnitIsDead("player") or UnitIsGhost("player") then return end
3022 if not UnitInRaid("player") then SavePartyChump(threshold) return end
3023 for i=1,GetNumRaidMembers() do
3024 local id="raid"..i
3025 local name,realm=UnitName(id)
3026 if IsAlive(id) then
3027 local chumphp=UnitHealth(id)/UnitHealthMax(id)
3028 if UnitClass("player")=="Priest" and UnitHealth(id)/UnitHealthMax(id)<.55 and not buffed("Weakened Soul",id) then TargetUnit(id) cast("Power Word: Shield") TargetUnit("playertarget") end
3029 if buffed("Hellfire","raid"..i) then threshold=.7 end
3030 if chumphp<threshold then
3031 local name,realm=UnitName(id)
3032 InnerFocus()
3033 NS()
3034 QuickHealD(id)
3035 break
3036 end
3037 end
3038 end
3039end
3040function NS()
3041 if not InCombat() then return end
3042 if IsDruidHealer() or (UnitClass("player")=="Shaman" and (not IsEnhancementShammy() and not IsElementalShammy())) then
3043 if OnCooldown("Nature's Swiftness") then return end
3044 cast("Nature's Swiftness")
3045 SpellStopCasting()
3046 end
3047end
3048function SavePartyChump(threshold)
3049 if UnitIsDead("player") or UnitIsGhost("player") then return end
3050 for i=1,GetNumPartyMembers() do
3051 local id="party"..i
3052 if UnitHealth(id)>0 then
3053 local chumphp=UnitHealth(id)/UnitHealthMax(id)
3054 if buffed("Hellfire",id) then threshold=.7 end
3055 if chumphp<threshold then
3056 local name=UnitName(id)
3057 InnerFocus()
3058 NS()
3059 QuickHealD(id)
3060 end
3061 end
3062 end
3063end
3064function TravelForm()
3065 if UnitClass("player")=="Shaman" then cast("Ghost Wolf") end
3066 if UnitClass("player")=="Druid" then StanceCast("Travel Form") end
3067end
3068function TankOnMyTarget()
3069--Sometimes I need to know if the tank is targeting my target, say if I want to sheep it, then forget it, tank's got it.
3070 local targ,tank
3071 local tank=WhoIs("Furyswipes")
3072 if not tank then return nil end
3073 --Print(tank)
3074 if UnitIsUnit("target",tank.."target") then return 1 else return nil end
3075end
3076function TankIsTargeting(name)
3077--Checks if tank is targeting the named mob
3078--
3079 local targ,tank
3080 if IAmFocus() then
3081 tank=WhoIs(UnitName("player"))
3082 else
3083 tank=WhoIs(ClassicFocus_CurrentFocus)
3084 end
3085 if tank=="Me" then tank=PartyID(UnitName("player")) end
3086 if not tank then return nil end
3087 --Print(tank)
3088 if UnitName(tank.."target") == name then return 1 else return nil end
3089end
3090function WhoIs(name)
3091--sort of like RaidID, but works with parties
3092--In a party, it returns "Me" if the name is mine
3093if UnitInRaid("player") then
3094 for i=1,GetNumRaidMembers() do
3095 uname,realm=UnitName("raid"..i) if name==uname then return "raid"..i end
3096 end
3097else
3098 if UnitName("player")==name then return "Me"
3099 else
3100 for i=1,GetNumPartyMembers() do
3101 local uname,realm=UnitName("party"..i)
3102 if name==uname then return "party"..i end
3103 end
3104 end
3105end
3106end
3107--
3108-- CHARACTER ROTATION FUNCTIONS--THIS IS WHERE YOU TAME YOUR BOTS
3109-- Every TOON has 5 slots on the action bar-- [prep/melee_support][single target][multi target][turbo cooldowns][closecombat multi-target]
3110--
3111--PREP: This button is for preparing for battle. Buffs, water trading, etc. It never targets ever, on any toon.
3112--SINGLE: This button is for direct damage or healing on one target, usually whatever the focus(tank) is targeting.
3113--MULTI: This button is for targeting as many mobs as you can close by or far. Healing remains the same. It also happens here.
3114--TURBO: This button is for blowing your dps cooldowns or using trinkets
3115--CC: This button is for massive AOE when all mobs are nearby
3116----
3117--
3118function setup(demontype)
3119 if UnitLevel("player")==60 then buystacks() end
3120 local class=UnitClass("player")
3121 if class=="Mage" then mage_setup() return end
3122 if class=="Paladin" then paladin_setup() return end
3123 if class=="Shaman" then shammy_setup() return end
3124 if class=="Priest" then priest_setup() return end
3125 if class=="Rogue" then rogue_setup() return end
3126 if class=="Warrior" then warrior_setup() return end
3127 if class=="Warlock" then lock_setup(demontype) return end
3128 if class=="Druid" then dru_setup() return end
3129 if class=="Hunter" then hunter_setup() return end
3130end
3131function single()
3132 local class=UnitClass("player")
3133 if class=="Mage" then mage_single() return end
3134 if class=="Paladin" then paladin_single() return end
3135 if class=="Shaman" then shammy_single() return end
3136 if class=="Priest" then priest_single() return end
3137 if class=="Rogue" then rogue_single() return end
3138 if class=="Warrior" then warrior_single() return end
3139 if class=="Warlock" then lock_single() return end
3140 if class=="Druid" then dru_single() return end
3141 if class=="Hunter" then hunter_single() return end
3142end
3143function multi()
3144 local class=UnitClass("player")
3145 if class=="Mage" then mage_multi() return end
3146 if class=="Paladin" then paladin_multi() return end
3147 if class=="Shaman" then shammy_multi() return end
3148 if class=="Priest" then priest_multi() return end
3149 if class=="Rogue" then rogue_multi() return end
3150 if class=="Warrior" then warrior_multi() return end
3151 if class=="Warlock" then lock_multi() return end
3152 if class=="Druid" then dru_multi() return end
3153 if class=="Hunter" then hunter_multi() return end
3154end
3155function turbo()
3156 if IsControlKeyDown() then MountUp() return end
3157 if not IAmFocus() then SetView(2) end
3158 if IsAltKeyDown() then Accept() end
3159 if IsAltKeyDown() and not IAmFocus() then follow_assist() return end
3160 local class=UnitClass("player")
3161 if class=="Mage" then mage_turbo() return end
3162 if class=="Paladin" then paladin_turbo() return end
3163 if class=="Shaman" then shammy_turbo() return end
3164 if class=="Priest" then priest_turbo() return end
3165 if class=="Rogue" then rogue_turbo() return end
3166 if class=="Warrior" then warrior_turbo() return end
3167 if class=="Warlock" then lock_turbo() return end
3168 if class=="Druid" then dru_turbo() return end
3169 if class=="Hunter" then hunter_turbo() return end
3170end
3171function aoe()
3172 local class=UnitClass("player")
3173 if IsControlKeyDown() and class~="Mage" then return end
3174 if class=="Mage" then mage_aoe() return end
3175 if class=="Paladin" then paladin_aoe() return end
3176 if class=="Shaman" then shammy_aoe() return end
3177 if class=="Priest" then priest_aoe() return end
3178 if class=="Rogue" then rogue_aoe() return end
3179 if class=="Warrior" then warrior_aoe() return end
3180 if class=="Warlock" then lock_aoe() return end
3181 if class=="Druid" then dru_aoe() return end
3182 if class=="Hunter" then hunter_aoe() return end
3183end
3184function tap()
3185 local class=UnitClass("player")
3186 if class=="Mage" then mage_tap() return end
3187 if class=="Paladin" then paladin_tap() return end
3188 if class=="Shaman" then shammy_tap() return end
3189 if class=="Priest" then priest_tap() return end
3190 if class=="Rogue" then rogue_tap() return end
3191 if class=="Warrior" then warrior_tap() return end
3192 if class=="Warlock" then lock_tap(demontype) return end
3193 if class=="Druid" then dru_tap() return end
3194 if class=="Hunter" then hunter_tap() return end
3195end
3196
3197--WARLOCK
3198function lock_turbo()
3199 if not InCombat() then return end
3200 if not TargetInCombat() then return end
3201 use(13)
3202 use(14)
3203end
3204function lock_setup(demontype)
3205 --demontype is no longer used here. It is kept for backward compatibility
3206 AutoDelete()
3207 if IsAltKeyDown() then MB_Assist() return end
3208 --if IsAltKeyDown() then return end
3209--Meant to be on the 1 key, does all the prepwork intended for warlocks
3210--The demontype should be a capitalized argument in quotes of which demon you want in prep. ex. "Voidwalker"
3211--Not all demons supported. It's a pain. You need to know the names of all possible demons in your party
3212--to keep from resummoning. See the SummonDemon() function
3213 if InCombat() then CancelTrade() end
3214 if ManaDown()>0 and buffed("Drink","player") then return end
3215 if buffed("Food","player") then return end
3216 if MyLevel()>19 then
3217 SelfBuff("Demon Armor")
3218 else
3219 SelfBuff("Demon Skin")
3220 end
3221--if you hold the alt key down, you will buff without summoning
3222 if not MB_my_lock_pet and IsTouchOfShadowLock() and not buffed("Touch of Shadow","player") then
3223 cast("Demonic Sacrifice")
3224 cast("Fel Domination")
3225 cast("Summon Succubus")
3226 else
3227 SummonDemon()
3228 end
3229 if not InCombat() then smartdrink() end
3230--***This is working soulstone code that I don't use. Really, you should ss the tank.
3231--if NoRezzers() and not buffed("Soulstone","player") then
3232--if not HasSoulstone() and NumShards()>0 then CastSpell(SpellNum("Create Soulstone (Major)"),BOOKTYPE_SPELL) end
3233--use("Major Soulstone")
3234--TargetUnit("player")
3235--end
3236--***This is working healthstone code that I don't use.Too many shards for how much I wipe
3237 --if not HasMajorHealthstone() and NumShards()>0 then CastSpell(SpellNum("Create Healthstone (Major)"),BOOKTYPE_SPELL) end
3238 --if not HasGreaterHealthstone() and NumShards()>0 then CastSpell(SpellNum("Create Healthstone (Greater)"),BOOKTYPE_SPELL) end
3239 --if not HasHealthstone() and NumShards()>0 then cast("Create Healthstone") end
3240end
3241function lock_single()
3242 if buffed("Living Bomb","player") then Follow_Komal() end
3243--This is the single target warlock program that does all dps on single targets
3244--put it in key slot 2, macro should be simply, /script lock_single()
3245--If the alt key is down, the warlock doesn't shoot. This allows tank to build aggro.
3246--
3247 --Decurse()
3248 --main targeting function. Usually targets main tank's target. Many exceptions for raid boss fights.
3249 if IsAltKeyDown() then
3250 CC()
3251 return
3252 end
3253 CC()
3254 if not IAmFocus() then LockonTarget() end
3255 --If you are cc-ing, you can only shoot at the tank target. Loss of flexibility, but oh well
3256 --If you are hellfiring because of lock_cc() being run, STOP. Only casting a rank1 life tap reliably stops HF.
3257 if buffed("Hellfire","player") then RunLine("/cast Life Tap(Rank 1)") end
3258 if UnitName("target")=="Mana Fiend" and not buffed("Banish","Target") then cast("Banish") end
3259 if ImBusy() then return end
3260 --May as well swig those healing pots
3261 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
3262 --don't do crap if Alt is down. That means the tank wants aggro
3263 --Get ready to start blowing sh*t up
3264 --You are a warlock,not the tank. ONLY shoot at something if it is already in combat or you have NO FOCUS (meaning, you are probably alone)
3265 --if TankTarget("Lord Kazzak") and MyMana()<1000 then cast("Life Tap") end
3266 if TargetInCombat() or IAmFocus() then
3267 --Send your pet to the target.
3268 if UnitName("target")=="Moam" and (MyClassOrder()==1 or MyClassOrder()==2 or MyClassOrder()==3) then cast("Drain Mana") end
3269 SickemTarget()
3270 --If you are dying, you should do something about it.
3271 if MyHealthPct()<.1 then cast("Drain Life") end
3272 --Start drain soul at 5% health on targets who aren't raid bosses
3273 if NumShards()<20 and UnitHealthMax("target")<100000 and UnitHealth("target")/UnitHealthMax("target")<.10 then cast("Drain Soul") end
3274 --if UnitName("target")=="Death Knight Captain" or UnitName("target")=="Necro Knight" then cast("Death Coil") end
3275 --Cast corruption if target doesn't have it on already
3276 DotCast("Corruption")
3277 --Manage curses based on warlocks in your raid.
3278 if MyClassOrder()==1 then DotCast("Curse of Shadow") end
3279 if MyClassOrder()==2 then DotCast("Curse of the Elements") end
3280 if MyClassOrder()>2 then
3281 if UnitHealth("target")>50000 then cast("Curse of Doom")
3282 else
3283 if UnitName("target")=="The Prophet Skeram" then
3284 DotCast("Curse of Tongues")
3285 else
3286 DotCast("Curse of Weakness")
3287 end
3288 end
3289 end
3290 if FastKill() then cast("Searing Pain") end
3291 cast("Shadow Bolt")
3292 --if you dont' have enough juice for any of that, why not life tap if you aren't near death?
3293 if MyManaPct()<.1 and MyHealthPct()>.4 then cast("Life Tap") end
3294 if not RAIS_shooting then UseAction(72) return end
3295 end
3296end
3297function lock_multi()
3298--This is the first of the "multi" dps programs.
3299--It is meant to be used when there are multiple ranged targets.
3300--It is meant to go in slot 3 of the keys
3301--It also works when there are multiple close targets, but perhaps you want lock_cc() (close combat) for that
3302--THIS MACRO SUCKS. Actually, for lock multi, locks should change target and dot every enemy in combat up.
3303--
3304 if IsAltKeyDown() then
3305 CC()
3306 return
3307 end
3308 CC()
3309 if not IAmFocus() then LockonTarget() end
3310 --Jump out of hellfire in multi--hellfire is only run in lock_cc
3311 --multi is meant for ranged targets
3312 if buffed("Hellfire","player") then RunLine("/cast Life Tap(Rank 1)") end
3313 if ImBusy() then return end
3314 --don't run this program if busy draining
3315 if buffed("Drain Life","player") then return end
3316 if buffed("Drain Soul","player") then return end
3317 --You are dying. Use a pot
3318 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
3319 --If the alt-key is down, tank wants more aggro, stop dpsing
3320 if IsAltKeyDown() then SpellStopCasting() return end
3321 --You are not a tank. Do not shoot at anything unless it is already in combat. Or you are by yourself and have no focus.
3322 if TargetInCombat() or IAmFocus() then
3323 --send your pet
3324 SickemTarget()
3325 --you are dying, drain him
3326 if MyHealthPct()<.1 then cast("Drain Life") end
3327 --Hey, we need shards, don't we? Don't DS bosses
3328 if UnitHealth("target")>100000 and UnitHealth("target")/UnitHealthMax("target")<.05 then cast("Drain Soul") end
3329 --throw dots on target--need to add switching targets here
3330 DotCast("Corruption")
3331 if UnitName("player")=="Brutalio" then
3332 DotCast("Curse of Shadow")
3333 elseif UnitName("player")=="Brutalium" then
3334 DotCast("Curse of the Elements")
3335 else
3336 if UnitHealthMax("target")>100000 then DotCast("Curse of Doom")
3337 else DotCast("Curse of Weakness") end
3338 end
3339 cast("Shadow Bolt")
3340 --You are out of mana but not life. Why not life tap and get some mana?
3341 if MyManaPct()<.1 and MyHealthPct()>.4 then cast("Life Tap") end
3342 if not RAIS_shooting then UseAction(72) return end
3343 end
3344end
3345function lock_aoe()
3346--ONE OF MY FAVORITES. Cast hellfire. Stack a bunch of locks doing this and get thousands of dps!
3347--Stop hellfire if you are near death
3348--You can only interrupt hellfire by casting another spell, like life tap rank 1
3349 if buffed("Hellfire","player") and MyHealthPct()<.1 then RunLine("/cast Life Tap(Rank 1)") end
3350 if ImBusy() then return end
3351 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
3352 if not IAmFocus() then LockonNearest() end
3353 if TargetInCombat() or IAmFocus() then
3354 if not IsAltKeyDown() then
3355 SickemTarget()
3356 if MyManaPct()<=.1 then cast("Life Tap") end
3357 if MyHealthPct()<=.1 then use("Major Healthstone") end
3358 if MyHealthPct()<=.1 then use("Greater Healthstone") end
3359 if MyHealthPct()<=.1 then use("Healthstone") end
3360 if MyHealthPct()<.15 then RunLine("/cast Life Tap(Rank 1)") end
3361 if MyHealthPct()>.17 and not buffed("Hellfire","player") then cast("Hellfire") end
3362 end
3363 end
3364end
3365--
3366--
3367-- WARRIOR
3368function warrior_setup()
3369 name,realm=UnitName("player")
3370 if not FindInTable(MB_tanklist,name) and not IsControlKeyDown() and not IsAltKeyDown() then Follow() end
3371 if IsControlKeyDown() and IAmFocus() then
3372 if UnitName("target") then cast("Bloodrage") end
3373 if UnitName("target") and InMeleeRange() then cast("Demoralizing Shout") end
3374 if UnitName("target") and InMeleeRange() then cast("Cleave") end
3375 if UnitName("target") and InMeleeRange() and MyRage()>14 and not OnCooldown("Thunder Clap") then
3376 StanceCast("Battle Stance")
3377 cast("Thunder Clap")
3378 else
3379 StanceCast("Defensive Stance")
3380 end
3381 if UnitName("target") and InMeleeRange() and MyRage()>24 and not OnCooldown("Whirlwind") then
3382 StanceCast("Berserker Stance")
3383 cast("Whirlwind")
3384 else
3385 StanceCast("Defensive Stance")
3386 end
3387 if UnitName("target") then cast("Shoot Crossbow") end
3388 if InMeleeRange() and not IsCurrentAction(72) then UseAction(72) end;
3389 return
3390 end
3391 if IsAltKeyDown() and TableLength(MB_My_ot_target)==0 then MB_Assist() end
3392 if IsAltKeyDown() then
3393 --stop all attacks, furyswipes taunting
3394 if UnitName("target")~="Kurinnaxx" and IsCurrentAction(72) then
3395 UseAction(72)
3396 return
3397 end
3398 end
3399 if not IAmFocus() and IsAltKeyDown() and TargetInCombat() then StanceCast("Defensive Stance") cast("Taunt") cast("Revenge") cast("Mocking Blow") ; end
3400 AutoDelete()
3401end
3402function fearbreak()
3403 if not OnCooldown("Will of the Forsaken") then cast("Will of the Forsaken") return end
3404 --Print("Fearbreak")
3405 if not OnCooldown("Berserker Rage") then
3406 StanceCast("Berserker Stance")
3407 cast("Berserker Rage")
3408 end
3409 CooldownCast("Tremor Totem",60)
3410
3411
3412end
3413function AutoAssignCC()
3414 if IAmFocus() and UnitName("target")=="Moam" or UnitName("target")=="Vile Scarab" then
3415 for i=1,5 do
3416 if UnitName("target")=="Mana Fiend" and not GetRaidTargetIndex("target") and not UnitIsDead("target") then MB_assign_cc() return end
3417 TargetNearestEnemy()
3418 end
3419 end
3420end
3421function warrior_tank_single()
3422 if IsControlKeyDown() then WarriorInterrupt() return end
3423 local tname=UnitName("target")
3424 local myname=UnitName("player")
3425 if not tname then tname="" end
3426 if MyHealthPct()<.15 then WarriorSurvive() end
3427 --Charge and Thunderclap
3428 if IAmFocus() then CloseDistance() end
3429 if SpellExists("Charge") then
3430 if IAmFocus() and (CooldownTime("Charge")>.85 and CooldownTime("Charge")<4) and not OnCooldown("Thunder Clap") and InMeleeRange() then cast("Thunder Clap") end
3431 end
3432 if SpellExists("Charge") then
3433 if CooldownTime("Charge")>0 and CooldownTime("Charge")<1.5 then return end
3434 end
3435 --if tname~="Mana Fiend" then AutoAssignCC() end
3436 --TAUNT CODE
3437 if TableLength(MB_My_ot_target)>0 then
3438 --Select my off-tank target if I've lost it
3439 OT()
3440 --I test MB_My_ot_target again because in OT(), it might have been cleared on death of target.
3441 if TableLength(MB_My_ot_target)>0 and UnitName("targettarget")~=myname and TargetInCombat() then WarriorTaunt("AUTOTAUNT:OT not on me: "..tname) end
3442 --If you are a tank, (focus or not) and not assigned to an OT target, you will taunt anything NOT attacking a tank
3443 elseif UnitIsEnemy("player","target") and not FindInTable(MB_tanklist,UnitName("targettarget")) and TargetInCombat() then ttname=UnitName("targettarget") if ttname then WarriorTaunt("AUTOTAUNT: "..tname.." attacking "..ttname) end end
3444 --Force taunt on alt-2 if you are main tank, otherwise ctrl-3 if you are bot
3445 if IAmFocus() and IsAltKeyDown() and UnitIsEnemy("player","target") and UnitName("targettarget")~=myname then WarriorTaunt("TAUNT--alt-2: "..tname) end
3446 if not IAmFocus() and IsAltKeyDown() and UnitName("target")=="Kurinnaxx" then
3447 --stop attacking during kurinnaxx when you are the off tank and the main tank is taunting!
3448 if IsCurrentAction(72) then UseAction(72) end
3449 return
3450 end
3451 --END TAUNT CODE
3452 --if UnitName("Target")=="Moam" then
3453 --for i=1,5
3454 if not UnitName("target") and not IAmFocus() and TableLength(MB_My_ot_target)==0 then
3455 TargetNotOnTankNoAlt()
3456 elseif TableLength(MB_My_ot_target)==0 then
3457 FindATargetStupid()
3458 end
3459 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3460 ------END OF TARGETING------------DO THAT WARRIOR SHIT------------
3461 if DPSOutOnGolemagg() then return end
3462 --if IAmFocus() then CloseDistance() end
3463 if UnitName("target") and ((TargetInCombat() or IAmFocus() or IsAltKeyDown())) then
3464 --Only if you are in combat or are the leader! (force OT attacks if alt key down)
3465 WarriorSnarePlayer()
3466 if InMeleeRange() and InCombat() then StanceCast("Defensive Stance") ; end
3467 if InMeleeRange() and InCombat() then cast("Bloodrage") end
3468 if (UnitName("target")=="Flamewaker Elite" or UnitName("target")=="Majordomo Executus" or UnitName("target")=="Gurubashi Axe Thrower" or UnitName("target")=="Deathknight Captain") and not OnCooldown("Disarm") and not buffed("Disarm","target") then cast("Disarm") end
3469 cast("Shield Slam")
3470 if InMeleeRange() then StanceCast("Defensive Stance") end
3471 if SpellExists("Sunder Armor") then StackCast("Sunder Armor",5) end
3472 if MyHealthPct()<.8 then cast("Shield Block") end
3473 cast("Revenge")
3474 if not IsAltKeyDown() and not buffed("Thunder Clap","target") and MyRage()>15 and not OnCooldown("Thunder Clap") then
3475 StanceCast("Battle Stance")
3476 cast("Thunder Clap")
3477 end
3478 if not IsAltKeyDown() then BufCast("Demoralizing Shout") end
3479 if MyRage()>50 then cast("Heroic Strike") end
3480 if MyRage()>40 then cast("Shield Bash") end
3481 if not IsCurrentAction(72) then UseAction(72) end;
3482 SelfBuff("Battle Shout")
3483 end
3484end
3485function InBattleStance()
3486 local texture,name,isActive,isCastable = GetShapeshiftFormInfo(1)
3487 if isActive then return true end
3488end
3489function WarriorTaunt(msg)
3490 if not OnCooldown("Taunt") then
3491 MB_msg(msg)
3492 StanceCast("Defensive Stance")
3493 cast("Taunt")
3494 return
3495 end
3496 if not OnCooldown("Mocking Blow") and MyRage()>9 and MyStance()==1 then
3497 MB_msg(msg.." Taunt failed or on cooldown--trying mocking blow!")
3498 cast("Mocking Blow")
3499 return
3500 end
3501 if not OnCooldown("Mocking Blow") and MyRage()>9 then
3502 StanceCast("Battle Stance")
3503 end
3504end
3505function BearTaunt(msg)
3506 --if not OnCooldown("Growl") and TargetInCombat() then
3507 if not OnCooldown("Growl") then
3508 MB_msg(msg)
3509 cast("Growl")
3510 return
3511 end
3512 --if not OnCooldown("Faerie Fire (Feral)") and TargetInCombat() then
3513 if not OnCooldown("Faerie Fire (Feral)") then
3514 MB_msg(msg.." Growl on CD, trying FF")
3515 cast("Faerie Fire (Feral)()")
3516 end
3517end
3518function DPSOutOnGolemagg()
3519 if UnitName("target")=="Golemagg the Incinerator" and buffed("Magma Splash","player") then
3520 for n=1,16 do
3521 MB_buffname=GetPlayerBuff(n)
3522 MB_bufstacks=GetPlayerBuffApplications(n)
3523 if buffname=="Magma Splash" then break end
3524 end
3525 if MB_bufstacks>9 then
3526 if IsCurrentAction(72) then UseAction(72) end;
3527 return true
3528 end
3529 end
3530end
3531function warrior_tank_multi()
3532 if IsControlKeyDown() then cast("Challenging Shout") return ; end
3533 --Don't Do anything unless you are tank or you are a bot in combat
3534 --WarriorSurvive()
3535 --If you have a target and it's in combat, or if you have a target and you are the tank, do your tank shit.
3536 local tname=UnitName("target")
3537 local myname=UnitName("player")
3538 if not tname then tname="" end
3539 if MyHealthPct()<.15 then WarriorSurvive() end
3540 --If you are a bot and have a target in combat, do shit. If you are the tank, do shit anyway.
3541 --Bots assist tank
3542 --TAUNT CODE
3543 if TableLength(MB_My_ot_target)>0 then
3544 --Select my off-tank target if I've lost it. I test MB_My_ot_target again because in OT(), it might have been cleared on death of target.
3545 OT()
3546 if TableLength(MB_My_ot_target)>0 and UnitName("targettarget")~=myname and TargetInCombat() then WarriorTaunt("AUTOTAUNT:OT not on me: "..tname) end
3547 elseif
3548 --Any time you are targeting an enemy not attacking a tank, taunt it
3549 UnitIsEnemy("player","target") and not FindInTable(MB_tanklist,UnitName("targettarget")) and TargetInCombat() then
3550 --this ttname code prevents taunting when a unit is just stunned for a moment and has no target.
3551 ttname=UnitName("targettarget") if ttname then WarriorTaunt("AUTOTAUNT: "..tname.." attacking "..ttname) end
3552 end
3553 --Force taunt on ctrl-3 if you are not a focus tank
3554 if IAmFocus() and IsControlKeyDown() and UnitIsEnemy("player","target") and UnitName("targettarget")~=myname and not IAmFocus() then WarriorTaunt("TAUNT:ctrl-3: "..tname) end
3555 --END TAUNT CODE
3556 if not IAmFocus() and TableLength(MB_My_ot_target)==0 then
3557 TargetNotOnTankNoAlt()
3558 elseif TableLength(MB_My_ot_target)==0 then
3559 FindATargetStupid()
3560 end
3561 if IAmFocus() and IsAltKeyDown() then TargetNotOnMe() end
3562 if DPSOutOnGolemagg() then return end
3563 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3564 if UnitName("target") and (TargetInCombat() or IAmFocus()) then
3565 --If you are the tank, and you hold alt key down, you will find the next target not on you.
3566 if IAmFocus() and IsAltKeyDown() then TargetNotOnMe() end
3567 --if TableLength(MB_My_ot_target)==0 then CloseDistance() end
3568 WarriorSnarePlayer()
3569 cast("Bloodrage")
3570 SelfBuff("Battle Shout")
3571 if not IsAltKeyDown() then BufCast("Demoralizing Shout") end
3572 --if not IsAltKeyDown() and not buffed("Thunder Clap","target") and not OnCooldown("Thunder Clap") then
3573 --cast("Thunder Clap")
3574 --StanceCast("Battle Stance")
3575 --end
3576 cast("Cleave")
3577 cast("shield slam")
3578 StanceCast("Defensive Stance")
3579 if MyRage()>25 then cast("Revenge") end
3580 if MyRage()>25 then StackCast("Sunder Armor",5) end
3581 if MyHealthPct()<.8 and MyRage()>30 then cast("shield block") end
3582 if not IsCurrentAction(72) then UseAction(72) end;
3583 end
3584end
3585function warrior_tank_aoe()
3586 if not IAmFocus() and IsAltKeyDown() then Follow() return end
3587 if IsAltKeyDown() then return end
3588 --Only difference from defensive_multi is it auto-runs targetNotOnMe()
3589 --Also no charging or snaring
3590 --Don't Do anything unless you are tank or you are a bot in combat
3591 --WarriorSurvive()
3592 local tname=UnitName("target")
3593 local myname=UnitName("player")
3594 --If you are a bot and have a target in combat, do shit. If you are the tank, do shit anyway.
3595 --Bots assist tank
3596 --TAUNT CODE
3597 if TableLength(MB_My_ot_target)>0 then
3598 --Select my off-tank target if I've lost it
3599 OT()
3600 --I test MB_My_ot_target again because in OT(), it might have been cleared on death of target.
3601 if TableLength(MB_My_ot_target)>0 and UnitName("targettarget")~=myname and TargetInCombat() then WarriorTaunt("AUTOTAUNT:AOE OT not on me: "..tname) end
3602 --If you are a tank, (focus or not) and not assigned to an OT target, you will taunt anything NOT attacking a tank
3603 elseif UnitIsEnemy("player","target") and not FindInTable(MB_tanklist,UnitName("targettarget")) and TargetInCombat() then ttname=UnitName("targettarget") if ttname then WarriorTaunt("AUTOTAUNT:AOE "..tname.." attacking "..ttname) end end
3604 --END TAUNT CODE
3605 --If you have a target and it's in combat, or if you have a target and you are the tank, do your tank shit.
3606 if UnitName("target") and (TargetInCombat() or IAmFocus()) then
3607 --this is close combat, find mobs on your buddies, and try to taunt everyone! UNLESS you are assigned an ot targ.
3608 if TableLength(MB_My_ot_target)==0 then TargetNotOnTankNoAlt() end
3609 cast("Bloodrage")
3610 SelfBuff("Battle Shout")
3611 BufCast("Demoralizing Shout")
3612 if MyRage()>19 and not buffed("Thunder Clap","target") and not OnCooldown("Thunder Clap") then
3613 StanceCast("Battle Stance")
3614 cast("Thunder Clap")
3615 return
3616 else
3617 StanceCast("Defensive Stance")
3618 cast("Cleave")
3619 StanceCast("Defensive Stance")
3620 if MyHealthPct()<.8 and MyRage()>30 then cast("shield block") end
3621 cast("shield slam")
3622 if MyRage()>25 then cast("Revenge") end
3623 if MyRage()>25 then StackCast("Sunder Armor",5) end
3624 end
3625 if not IsCurrentAction(72) then UseAction(72) end;
3626 end
3627end
3628function fury_single()
3629 if UnitName("target") then
3630 if InMeleeRange() and UnitHealth("target")/UnitHealthMax("target")<=.2 then cast("Execute") ; cast("Bloodrage") ; end
3631 --if IsAltKeyDown() then cast ("Taunt") ; cast ("Mocking Blow") ; end
3632 if IsControlKeyDown() then WarriorInterrupt() ; end
3633 --WarriorSurvive()
3634 if IAmFocus() then CloseDistance() end
3635 WarriorSnarePlayer()
3636 SelfBuff("Battle Shout")
3637 BufCast("Thunder Clap")
3638 CombatUse(14)
3639 CombatUse(13)
3640 --if not UnitIsUnit("targettarget","player") and not IsPet("targettarget") then cast("Taunt") ; end
3641 --if not UnitIsUnit("targettarget","player") and not IsPet("targettarget") then cast("Mocking Blow") ; end
3642 if (UnitName("target")=="Flamewaker Elite" or UnitName("target")=="Majordomo Executus" or UnitName("target")=="Gurubashi Axe Thrower" or UnitName("target")=="Deathknight Captain") and not OnCooldown("Disarm") and not buffed("Disarm","target") then cast("Disarm")
3643 else
3644 if InMeleeRange() and InCombat() then StanceCast("Berserker Stance") ; end
3645 if not IsAltKeyDown() then BufCast("Demoralizing Shout") end
3646 cast("Bloodthirst")
3647 if MyRage("player")>42 then cast("Heroic Strike") end
3648 if not IsCurrentAction(72) then UseAction(72) end;
3649 end
3650 else
3651 TargetNearestEnemy()
3652 end
3653end
3654function fury_multi()
3655 if UnitName("target") then
3656 AutoTaunt()
3657 --if IsAltKeyDown() then cast ("Taunt") ; cast ("Mocking Blow") ; end
3658 if IsControlKeyDown() then cast("Challenging Shout") ; end
3659 --WarriorSurvive()
3660 TargetNotOnMe()
3661 if IAmFocus() then CloseDistance() end
3662 WarriorSnarePlayer()
3663 SelfBuff("Battle Shout")
3664 BufCast("Thunder Clap")
3665 CombatUse(14)
3666 CombatUse(13)
3667 --if not UnitIsUnit("targettarget","player") and not IsPet("targettarget") then cast("Taunt") ; end
3668 --if not UnitIsUnit("targettarget","player") and not IsPet("targettarget") then cast("Mocking Blow") ; end
3669 if UnitName("target")=="Gurubashi Axe Thrower" and not OnCooldown("Disarm") and not buffed("Disarm","target") then StanceCast("Defensive Stance") ; cast("Disarm")
3670 else
3671 if InMeleeRange() and InCombat() then StanceCast("Berserker Stance") ; end
3672 if not IsAltKeyDown() then BufCast("Demoralizing Shout") end
3673 cast("Whirlwind")
3674 cast("Cleave")
3675 if not IsCurrentAction(72) then UseAction(72) end;
3676 end
3677 else
3678 TargetNearestEnemy()
3679 end
3680end
3681function arms_single()
3682 Print("In Arms Single")
3683 if UnitName("target") then
3684 if InMeleeRange() and UnitHealth("target")/UnitHealthMax("target")<=.2 then cast("Execute") ; cast("Bloodrage") ; end
3685 if IsControlKeyDown() then WarriorInterrupt() ; end
3686 --WarriorSurvive()
3687 if IAmFocus() then CloseDistance() end
3688 WarriorSnarePlayer()
3689 SelfBuff("Battle Shout")
3690 BufCast("Thunder Clap")
3691 CombatUse(14)
3692 CombatUse(13)
3693 if UnitName("target")=="Gurubashi Axe Thrower" and not OnCooldown("Disarm") and not buffed("Disarm","target") then StanceCast("Defensive Stance") ; cast("Disarm")
3694 else
3695 if InMeleeRange() and InCombat() then StanceCast("Battle Stance") ; end
3696 cast("Overpower")
3697 if UnitIsPlayer("target") then BufCast("Rend") end
3698 BufCast("Thunder Clap")
3699 if UnitIsPlayer("target") and not OnCooldown("Mortal Strike") then cast("Mortal Strike")
3700 else cast("Heroic Strike") end
3701 if not IsCurrentAction(72) then UseAction(72) end;
3702 end
3703 else
3704 TargetNearestEnemy()
3705 end
3706end
3707function arms_multi()
3708 Print("In Arms Multi")
3709 if UnitName("target") then
3710 if IsControlKeyDown() then cast("Challenging Shout") ; end
3711 --WarriorSurvive()
3712 TargetNotOnMe()
3713 if IAmFocus() then CloseDistance() end
3714 WarriorSnarePlayer()
3715 if UnitName("target")=="Gurubashi Axe Thrower" and not OnCooldown("Disarm") and not buffed("Disarm","target") then StanceCast("Defensive Stance") ; cast("Disarm")
3716 else
3717 if InMeleeRange() and TargetInCombat() and MyRage()>=25 and not OnCooldown("Whirlwind") then
3718 StanceCast("Berserker Stance")
3719 cast("Whirlwind")
3720 end
3721 cast("Overpower")
3722 if UnitIsPlayer("target") then BufCast("Rend") end
3723 StanceCast("Battle Stance")
3724 if not OnCooldown("Sweeping Strikes") then
3725 StanceCast("Battle Stance")
3726 cast("Sweeping Strikes")
3727 end
3728 BufCast("Thunder Clap")
3729 if buffed("Sweeping Strikes","player") then cast("Heroic Strike") end
3730 cast("Cleave")
3731 if MyRage()>35 then cast("Heroic Strike") end
3732 SelfBuff("Battle Shout")
3733 if not IsAltKeyDown() then BufCast("Demoralizing Shout") end
3734 CombatUse(14)
3735 CombatUse(13)
3736 if not IsCurrentAction(72) then UseAction(72) end;
3737 end
3738 else
3739 TargetNearestEnemy()
3740 end
3741end
3742function warrior_turbo()
3743 if not InCombat() then return end
3744 --if not OnCooldown("Death Wish") then cast("Death Wish"); cast("Bloodrage") ; cast("Berserker Rage")
3745 CombatUse(13)
3746 CombatUse(14)
3747end
3748--
3749-- --
3750-- -- PALLY
3751function paladin_turbo()
3752 if not InCombat() then return end
3753end
3754function paladin_single()
3755 if IsHolyPally() then pally_heal_single() return end
3756 pally_tank_single()
3757end
3758function paladin_multi()
3759 if IsHolyPally() then pally_heal_multi() return end
3760 pally_tank_multi()
3761end
3762function paladin_aoe()
3763 if IsHolyPally() then pally_heal_aoe() return end
3764 pally_tank_aoe()
3765end
3766function PallySurvive()
3767 if not InCombat() then return end
3768 local health=UnitHealth("player")
3769 if health<200 then SpellStopCasting() cast("Divine Protection") TargetUnit("player") cast("Blessing of Protection") TargetUnit("playertarget") end
3770 if health<UnitHealthMax("player") and (buffed("Divine Protection","player") or buffed("Blessing of Protection","player")) then RunLine("/qh player") return end
3771 if health<200 then TargetUnit("player") cast ("Lay on Hands") TargetUnit("playertarget") end
3772end
3773function pally_heal_single()
3774 --Begin heal program
3775 --Interrupts are priority one, bot or not.
3776 --Print("Pally Heal program")
3777 if IsControlKeyDown() then PallyInterrupt() ; end
3778 PallySurvive()
3779 HealSelf(.2)
3780 HealTank(.3)
3781 SaveChump(.33)
3782 Decurse()
3783 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3784 if UnitName("target") and (TargetInCombat() or IAmFocus()) then
3785 CombatUse(14)
3786 CombatUse(13)
3787 if TargetInCombat() and InMeleeRange() then cast("Consecration") end
3788 if not buffed("Judgement of Justice","target") then SelfBuff("Seal of Justice") else SelfBuff("Seal of Righteousness") end
3789 cast("Judgement")
3790 if not IsCurrentAction(72) then UseAction(72) end;
3791 --If you are tank hand have no target, target nearest, I guess.
3792 if IAmFocus() then
3793 FindATargetStupid()
3794 else
3795 --If you are a bot, assist tank.
3796 if not IAmFocus() then LockonTarget() end
3797 end
3798 end
3799 RaidHeal()
3800 --PallyBuff()
3801end
3802function pally_heal_multi()
3803 --Begin heal program
3804 --Interrupts are priority one, bot or not.
3805 --Print("Pally Heal program")
3806 if IsControlKeyDown() then PallyInterrupt() ; end
3807 PallySurvive()
3808 HealSelf(.2)
3809 HealTank(.3)
3810 SaveChump(.33)
3811 Decurse()
3812 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3813 if UnitName("target") and (TargetInCombat() or IAmFocus()) then
3814 CombatUse(14)
3815 CombatUse(13)
3816 if TargetInCombat() and InMeleeRange() then cast("Consecration") end
3817 if not buffed("Judgement of Justice","target") then SelfBuff("Seal of Justice") else SelfBuff("Seal of Righteousness") end
3818 cast("Judgement")
3819 if not IsCurrentAction(72) then UseAction(72) end;
3820 --If you are tank hand have no target, target nearest, I guess.
3821 if IAmFocus() then
3822 FindATargetStupid()
3823 else
3824 --If you are a bot, assist tank.
3825 if not IAmFocus() then LockonTarget() end
3826 end
3827 end
3828 RaidHeal()
3829 --PallyBuff()
3830end
3831function pally_heal_aoe()
3832 --Begin heal program
3833 --Interrupts are priority one, bot or not.
3834 --Print("Pally Heal program")
3835 if IsControlKeyDown() then PallyInterrupt() ; end
3836 PallySurvive()
3837 HealSelf(.2)
3838 HealTank(.3)
3839 SaveChump(.33)
3840 Decurse()
3841 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3842 if UnitName("target") and (TargetInCombat() or IAmFocus()) then
3843 CombatUse(14)
3844 CombatUse(13)
3845 if TargetInCombat() and InMeleeRange() then cast("Consecration") end
3846 if not buffed("Judgement of Justice","target") then SelfBuff("Seal of Justice") else SelfBuff("Seal of Righteousness") end
3847 cast("Judgement")
3848 if not IsCurrentAction(72) then UseAction(72) end;
3849 --If you are tank hand have no target, target nearest, I guess.
3850 if IAmFocus() then
3851 FindATargetStupid()
3852 else
3853 --If you are a bot, assist tank.
3854 if not IAmFocus() then LockonTarget() end
3855 end
3856 end
3857 RaidHeal()
3858 --PallyBuff()
3859end
3860function pally_tank_single()
3861 --Begin tank program
3862 --Interrupts are priority one, bot or not.
3863 --if IsControlKeyDown() then PallyInterrupt() ; end
3864 --PallySurvive()
3865 HealSelf(.15)
3866 ----Decurse()
3867 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3868 --if InMeleeRange() then cast("Consecration") end
3869 SelfBuff("Seal of Righteousness")
3870 cast("Judgement")
3871 if not IsCurrentAction(72) then UseAction(72) end;
3872 --If you are tank hand have no target, target nearest, I guess.
3873 RaidHeal()
3874 SelfBuff("Righteous Fury")
3875 PallyBuff()
3876end
3877function pally_tank_multi()
3878 --Begin tank program
3879 --Interrupts are priority one, bot or not.
3880 if IsControlKeyDown() then PallyInterrupt() ; end
3881 PallySurvive()
3882 HealSelf(.15)
3883 --Decurse()
3884 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3885 CombatUse(14)
3886 CombatUse(13)
3887 if InMeleeRange() then cast("Consecration") end
3888 SelfBuff("Seal of Righteousness")
3889 cast("Judgement")
3890 if not IsCurrentAction(72) then UseAction(72) end;
3891 --If you are tank hand have no target, target nearest, I guess.
3892 RaidHeal()
3893 SelfBuff("Righteous Fury")
3894 --PallyBuff()
3895end
3896function pally_tank_aoe()
3897 --Begin tank program
3898 --Interrupts are priority one, bot or not.
3899 if IsControlKeyDown() then PallyInterrupt() ; end
3900 PallySurvive()
3901 HealSelf(.15)
3902 --Decurse()
3903 if not UnitName("target") and not IAmFocus() then LockonTarget() end
3904 CombatUse(14)
3905 CombatUse(13)
3906 if InMeleeRange() then cast("Consecration") end
3907 SelfBuff("Seal of Righteousness")
3908 cast("Judgement")
3909 if not IsCurrentAction(72) then UseAction(72) end;
3910 --If you are tank hand have no target, target nearest, I guess.
3911 RaidHeal()
3912 SelfBuff("Righteous Fury")
3913 --PallyBuff()
3914end
3915function pally_turbo()
3916 if not InCombat() then return end
3917end
3918function paladin_setup()
3919 if IsControlKeyDown() then cast("Judgement") cast("Seal of the Crusader") return end
3920 if IsAltKeyDown() then
3921 --stop all attacks, furyswipes taunting
3922 if UnitName("target")~="Kurinnaxx" and IsCurrentAction(72) then
3923 UseAction(72)
3924 return
3925 end
3926 end
3927 if UnitName("target")~="Kurinnaxx" and not IAmFocus() and not IsAltKeyDown() and not IsControlKeyDown() then Follow() end
3928 if not IAmFocus() and IsAltKeyDown() and TargetInCombat() then cast ("Hammer of Justice") ; cast ("Seal of the Crusader") ; end
3929 AutoDelete()
3930 PallyBuff()
3931 smartdrink()
3932 if not IsHolyPally() then SelfBuff("Righteous Fury") end
3933end
3934function PallyBuff()
3935 local name,realm=UnitName("player")
3936 if name=="Bubblefail" then
3937 SelfBuff("Devotion Aura")
3938 if RaidBuff("Blessing of Wisdom") then return end
3939 end
3940 if name=="Bubblescum" then
3941 SelfBuff("Retribution Aura")
3942 if RaidBuff("Blessing of Might") then return end
3943 end
3944 if name=="Bubblebootie" then
3945 SelfBuff("Concentration Aura")
3946 if RaidBuff("Blessing of Kings") then return end
3947 end
3948end
3949
3950--
3951----
3952----SHAMAN
3953function shammy_turbo()
3954 if not InCombat() then return end
3955 if not TargetInCombat() then return end
3956 if IsElementalShammy() then
3957 cast("Elemental Mastery")
3958 use(13)
3959 use(14)
3960 end
3961end
3962function shammy_setup()
3963 if IsAltKeyDown() then MB_Assist() return end
3964 if IsAltKeyDown() or IsShiftKeyDown() then return end
3965 if ManaDown()>0 and buffed("Drink","player") then return end
3966 if ImBusy() then return end
3967 if IsControlKeyDown() then return end
3968 if (IsEnhancementShammy()) and not IsControlKeyDown() and not IsAltKeyDown() then Follow() end
3969 AutoDelete()
3970 if InCombat() then CancelTrade() end
3971 Decurse()
3972 party_totems()
3973 RaidHeal()
3974 if not InCombat() then
3975 smartdrink()
3976 end
3977end
3978function shammy_single()
3979 if IsElementalShammy() then shammy_ele_single() return end
3980 if IsEnhancementShammy() then shammy_enh_single() return end
3981 shammy_heal_single()
3982end
3983function shammy_aoe()
3984 if IsAltKeyDown() then return end
3985 if IsElementalShammy() then shammy_ele_aoe() return end
3986 if IsEnhancementShammy() then shammy_enh_aoe() return end
3987 shammy_heal_aoe()
3988end
3989function shammy_heal_single()
3990 if buffed("Living Bomb","player") then Follow_Komal() end
3991 if ImBusy() then return end
3992 Decurse()
3993 if buffed("Last Stand","target") or buffed("Shield Wall","target") or buffed("Frenzied Regeneration","target") then
3994 CombatUse(13)
3995 CombatUse(14)
3996 end
3997 --SaveAndorov(.5)
3998 HealSelf(.2)
3999 HealTank(.3)
4000 SaveChump(.33)
4001 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4002 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4003 if ManaDown()>2000 and InCombat() then CastTotem("Mana Tide Totem") ; end
4004 RaidHeal()
4005 --SelfBuff("Lightning Shield")
4006 CombatUse(13)
4007 CombatUse(14)
4008 --party_totems()
4009 FlametongueWeapon()
4010 RockbiterWeapon()
4011 if not IAmFocus() then LockonTarget() end
4012 if TargetInCombat() and InMeleeRange() then
4013 if not IsCurrentAction(72) then UseAction(72) end
4014 end
4015end
4016function shammy_multi()
4017 if IsElementalShammy() then shammy_ele_multi() return end
4018 if IsEnhancementShammy() then shammy_enh_multi() return end
4019 shammy_heal_multi()
4020end
4021function preheal_tanks()
4022 if UnitName("player")=="Cashme" then
4023 TargetByName("Cuppycake",1)
4024 cast("Power Word: Shield")
4025 cast("Renew")
4026 end
4027 if UnitName("player")=="Refill" then
4028 TargetByName("Eversmile",1)
4029 cast("Power Word: Shield")
4030 cast("Renew")
4031 end
4032 if UnitName("player")=="Bubbling" then
4033 TargetByName("Furyswipes",1)
4034 cast("Power Word: Shield")
4035 cast("Renew")
4036 end
4037 if UnitName("player")=="Avindra" then
4038 TargetByName("Komal",1)
4039 cast("Power Word: Shield")
4040 cast("Renew")
4041 end
4042 if UnitName("player")=="Zumwalt" then
4043 TargetByName("Cuppycake",1)
4044 cast("Renew")
4045 end
4046 if UnitName("player")=="Punchingbear" then
4047 TargetByName("Cuppycake",1)
4048 BufCast("Regrowth")
4049 TargetByName("Eversmile",1)
4050 BufCast("Regrowth")
4051 TargetByName("Furyswipes",1)
4052 BufCast("Regrowth")
4053 TargetByName("Cuppycake",1)
4054 BufCast("Regrowth")
4055 end
4056end
4057function shammy_heal_multi()
4058 --if buffed("Threatening Gaze","player") then
4059 --if IsAutoRepeatAction(72) then
4060 --cast("Attack"); end
4061 --return
4062 --end
4063 if ImBusy() then return end
4064 if buffed("Last Stand","target") or buffed("Shield Wall","target") or buffed("Frenzied Regeneration","target") then
4065 CombatUse(13)
4066 CombatUse(14)
4067 end
4068 Decurse()
4069 --SaveAndorov(.5)
4070 HealSelf(.2)
4071 HealTank(.3)
4072 SaveChump(.33)
4073 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4074 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4075 --Stoneclaw()
4076 if ManaDown()>2000 and InCombat() then CastTotem("Mana Tide Totem") ; end
4077 if not buffed("Mana Tide","player") then
4078 if PartyIsPoisoned() then CastTotem("Poison Cleansing Totem") end
4079 if PartyIsDiseased() then CastTotem("Disease Cleansing Totem") end
4080 end
4081 RaidHeal()
4082 party_totems()
4083 --SelfBuff("Lightning Shield")
4084 CombatUse(13)
4085 CombatUse(14)
4086 FlametongueWeapon()
4087 if not IAmFocus() then LockonTarget() end
4088 if TargetInCombat() and InMeleeRange() then
4089 if not IsCurrentAction(72) then UseAction(72) end
4090 end
4091end
4092function shammy_enh_turbo()
4093 if not InCombat() then return end
4094end
4095function shammy_enh_single()
4096 if buffed("Living Bomb","player") then Follow_Komal() end
4097 Print("Enhancement Single")
4098 --Decurse()
4099 if ImBusy() then return end
4100 if not IAmFocus() then LockonTarget() end
4101 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4102 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4103 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
4104 if TargetInCombat() or IAmFocus() then
4105 if not IsAltKeyDown() then
4106 if buffed("Focus","player") then cast("Lightning Bolt") end
4107 SelfBuff("Lightning Shield")
4108 if not InMeleeRange() then cast("Lightning Bolt") end
4109 cast("Stormstrike")
4110 cast("Frost Shock")
4111 cast("Earth Shock")
4112 party_totems()
4113 CombatUse(14)
4114 RockbiterWeapon()
4115 if not IsCurrentAction(72) then UseAction(72) end
4116 end
4117 end
4118end
4119function shammy_enh_multi()
4120 if ImBusy() then return end
4121 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4122 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4123 --Decurse()
4124 if not IAmFocus() then LockonTarget() end
4125 if not IsAltKeyDown() then
4126 SelfBuff("Lightning Shield")
4127 if InMeleeRange() then cast("Fire Nova Totem") end
4128 cast("Stormstrike")
4129 cast("Frost Shock")
4130 cast("Earth Shock")
4131 cast("Chain Lightning")
4132 cast("Lightning Bolt")
4133 party_totems()
4134 CombatUse(14)
4135 RockbiterWeapon()
4136 if not IsCurrentAction(72) then UseAction(72) end
4137 --end
4138 end
4139end
4140function shammy_enh_aoe()
4141 --if buffed("Threatening Gaze","player") then
4142 --if IsAutoRepeatAction(72) then
4143 --cast("Attack"); end
4144 --return
4145 --end
4146 if ImBusy() then return end
4147 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4148 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4149 --Stoneclaw()
4150 if not IAmFocus() then LockonTarget() end
4151 if (TargetInCombat() or IAmFocus()) and InMeleeRange() then
4152 cast("Fire Nova Totem")
4153 SelfBuff("Lightning Shield")
4154 cast("Stormstrike")
4155 cast("Frost Shock")
4156 cast("Earth Shock")
4157 cast("Chain Lightning")
4158 cast("Lightning Bolt")
4159 CombatUse(14)
4160 RockbiterWeapon()
4161 --if InMeleeRange() then
4162 if not IsCurrentAction(72) then UseAction(72) end
4163 --end
4164 end
4165end
4166function shammy_ele_single()
4167 if buffed("Living Bomb","player") then Follow_Komal() end
4168 Print("Elemental single")
4169 if ImBusy() then return end
4170 HealSelf(.3)
4171 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4172 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4173 Decurse()
4174 if not IAmFocus() then LockonTarget() end
4175 if IsAltKeyDown() then SpellStopCasting() return end
4176 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
4177 if not IAmFocus() and not TargetInCombat() then return end
4178 if IAmFocus() or (not IsAltKeyDown() and TargetInCombat()) then
4179 --flame shock in b set
4180 if UnitName("target")=="High Priest Venoxis" and buffed("Renew","target") then cast("Purge") end
4181 --if RaidHealth()<.7 then RaidHeal() end
4182 SelfBuff("Lightning Shield")
4183 --cast("Elemental Mastery")
4184 if UnitLevel("player")<10 then RaidHeal() end
4185 --party_totems()
4186 if buffed("Elemental Mastery","player") then
4187 CombatUse(13)
4188 CombatUse(14)
4189 cast("Lightning Bolt")
4190 else
4191 SelfBuff("Lightning Shield")
4192 cast("Lightning Bolt")
4193 cast("Frost Shock")
4194 cast("Earth Shock")
4195 CombatUse(14)
4196 FlametongueWeapon()
4197 RockbiterWeapon()
4198 if TargetInCombat() and InMeleeRange() then
4199 if not IsCurrentAction(72) then UseAction(72) end
4200 end
4201 end
4202 end
4203end
4204function shammy_ele_multi()
4205 if ImBusy() then return end
4206 HealSelf(.3)
4207 --if buffed("Threatening Gaze","player") then
4208 --if IsAutoRepeatAction(72) then
4209 --cast("Attack"); end
4210 --return
4211 --end
4212 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4213 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4214 --Stoneclaw()
4215 --if FocPoisoned() then RunLine("/tarfocus") cast("Cure Poison") end
4216 --if FocDiseased() then RunLine("/tarfocus") cast("Cure Disease") end
4217 --if not buffed("Mana Tide","player") then
4218 --if PartyIsPoisoned() then TotemCast("Poison Cleansing Totem") end
4219 --if PartyIsDiseased() then TotemCast("Disease Cleansing Totem") end
4220 --end
4221 Decurse()
4222 if UnitLevel("player")<10 then RaidHeal() end
4223 if not IAmFocus() then LockonTarget() end
4224 if IsAltKeyDown() then SpellStopCasting() end
4225 if IAmFocus() or (not IsAltKeyDown() and TargetInCombat()) then
4226 --if RaidHealth()<.7 then RaidHeal() end
4227 SelfBuff("Lightning Shield")
4228 party_totems()
4229 if buffed("Elemental Mastery","player") then
4230 CombatUse(13)
4231 CombatUse(14)
4232 cast("Chain Lightning")
4233 cast("Lightning Bolt")
4234 else
4235 cast("Frost Shock")
4236 cast("Earth Shock")
4237 SelfBuff("Lightning Shield")
4238 cast("Chain Lightning")
4239 cast("Lightning Bolt")
4240 CombatUse(14)
4241 FlametongueWeapon()
4242 if TargetInCombat() and InMeleeRange() then
4243 if not IsCurrentAction(72) then UseAction(72) end
4244 end
4245 end
4246 end
4247end
4248function shammy_ele_aoe()
4249 if ImBusy() then return end
4250 HealSelf(.3)
4251 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4252 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4253 --Stoneclaw()
4254 SaveChump(.33)
4255 Decurse()
4256 if UnitLevel("player")<10 then RaidHeal() end
4257 if not IAmFocus() then LockonNearest() end
4258 SelfBuff("Lightning Shield")
4259 CombatUse(13)
4260 CombatUse(14)
4261 cast("Fire Nova Totem")
4262 cast("Chain Lightning")
4263 cast("Lightning Bolt")
4264 SelfBuff("Lightning Shield")
4265 cast("Frost Shock")
4266 cast("Earth Shock")
4267 party_totems()
4268 FlametongueWeapon()
4269 if TargetInCombat() and InMeleeRange() then
4270 if not IsCurrentAction(72) then UseAction(72) end
4271 end
4272end
4273function shammy_heal_aoe()
4274 if ImBusy() then return end
4275 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4276 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4277 SaveChump(.33)
4278 --Stoneclaw()
4279 Decurse()
4280 SelfBuff("Lightning Shield")
4281 if not UnitInRaid("player") then RunLine("/qh") end
4282 CombatUse(13)
4283 CombatUse(14)
4284 cast("Fire Nova Totem")
4285 LockonNearest()
4286 cast("Chain Lightning")
4287 cast("Lightning Bolt")
4288 local raidhealth,mosthurt=RaidHealth()
4289 cast("Chain Heal")
4290 SelfBuff("Lightning Shield")
4291 party_totems()
4292 FlametongueWeapon()
4293 if TargetInCombat() and InMeleeRange() then
4294 if not IsCurrentAction(72) then UseAction(72) end
4295 end
4296 RaidHeal()
4297end
4298--
4299----
4300----HUNTER
4301function hunter_turbo()
4302 if not TargetInCombat() then return end
4303 if not InCombat() then return end
4304 if ImBusy() then return end
4305 cast("Blood Fury")
4306 cast("Bestial Wrath")
4307 cast("Rapid Fire")
4308 use(13)
4309 use(14)
4310end
4311function hunter_setup()
4312 if IsAltKeyDown() then Print("Assist tank") MB_Assist() return end
4313 if ImBusy() then return end
4314 if InCombat() then CancelTrade() end
4315 if ManaDown()>0 and buffed("Drink","player") then return end
4316 if buffed("Food","player") then return end
4317 if (IsControlKeyDown()) then
4318 SelfBuff("Aspect of the Cheetah")
4319 else
4320 --cast("Explosive Trap")
4321 PetStuff()
4322 if (IsAltKeyDown()) then
4323 CastPetAction(9)
4324 CastPetAction(2)
4325 else
4326 local name,realm=UnitName("player")
4327 if SpellExists("Trueshot Aura") then SelfBuff("Trueshot Aura"); end
4328 end
4329 if not IAmFocus() then LockonTarget() end
4330 end
4331 if not InCombat() then smartdrink() end
4332end
4333function PerfectAim()
4334 if FastKill() then if not IsAutoRepeatAction(72) then cast("Auto Shot") end return end
4335 if SpellExists("Aimed Shot") and UnitHealth("target")<20000 then
4336 if not RAIS_shooting then UseAction(72) return end
4337 if RAIS_aimedStart then return end
4338 if ImBusy() then return end
4339 local diff=GetTime()-RAIS_startTime
4340 if not OnCooldown("AimedShot") and ( (diff<.49 and diff>0) or diff>6) then CastSpellByName("Aimed Shot") end
4341 else
4342 if not IsAutoRepeatAction(72) then cast("Auto Shot") end
4343 end
4344end
4345function fd()
4346 if InCombat() and not OnCooldown("Feign Death") then cast("Freezing Trap") cast("Feign Death") end
4347 cast("Faerie Fire (Feral)")
4348end
4349function hunter_single()
4350 if buffed("Living Bomb","player") then Follow_Komal() end
4351 if ImBusy() then return end
4352 if buffed("Feign Death","player") then return end
4353 if IsAltKeyDown() then
4354 if IsAutoRepeatAction(72) then cast("Auto Shot") end
4355 return
4356 end
4357 --if buffed("Threatening Gaze","player") then
4358 --cast("Feign Death")
4359 --if IsAutoRepeatAction(72) then
4360 --cast("Auto Shot"); end
4361 --return
4362 --end
4363 if not IAmFocus() then LockonTarget() end
4364 --Print("Out of hunter LockonTarget")
4365 if TargetInCombat() or IAmFocus() then
4366 if not IsAltKeyDown() then
4367 SickemTarget()
4368 if IsControlKeyDown() then
4369 cast("Concussive Shot")
4370 end
4371 if InMeleeRange() then
4372 hunter_aoe()
4373 else
4374 if not TankTarget("Buru Egg") and not TankTarget("Buru the Gorger") and not (UnitName("player")=="Everglades" and UnitName("target")=="Plague Slime") then SelfBuff("Aspect of the Hawk") end
4375 if TargetInCombat() or IAmFocus() then
4376 if UnitName("target")=="Moam" then BufCast("Viper Sting") end
4377 --if buffed("Frenzy","target") and not OnCooldown("Tranquilizing Shot") then cast ("Tranquilizing Shot") end
4378 if UnitName("target")=="Magmadar" and MyMana()<244 then return end
4379 --stingit()
4380 if (UnitIsPlayer("targettarget") and UnitName("targettarget")~=ClassicFocus_CurrentFocus) then cast("growl") end
4381 if UnitName("target")=="Magmadar" or UnitName("target")=="Hakkar" then
4382 BufCast("Hunter's Mark")
4383 if not OnCooldown("Tranquilizing Shot") then cast("Tranquilizing Shot") end
4384 --cast("Multi-Shot")
4385 --cast("Arcane Shot")
4386 if not IsAutoRepeatAction(72) then cast("Auto Shot") end
4387 else
4388 BufCast("Hunter's Mark")
4389 PerfectAim()
4390 cast("Multi-Shot")
4391 end
4392 cast("Multi-Shot")
4393 end
4394 end
4395 end
4396 end
4397end
4398function hunter_multi()
4399 if ImBusy() then return end
4400 --if buffed("Feign Death","player") then return end
4401 --if buffed("Threatening Gaze","player") then
4402 --cast("Feign Death")
4403 --if IsAutoRepeatAction(72) then
4404 --cast("Auto Shot"); end
4405 --return
4406 --end
4407 if IsAltKeyDown() then
4408 if IsAutoRepeatAction(72) then cast("Auto Shot") end
4409 return
4410 end
4411 if not IAmFocus() then LockonTarget() end
4412 --Print("Out of hunter LockonTarget")
4413 if TargetInCombat() or IAmFocus() then
4414 if not IsAltKeyDown() then
4415 SickemTarget()
4416 if IsControlKeyDown() then
4417 cast("Concussive Shot")
4418 end
4419 if InMeleeRange() then
4420 hunter_aoe()
4421 else
4422 if not (UnitName("player")=="Everglades" and UnitName("target")=="Plague Slime") then SelfBuff("Aspect of the Hawk") end
4423 if not (IsAltKeyDown()) then
4424 --stingit()
4425 PerfectAim()
4426 cast("Multi-Shot")
4427 end
4428 end
4429 end
4430 end
4431end
4432function stingit()
4433 if ImBusy() then return end
4434 if UnitName("target")=="Plague Slime" then return end
4435 if UnitName("target")=="Stoneskin Gargoyle" then return end
4436 --if UnitPowerType("target")==0 then
4437 --BufCast("Viper Sting")
4438 --else
4439 BufCast("Serpent Sting");
4440 --end
4441end
4442function PetStuff()
4443 if UnitExists("pet") then
4444 FeedPet()
4445else
4446 cast("Call Pet")
4447end
4448end
4449function hunter_aoe()
4450 if ImBusy() then return end
4451 if not IAmFocus() then LockonNearest() end
4452 if not IAmFocus() and not UnitName("target") then LockonTarget() end
4453 if TargetInCombat() or IAmFocus() then
4454 if InMeleeRange() then
4455 --wing clip on alt
4456 if not IsAltKeyDown() then
4457 cast("Mongoose Bite")
4458 cast ("Raptor Strike")
4459 cast ("Blood Fury")
4460 if not IsCurrentAction(71) then UseAction(71) end
4461 if UnitIsPlayer("targettarget") then cast("growl") ; end
4462 if not (UnitName("player")=="Everglades" and UnitName("target")=="Plague Slime") then SelfBuff("Aspect of the Monkey") end
4463 else
4464 BufCast("Wing Clip")
4465 end
4466 else
4467 if not IsAltKeyDown() then
4468 SickemTarget()
4469 if IsControlKeyDown() then cast("Concussive Shot") end
4470 if not (UnitName("player")=="Everglades" and UnitName("target")=="Plague Slime") then SelfBuff("Aspect of the Hawk") end
4471 --stingit()
4472 if UnitIsPlayer("targettarget") and UnitName("targettarget")~="Eversmile" then cast("growl") ; end
4473 PerfectAim()
4474 cast("Multi-Shot")
4475 end
4476 end
4477 end
4478end
4479function mend()
4480 if ImBusy() then return end
4481--This throws a mend on the pet--I usually put it in shift-5 slot.
4482 if UnitHealth("pet")==0 then
4483 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
4484
4485 cast("Revive Pet")
4486 SpellTargetUnit("pet")
4487 else if UnitHealth('pet')/UnitHealthMax('pet')<0.80 then
4488 if not buffed("Mend Pet","pet") then
4489 cast("mend pet"); end
4490 end
4491 end
4492end;
4493--
4494----
4495----DRUID (feral and healing and moonkin)
4496function IAmFocus()
4497 if ClassicFocus_CurrentFocus == nil then return true end
4498end
4499function dru_setup()
4500 local name,realm=UnitName("player")
4501 if IsAltKeyDown() and TableLength(MB_My_ot_target)==0 then MB_Assist() end
4502 if not IsControlKeyDown() and not IsAltKeyDown() and not IsDruidHealer() and not IsBoomkin() and not FindInTable(MB_tanklist,name) then Follow() end
4503 if IsShiftKeyDown() then return end
4504 if IsControlKeyDown() then CastSpell(SpellNum("Faerie Fire (Feral)"),BOOKTYPE_SPELL) return end
4505 --Off tank Taunt logic
4506 if not IAmFocus() and TargetInCombat() and IsAltKeyDown() then
4507 if (UnitName("player")=="Furyswipes" and TankName()=="Eversmile") then
4508 cast("Growl")
4509 CastSpell(SpellNum("Faerie Fire (Feral)"),BOOKTYPE_SPELL)
4510 end
4511 end
4512 AutoDelete()
4513 if IsAltKeyDown() then
4514 --Eversmile taunting, stop attackking
4515 if IsCurrentAction(72) then UseAction(72) end;
4516 end
4517 if IsAltKeyDown() then return end
4518 if InCombat() then CancelTrade() end
4519 if buffed("Food","player") then return end
4520 if not InCombat() then
4521 if TableLength(MB_My_ot_target)==0 and UnitLevel("player")==60 then RaidBuff("Gift of the Wild") end
4522 if ManaDown()>0 and buffed("Drink","player") then return end
4523 TankBuff("Thorns")
4524 if UnitLevel("player")<60 then RaidBuff("Mark of the Wild") end
4525 end
4526 if SpellExists("Omen of Clarity") then SelfBuff("Omen of Clarity") end
4527 if IsBoomkin() then SelfBuff("Moonkin Form") end
4528 if UnitName("player")=="Punchingbear" then RaidHeal() end
4529 if not InCombat() then
4530 smartdrink()
4531 end
4532end
4533function dru_turbo()
4534 if not InCombat() then return end
4535 if not TargetInCombat() then return end
4536end
4537function dru_single()
4538 local name,realm=UnitName("player")
4539 if FindInTable(MB_tanklist,name) then dru_tank_single() return end
4540 if IsBoomkin() then boomkin_single() return end
4541 if IsDruidHealer() then dru_heal_single() return end
4542 dru_cat_single()
4543end
4544function dru_multi()
4545 local name,realm=UnitName("player")
4546 if FindInTable(MB_tanklist,name) then dru_tank_multi() return end
4547 if IsBoomkin() then boomkin_multi() return end
4548 if IsDruidHealer() then dru_heal_multi() return end
4549 dru_cat_single()
4550end
4551function dru_aoe()
4552 local name,realm=UnitName("player")
4553 if FindInTable(MB_tanklist,name) then dru_tank_aoe() return end
4554 if IsBoomkin() then boomkin_multi() return end
4555 if IsDruidHealer() then dru_heal_multi() return end
4556 dru_cat_single()
4557end
4558function InnervateAHealer()
4559 if ImBusy() then return end
4560 if OnCooldown("Innervate") or not InCombat() then return end
4561 if MyMana()<62 then use("Major Mana Potion") end
4562 if MyMana()<62 then return end
4563 if UnitInRaid("player") then
4564 for i=1,TableLength(MB_healer_priority) do
4565 local found=nil
4566 for x=1,GetNumRaidMembers() do
4567 name,realm=UnitName("raid"..x)
4568 if name==MB_healer_priority[i] and UnitIsConnected("raid"..x) and UnitMana("raid"..x)<800 then
4569 TargetUnit(RaidID(name))
4570 CancelForm()
4571 BufCast("Innervate")
4572 MB_msg("<<INNERVATING "..name.." >>")
4573 TargetUnit("playertarget")
4574 return
4575 end
4576 end
4577 end
4578 else
4579 for i=1,TableLength(MB_healer_priority) do
4580 local found=nil
4581 for x=1,GetNumPartyMembers() do
4582 name,realm=UnitName("party"..x)
4583 if name==MB_healer_priority[i] and UnitIsConnected("party"..x) and UnitMana("party"..x)<800 then
4584 CancelForm()
4585 TargetUnit(RaidID(name))
4586 cast("Innervate")
4587 MB_msg("<<INNERVATING "..name.." >>")
4588 TargetUnit("playertarget")
4589 return
4590 end
4591 end
4592 end
4593 end
4594 if IsDruidHealer() and UnitMana("player")<1000 then
4595 cast("Innervate",1)
4596 MB_msg("<<INNERVATING myself, punks! Heal better! >>")
4597 return
4598 end
4599end
4600
4601function dru_heal_single()
4602 if buffed("Living Bomb","player") then Follow_Komal() end
4603 if ImBusy() then return end
4604 InnervateAHealer()
4605 if TankTarget("Obsidian Eradicator") then QuickHeal() return end
4606 CC()
4607 Decurse()
4608 if buffed("Last Stand","target") or buffed("Shield Wall","target") or buffed("Frenzied Regeneration","target") then
4609 CombatUse(13)
4610 CombatUse(14)
4611 end
4612 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
4613 --SaveAndorov(.5)
4614 HealSelf(.2)
4615 HealTank(.3)
4616 SaveChump(.33)
4617 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4618 if UnitHealth("player")/UnitHealthMax("player")<.6 then cast ("Barkskin") end
4619 TargetUnit("player")
4620 if (RaidHealth()<.6 ) and InCombat() and not OnCooldown("Tranquility") then
4621 cast("Tranquility")
4622 use("Major Mana Potion")
4623 else
4624 RaidHeal()
4625 if not IAmFocus() then LockonTarget() end
4626 if TargetInCombat() and InMeleeRange() then
4627 if not IsCurrentAction(72) then UseAction(72) end
4628 end
4629 RaidHeal()
4630 end
4631end
4632function dru_heal_multi()
4633 if ImBusy() then return end
4634 InnervateAHealer()
4635 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4636 if UnitHealth("player")/UnitHealthMax("player")<.6 then cast ("Barkskin") end
4637 tankh=FocHealth()
4638 CC()
4639 Decurse()
4640 if buffed("Last Stand","target") or buffed("Shield Wall","target") or buffed("Frenzied Regeneration","target") then
4641 CombatUse(13)
4642 CombatUse(14)
4643 end
4644 --SaveAndorov(.5)
4645 HealSelf(.2)
4646 HealTank(.3)
4647 SaveChump(.33)
4648 TargetUnit("player")
4649 if (RaidHealth()<.6 ) and InCombat() and not OnCooldown("Tranquility") then
4650 cast("Tranquility")
4651 use("Major Mana Potion")
4652 else
4653 RaidHeal()
4654 if not IAmFocus() then LockonTarget() end
4655 if TargetInCombat() and InMeleeRange() then
4656 if not IsCurrentAction(72) then UseAction(72) end
4657 end
4658 end
4659end
4660function dru_tank_single()
4661 SelfBuff("Dire Bear Form")
4662 if not buffed("Frenzied Regeneration","player") and MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4663 if buffed("Enveloping Webs","player") then cast("Cat Form") end
4664 if MyHealthPct()<.2 then cast("Frenzied Regeneration") end
4665 if IsControlKeyDown() then FeralInterrupt() ; end
4666 local tname=UnitName("target")
4667 local myname=UnitName("player")
4668 if not tname then tname="" end
4669 --TAUNT CODE
4670 if TableLength(MB_My_ot_target)>0 then
4671 --Select my off-tank target if I've lost it
4672 OT()
4673 --I test MB_My_ot_target again because in OT(), it might have been cleared on death of target.
4674 if TableLength(MB_My_ot_target)>0 and UnitName("targettarget")~=myname and TargetInCombat() then BearTaunt("AUTOTAUNT:OT not on me: "..tname) end
4675 --If you are a tank, (focus or not) and not assigned to an OT target, you will taunt anything NOT attacking a tank
4676 elseif UnitIsEnemy("player","target") and not FindInTable(MB_tanklist,UnitName("targettarget")) and TargetInCombat() then ttname=UnitName("targettarget") if ttname and TargetInCombat() then BearTaunt("AUTOTAUNT: "..tname.." attacking "..ttname) end end
4677 --Force taunt on alt-2 if you are main tank, otherwise ctrl-3 if you are bot
4678 if IAmFocus() and IsAltKeyDown() and UnitIsEnemy("player","target") and UnitName("targettarget")~=myname then BearTaunt("TAUNT:alt-2 "..tname) end
4679 --END TAUNT CODE
4680 if not UnitName("target") and not IAmFocus() and TableLength(MB_My_ot_target)==0 then
4681 TargetNotOnTankNoAlt()
4682 elseif TableLength(MB_My_ot_target)==0 then
4683 FindATargetStupid()
4684 end
4685 if IAmFocus() then CloseDistance() end
4686 if MyRage()>9 and (CooldownTime("Feral Charge")>.75 and CooldownTime("Feral Charge")<4) and InMeleeRange() then cast("Demoralizing Roar") end
4687 if UnitName("target")~="Kurinnaxx" and InMeleeRange() and TargetInCombat() then cast"Faerie Fire (Feral)()" end
4688 if UnitName("target")=="High Priestess Arlokk" then cast("Swipe") end
4689 --During panther boss fight, if you are not main tank, pick up all panthers not on you
4690 if not IAmFocus() and TankTarget("High Priestess Arlokk") then TargetNotOnTankNoAlt() cast("Swipe") end
4691 --Don't do anything if someone else is tanking and alt key down.
4692 --if not IAmFocus() and IsAltKeyDown() then return end
4693 --if not IsAltKeyDown() or IAmFocus() and TableLength(MB_My_ot_target)==0 then CloseDistance() end
4694 if IAmFocus() or (not IAmFocus() and TargetInCombat() or IsAltKeyDown() ) then
4695 cast("Faerie Fire (Feral)()")
4696 cast("Swipe")
4697 cast("Maul")
4698 if not IsAltKeyDown() then BufCast("Demoralizing Roar") end
4699 if InMeleeRange() then
4700 if not IsCurrentAction(72) then UseAction(72) end
4701 end
4702 end
4703end
4704function dru_cat_single()
4705 if not buffed("Frenzied Regeneration","player") and MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4706 if MyHealthPct()<.2 then SelfBuff("Dire Bear Form") cast("Frenzied Regeneration") end
4707 if IAmFocus() then CloseDistance() end
4708 if not buffed("Frenzied Regeneration","player") then SelfBuff("Cat Form") end
4709 if buffed("Dire Bear Form","player") then
4710 if not IAmFocus() then LockonTarget() end
4711 if IsControlKeyDown() then FeralInterrupt() ; end
4712 if InMeleeRange() then
4713 cast("Maul")
4714 cast("Swipe")
4715 if not IsCurrentAction(72) then UseAction(72) end
4716 end
4717 if buffed("Enveloping Webs","player") then cast("Cat Form") end
4718 return
4719 end
4720 if buffed("Enveloping Webs","player") then cast("Cat Form") end
4721 if not IAmFocus() then LockonTarget() end
4722 if IsControlKeyDown() then FeralInterrupt() ; end
4723 if IAmFocus() or (not IAmFocus() and TargetInCombat() or IsAltKeyDown() ) then
4724 --SelfBuff("Tiger's Fury")
4725 if InMeleeRange() then
4726 if GetComboPoints()>=5 and not buffed("Rip","target") then cast("Rip") end
4727 if GetComboPoints()>=5 then cast("Ferocious Bite") end
4728 BufCast("Faerie Fire (Feral)()")
4729 SelfBuff("Tiger's Fury")
4730 BufCast("Rake")
4731 cast("Shred")
4732 cast("Claw")
4733 if not IsCurrentAction(72) then UseAction(72) end
4734 end
4735 end
4736end
4737function dru_tank_multi()
4738 --Print("In Dru Tank multi")
4739 SelfBuff("Dire Bear Form")
4740 if not buffed("Frenzied Regeneration","player") and MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4741 if buffed("Enveloping Webs","player") then cast("Cat Form") end
4742 if MyHealthPct()<.2 then cast("Frenzied Regeneration") end
4743 if IsControlKeyDown() then cast("Challenging Roar") end
4744 local tname=UnitName("target")
4745 local myname=UnitName("player")
4746 if not tname then tname="" end
4747 --TAUNT CODE
4748 if TableLength(MB_My_ot_target)>0 then
4749 --Select my off-tank target if I've lost it
4750 OT()
4751 --I test MB_My_ot_target again because in OT(), it might have been cleared on death of target.
4752 if TableLength(MB_My_ot_target)>0 and UnitName("targettarget")~=myname and TargetInCombat() then BearTaunt("AUTOTAUNT:OT not on me: "..tname) end
4753 --If you are a tank, (focus or not) and not assigned to an OT target, you will taunt anything NOT attacking a tank
4754 elseif UnitIsEnemy("player","target") and not FindInTable(MB_tanklist,UnitName("targettarget")) and TargetInCombat() then ttname=UnitName("targettarget") if ttname then BearTaunt("AUTOTAUNT: "..tname.." attacking "..ttname) end end
4755 --Force taunt on ctrl-3 if you are not a focus tank
4756 if IAmFocus() and IsControlKeyDown() and UnitIsEnemy("player","target") and UnitName("targettarget")~=myname and not IAmFocus() then BearTaunt("TAUNT:ctrl-3: "..tname) end
4757 --END TAUNT CODE
4758 if not IAmFocus() and TableLength(MB_My_ot_target)==0 then
4759 TargetNotOnTankNoAlt()
4760 elseif TableLength(MB_My_ot_target)==0 then
4761 FindATargetStupid()
4762 end
4763 if IAmFocus() and IsAltKeyDown() then TargetNotOnMe() end
4764 --Now you have a target. If it's in combat, do your dru shit
4765 if UnitName("target") and TargetInCombat() then
4766 --Don't do anything if Eversmile is tanking and alt key down.
4767 if not IAmFocus() and IsAltKeyDown() then return end
4768 cast("Swipe")
4769 cast("Faerie Fire (Feral)()")
4770 if MyRage()>16 then cast("Maul") end
4771 if not IsAltKeyDown() then BufCast("Demoralizing Roar") end
4772 if InMeleeRange() then
4773 if not IsCurrentAction(72) then UseAction(72) end
4774 end
4775 end
4776end
4777function dru_tank_aoe()
4778 --Print("In Dru Tank aoe")
4779 if not IAmFocus() and IsAltKeyDown() then Follow() return end
4780 SelfBuff("Dire Bear Form")
4781 local tname=UnitName("target")
4782 local myname=UnitName("player")
4783 if not tname then tname="" end
4784 if not buffed("Frenzied Regeneration","player") and MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
4785 if MyHealthPct()<.2 then cast("Frenzied Regeneration") end
4786 --TAUNT CODE
4787 if TableLength(MB_My_ot_target)>0 then
4788 --Select my off-tank target if I've lost it
4789 OT()
4790 --I test MB_My_ot_target again because in OT(), it might have been cleared on death of target.
4791 if TableLength(MB_My_ot_target)>0 and UnitName("targettarget")~=myname and TargetInCombat() then BearTaunt("AUTOTAUNT:AOE OT not on me: "..tname) end
4792 --If you are a tank, (focus or not) and not assigned to an OT target, you will taunt anything NOT attacking a tank
4793 elseif not FindInTable(MB_tanklist,UnitName("targettarget")) and TargetInCombat() then ttname=UnitName("targettarget") if ttname then BearTaunt("AUTOTAUNT:AOE "..tname.." attacking "..ttname) end end
4794 --END TAUNT CODE
4795 --This is CC, bot or not, you should be finding a target not on you unless you have an ot assignment
4796 if TableLength(MB_My_ot_target)==0 then TargetNotOnTankNoAlt() end
4797 if TargetInCombat() then
4798 if not UnitName("target") and TableLength(MB_My_ot_target)==0 then FindATargetStupid() end
4799 if UnitIsDead("target") and TableLength(MB_My_ot_target)>0 then
4800 table.remove(MB_My_ot_target,GetRaidTargetIndex("target"))
4801 end
4802 if not IsAltKeyDown() then BufCast("Demoralizing Roar") end
4803 if MyRage()>16 then cast("Maul") end
4804 if InMeleeRange() then
4805 if not IsCurrentAction(72) then UseAction(72) end
4806 end
4807 end
4808end
4809function UnitAttackingTank()
4810 if not TankName() then return true end
4811 if UnitName("targettarget")==TankName() then return true end
4812end
4813function CancelForm()
4814 if buffed("Moonkin Form","player") then cast("Moonkin Form") end
4815 if buffed("Dire Bear Form","player") then cast("Dire Bear Form") end
4816 if buffed("Cat Form","player") then cast("Cat Form") end
4817 if buffed("Bear Form","player") then cast("Bear Form") end
4818 if buffed("Travel Form","player") then cast("Travel Form") end
4819end
4820function boomkin_single()
4821 Print("Boomkin Single")
4822 if ImBusy() then return end
4823 if UnitHealth("player")/UnitHealthMax("player")<.6 then cast ("Barkskin") end
4824 SelfBuff("Moonkin Form")
4825 --SelfBuff("Omen of Clarity")
4826 --SelfBuff("Thorns")
4827 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
4828 InnervateAHealer()
4829 --Decurse()
4830 if not IAmFocus() then LockonTarget() end
4831 if UnitLevel("player")<10 then RaidHeal() end
4832 if IAmFocus() or (not IsAltKeyDown() and TargetInCombat()) then
4833 if UnitAttackingTank() and not buffed("Moonfire","target") then BufCast("Moonfire") end
4834 cast("Starfire")
4835 cast("Wrath")
4836 if not IsCurrentAction(72) then UseAction(72) end
4837 end
4838end
4839function boomkin_multi()
4840 if ImBusy() then return end
4841 if UnitHealth("player")/UnitHealthMax("player")<.6 then cast ("Barkskin") end
4842 SelfBuff("Moonkin Form")
4843 --SelfBuff("Omen of Clarity")
4844 --SelfBuff("Thorns")
4845 InnervateAHealer()
4846 --Decurse()
4847 if UnitLevel("player")<10 then RaidHeal() end
4848 if not IAmFocus() then LockonTarget() end
4849 if IAmFocus() or (not IsAltKeyDown() and TargetInCombat()) then
4850 if UnitAttackingTank() and not buffed("Moonfire","target") then BufCast("Moonfire") end
4851 cast("Starfire")
4852 cast("Wrath")
4853 if not IsCurrentAction(72) then UseAction(72) end
4854 end
4855end
4856--
4857---
4858----PRIEST (shadow and holy)
4859function priest_single()
4860 if IsShadow() then priest_shadow_single() return end
4861 priest_heal_single()
4862end
4863function priest_multi()
4864 if IsShadow() then priest_shadow_multi() return end
4865 priest_heal_multi()
4866end
4867function priest_aoe()
4868 if IsAltKeyDown() then return end
4869 if IsShadow() then priest_shadow_multi() return end
4870 priest_heal_aoe()
4871end
4872----Warrior (arms/fury/prot)
4873function warrior_single()
4874 local name,realm=UnitName("player")
4875 if FindInTable(MB_tanklist,name) then warrior_tank_single() return end
4876 if IsFury() then fury_single() return end
4877 if IsArms() then arms_single() return end
4878 warrior_tank_single()
4879end
4880function warrior_multi()
4881 local name,realm=UnitName("player")
4882 if FindInTable(MB_tanklist,name) then warrior_tank_multi() return end
4883 if IsFury() then fury_multi() return end
4884 if IsArms() then arms_multi() return end
4885 warrior_tank_multi()
4886end
4887function warrior_aoe()
4888 local name,realm=UnitName("player")
4889 if FindInTable(MB_tanklist,name) then warrior_tank_aoe() return end
4890 if IsFury() then fury_multi() return end
4891 if IsArms() then arms_multi() return end
4892 warrior_tank_aoe()
4893end
4894function ShieldBomb()
4895 for i=1,40 do
4896 if buffed("Living Bomb","raid"..i) and not buffed("Weakened Soul","raid"..i) then
4897 TargetUnit("raid"..i)
4898 cast("Power Word: Shield")
4899 return
4900 end
4901 end
4902end
4903function priest_heal_single()
4904 if buffed("Living Bomb","player") then Follow_Komal() end
4905 ShieldBomb()
4906 if ImBusy() then return end
4907 CC()
4908 Fade()
4909 --Bubble()
4910 HealSelf(.2)
4911 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
4912 local myname,realm=UnitName("player")
4913 if buffed("Last Stand","target") or buffed("Shield Wall","target") or buffed("Frenzied Regeneration","target") then
4914 CombatUse(13)
4915 CombatUse(14)
4916 end
4917 if not FindInTable(MB_dedicated_healers,myname) then
4918 Decurse()
4919 --SaveAndorov(.5)
4920 HealTank(.3)
4921 if TankTarget("Moam") and MyClassOrder()==2 then RunLine("/target Moam") cast("Mana Burn") end
4922 SaveChump(.33)
4923 end
4924 --if UnitHealth("target")/UnitHealthMax("target") then SpellStopCasting() end
4925 --if PartyHurt(700,3) then cast("Prayer of Healing") end
4926 RaidHeal()
4927 if InCombat() and not IsAltKeyDown() then
4928 LockonTarget()
4929 if not RAIS_shooting then UseAction(72) return end
4930 end
4931end
4932function priest_heal_multi()
4933 if ImBusy() then return end
4934 CC()
4935 Fade()
4936 --Bubble()
4937 local myname,realm=UnitName("player")
4938 --SaveAndorov(.5)
4939 if buffed("Last Stand","target") or buffed("Shield Wall","target") or buffed("Frenzied Regeneration","target") then
4940 CombatUse(13)
4941 CombatUse(14)
4942 end
4943 HealSelf(.2)
4944 if not FindInTable(MB_dedicated_healers,myname) then
4945 Decurse()
4946 HealTank(.3)
4947 SaveChump(.33)
4948 end
4949 RaidHeal()
4950 if (InCombat() or TargetInCombat()) and not IsAltKeyDown() then
4951 LockonTarget()
4952 if not RAIS_shooting then UseAction(72) return end
4953 end
4954end
4955function SaveAndorov(thresh)
4956 RunLine("/target Lieutenant General Andorov")
4957 if UnitHealth("target")/UnitHealthMax("target")<thresh then
4958 QuickHeal("target")
4959 end
4960 TargetUnit("playertarget")
4961end
4962function priest_heal_aoe()
4963 if ImBusy() then return end
4964 CC()
4965 Fade()
4966 --Bubble()
4967 HealSelf(.2)
4968 HealTank(.3)
4969 SaveChump(.33)
4970 cast("Holy Nova")
4971 --if PartyHurt(700,3) then cast("Prayer of Healing") end
4972 RaidHeal()
4973end
4974function priest_shadow_single()
4975 --if buffed("Threatening Gaze","player") then
4976 --if IsAutoRepeatAction(72) then
4977 --cast("Shoot"); end
4978 --return
4979 --end
4980 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
4981 if ImBusy() then return end
4982 Fade()
4983 Decurse()
4984 --SelfBuff("Shadowform")
4985 HealSelf(.2)
4986 HealTank(.3)
4987 SaveChump(.33)
4988 if not IAmFocus() then LockonTarget() end
4989 if IAmFocus() or (not IsAltKeyDown() and TargetInCombat()) then
4990 if MyMana()>205 and buffed("Vampiric Embrace","target") or MyMana()>40 and not buffed("Vampiric Embrace","target") then
4991 BufCast("Vampiric Embrace")
4992 BufCast("Shadow Word: Pain")
4993 cast("Mind Blast")
4994 cast("Mind Flay")
4995 if UnitLevel("player")<13 then cast("Smite") end
4996 end
4997 end
4998end
4999function priest_shadow_multi()
5000 if ImBusy() then return end
5001 Fade()
5002 Decurse()
5003 SelfBuff("Shadowform")
5004 if not IsAltKeyDown() then
5005 if PartyHurt(700,3) then cast("Prayer of Healing") end
5006 HealSelf(.2)
5007 HealTank(.3)
5008 SaveChump(.33)
5009 if not IAmFocus() then LockonTarget() end
5010 if IAmFocus() or (not IsAltKeyDown() and UnitInCombat()) then
5011 if MyMana()>205 and buffed("Vampiric Embrace","target") or MyMana()>40 and not buffed("Vampiric Embrace","target") then
5012 BufCast("Vampiric Embrace")
5013 BufCast("Shadow Word: Pain")
5014 cast("Mind Blast")
5015 cast("Mind Flay")
5016 if UnitLevel("player")<13 then cast("Smite") end
5017 end
5018 end
5019 end
5020end
5021function priest_setup()
5022 if ImBusy() then return end
5023 if IsAltKeyDown() then MB_Assist() return end
5024 if IsShiftKeyDown() or IsAltKeyDown() then return end
5025 if IsControlKeyDown() then return end
5026 AutoDelete()
5027 if InCombat() then CancelTrade() end
5028 if not InCombat() then
5029 if UnitLevel("player")==60 then
5030 RaidBuff("Prayer of Fortitude")
5031 else
5032 RaidBuff("Power Word: Fortitude")
5033 end
5034 end
5035 if MyMana()<3400 and buffed("Drink","player") then return end
5036 if not InCombat() then
5037 if UnitLevel("player")==60 then
5038 if RaidBuff("Prayer of Spirit")then return end
5039 if RaidBuff("Prayer of Shadow Protection") then return end
5040 end
5041 end
5042 SelfBuff("Inner Fire")
5043 local name,realm=UnitName("player")
5044 Decurse()
5045 if not InCombat() then smartdrink() end
5046 --RaidHeal()
5047end
5048function priest_turbo()
5049 if not InCombat() then return end
5050 if not TargetInCombat() then return end
5051 if ImBusy() then return end
5052 if IsShadow() then
5053 cast("Berserking")
5054 use(13)
5055 use(14)
5056 end
5057end
5058--
5059---
5060----MAGE
5061function mage_single()
5062 if IsFire() then mage_fire_single() return end
5063 mage_frost_single()
5064end
5065function mage_multi()
5066 if IsFire() then mage_fire_multi() return end
5067 mage_frost_multi()
5068end
5069function mage_aoe()
5070 if IsAltKeyDown() then return end
5071 if IsFire() then mage_fire_aoe() return end
5072 mage_frost_aoe()
5073end
5074function mage_fire_single()
5075 if buffed("Living Bomb","player") then Follow_Komal() end
5076 if ImBusy() then return end
5077 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
5078 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
5079 CC()
5080 Decurse()
5081 if not IAmFocus() then LockonTarget() end
5082 --if FocCursed() then RunLine("/tarfocus") cast("Remove Curse") end
5083 if MyManaPct()<.1 and not OnCooldown("Evocation") then cast("Evocation") end
5084 --CrowdControl()
5085 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
5086 if TargetInCombat() or IAmFocus() then
5087 if IsAltKeyDown() then SpellStopCasting() end
5088 if not IsAltKeyDown() then
5089 if FireResistant() then
5090 cast("Frostbolt")
5091 end
5092 StackCast("Scorch",5)
5093 cast("Fireblast")
5094 cast("Fireball")
5095 if not RAIS_shooting then UseAction(72) return end
5096 --if UnitHealth("target")>2000 then cast("Pyroblast") end
5097 end
5098 end
5099end
5100function mage_fire_multi()
5101 if ImBusy() then return end
5102 --if buffed("Threatening Gaze","player") then return end
5103 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
5104 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
5105 CC()
5106 Decurse()
5107 if not IAmFocus() then LockonTarget() end
5108 if buffed("Evocation","player") then return end
5109 --if FocCursed() then RunLine("/tarfocus") cast("Remove Curse") end
5110 if MyManaPct()<.1 and not OnCooldown("Evocation") then cast("Evocation") end
5111 --CrowdControl()
5112 if TargetInCombat() or IAmFocus() then
5113 if IsAltKeyDown() then SpellStopCasting() end
5114 if not IsAltKeyDown() then
5115 --if UnitName("target")=="Bloodlord Mandokir" then cast("Frostbolt") end
5116 cast("Combustion")
5117 if InMeleeRange then cast("Blast Wave") end
5118 if InMeleeRange() then cast("Frost Nova") end
5119 if InMeleeRange() and frozen() then cast("Cone of Cold") end
5120 if FireResistant() then
5121 cast("Frostbolt")
5122 end
5123 StackCast("Scorch",5)
5124 cast("Fireblast")
5125 cast("Fireball")
5126 if not RAIS_shooting then UseAction(72) return end
5127 --if UnitHealth("target")>2000 then cast("Pyroblast") end
5128 end
5129 end
5130end
5131function FireResistant()
5132 if UnitName("target")=="Golemagg the Incinerator" then return true end
5133 if UnitName("target")=="Molten Destroyer" then return true end
5134 if UnitName("target")=="Baron Geddon" then return true end
5135 if UnitName("target")=="Molten Giant" then return true end
5136 if UnitName("target")=="Ragnaros" then return true end
5137 if UnitName("target")=="Magmadar" then return true end
5138end
5139function mage_fire_aoe()
5140 if ImBusy() then return end
5141 --if buffed("Threatening Gaze","player") then return end
5142 if MyHealthPct()<.1 then RunLine("/use Major Healing Potion") end
5143 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
5144 Decurse()
5145 LockonNearest()
5146 if TargetInCombat() or IAmFocus() then
5147 if not IsAltKeyDown() then
5148 cast("Combustion")
5149 cast("Blast Wave")
5150 cast("Arcane Explosion")
5151 end
5152 end
5153end
5154function CancelAura(buff)
5155 for i=1,16 do
5156 buffname=GetPlayerBuff(i)
5157 if not buffname then return end
5158 if buffname==buff then CancelPlayerBuff(i) end
5159 end
5160end
5161function mage_frost_aoe()
5162 --if buffed("Threatening Gaze","player") then return end
5163 if buffed("Ice Block","player") and MyHealth()>3000 then CancelAura("Ice Block") end
5164 if MyHealthPct()<.10 then if OnCooldown("Ice Block") then cast("Cold Snap") end cast("Ice Block") end
5165 if ImBusy() then return end
5166 if MyManaPct()<.1 then RunLine("/use Major Mana Potion") end
5167 CC()
5168 if not IAmFocus() then LockonNearest() end
5169 cast("Arcane Explosion")
5170end
5171function mage_frost_single()
5172 if buffed("Living Bomb","player") then Follow_Komal() end
5173 if buffed("Ice Block","player") and MyHealthPct()>.6 then CancelAura("Ice Block") end
5174 if TankTarget("Gehennas") or TankTarget("Flamewaker") and UnitName("player")=="Jenjja" then FollowByName("Cashme",1) end
5175 if MyHealthPct()<.1 and InCombat() then if OnCooldown("Ice Block") then cast("Cold Snap") end cast("Ice Block") end
5176 if ImBusy() then return end
5177 if MyManaPct()<.8 and InCombat() then RunLine("/use Mana Ruby") end
5178 if MyManaPct()<.8 and InCombat() then RunLine("/use Mana Citrine") end
5179 if MyManaPct()<.1 and InCombat() then RunLine("/use Major Mana Potion") end
5180 if MyHealthPct()<.1 and InCombat() then RunLine("/use Major Healing Potion") end
5181 CC()
5182 Decurse()
5183 if not IAmFocus() then LockonTarget() end
5184 --SelfBuff("Ice Barrier")
5185 if MyManaPct()<.1 and not OnCooldown("Evocation") then cast("Evocation") end
5186 --CrowdControl()
5187 --if TankTarget("Lord Kazzak") and MyMana()<1000 then return end
5188 if TargetInCombat() or IAmFocus() then
5189 if IsAltKeyDown() then if not MB_My_cc_target then SpellStopCasting() return end end
5190 if not IsAltKeyDown() and (TargetInCombat() or IAmFocus()) then
5191 --if UnitName("target")=="Magmadar" then BufCast("Detect Magic") end
5192 if TankTarget("Gehennas") then Decurse() else
5193 if FastKill() then cast("Scorch") end
5194 cast("Frostbolt")
5195 cast("Fireball")
5196 if not RAIS_shooting then UseAction(72) return end
5197 end
5198 end
5199 end
5200end
5201function mage_frost_multi()
5202 --if buffed("Threatening Gaze","player") then return end
5203 if buffed("Ice Block","player") and MyHealth()>3000 then CancelAura("Ice Block") end
5204 if MyHealthPct()<.10 then if OnCooldown("Ice Block") then cast("Cold Snap") end cast("Ice Block") end
5205 if ImBusy() then return end
5206 if MyManaPct()<.1 and InCombat() then RunLine("/use Mana Ruby") end
5207 if MyManaPct()<.1 and InCombat() then RunLine("/use Mana Citrine") end
5208 if MyManaPct()<.1 and InCombat() then RunLine("/use Major Mana Potion") end
5209 if MyHealthPct()<.1 and InCombat() then RunLine("/use Major Healing Potion") end
5210 CC()
5211 Decurse()
5212 if not IAmFocus() then LockonTarget() end
5213 if buffed("Evocation","player") then return end
5214 --if FocCursed() then RunLine("/tarfocus") cast("Remove Curse") end
5215 if MyManaPct()<.1 and not OnCooldown("Evocation") then cast("Evocation") end
5216 --CrowdControl()
5217 if TargetInCombat() or IAmFocus() then
5218 if IsAltKeyDown() then SpellStopCasting() end
5219 if not IsAltKeyDown() and TargetInCombat() then
5220 --if InMeleeRange() then cast("Frost Nova") end
5221 --if InMeleeRange() and frozen() then cast("Cone of Cold") end
5222 cast("Frostbolt")
5223 if not RAIS_shooting then UseAction(72) return end
5224 end
5225 end
5226end
5227function frozen()
5228 if buffed("Frost Nova","target") then return true end
5229end
5230function mage_turbo()
5231 if not TargetInCombat() then return end
5232 if not InCombat() then return end
5233 if ImBusy() then return end
5234 cast("Berserking")
5235 cast("Presence of Mind")
5236 cast("Arcane Power")
5237 use(13)
5238 use(14)
5239end
5240function MyLevel()
5241 return UnitLevel("player")
5242end
5243function mage_setup()
5244 --if not tD_Temp.isEnabled then RunLine("/td toggle") end
5245 if IsAltKeyDown() then MB_Assist() return end
5246 if IsControlKeyDown() or IsShiftKeyDown() then return end
5247 AutoDelete()
5248 if InCombat() then CancelTrade() end
5249 if ImBusy() then return end
5250 if MyLevel()>57 then
5251 if HasItem("Mana Ruby")==0 then cast("Conjure Mana Ruby") end
5252 end
5253 if MyLevel()>47 then
5254 if HasItem("Mana Citrine")==0 then cast("Conjure Mana Citrine") end
5255 end
5256 if SpellExists("Mage Armor") then
5257 SelfBuff("Mage Armor")
5258 elseif SpellExists("Ice Armor") then
5259 SelfBuff("Ice Armor")
5260 elseif SpellExists("Frost Armor") then
5261 SelfBuff("Frost Armor")
5262 end
5263 if UnitLevel("player")==60 then
5264 RaidBuff("Arcane Brilliance")
5265 else
5266 RaidBuff("Arcane Intellect")
5267 end
5268 if TankTarget("High Priest Thekal") then RaidBuff("Amplify Magic") end
5269 if TankTarget("Moam") then RaidBuff("Dampen Magic") end
5270 if TankTarget("Qiraji Gladiator") then RaidBuff("Amplify Magic") end
5271 if TankTarget("Zulian Tiger") then RaidBuff("Amplify Magic") end
5272 if TankTarget("Jin'do the Hexxer") then RaidBuff("Amplify Magic") end
5273 if TankTarget("Kurinnaxx") then RaidBuff("Amplify Magic") end
5274 if TankTarget("Lieutenant General Andorov") then RaidBuff("Amplify Magic") end
5275 if TankTarget("Hakkar") then RaidBuff("Amplify Magic") end
5276 if ManaDown()>0 and buffed("Drink","player") then return end
5277 if not InCombat() then smartdrink() end
5278end
5279--
5280---
5281----ROGUE
5282function Stealthed()
5283 local buftype,isBuffed,bufname=buffed("Stealth","player")
5284 return isBuffed
5285end
5286function rogue_setup()
5287 if IsAltKeyDown() then MB_Assist() return end
5288 AutoDelete()
5289 if not IsControlKeyDown() and not IsAltKeyDown() then Follow() end
5290 if IsAltKeyDown() and Stealthed() then cast("Stealth") return end
5291 if Stealthed() then cast("Pick Pocket") end
5292 --if not Stealthed() then cast("Stealth") end
5293 --InstantPoisonMain()
5294 InstantPoisonOff()
5295end
5296function rogue_single()
5297 if InCombat() then RogueSurvive() end
5298 if IsAltKeyDown() then if IsCurrentAction(72) then UseAction(72) return end end
5299 if buffed("Living Bomb","player") then Follow_Komal() end
5300 if not IAmFocus() then LockonTarget() end
5301 if TargetInCombat() or IAmFocus() then
5302 if InMeleeRange() then
5303 if Stealthed() then cast("Garrote") end
5304 if GetComboPoints()>=1 and not buffed("Slice and Dice","player") then cast("Slice and Dice") end
5305 if GetComboPoints()>=5 then cast("Eviscerate") end
5306 cast("Sinister Strike")
5307 if not IsCurrentAction(72) then UseAction(72) end
5308 end
5309 end
5310end
5311function RogueSurvive()
5312 if TargetedByMelee() then cast("Feint") end
5313 if MyHealthPct()<.6 and TargetedByMelee() then cast("Evasion") end
5314 if MyHealthPct()<.1 and InCombat() then cast("Vanish") end
5315end
5316function TargetedByOtherRogue(unit)
5317 --local roguelist={"Stabsya",Kimboslicer","Toshredsusay","Pocklick","Crookshanks"}
5318 local roguelist={"Toshredsusay","Crookshanks"}
5319 for key,rogue in roguelist do
5320 local name,realm=UnitName("player")
5321 if name~=rogue then
5322 if UnitIsUnit(unit,RaidID(rogue).."target") then return true end
5323 end
5324 end
5325end
5326function RogueSpreadTargets()
5327 if GetComboPoints()>0 then return end
5328 for i=1,10 do
5329 TargetNearestEnemy()
5330 if InMeleeRange() and TargetInCombat() then
5331 if not TargetedByOtherRogue("target") then return end
5332 end
5333 end
5334 TargetUnit("playertarget")
5335end
5336function TargetedByMelee()
5337 for i=1,5 do
5338 TargetNearestEnemy()
5339 local class=UnitClass("target")
5340 if UnitIsEnemy("target","player") and InMeleeRange() and TargetInCombat() then
5341 if (class=="Warrior" or class=="Rogue" or class=="Paladin" or class=="Shaman" or class=="Hunter") and UnitIsUnit("targettarget","player") then TargetUnit("playertarget") return true end
5342 end
5343 end
5344 TargetUnit("playertarget")
5345end
5346function InnerFocus()
5347 if UnitClass("player") ~= "Priest" then return end
5348 if not OnCooldown("Inner Focus") and UnitClass("player")=="Priest" and UnitHealth("target")<800 and MyMana()<350 and InCombat() then cast("Inner Focus") QuickHeal("target") end
5349end
5350function rogue_multi()
5351 if InCombat() then RogueSurvive() end
5352 if IsAltKeyDown() then if IsCurrentAction(72) then UseAction(72) return end end
5353 if not UnitName("target") then LockonNearest() end
5354 if TargetInCombat() or IAmFocus() then
5355 --RogueSpreadTargets()
5356 if InMeleeRange() then
5357 cast("Blade Flurry")
5358 if GetComboPoints()>=1 and not buffed("Slice and Dice","player") then cast("Slice and Dice") end
5359 if GetComboPoints()>=3 then cast("Eviscerate") end
5360 cast("Sinister Strike")
5361 if not IsCurrentAction(72) then UseAction(72) end
5362 end
5363 end
5364end
5365function rogue_aoe()
5366 if InCombat() then RogueSurvive() end
5367 if not UnitName("target") then LockonNearest() end
5368 if TargetInCombat() or IAmFocus() then
5369 --RogueSpreadTargets()
5370 if InMeleeRange() then
5371 cast("Blade Flurry")
5372 if GetComboPoints()>=1 and not buffed("Slice and Dice","player") then cast("Slice and Dice") end
5373 if GetComboPoints()>=3 then cast("Eviscerate") end
5374 cast("Sinister Strike")
5375 if not IsCurrentAction(72) then UseAction(72) end
5376 end
5377 end
5378end
5379function rogue_turbo()
5380 if not InCombat() then return end
5381 if not TargetInCombat() then return end
5382 cast ("Adrenaline Rush")
5383 cast ("Blood Fury")
5384 cast ("Berserking")
5385 use(13)
5386 use(14)
5387end
5388-- LUA UTILITIES
5389function spairs(t, order)
5390 -- collect the keys
5391 local keys = {}
5392 local size
5393 for k in pairs(t) do size=TableLength(keys) keys[size+1] = k end
5394
5395 -- if order function given, sort by it by passing the table and keys a, b,
5396 -- otherwise just sort the keys
5397 if order then
5398 table.sort(keys, function(a,b) return order(t, a, b) end)
5399 else
5400 table.sort(keys)
5401 end
5402
5403 -- return the iterator function
5404 local i = 0
5405 return function()
5406 i = i + 1
5407 if keys[i] then
5408 return keys[i], t[keys[i]]
5409 end
5410 end
5411end
5412function FindKeyInTable(table,string)
5413 if not table then return end
5414 for i,v in table do
5415 if i==string then return i end
5416 end
5417 return nil
5418end
5419function TableConcat(t1,t2)
5420 for _,v in ipairs(t2) do
5421 table.insert(t1, v)
5422 end
5423end
5424function TableLength(tab)
5425--This utility tells you how many elements are in a table
5426 local len=0
5427 for _ in pairs(tab) do
5428 len=len+1
5429 end
5430 return len
5431end
5432-- UNUSED CODE
5433function TradeFood()
5434 class=UnitClass("player")
5435 if class=="Mage" then
5436 InitiateTrade("target")
5437 slot1=GetTradePlayerItemLink(1)
5438 if not slot1 then Print("Nothing in slot1") end
5439 if slot1 then AcceptTrade()
5440 else
5441 Print("Picking up food")
5442 if not CursorHasItem() then
5443 pickupfood()
5444 else
5445 ClickTradeButton(1)
5446 end
5447 end
5448 else
5449 slot1=GetTradeTargetItemLink(1)
5450 if slot1 and string.find(slot1, "Conjured") then AcceptTrade() end
5451 end
5452end
5453function GiveFood()
5454 class=UnitClass("player")
5455 if class=="Mage" then
5456 if GetTradePlayerItemLink(1) then
5457 AcceptTrade()
5458 else
5459 if not CursorHasItem() then
5460 pickupfood()
5461 else
5462 DropItemOnUnit("target")
5463 end
5464 end
5465 else
5466 AcceptTrade()
5467 end
5468end
5469function smartdrink_withfood()
5470--I don't produce or hand out food anymore, it's stupid in a raid with 6 healers
5471 local class=UnitClass("player")
5472 --Print(class)
5473 --Print("In Smartdrink")
5474 if class=="Mage" then
5475 if buffed("Evocation","player") then return end
5476 if MyManaPct()>.25 and (MageWater()<11 or magefood()<40) then
5477 if magefood()>=MageWater() and MageWater()<40 then cast("Conjure Water") end
5478 if magefood()<MageWater() and magefood()<40 then cast("Conjure Food") end
5479 end
5480 if ManaDown()>0 and not buffed("Drink","player") then RunLine("/use Conjured Water") end
5481 if healthdown()>0 and not buffed("Food","player") then RunLine("/use Conjured Sweet Roll") end
5482 else
5483 local mage=MageInGroup()
5484 if mage then
5485 if (MageWater()<5 or magefood()<5) then
5486 TargetByName(mage,1)
5487 InitiateTrade("target")
5488 if GetTradeTargetItemLink(2) and string.find(GetTradeTargetItemLink(2), "Conjured") then AcceptTrade() end
5489 end
5490 if ManaUser() and ManaDown()>0 and not buffed("Drink","player") then RunLine("/use Conjured Crystal Water") end
5491 if healthdown()>0 and not buffed("Food","player") then RunLine("/use Conjured Sweet Roll") end
5492 else
5493 if ManaUser() and ManaDown()>700 and not buffed("Drink","player") then RunLine("/use Morning Glory Dew") end
5494 if healthdown()>700 and not buffed("Food","player") then RunLine("/use Roasted Quail") end
5495 end
5496 end
5497end
5498function test()
5499 for i=1,TableLength(MB_party_healer_list) do
5500 Print(MB_party_healer_list[i])
5501 Print(PartyID(MB_party_healer_list[i]))
5502 Print(UnitMana(PartyID(MB_party_healer_list[i])))
5503 Print(UnitMana(PartyID(MB_party_healer_list[i]))/UnitManaMax(PartyID(MB_party_healer_list[i])))
5504 end
5505end
5506function PartyHeal()
5507 --not used right now, but better algorithm than raidheal!
5508 if UnitIsDead("player") or UnitIsGhost("player") then return end
5509 if ManaDown()>0 and buffed("Drink","player") then return end
5510 local i,name,dmg
5511 local myname,realm=UnitName("player")
5512 local myclass=UnitClass("player")
5513 local live_ready_healers={}
5514 local remove_list={}
5515 local x=1
5516 MB_party_healer_list={}
5517 --Create a list of all healers in party who are connected to game
5518 --Lua tables are not guaranteed to be ordered, but it seems to work
5519 --even though I'm depending on order.
5520 for i=1,TableLength(MB_healer_priority) do
5521 local found=nil
5522 for x=1,GetNumPartyMembers() do
5523 name,realm=UnitName("party"..x)
5524 --Print(x)
5525 --Print("Checking for healer name "..MB_healer_priority[i])
5526 if myname==MB_healer_priority[i] then found=true break end
5527 if name==MB_healer_priority[i] and UnitIsConnected("party"..x) then found=true break end
5528 end
5529 if found then table.insert(MB_party_healer_list,MB_healer_priority[i]) end
5530 end
5531 --Go through the list of party healers, and remove those
5532 --that aren't ready to heal, dead, etc.
5533 --Print("Proccessing healer in healer priority table "..MB_healer_priority[i])
5534 --TO BE A QUALIFIED HEALER IN THE HEALER LIST:
5535 --1) He must be named in the healer list (MB_healer_priority)
5536 --2) He must have more than .2 health (otherwise you are self healing)
5537 --3) He must not be under sonic burst (there are many silences, I only handle this one)
5538 --4) He must have 5% mana left, or be you--you will always place yourself in the healer list
5539 --Print("Table is length "..TableLength(MB_party_healer_list))
5540 for i=1,TableLength(MB_party_healer_list) do
5541 --Print("Should I remove ")
5542 --Print(MB_party_healer_list[i])
5543 local manaleft=UnitMana(PartyID(MB_party_healer_list[i]))
5544 local manaleftpct=UnitMana(PartyID(MB_party_healer_list[i]))/UnitManaMax(PartyID(MB_party_healer_list[i]))
5545 local isdead=UnitIsDead(PartyID(MB_party_healer_list[i])) or UnitIsGhost(PartyID(MB_party_healer_list[i]))
5546 --Print("location in table ")
5547 --Print(FindInTable(MB_party_healer_list,MB_party_healer_list[i]))
5548 if (isdead or RaiderHealthP(PartyID(MB_party_healer_list[i]))<.2 or buffed("Drink",PartyID(MB_party_healer_list[i])) or buffed("Sonic Burst",PartyID(MB_party_healer_list[i])) or manaleftpct<.08) and name~=myname then table.insert(remove_list,MB_party_healer_list[i]) end
5549 end
5550 for i=1,TableLength(remove_list) do
5551 --Print(remove_list[i])
5552 table.remove(MB_party_healer_list,FindInTable(MB_party_healer_list,remove_list[i]))
5553 end
5554 --for x=1,TableLength(MB_party_healer_list) do Print(MB_party_healer_list[x]) end
5555 --
5556 --Now that we have a list of ready healers in order, make a list of hurt
5557 --party members and how much damage they have taken
5558 MB_raid_damage={}
5559 for i=1,GetNumPartyMembers() do
5560 name=UnitName("party"..i)
5561 isdead=UnitIsDead("party"..i) or UnitIsGhost("party"..i)
5562 if not isdead then
5563 local losthealth=UnitHealthMax("party"..i)-UnitHealth("party"..i)
5564 --Print(name.." has lost "..losthealth.." health")
5565 MB_raid_damage[name]=losthealth
5566 end
5567 end
5568 isdead=UnitIsDead("player") or UnitIsGhost("player")
5569 if not isdead then
5570 local losthealth=UnitHealthMax("player")-UnitHealth("player")
5571 --Print(myname.." has lost "..losthealth.." health")
5572 MB_raid_damage[myname]=losthealth
5573 end
5574 --for x=1,TableLength(raid_damage) do
5575 --Print(raid_damage[x])
5576 --end
5577 --for name,dmg in spairs(raid_damage, function(t,a,b) return t[b] < t[a] end) do
5578 --Print(name)
5579 --Print(dmg)
5580 --end
5581 --Okay, now find my order in the healing list.
5582 --Sort the damaged toons by most damage
5583 --Assume the other healers ahead of me are going to heal their order
5584 --on the list.
5585 --Heal the nth person down the list, where n=myorder
5586 i=1
5587 for x=1,TableLength(MB_party_healer_list) do if myname==MB_party_healer_list[x] then myorder=x break end end
5588 --for i,name in MB_party_healer_list do Print("liveready name "..name) end
5589 --if myorder then Print("My healing order is "..myorder) end
5590 myorder=myorder
5591 --Print("My healing order is "..myorder)
5592 for name,dmg in spairs(MB_raid_damage, function(t,a,b) return t[b] < t[a] end) do
5593 --Print(name.." needs "..dmg.." healing.")
5594 if MB_party_healer_list[i] then
5595 if i==myorder and dmg==0 then return end
5596 --if i==myorder then QuickHealD(PartyID(name)) Print(UnitName("player").." is healing "..name.." because myorder is "..myorder.." and he is down "..dmg) break end
5597 if i==myorder then QuickHealD(PartyID(name)) break end
5598 i=i+1
5599 end
5600 end
5601end
5602function QuickHealD(targ)
5603 local class=UnitClass("player")
5604 if class~="Druid" then QuickHeal(targ) return end
5605 if not targ then
5606 rh,targ=RaidHealth()
5607 if not targ then return end
5608 end
5609 if buffed("Regrowth",targ) and not OnCooldown("Swiftmend") then
5610 TargetUnit(targ)
5611 RunLine("/yell "..UnitName(targ).." has regrowth, casting swiftmend")
5612 cast("Swiftmend")
5613 return
5614 end
5615 QuickHeal(targ)
5616end
5617function PartyHeal_old()
5618--this is code to heal 5 mans, supposedly--I don't run 5 mans, so I don't pay much attention to it.
5619 if UnitIsDead("player") or UnitIsGhost("player") then return end
5620 if ManaDown()>0 and buffed("Drink","player") then return end
5621 local i,name,dmg
5622 local myname,realm=UnitName("player")
5623 local myclass=UnitClass("player")
5624 local live_ready_healers={}
5625 local party_damage={}
5626 local x=1
5627 for i=1,TableLength(MB_healer_priority) do
5628 if PartyID(name) then
5629 local name=MB_healer_priority[i]
5630 local manaleft=UnitMana(PartyID(name))
5631 if not isdead and (manaleft>800 or name==myname) then live_ready_healers[x]=name x=x+1 end
5632 end
5633 end
5634 for x=1,TableLength(live_ready_healers) do Print(live_ready_healers[x]) end
5635 for x=1,TableLength(live_ready_healers) do if myname==live_ready_healers[x] then myorder=x break end end
5636 for i,name in live_ready_healers do Print("liveready name "..name) end
5637 if myorder then Print("My healing order is "..myorder) end
5638 if not (myclass=="Priest" or myclass=="Shaman" or myclass=="Druid" ) then return end
5639 for i=1,GetNumPartyMembers() do
5640 local name=UnitName("party"..i)
5641 local isdead=UnitIsDead("party"..i) or UnitIsGhost("party"..i)
5642 if not isdead then
5643 local losthealth=UnitHealthMax("party"..i)-UnitHealth("party"..i)
5644 party_damage[name]=losthealth
5645 end
5646 end
5647 mylosthealth=UnitHealthMax("player")-UnitHealth("player")
5648 party_damage[myname]=mylosthealth
5649 i=1
5650 local promote
5651 for name,dmg in spairs(party_damage, function(t,a,b) return t[b] < t[a] end) do
5652 --heal up the list if the shit is hitting the fan
5653 local TargPct=UnitHealth(RaidID(name))/UnitHealthMax(RaidID(name))
5654 if PartyID(live_ready_healers[i]) and not promote and i~=myorder and (TargPct<.2 or dmg>3000 or UnitMana(PartyID(live_ready_healers[i])<800)) then myorder=myorder-1 promote=1 end
5655 if i<=myorder then CastHeal(name) break end
5656 i=i+1
5657 end
5658end
5659function HunterDuel()
5660--If you want to level your weapons fast, simply duel hunter pets.
5661--Hunter pets count as legal targets for leveling weapons in 1.12
5662--Use a grey weapon so you don't kill the pet fast, int buffs, too
5663--Watch your health and remove gear if you kill pet faster than he kills you
5664 if UnitName("player")=="Everglades" then
5665 StartDuel("Olympic")
5666 TargetByName("Olympic",1)
5667 PetAttack("target")
5668 TargetByName("ItsJustAPet",1)
5669 if IsAutoRepeatAction(71) then cast("Attack") end
5670 end
5671 if UnitName("player")=="Olympic" then
5672 TargetByName("Everglades",1)
5673 PetAttack("target")
5674 TargetByName("BaconKills",1)
5675 if IsAutoRepeatAction(71) then cast("Attack") end
5676 end
5677 if UnitName("player")=="Monterey" then
5678 StartDuel("Badlands")
5679 TargetByName("Badlands",1)
5680 PetAttack("target")
5681 TargetByName("Draculia",1)
5682 if IsAutoRepeatAction(71) then cast("Attack") end
5683 end
5684 if UnitName("player")=="Badlands" then
5685 TargetByName("Monterey",1)
5686 PetAttack("target")
5687 TargetByName("Grubbs",1)
5688 if IsAutoRepeatAction(71) then cast("Attack") end
5689 end
5690 if buffed("Mend Pet","player") then return end
5691 if UnitHealth("pet")<1000 then cast("Mend Pet") end
5692 cast("Deterrence")
5693 if not (UnitName("player")=="Everglades" and UnitName("target")=="Plague Slime") then scast("Aspect of the Monkey") end
5694 if not IsAutoRepeatAction(71) then cast("Attack") end
5695end
5696function RaidHeal_Experimental()
5697 --This is an experiment in time-slicing heals so healers will self cancel--it doesn't work well, because they all pile on the same target anyhow.
5698 if not UnitInRaid("player") then return end
5699 if UnitIsDead("player") or UnitIsGhost("player") then return end
5700 if ManaDown()>0 and buffed("Drink","player") then return end
5701 local healer_slice = { Refill=0.0,Shamancinco=.33,Punchingbear=.66,Shamanuno=1.0,Bubbling=1.33,Shamanquatro=1.66 }
5702 local i,name,dmg
5703 local myname,realm=UnitName("player")
5704 local x=1
5705 local myslice=healer_slice[myname]
5706 local time=GetTime()
5707 local int=math.floor(time)
5708 local frac=math.mod(time,1)
5709 local odd=math.mod(int,2)
5710 local myslicef=math.mod(myslice,1)
5711 if myslicef==0 then myslicef=1 end
5712 Print("Time="..time.." myslice="..myslice.." myslicef="..myslicef.." odd="..odd.." int="..int.." frac="..frac.." myslicef-.33="..myslicef-.33)
5713 if (myslice>=1 and odd and (myslicef-.33)<frac and frac<myslicef) or (myslice<1 and not odd and (myslicef-.33)<frac and frac<myslicef ) then RunLine("/qh") end
5714end
5715function RaidGroup()
5716--Returns what raid group you are in.
5717 local raidlist= {}
5718 for i=1,GetNumRaidMembers() do
5719 local name,rank,subgroup=GetRaidRosterInfo(i)
5720 raidlist[name]=subgroup
5721 end
5722 return raidlist[UnitName("player")]
5723end
5724function UpdateCrowdControllers()
5725--Updates the list of all crowd controllers in your raid.
5726 if UnitInRaid("player") then
5727 for i=1,GetNumRaidMembers() do
5728 local name,realm=GetUnitName("raid"..i)
5729 local class=GetUnitClass("raid"..i)
5730 if class=="Mage" then
5731 MB_cc_table["Mage"]=name
5732 end
5733 end
5734 else
5735 local name,realm=UnitName("player")
5736 local class=UnitClass("player")
5737 local targ=nil
5738 if class=="Mage" and not FindInTable(MB_cc_table["Sheeper"],name) then table.insert(MB_cc_table["Sheeper"],name) end
5739 if class=="Priest" then Print("Inserting myself as priest into cc table") ; table.insert(MB_cc_table["Shackler"],name) end
5740 if class=="Warlock" then Print("Inserting myself Warlock into cc table") ; table.insert(MB_cc_table["Banisher"],name) end
5741 if class=="Druid" then Print("Inserting myself Druid into cc table") ; table.insert(MB_cc_table["Rooter"],name) end
5742 for i=1,GetNumPartyMembers() do
5743 local name,realm=UnitName("party"..i)
5744 local class=UnitClass("party"..i)
5745 local targ=nil
5746 if class=="Mage" then Print("Inserting mage into cc table") ; table.insert(MB_cc_table["Sheeper"],name) end
5747 if class=="Priest" then Print("Inserting Priest into cc table") ; table.insert(MB_cc_table["Shackler"],name) end
5748 if class=="Warlock" then Print("Inserting Warlock into cc table") ; table.insert(MB_cc_table["Banisher"],name) end
5749 if class=="Druid" then Print("Inserting Druid into cc table") ; table.insert(MB_cc_table["Rooter"],name) end
5750 end
5751 end
5752end
5753function CC()
5754 if not MB_My_cc_target then Fear() return end
5755 for i=1,10 do
5756 if GetRaidTargetIndex("target")==MB_My_cc_target and not UnitIsDead("target") then
5757 Print("CC spell is ")
5758 Print(MB_CC_spell[UnitClass("player")])
5759 if UnitName("target") and not buffed(MB_CC_spell[UnitClass("player")],"target") then MB_msg("Sheeping "..UnitName("target"))
5760 BufCast(MB_CC_spell[UnitClass("player")])
5761 --SpellStopCasting()
5762 --CooldownCast(MB_CC_spell[UnitClass("player")],28)
5763 TargetUnit("playertarget")
5764 return
5765 end
5766 end
5767 if GetRaidTargetIndex("target")==MB_My_cc_target and UnitIsDead("target") then
5768 MB_My_cc_target=""
5769 TargetUnit("playertarget")
5770 return
5771 end
5772 TargetNearestEnemy()
5773 end
5774end
5775function Fear()
5776 if not MB_My_fear_target then return end
5777 for i=1,10 do
5778 if GetRaidTargetIndex("target")==MB_My_fear_target and not UnitIsDead("target") then
5779 Print("Fear spell is ")
5780 Print(MB_Fear_spell[UnitClass("player")])
5781 if UnitName("target") and not buffed(MB_Fear_spell[UnitClass("player")],"target") then MB_msg("Fearing "..UnitName("target"))
5782 BufCast(MB_Fear_spell[UnitClass("player")])
5783 --SpellStopCasting()
5784 --CooldownCast(MB_Fear_spell[UnitClass("player")],28)
5785 TargetUnit("playertarget")
5786 return
5787 end
5788 end
5789 if GetRaidTargetIndex("target")==MB_My_fear_target and UnitIsDead("target") then
5790 MB_My_fear_target=""
5791 TargetUnit("playertarget")
5792 return
5793 end
5794 TargetNearestEnemy()
5795 end
5796end
5797function OT()
5798 MB_ots={}
5799 for k,tank in pairs(MB_tanklist) do
5800 local name, realm=UnitName("player")
5801 if IsAlive(RaidID(tank)) and tank~=name then
5802 table.insert(MB_ots,tank)
5803 end
5804 end
5805 local numtargs=TableLength(MB_My_ot_target)
5806 if numtargs==0 then return end
5807 for i=1,10 do
5808 for k,ottarg in pairs(MB_My_ot_target) do
5809 if GetRaidTargetIndex("target")==ottarg and not UnitIsDead("target") then
5810 if not UnitIsUnit("player","targettarget") then return end
5811 numtargs=numtargs-1
5812 end
5813 if GetRaidTargetIndex("target")==ottarg and UnitIsDead("target") then
5814 table.remove(MB_My_ot_target,ottarg)
5815 TargetUnit("playertarget")
5816 numtargs=numtargs-1
5817 end
5818 end
5819 if numtargs==0 then return end
5820 --if numtargs==0 then TargetUnit("playertarget") return end
5821 TargetNearestEnemy()
5822 end
5823end
5824function printots()
5825 for k,ottarg in pairs(MB_My_ot_target) do
5826 Print(ottarg)
5827 end
5828end
5829function MB_clearraidtarget()
5830 if not IAmFocus() then return end
5831 local id=GetRaidTargetIndex("target")
5832 if UnitInRaid("player") then
5833 SendAddonMessage(MB_RAID.."CLR_TARG",UnitName("player"),"RAID")
5834 else
5835 SendAddonMessage(MB_RAID.."CLR_TARG",UnitName("player"))
5836 end
5837 SetRaidTarget("target",0)
5838end
5839function MB_assign_cc()
5840if not IAmFocus() then return end
5841if IsShiftKeyDown() then MB_assign_fear() return end
5842 if UnitCreatureType("target")=="Demon" or UnitCreatureType("target")=="Elemental" then
5843 if not GetRaidTargetIndex("target") or GetRaidTargetIndex("target")==0 then
5844 SetRaidTarget("target",MB_currentraidtarget)
5845 if MB_currentraidtarget==8 then MB_currentraidtarget=1 else MB_currentraidtarget=MB_currentraidtarget+1 end
5846 end
5847 Print("Banish that Demon")
5848 num_locks=TableLength(IsInGroup("Warlock"))
5849 --Print("num_locks="..num_locks)
5850 if num_locks>0 then
5851 if UnitInRaid("player") then
5852 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Warlock")[MB_cc_current.Warlock].." "..UnitName("player"),"RAID")
5853 else
5854 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Warlock")[MB_cc_current.Warlock].." "..UnitName("player"))
5855 end
5856 if MB_cc_current.Warlock==num_locks-1 then
5857 MB_cc_current.Warlock=0
5858 else
5859 MB_cc_current.Warlock=MB_cc_current.Warlock+1
5860 end
5861 end
5862 elseif UnitCreatureType("target")=="Undead" then
5863 Print("Shackle that Zombie")
5864 if not GetRaidTargetIndex("target") or GetRaidTargetIndex("target")==0 then
5865 SetRaidTarget("target",MB_currentraidtarget)
5866 if MB_currentraidtarget==8 then MB_currentraidtarget=1 else MB_currentraidtarget=MB_currentraidtarget+1 end
5867 end
5868 num_priests=TableLength(IsInGroup("Priest"))
5869 --Print("num_priests="..num_priests)
5870 if num_priests>0 then
5871 if UnitInRaid("player") then
5872 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Priest")[MB_cc_current.Priest].." "..UnitName("player"),"RAID")
5873 else
5874 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Priest")[MB_cc_current.Priest].." "..UnitName("player"))
5875 end
5876 if MB_cc_current.Priest==num_priests-1 then
5877 MB_cc_current.Priest=0
5878 else
5879 MB_cc_current.Priest=MB_cc_current.Priest+1
5880 end
5881 end
5882 elseif UnitCreatureType("target")=="Beast" or UnitCreatureType("target")=="Humanoid" or UnitCreatureType("target")=="Critter" then
5883 --Print("Sheep that Beast")
5884 if not GetRaidTargetIndex("target") or GetRaidTargetIndex("target")==0 then
5885 SetRaidTarget("target",MB_currentraidtarget)
5886 if MB_currentraidtarget==8 then MB_currentraidtarget=1 else MB_currentraidtarget=MB_currentraidtarget+1 end
5887 end
5888 num_mages=TableLength(IsInGroup("Mage"))
5889 --Print("num_mages="..num_mages)
5890 if num_mages>0 then
5891 --Print("mage rotation at "..MB_cc_current.Mage)
5892 if UnitInRaid("player") then
5893 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Mage")[MB_cc_current.Mage].." "..UnitName("player"),"RAID")
5894 else
5895 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Mage")[MB_cc_current.Mage].." "..UnitName("player"))
5896 end
5897 if MB_cc_current.Mage==num_mages-1 then
5898 MB_cc_current.Mage=0
5899 else
5900 MB_cc_current.Mage=MB_cc_current.Mage+1
5901 end
5902 end
5903 elseif UnitCreatureType("target")=="Dragonkin" then
5904 --Print("Sheep that Beast")
5905 if not GetRaidTargetIndex("target") or GetRaidTargetIndex("target")==0 then
5906 SetRaidTarget("target",MB_currentraidtarget)
5907 if MB_currentraidtarget==8 then MB_currentraidtarget=1 else MB_currentraidtarget=MB_currentraidtarget+1 end
5908 end
5909 num_druids=TableLength(IsInGroup("Druid"))
5910 --Print("num_mages="..num_mages)
5911 if num_druids>0 then
5912 --Print("mage rotation at "..MB_cc_current.Mage)
5913 if UnitInRaid("player") then
5914 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Druid")[MB_cc_current.Druid].." "..UnitName("player"),"RAID")
5915 else
5916 SendAddonMessage(MB_RAID.."_CC",IsInGroup("Druid")[MB_cc_current.Druid].." "..UnitName("player"))
5917 end
5918 if MB_cc_current.Mage==num_druids-1 then
5919 MB_cc_current.Druid=0
5920 else
5921 MB_cc_current.Druid=MB_cc_current.Druid+1
5922 end
5923 end
5924 end
5925end
5926function MB_assign_fear()
5927if not IAmFocus() then return end
5928 if not GetRaidTargetIndex("target") or GetRaidTargetIndex("target")==0 then
5929 SetRaidTarget("target",MB_currentraidtarget)
5930 if MB_currentraidtarget==8 then MB_currentraidtarget=1 else MB_currentraidtarget=MB_currentraidtarget+1 end
5931 end
5932 num_locks=TableLength(IsInGroup("Warlock"))
5933 --Print("num_locks="..num_locks)
5934 if num_locks>0 then
5935 Print("Fear that Fool")
5936 if UnitInRaid("player") then
5937 SendAddonMessage(MB_RAID.."_FEAR",IsInGroup("Warlock")[MB_fear_current.Warlock].." "..UnitName("player"),"RAID")
5938 else
5939 SendAddonMessage(MB_RAID.."_FEAR",IsInGroup("Warlock")[MB_fear_current.Warlock].." "..UnitName("player"))
5940 end
5941 if MB_fear_current.Warlock==num_locks-1 then
5942 MB_fear_current.Warlock=0
5943 else
5944 MB_fear_current.Warlock=MB_fear_current.Warlock+1
5945 end
5946 end
5947end
5948function IncrementIndex(tab,len)
5949 if tab==len then return 1 end
5950 return tab+1
5951end
5952function MB_assign_ot()
5953 --Assign OTs in order of Furyswipes,Eversmile,Komal,Other
5954if not IAmFocus() then return end
5955MB_ots={}
5956for k,tank in pairs(MB_tanklist) do
5957 local name, realm=UnitName("player")
5958 if IsAlive(RaidID(tank)) and tank~=name then
5959 table.insert(MB_ots,tank)
5960 end
5961end
5962table.sort(MB_ots)
5963local myname,realm=UnitName("player")
5964 if not GetRaidTargetIndex("target") or GetRaidTargetIndex("target")==0 then
5965 SetRaidTarget("target",MB_currentraidtarget)
5966 local thistargidx=MB_currentraidtarget
5967 if MB_currentraidtarget==8 then MB_currentraidtarget=1 else MB_currentraidtarget=MB_currentraidtarget+1 end
5968 else
5969 local thistargidx=GetRaidTargetIndex("target")
5970 end
5971 --Hold SHIFT to assign a second (and third, etc.) target to the tank!
5972 local thisot
5973 if IsShiftKeyDown() then
5974 thisot=MB_ots[MB_ot_index-1]
5975 else
5976 thisot=MB_ots[MB_ot_index]
5977 end
5978 if UnitInRaid("player") then
5979 SendAddonMessage(MB_RAID.."_OT",thisot.." "..UnitName("player"),"RAID")
5980 else
5981 SendAddonMessage(MB_RAID.."_OT",thisot.." "..UnitName("player"))
5982 end
5983 if not IsShiftKeyDown() then MB_ot_index=IncrementIndex(MB_ot_index,TableLength(MB_ots)) end
5984end
5985function PartyMana()
5986--Currently unused
5987--Used by Shaman to determine when to drop Mana Tide. Calculates total amount party is down in mana.
5988--Probably not the best way to decide
5989 partyMP=0
5990 partyMPM=0
5991 lowestMP=1
5992 leastmana=""
5993 for i=1,5 do
5994 if i==5 then
5995 --give leastmana to first connected mana player
5996 if UnitIsConnected("player") and UnitPowerType("player")==0 then
5997 if leastmana=="" then leastmana="player" end
5998 lowsetMP=UnitMana("player")/UnitManaMax("player")
5999 break
6000 end
6001 else
6002 --give mosthurt to first connected player
6003 if UnitIsConnected("party"..i) and UnitPowerType("party"..i)==0 then
6004 if leastmana=="" then leastmana="party"..i end
6005 lowsetMP=UnitMana("party"..i)/UnitManaMax("party"..i)
6006 break
6007 end
6008 end
6009 end
6010 for i=1,5 do
6011 if i==5 then
6012 if UnitPowerType("player")==0 then
6013 mana=UnitMana("player")
6014 manam=UnitManaMax("player")
6015 if health~=1 and UnitIsConnected("player") then
6016 partyMP=partyMP+mana
6017 partyMPM=partyMPM+manam
6018 if mana/manam<lowestMP then lowestMP=mana/manam ; leastmana="player" end
6019 end
6020 end
6021 else
6022 if UnitPowerType("party"..i)==0 then
6023 mana=UnitMana("party"..i)
6024 manam=UnitManaMax("party"..i)
6025 if health~=1 and UnitIsConnected("party"..i) then
6026 partyMP=partyMP+mana
6027 partyMPM=partyMPM+manam
6028 if mana/manam<lowestMP then lowestMP=mana/manam ; leastmana="party"..i end
6029 end
6030 end
6031 end
6032 end
6033 return partyMP/partyMPM*100,leastmana
6034end
6035--Currently unused, was used for pets to determine who to taunt off of.
6036MB_nontanks = {
6037"Shamanuno",
6038"Brutalia",
6039"Refill",
6040"Cashme",
6041"Bubbling",
6042"Shamanquatro",
6043"Olympic",
6044"Yellowstone",
6045"Everglades",
6046"Flameshocked",
6047"Brutalio",
6048"Punchingbear",
6049"Avindra",
6050"Maala",
6051"Zillazee",
6052"Shamancinco",
6053"Brutalic",
6054"Icefloes",
6055"Shamantres",
6056"Brutalium",
6057"Brutaliar",
6058"Monterey",
6059"Badlands"
6060 }
6061function ShammyOrderInParty()
6062 --Returns the alphabetical order of a shammy in the party if there are more than one
6063 --Not currently used
6064 myname,realm=UnitName("player")
6065 shammys={myname}
6066 for i=1,GetNumPartyMembers() do
6067 class=UnitClass("party"..i)
6068 name,realm=UnitName("party"..i)
6069 if class=="Shaman" then
6070 table.insert( shammys, name )
6071 end
6072 end
6073 table.sort( shammys )
6074 for i,shamname in shammys do
6075 if shamname==myname then return i end
6076 end
6077end
6078function IsElementalShammy()
6079 return TalentPointsIn(1)>=TalentPointsIn(2) and TalentPointsIn(1)>=TalentPointsIn(3)
6080end
6081function IsHolyPally()
6082 n,ic,t,c,EM=GetTalentInfo(1,2)
6083 if EM>0 then return EM else return nil end
6084end
6085function IsFire()
6086 return TalentPointsIn(2)>TalentPointsIn(1) and TalentPointsIn(2)>TalentPointsIn(3)
6087end
6088function IsBoomkin()
6089 return TalentPointsIn(1)>=TalentPointsIn(2) and TalentPointsIn(1)>=TalentPointsIn(3)
6090end
6091function IsTouchOfShadowLock()
6092 n,ic,t,c,EM=GetTalentInfo(2,13)
6093 if EM>0 then return EM else return nil end
6094end
6095function IsDruidHealer()
6096 return TalentPointsIn(3)>TalentPointsIn(2) and TalentPointsIn(3)>TalentPointsIn(1)
6097end
6098function IsShadow()
6099 return TalentPointsIn(3)>=TalentPointsIn(2) and TalentPointsIn(3)>=TalentPointsIn(1)
6100end
6101function IsFury()
6102 return TalentPointsIn(2)>TalentPointsIn(1) and TalentPointsIn(2)>TalentPointsIn(3)
6103end
6104function IsArms()
6105 return TalentPointsIn(1)>TalentPointsIn(2) and TalentPointsIn(1)>TalentPointsIn(3)
6106end
6107function TalentPointsIn(tab)
6108 points=0
6109 for t=1,GetNumTalents(tab) do
6110 n,ic,tier,c,EM=GetTalentInfo(tab,t)
6111 points=points+EM
6112 end
6113 return points
6114end
6115function IsEnhancementShammy()
6116 return TalentPointsIn(2)>TalentPointsIn(1) and TalentPointsIn(2)>TalentPointsIn(3)
6117end
6118function NoRezzers()
6119--Unused--meant to be used by soulstone code to find out if there are any rezzers to SS
6120 for i=1,GetNumRaidMembers() do
6121 class=UnitClass("raid"..i)
6122 dead=UnitIsDeadOrGhost("raid"..i) or UnitIsGhost("raid"..i)
6123 connected=UnitIsConnected("raid"..i)
6124 if (class=="Shaman" or class=="Priest" or class=="Druid") and conneced then
6125 if not dead then return nil end
6126 end
6127 end
6128 return true
6129end
6130function AnyTargeting(mob)
6131--Unused
6132--Clever code to determine if anyone in your raid is targeting a named mob
6133 for i=1,GetNumRaidMembers() do
6134 TargetUnit("raid"..i)
6135 if UnitName("targettarget")==mob then return 1 end
6136 TargetUnit("playertarget")
6137 end
6138end
6139function Stoneclaw()
6140--Unused
6141--Shaman stoneclaw when any of 20 nearby mobs are attacking them
6142--Note: Stoneclaw sucks.
6143 for i=1,10 do
6144 TargetNearestEnemy()
6145 local name=UnitName("target")
6146 if not name then break end
6147 if UnitIsEnemy("target","player") and not UnitIsPlayer("target") and TargetInCombat() and UnitIsUnit("targettarget","player") and not OnCooldown("Stoneclaw Totem") and not TotemExists("Tremor Totem") then
6148 MB_msg(UnitName("player").." CASTTING STONECLAW BECAUSE OF AGRO FROM "..name)
6149 cast("Stoneclaw Totem")
6150 end
6151 end
6152 TargetUnit("playertarget")
6153end
6154function SickemTargetSmartGrowl()
6155--Currently unused but works.
6156--Tells pets to growl at any enemy in combat not attacking a tank or pet
6157 if UnitHealth("pet")<1 then return end
6158 if (IsAltKeyDown() )then
6159 PetPassiveMode()
6160 Follow()
6161 else
6162 local class=UnitClass("player")
6163 if (class=="Warlock" and (HasPetSpell("Torment") or HasPetSpell("Suffering")) and (not PetOnCooldown("Torment") or not PetOnCooldown("Suffering")) or (class=="Hunter" and HasPetSpell("Growl") and not PetOnCooldown("Growl"))) then
6164 for i=1,10 do
6165 TargetNearestEnemy()
6166 local name=UnitName("target")
6167 if not name then return end
6168 local tname=UnitName("targettarget")
6169 if FindInTable(MB_nontanks,tname) and TargetInCombat() then
6170 if class=="Hunter" then PetAttack("target") PetCast("Growl") end
6171 if class=="Warlock" then PetAttack("target") PetCast("Torment") end
6172 if class=="Warlock" then PetAttack("target") PetCast("Suffering") end
6173 Print(UnitName("player").." pet-taunting "..name.." because he's attacking "..tname)
6174 return
6175 end
6176 end
6177 TargetUnit("playertarget")
6178 if TargetInCombat() then PetAttack("target") PetMoveFast() end
6179 end
6180 end
6181end
6182function CooldownCast(spell,cooldown)
6183 local time=GetTime()
6184 if not MB_cooldowns[spell] then
6185 cast(spell)
6186 MB_cooldowns[spell]=time
6187 return
6188 end
6189 if MB_cooldowns[spell]+cooldown>time then
6190 Print(spell.." is in cooldown for "..math.floor(MB_cooldowns[spell]+cooldown-time).." more seconds")
6191 return
6192 end
6193 if MB_cooldowns[spell]+cooldown<=time then
6194 cast(spell)
6195 MB_cooldowns[spell]=nil
6196 end
6197end
6198function MageFood()
6199--unused--I no longer make food. it's a stupid waste of time
6200--How much crappy mage food do you have? This function will tell you--change name below if you have best water
6201 local amount=0
6202 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
6203 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
6204 if texture then
6205 link=GetContainerItemLink(bag,slot)
6206 if string.find(link, "Conjured Sweet Roll") then amount=amount+itemCount end
6207 end
6208 end
6209 end
6210 return amount
6211end
6212function GiveWater()
6213--Unused--I use trade dispenser for this now.
6214 local class=UnitClass("player")
6215 if class=="Mage" then
6216 if GetTradePlayerItemLink(1) then
6217 AcceptTrade()
6218 else
6219 if not CursorHasItem() then
6220 pickupwater()
6221 else
6222 DropItemOnUnit("target")
6223 end
6224 end
6225 else
6226 AcceptTrade()
6227 end
6228end
6229function PickupWater()
6230--pick up a stack of the best water in your bags
6231 local waterranks=table.invert(MB_mywater)
6232 local amount=0
6233 local mycarriedwater={}
6234 local bestrank=0
6235 local bag,slot,link
6236 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
6237 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
6238 if texture then
6239 link=GetContainerItemLink(bag,slot)
6240 local bsnum=string.gsub(link,".-\124H([^\124]*)\124h.*", "%1")
6241 local itemName, itemNo, itemRarity, itemReqLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemIcon = GetItemInfo(bsnum)
6242 FindInTable(waterranks,itemName)
6243 if FindInTable(MB_mywater,itemName) then
6244 if waterranks[itemName]>bestrank then
6245 bestrank=waterranks[itemName]
6246 bestwater=itemName.." "..bag.." "..slot
6247 end
6248 end
6249 end
6250 end end
6251 if bestrank>0 then
6252 _,_,water,bag,slot=string.find(bestwater,"(Conjured.*Water) (%d+) (%d+)")
6253 PickupContainerItem(bag,slot)
6254 return water
6255 end
6256end
6257function PickupWater_unused()
6258--unused--used to be used for trading water, but I use tradedipsenser for this now
6259 local amount=0
6260 local bag,slot,link
6261 for level,water in MB_mywater do
6262 if MyLevel()-level>=0 and MyLevel()-level<=10 then MyWater=water break end
6263 end
6264 if not CursorHasItem() then
6265 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
6266 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
6267 if texture then
6268 link=GetContainerItemLink(bag,slot)
6269 --Print(link)
6270 if string.find(link, MyWater) and itemCount==20 then Print("Picking Up "..bag..","..slot) ; PickupContainerItem(bag,slot) ; return end
6271 end
6272 end
6273 end
6274 end
6275end
6276function HasMajorHealthstone()
6277--Unused but working code to check for the big HS.
6278 for bag=0,4 do for slot=1,GetContainerNumSlots(bag)
6279 do local link=GetContainerItemLink(bag,slot)
6280 if link==nil then link="" end
6281 if string.find(link, "Major Healthstone") then return 1 end
6282 -- To sell to vendor if quality==2 then UseContainerItem(bag,slot) end
6283 end
6284 end
6285 return nil
6286end
6287function HasHealthstone()
6288--Unused but working code to check for the small HS.
6289 for bag=0,4 do for slot=1,GetContainerNumSlots(bag)
6290 do local link=GetContainerItemLink(bag,slot)
6291 if link==nil then link="" end
6292 --%p means punctuation character
6293 if string.find(link, "%pHealthstone") then return 1 end
6294 end
6295 end
6296 return nil
6297end
6298function HasGreaterHealthstone()
6299--Unused but working code to check for the medium HS.
6300 for bag=0,4 do for slot=1,GetContainerNumSlots(bag)
6301 do local link=GetContainerItemLink(bag,slot)
6302 if link==nil then link="" end
6303 if string.find(link, "Greater Healthstone") then return 1 end
6304 end
6305 end
6306 return nil
6307end
6308function HotTanks()
6309--Hots suck. Not used
6310 if InCombat() then
6311 TargetByName("Furyswipes",1)
6312 if UnitHealth("target")/UnitHealthMax("target")<.7 then
6313 BufCast("Rejuvenation")
6314 BufCast("Regrowth")
6315 end
6316 TargetByName("Eversmile",1)
6317 if UnitHealth("target")/UnitHealthMax("target")<.7 then
6318 BufCast("Rejuvenation")
6319 BufCast("Regrowth")
6320 end
6321 end
6322end
6323--
6324-- FUNCTIONS FOR PRIVATE SERVER
6325--
6326--RAIDING ADVICE FOR DOWNING BOSSES
6327--JEKLIk
6328--VOIDWALKERS ONLY
6329--Make a group >30 yards away but within healing dist.
6330--drop tremor totems
6331--ONLY build tank aggro for 45seconds or so, dps out otherwise
6332--hit the 1 button to resummon dead pets 30 secs after they die
6333--remove curses on furyswipes! Very important!
6334--interrupt heal with shift3 --MUST! Bright yellow starburst spell
6335--innervate refill early with furyswipes
6336--take healing potion on furyswipes early and late
6337--hit the 1 button to resummon dead pets! very important
6338--
6339--MANDOKIR
6340--no fire shield for any imp
6341--one lock on bottom pull iwth imp
6342--all others on ledge left of stairs(you can get on without aggroing boss)
6343--GET TO FAR TIP OF CORNER LEDGE
6344--furyswipes on bottom.
6345--
6346--TIGER BOSS
6347--PHASE 1
6348--melee totems
6349--Eversmile present
6350--dps down phase 1 bosses evenly, burn down tigers
6351--Try to lose no one.
6352--PHASE 2
6353-- **back against wall**
6354-- fear tigers
6355-- group up
6356--
6357--VENOXIS (snake boss)
6358-- no thorns
6359-- dismiss hunter pets
6360-- open with alt-2! won't taunt unless agro lost:
6361-- hellfire burndown of snakes after 5 seconds on boss with turbo with 5
6362-- DO NOT summon hunter pets EVER
6363-- dps/heals STAND WHERE YOU CANT BE KNOCKED BACK AND WHERE YOU WON'T HAVE los bugs
6364-- I like right side wall in middle angle
6365-- TANK BACK UP whenever poison cloud fades. Back up immediately on change to snake form (50%)
6366--DO NOT rez pets EVER
6367--
6368--MAR'LI(spider boss) single druid tank
6369--Use special targeting
6370--NEVER stand up as bear when spider form bashing you
6371--DPS/heals tight group. Stay more than 30y away from it so they don't get hit with poison volley splash
6372--Poison volley doesn't matter when only on tank and pets
6373--Every time you lose aggro to spider web, taunt fight for 10 seconds (alt-2) to build aggro IMPORTANT
6374--solo pull boss let spiders run by
6375--Targeting will automatically kill spiders
6376--Do not let spider form hit caster group
6377--Have a shaman close up front to interrupt Mar'li's life drain when the mages run out of mana
6378--
6379--KURINNAXX AQ20 (scorpion boss)
6380--Two tanks, taunt at 2 stacks
6381--dps one group 35 yards away
6382--
6383--************************************************************************************************************
6384--Special purpos functions.
6385--The following functions are used by leveling groups while I'm leveling 16 at a time.
6386--They make a group leader "tap" the mob (damage it for experience), meanwhile, an accompanying group of 60s smokes any tapped mobs.
6387--Each group takes a turn tapping with the 1 key...straight 1 press is group 1. alt-1 is group2 ctrl-1 is group3 shift-1 is group4
6388
6389function UnmodGroup()
6390 local name,realm=UnitName("player")
6391 if ((name=="Bubblyboo" ) or (name=="Desdemonia") or (name=="Drainsoulia") or (name=="Bubblydoom") or (name=="Bubblup")) and not (IsAltKeyDown() or IsShiftKeyDown() or IsControlKeyDown()) then Print("Unmod Requested") return 1 end
6392end
6393function AltGroup()
6394 local name,realm=UnitName("player")
6395 if ((name=="Holybabe") or (name=="Bubblebootie") or (name=="Bubblebrave") or (name=="Bubblesong") or (name=="Bubblefame")) and IsAltKeyDown() then Print("Alt Requested") return 1 end
6396end
6397function CtrlGroup()
6398 local name,realm=UnitName("player")
6399 if (name=="Bubblemania" or name=="Zombiewife" or name=="Bubblewin" or name=="Bubblenator" or name=="Bridesmage") and IsControlKeyDown() then Print("Ctrl Requested") return 1 end
6400end
6401function ShiftGroup()
6402 local name,realm=UnitName("player")
6403 if (name=="Bubblefail" or name=="Bubblemad" or name=="Bubbleplanet" or name=="Bubblemama" or name=="Bubblescum") and IsShiftKeyDown() then Print("Shift Requested") return 1 end
6404end
6405function RequestedTap()
6406 return AltGroup() or CtrlGroup() or ShiftGroup() or UnmodGroup()
6407end
6408--The following tap fuctions are replacement for level 60 prep functions..they are meant to tap a leveling mob
6409--notice the low level buffs
6410function dru_tap()
6411 RunLine("/focus Bubblyboo")
6412 RunLine("/assist Bubblyboo")
6413 if RequestedTap() then
6414 Print(UnitName("player").." is casting moonfire")
6415 cast("Moonfire(Rank 1)")
6416 end
6417end
6418function paladin_tap()
6419 local name,realm=UnitName("player")
6420 if name~="Bubblyboo" then
6421 RunLine("/focus Bubblyboo")
6422 RunLine("/assist Bubblyboo")
6423 end
6424 if RequestedTap() then
6425 SelfBuff("Seal of Righteousness")
6426 cast("Judgement")
6427 if not IsCurrentAction(72) then UseAction(72) end;
6428 else
6429 if IsCurrentAction(72) then UseAction(72) end;
6430 end
6431end
6432function lock_tap()
6433 RunLine("/focus Bubblyboo")
6434 RunLine("/assist Bubblyboo")
6435 SelfBuff("Demon Skin")
6436 if RequestedTap() then
6437 cast("Corruption(Rank 1)")
6438end
6439end
6440function mage_tap()
6441 RunLine("/focus Bubblyboo")
6442 RunLine("/assist Bubblyboo")
6443 SelfBuff("Mage Armor")
6444 if RequestedTap() then
6445 --LockonTarget()
6446 cast("Fire Blast(Rank 1)")
6447 if InMeleeRange() then cast("Frost Nova(Rank 1)") end
6448 if InMeleeRange() then cast("Cone of Cold(Rank 1)") end
6449 if InMeleeRange() then cast("Blast Wave(Rank 1)") end
6450 if InMeleeRange() then cast("Arcane Explosion(Rank 1)") end
6451 end
6452
6453end
6454function rogue_tap()
6455 RunLine("/focus Bubblyboo")
6456 RunLine("/assist Bubblyboo")
6457 if RequestedTap() then
6458 if IsCurrentAction(72) then UseAction(72) end
6459 InstantPoisonMain()
6460 InstantPoisonOff()
6461 end
6462end
6463function priest_tap()
6464 RunLine("/focus Bubblyboo")
6465 RunLine("/assist Bubblyboo")
6466 SelfBuff("Inner Fire")
6467 HealLowbies()
6468 if RequestedTap() then
6469 --LockonTarget()
6470 cast("Shadow Word: Pain(Rank 1)")
6471 end
6472end
6473function HealLowbies()
6474--HealLowbies is a function I wrote to target a list of nearby NON-RAID members and keep them alive!
6475 ClearTarget()
6476 lowbies={
6477"Bubblyboo",
6478"Desdemonia",
6479"Drainsoulia",
6480"Bubblydoom",
6481"Bubbleup",
6482"Bubblefail",
6483"Bubblemad",
6484"Bubbleplanet",
6485"Bubblemama",
6486"Bubblescum",
6487"Bubblemania",
6488"Zombiewife",
6489"Bubblewin",
6490"Bubblenator",
6491"Bridesmage",
6492"Holybabe",
6493"Bubblebootie",
6494"Bubblebrave",
6495"Bubblesong",
6496"Bubblefame"
6497}
6498 lowestHP=100000
6499 mosthurt="Bubblyboo"
6500 for idx,lowbie in lowbies do
6501 --Print(lowbie)
6502 TargetByName(lowbie,1)
6503 health=UnitHealth("target")
6504 healthm=UnitHealthMax("target")
6505 if health~=1 and UnitIsConnected("target") then
6506 healthp=health/healthm
6507 if healthp<lowestHP then lowestHP=healthp ; mosthurt=UnitName("target") end
6508 end
6509 end
6510 if lowestHP<1 then
6511 TargetByName(mosthurt,1)
6512 Print(mosthurt.." has a health of "..lowestHP)
6513 if UnitName("target")~=nil then cast("Lesser Healing Wave") end
6514 end
6515end
6516function GetLink(item)
6517 for bag=0,4 do for slot=1,GetContainerNumSlots(bag) do
6518 local texture,itemCount,locked,quality,readable,lootable,link=GetContainerItemInfo(bag,slot)
6519 if texture then
6520 link=GetContainerItemLink(bag,slot)
6521 --Print(link)
6522 if string.find(link,item) then return link end
6523 end
6524 end end
6525end
6526function MountUp()
6527 use(GetLink("Warhorse"))
6528 use(GetLink("Horse"))
6529 use(GetLink("Timber Wolf"))
6530 use(GetLink("Kodo"))
6531 use(GetLink("Raptor"))
6532 use(GetLink("Charger"))
6533 use(GetLink("Dreadsteed"))
6534end