1. ;-----------------------------------------------|
  2. ; Shaman Routine by Swolbyn v0.7 |
  3. ;-----------------------------------------------/
  4. ;
  5. ; - Added a checkbox for spamming pull spell on casters
  6. ; - Hopefully fixed a bug that would cause you to stand there constantly trying to target instead of fighting
  7. ; - Cleaned up GUI a little.
  8. ;
  9. ; - Fixed if a creature dies in water, you would endlessly stand there jumping, not looting.
  10. ; - Added Swimming checks in buff pulse, if your toon is swimming it will jump and try to
  11. ; move towards the current target to melee range. To Prevent drowning.
  12. ; - Various tweaks to combat and pull logic
  13. ;
  14. ; - Removed flee, when I turned it on it was bugging stuff up big time.
  15. ; - Many combat tweaks
  16. ; - Added Shamanistic Focus Support
  17. ; - Under Spells tab you can choose "Save Shocks For Shamanistic Focus"
  18. ; When this is selected you will not use shocks regularly unless you have the focused effect after a crit attack
  19. ; - Immunities and Running Mobs Redesign
  20. ; - Now Mob Immunities and fleeing creatures are stored in MobData.xml in the routines folder
  21. ;
  22. ; - Reinarcation code reworked some. Still a little flaky there is a rare occurance when you reincarnate and then die quickly after that it doesn't detect you are dead again thus sitting at graveyard. It's rare. but happens. Due to this I have implemented a checkbox on main class configuration tab you can turn it off or on as you like.
  23. ; - Further adjustments to the attacking routines. FINALLY if a caster is shooting at you from afar, you'll shoot at him from afar. until he runs too close for your ranged spells, then you run to melee range as well. Works quite nicely.
  24. ; - Immunities should finally work. Took a bit of work this was a bitch :)
  25. ;
  26. ; - Reincarnation logic modifications
  27. ; - Further tweaks to combat / pull logic
  28. ;
  29. ; - Completely overhauled the Pull routine. Much smoother now.
  30. ; - Added in Disease Cleansing Totem logic to Mimic Poison Totem Logic
  31. ; - Added in the ressurection logic. (needs testing, not sure if it works)
  32. ; - Fixed some typos i found in the shielding logic
  33. ; - Fixed the Water Walking logic
  34. ;
  35. ; Thanks to all the many shaman routine writers out there in the openbot forums!
  36. ; This bot is a giant merged hybrid of shamany goodness. It includes some modified
  37. ; functions from all the many different bots that I have come across; as well as some
  38. ; custom stuff that I wrote in (and continue to do so) as I botted my shaman
  39. ; and notice changes that I wish to see.
  40. ;
  41. ; GUI kept from APOC's shaman routine, just took out some checkboxes that I found
  42. ; useless, i've integrated the logic into the system so there was no need for checkboxes.
  43. ;
  44. ; Overall my goal with this bot was to make it smarter. Less configuration is needed
  45. ; for certain aspects of it.
  46. ;
  47. ; You milage may vary. But I basically set it to use random shocks. I put my primary
  48. ; totem for combat set. leave the other totem boxes blank. (I used magma totem).
  49. ; Bot will automatically throw down stoneclaw totems on adds and uses the primary
  50. ; totem (magma for me) if the danger lvl is high enough or there's adds. This results
  51. ; in easier fights not wasting mana on totems.
  52. ;
  53. ; Curing poison and disease has been reworked. Will attempt to throw down a cure
  54. ; Totem if poisoned too soon after the first cure poison (20 seconds).
  55. ;
  56. ; I will continue updating the bot as I level and gain access to higher lvl spells.
  57. ; My shaman is currently in the 30's so if you are trying to bot higher lvl stuff
  58. ; You *may* find the luxury items not working. (Ex. I don't have dual wield or
  59. ; elementals to test yet.) I will get to them as I level and discover them. :)
  60. ;
  61.  
  62. objectdef oClass inherits oBase
  63. {
  64. /**************************************/
  65. /************ VARIABLES ***************/
  66.  
  67. variable bool UsePull = TRUE
  68. variable bool SpamPull = FALSE
  69. variable string PullSpell = "None"
  70. variable int RestHP = 50
  71. variable int RestMP = 50
  72. variable int StandHP = 80
  73. variable int StandMP = 80
  74. variable string EarthTotem = ""
  75. variable string FireTotem = ""
  76. variable string AirTotem = ""
  77. variable string WaterTotem = ""
  78. variable bool UseEarthElementa = FALSE
  79. variable bool UseFireElemental = FALSE
  80. variable bool UseEarthShock = FALSE
  81. variable bool UseFlameShock = FALSE
  82. variable bool UseFrostShock = FALSE
  83. variable bool RandomShock = FALSE
  84. variable bool SaveShocks = FALSE
  85. variable int ConserveMana = 40
  86. variable bool UseLBolt = FALSE
  87. variable bool UseChainLight = FALSE
  88. variable string MainHand = "None"
  89. variable string OffHand = "None"
  90. variable string Shield = "None"
  91. variable bool ShieldOnPull = FALSE
  92. variable bool DW = FALSE
  93. variable int HealWave = 20
  94. variable int LHealWave = 50
  95. variable int GOTN = 60
  96. variable bool Output = TRUE
  97. variable int MaxCastRange = 20
  98. variable int MaxShockRange = 20
  99. variable bool HasEarthTotem = FALSE
  100. variable bool HasFireTotem = FALSE
  101. variable bool HasWaterTotem = FALSE
  102. variable bool HasAirTotem = FALSE
  103. variable bool UseReincarnation = FALSE
  104. variable bool UseHPot = FALSE
  105. variable bool UseMPot = FALSE
  106. variable bool UseBandages = FALSE
  107. variable int HPot = 25
  108. variable int MPot = 25
  109. variable int Bandage = 25
  110. variable int restWaitTimer = 0
  111. variable int buffWaitTimer = 0
  112. variable int healWaitTimer = 0
  113. variable int curePoisonTimer = 0
  114. variable int cureDiseaseTimer = 0
  115. variable int jumpTimer = 0
  116. variable int PotTimer = 0
  117. variable int DangerMedium = 15
  118. variable int DangerHigh = 30
  119. variable int DangerVeryHigh = 45
  120. variable int DangerLevel = 0
  121. variable int Dangerlvl = 0
  122. variable int BuffNum = 0
  123. variable bool debuffStatus = FALSE
  124. variable string RealmChar = "${ISXWoW.RealmName}_${Me.Name}_${Me.Class}"
  125. variable bool MeleeOnly = FALSE
  126. variable bool RunnerDealtWith = FALSE
  127. variable bool Revived = FALSE
  128. variable int ReincarnateCount = 0
  129. variable int BackupAttempts = 0
  130. variable string MobDataStorage = "./routines/MobData.xml"
  131. variable set MobDataImmunities
  132. variable set MobDataRunners
  133.  
  134. variable collection:index:string RandomCast
  135. variable collection:int RandomCastCount
  136.  
  137. /**************************************/
  138. /***********Init & Shutdown************/
  139.  
  140. method Initialize()
  141. {
  142. LavishSettings:AddSet["MobData"]
  143. LavishSettings["MobData"]:Import["${MobDataStorage}"]
  144.  
  145. This:LoadConfig
  146. This:InitShamanGUI
  147.  
  148. if ${Me.Action["Gift of the Naaru"].Usable}
  149. {
  150. UIElement -toggle GOTN@Heals@Pages@ClassGUI
  151. UIElement -toggle lblGOTN@Heals@Pages@ClassGUI
  152. }
  153.  
  154. This:SetDistances
  155. This:CreateUIErrorStrings
  156. This:SetTotems
  157. This:InitRandoms
  158. This:InitTriggers
  159.  
  160. This.MobDataImmunities:Clear
  161. This.MobDataRunners:Clear
  162.  
  163. This:LoadList["MobData","MobDataImmunities"]
  164. This:LoadList["MobData","MobDataRunners"]
  165.  
  166. Bot:AddPulse["Class","Pulse",10,TRUE,TRUE]
  167.  
  168. UIElement[ClassGUI].FindChild[Console]:Echo["^_^=================================^_^"]
  169. UIElement[ClassGUI].FindChild[Console]:Echo[" Swolbyn's Shaman Routine v0.7"]
  170. UIElement[ClassGUI].FindChild[Console]:Echo["^_^=================================^_^"]
  171. }
  172.  
  173. method Shutdown()
  174. {
  175. This:SaveConfig
  176. This:RemoveTriggers
  177.  
  178. This:ExportList["MobData","MobDataImmunities"]
  179. This:ExportList["MobData","MobDataRunners"]
  180.  
  181. LavishSettings["MobData"]:Export["${MobDataStorage}"]
  182. }
  183.  
  184. method Pulse()
  185. {
  186. ExecuteQueued
  187. }
  188.  
  189. method SetDistances()
  190. {
  191. if ${This.GetSpellRange[30, "elemental"]}
  192. {
  193. This.MaxCastRange:Set[${This.GetSpellRange[30, "elemental"]}]
  194. This:CustOutput["Setting New MaxRange to ${This.MaxCastRange}"]
  195. This.MaxShockRange:Set[${This.GetSpellRange[20, "elemental"]}]
  196. This:CustOutput["Setting New MaxShockRange to ${This.MaxShockRange}"]
  197. }
  198. }
  199.  
  200. member GetSpellRange(int base, string spellTree)
  201. {
  202. if ${spellTree.Equal[elemental]}
  203. return ${Math.Calc[${base}*(1+(0.1*${Me.Talent[Storm Reach]}))-1].Round}
  204.  
  205. return ${base}
  206. }
  207.  
  208. /**************************************/
  209. /**********UI Error Strings************/
  210.  
  211. variable collection:string UIErrorMsgStrings
  212. method CreateUIErrorStrings()
  213. {
  214. This.UIErrorMsgStrings:Set["You are facing the wrong way!","backward"]
  215. This.UIErrorMsgStrings:Set["Target too close","backward"]
  216. This.UIErrorMsgStrings:Set["You are too far away!","forward"]
  217. This.UIErrorMsgStrings:Set["Out of range.","forward"]
  218. }
  219.  
  220. variable bool needUIHook = TRUE
  221. method UIErrorMessage(string Id, string Msg)
  222. {
  223. if ${This.UIErrorMsgStrings.Element[${Msg}](exists)} && !${Bot.PauseFlag} && ${This.crazyWaitTimer} < ${LavishScript.RunningTime}
  224. {
  225. if ${Msg.Equal["Target too close"]} || (${Target.Distance} < 5 && ${Me.InCombat}) || ${This.UIErrorMsgStrings.Element[${Msg}].Equal["forward"]} && !${Me.Casting}
  226. {
  227. This:Debug[${Msg}]
  228. This:CustOutput["Moving ${This.UIErrorMsgStrings.Element[${Msg}]} - UI Error: ${Msg}"]
  229. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  230. This.attackWaitTimer:Set[${This.InMilliseconds[25]}]
  231. This.pullWaitTimer:Set[${This.InMilliseconds[25]}]
  232. move ${This.UIErrorMsgStrings.Element[${Msg}]} 1000
  233. return
  234. }
  235. }
  236. }
  237.  
  238. /**************************************/
  239. /*********External Mob Data************/
  240.  
  241. method LoadList(string dataType, string loadingList)
  242. {
  243. variable iterator i
  244.  
  245. if !${LavishSettings[${dataType}].FindSet[${loadingList}](exists)}
  246. LavishSettings[${dataType}]:AddSet[${loadingList}]
  247.  
  248. LavishSettings[${dataType}].FindSet[${loadingList}]:GetSettingIterator[i]
  249.  
  250. i:First
  251. while ${i.IsValid}
  252. {
  253. ${loadingList}:Add[${i.Key}]
  254. i:Next
  255. }
  256. }
  257.  
  258. method ExportList(string dataType, string loadingList)
  259. {
  260. variable iterator i
  261.  
  262. LavishSettings[${dataType}].FindSet[${loadingList}]:Clear
  263. ${loadingList}:GetIterator[i]
  264. i:First
  265. while ${i.IsValid}
  266. {
  267. LavishSettings[${dataType}].FindSet[${loadingList}]:AddSetting[${i.Key},${i.Key}]
  268. i:Next
  269. }
  270. }
  271.  
  272. /**************************************/
  273. /**************Triggers****************/
  274.  
  275. method InitTriggers()
  276. {
  277. AddTrigger DetectRunner "[Event:@eventid@:CHAT_MSG_MONSTER_EMOTE](\"%%s attempts to run away in fear!\",\"@Mob@\",@*@"
  278. AddTrigger DetectImmune "[Event:@eventid@:CHAT_MSG_SPELL_SELF_DAMAGE](\"Your @FailedSpell@ failed. @Mob*@ is immune.@*@"
  279. }
  280.  
  281. method RemoveTriggers()
  282. {
  283. RemoveTrigger DetectRunner
  284. RemoveTrigger DetectImmune
  285. }
  286.  
  287. function DetectRunner(string Line, int eventid, string Mob)
  288. {
  289. if !${This.MobDataRunners.Contains[${Mob}]}
  290. {
  291. This:CustOutput["Added ${Mob} to the runner list"]
  292. This.MobDataRunners:Add[${Mob}]
  293. }
  294. }
  295.  
  296. function DetectImmune(string Line, int eventid, string FailedSpell, string Mob)
  297. {
  298. variable string MobId
  299. MobId:Set[${Mob}#${FailedSpell}]
  300.  
  301. if !${This.MobDataImmunities.Contains[${MobId}]}
  302. {
  303. This:CustOutput["Added ${MobId} to the mob immune list"]
  304. This.MobDataImmunities:Add[${MobId}]
  305. }
  306. }
  307.  
  308. /**************************************/
  309. /***********Character States***********/
  310.  
  311. member isRunner()
  312. {
  313. if ${This.MobDataRunners.Contains[${Target.Name}]}
  314. return TRUE
  315.  
  316. return FALSE
  317. }
  318.  
  319. member isImmune(string SpellName)
  320. {
  321. if ${This.MobDataImmunities.Contains[${Target.Name}#${SpellName}]}
  322. return TRUE
  323.  
  324. return FALSE
  325. }
  326.  
  327. member isPoisoned()
  328. {
  329. BuffNum:Set[1]
  330. while ${BuffNum} < 16
  331. {
  332. BuffNum:Inc
  333. if ${Me.Buff[${BuffNum}].DispelType.Equal["Poison"]}
  334. {
  335. return TRUE
  336. }
  337. }
  338. return FALSE
  339. }
  340.  
  341. member isDiseased()
  342. {
  343. BuffNum:Set[1]
  344. while ${BuffNum} < 16
  345. {
  346. BuffNum:Inc
  347. if ${Me.Buff[${BuffNum}].DispelType.Equal["Disease"]}
  348. {
  349. return TRUE
  350. }
  351. }
  352. return FALSE
  353. }
  354.  
  355. /**************************************/
  356. /************Reincarnation*************/
  357.  
  358. member NeedDead()
  359. {
  360. if !${This.Revived} && ${This.ReincarnateCount} < 10 && (${Me.Dead} || ${Me.Ghost}) && ${This.UseReincarnation}
  361. {
  362. return TRUE
  363. }
  364. else
  365. {
  366. return FALSE
  367. }
  368. }
  369.  
  370. method DeadPulse()
  371. {
  372. This:Output["Bad Shaman! you died?!"]
  373. Bot.RandomPause:Set[25]
  374.  
  375. This.ReincarnateCount:Inc
  376. if ${This.CanUseAnkh}
  377. {
  378. if ${WoWScript[StaticPopup1:IsVisible()]}
  379. {
  380. This:CustOutput["Reincarnation REPOPPING!"]
  381. This.Revived:Set[TRUE]
  382. This.ReincarnateCount:Set[0]
  383. WoWScript UseSoulstone()
  384. WoWScript RepopMe()
  385. }
  386. }
  387. return
  388. }
  389.  
  390. member CanUseAnkh()
  391. {
  392. if ${Navigator.PointIsSafe[${Me.X},${Me.Y},${Me.Z}]}
  393. {
  394. if ${Item[-inventory,"Ankh"](exists)} && ${Spell[Reincarnation](exists)} && !${Spell[Reincarnation].Cooldown}
  395. {
  396. This:CustOutput["We can use Reincarnation here."]
  397. return TRUE
  398. }
  399. else
  400. {
  401. This:CustOutput["Can't self res!"]
  402. }
  403. }
  404. else
  405. {
  406. This:CustOutput["Not a safe spot to use Reincarnation"]
  407. }
  408. return FALSE
  409. }
  410.  
  411. /**************************************/
  412. /****************Rest******************/
  413.  
  414. member NeedRest()
  415. {
  416. if ${Me.InCombat} || ${Targeting.realAgg}
  417. return FALSE
  418.  
  419. if ${This.LootFirst}
  420. return FALSE
  421.  
  422. if ${Me.Buff[Resurrection Sickness](exists)}
  423. return TRUE
  424.  
  425. if ${Me.PctHPs} < ${This.RestHP}
  426. return TRUE
  427.  
  428. if ${Me.PctMana} < ${This.RestMP}
  429. return TRUE
  430.  
  431. if ${Me.PctHPs} < ${This.StandHP} && ${Me.Sitting}
  432. return TRUE
  433.  
  434. if ${Me.PctMana} < ${This.StandMP} && ${Me.Sitting}
  435. return TRUE
  436.  
  437. return FALSE
  438. }
  439.  
  440. method RestPulse()
  441. {
  442. if ${Me.InCombat} || ${Targeting.realAgg}
  443. return
  444.  
  445. if ${Me.Casting}
  446. return
  447.  
  448. if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward}
  449. {
  450. Toon:Stop
  451. return
  452. }
  453.  
  454. if ${Me.Buff[Resurrection Sickness](exists)}
  455. {
  456. Toon:Sitdown
  457. return
  458. }
  459.  
  460. if !${Me.Dead} && !${Me.Ghost}
  461. This:Revived:Set[FALSE]
  462.  
  463. if ${This.ShouldCallTotems}
  464. {
  465. Toon:CastSpell["Totemic Call"]
  466. This:CustOutput["Calling my totems back"]
  467. return
  468. }
  469.  
  470. if ((${Me.PctMana} >= ${This.StandMP}) && (${Me.PctHPs} >= ${This.StandHP})) && ${Me.Sitting}
  471. {
  472. Toon:Standup
  473. This:Output["Standing."]
  474. return
  475. }
  476.  
  477. This:debuffAll
  478.  
  479. if !${Consumable.HasFood} && ${Me.PctHPs} < ${RestHP} && !${Me.Buff[Drink](exists)} && !${Me.Casting} && ${This.buffWaitTimer} < ${LavishScript.RunningTime}
  480. {
  481. if ${Toon.canCast["Lesser Healing Wave"]}
  482. {
  483. Toon:CastSpell["Lesser Healing Wave"]
  484. This:CustOutput["Casting Lesser Healing Wave - Rest"]
  485. This.buffWaitTimer:Set[${This.InSeconds[20]}]
  486. return
  487. }
  488. elseif ${Toon.canCast[Healing Wave]}
  489. {
  490. Toon:CastSpell["Healing Wave"]
  491. This:CustOutput["Casting Healing Wave - Rest"]
  492. This.buffWaitTimer:Set[${This.InSeconds[20]}]
  493. return
  494. }
  495. }
  496.  
  497. if ${Me.PctHPs} < ${This.Bandage} && ${Toon.canBandage} && !${Me.Sitting} && ${This.UseBandages}
  498. {
  499. Toon:Bandage
  500. This:CustOutput["Bandaging...."]
  501. return
  502. }
  503.  
  504. if ${Me.PctHPs} < ${This.RestHP} && ${Consumable.HasFood} && !${Me.Buff["Food"](exists)} && !${Me.Swimming} && !${Me.InCombat} && !${Me.Casting} && !${This.isPoisoned} && !${This.isDiseased} && !${Me.Sitting}
  505. {
  506. Consumable:useFood
  507. This:CustOutput["Eating..."]
  508. return
  509. }
  510.  
  511. if ${Me.PctMana} < ${This.RestMP} && ${Consumable.HasDrink} && !${Me.Buff["Drink"](exists)} && !${Me.Swimming} && !${Me.InCombat} && !${Me.Casting} && !${This.isPoisoned} && !${This.isDiseased} && !${Me.Sitting}
  512. {
  513. Consumable:useDrink
  514. This:CustOutput["Drinking..."]
  515. return
  516. }
  517.  
  518. if ${Me.PctMana} < ${This.RestMP} && ${Toon.canCast[M"ana Spring Totem"]} && !${This.OwnedTotemsCheck["Mana Spring Totem"]} && ${This.HasWaterTotem} && !${Consumable.HasDrink} && !${Me.Buff["Drink"](exists)} && !${Me.Swimming} && !${Me.InCombat} && !${Me.Casting}
  519. {
  520. Toon:CastSpell["Mana Spring Totem"]
  521. This:CustOutput["Casting Mana Spring Totem"]
  522. }
  523.  
  524. if ${Me.PctMana} >= ${This.StandMP} && ${Me.PctHPs} >= ${This.StandHP} && !${Me.Casting} && !${Me.Buff["Resurrection Sickness"](exists)}
  525. {
  526. Toon:Standup
  527. This:CustOutput["Done Resting!"]
  528. return
  529. }
  530. }
  531.  
  532. /**************************************/
  533. /****************Buff******************/
  534.  
  535. member NeedBuff()
  536. {
  537. if ${Me.InCombat} || ${Targeting.realAgg}
  538. return FALSE
  539.  
  540. if ${Me.Swimming} && !${Object[-dead,-range 0-5](exists)}
  541. return TRUE
  542.  
  543. if ${Mount.IsMounted}
  544. return FALSE
  545.  
  546. if ${Me.Swimming} && ${Toon.canCast[Water Walking]} && ${Item[-inventory,"Fish Oil"](exists)} && !${Me.Buff[Water Walking](exists)}
  547. {
  548. This:CustOutput["Swimming, need water walking"]
  549. return TRUE
  550. }
  551.  
  552. if ${Me.Swimming} && !${Me.Race.Find["Undead"]} && ${Toon.canCast["Water Breathing"]} && ${Item[-inventory,"Shiny Fish Scales"](exists)} && !${Me.Buff["Water Breathing"](exists)}
  553. {
  554. This:CustOutput["Swimming, need water breathing"]
  555. return TRUE
  556. }
  557.  
  558. if ${Toon.canUseScroll}
  559. {
  560. This:CustOutput["Need a scroll buff"]
  561. return TRUE
  562. }
  563.  
  564. if !${Me.Equip[mainhand].Enchantment[${This.MainHand}](exists)} && ${Toon.canCast["${This.MainHand} Weapon"]} && ${This.buffWaitTimer} < ${LavishScript.RunningTime} && !${This.MainHand.Equal[None]}
  565. {
  566. This:CustOutput["Need Mainhand Buff - ${This.MainHand}"]
  567. return TRUE
  568. }
  569.  
  570. if !${Me.Equip[offhand].Enchantment[${This.OffHand}](exists)} && ${Toon.canCast["${This.OffHand} Weapon"]} && ${This.DW} && !${This.OffHand.Equal[None]}
  571. {
  572. This:CustOutput["Need Offhand Buff - ${This.OffHand}"]
  573. return TRUE
  574. }
  575.  
  576. if !${Me.Buff[${Shield}](exists)} && ${This.canBuff[${This.Shield}]}
  577. return TRUE
  578.  
  579. return FALSE
  580. }
  581.  
  582. method BuffPulse()
  583. {
  584. if ${Me.Swimming}
  585. {
  586. if ${This.jumpTimer} < ${LavishScript.RunningTime}
  587. {
  588. wowpress JUMP
  589. This.jumpTimer:Set[${This.InSeconds[5]}]
  590. }
  591. if ${Target(exists)}
  592. {
  593. Toon:ToMelee
  594. }
  595. return
  596. }
  597.  
  598. if ${Me.InCombat} || ${Targeting.realAgg}
  599. return
  600.  
  601. if ${Me.Casting}
  602. return
  603.  
  604. if ${Me.Sitting}
  605. Toon:Standup
  606.  
  607. if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward}
  608. {
  609. Move -stop
  610. return
  611. }
  612.  
  613. if ${Me.Swimming} && ${Toon.canCast["Water Walking"]} && ${Item[-inventory,"Fish Oil"](exists)} && !${Me.Buff["Water Walking"](exists)}
  614. {
  615. Toon:CastSpell[Water Walking]
  616. This:CustOutput["Casting Water Walking"]
  617. return
  618. }
  619.  
  620. if ${Me.Swimming} && !${Me.Race.Find["Undead"]} && ${Toon.canCast["Water Breathing"]} && ${Item[-inventory,"Shiny Fish Scales"](exists)} && !${Me.Buff["Water Breathing"](exists)}
  621. {
  622. Toon:CastSpell[Water Breathing]
  623. This:CustOutput["Casting Water Breathing"]
  624. return
  625. }
  626.  
  627. if ${Toon.canUseScroll}
  628. {
  629. Toon:UseScroll
  630. This:CustOutput["Using a scroll"]
  631. return
  632. }
  633.  
  634. if !${Me.Equip[mainhand].Enchantment[${This.MainHand}](exists)} && ${Toon.canCast[${This.MainHand} Weapon]} && ${This.buffWaitTimer} < ${LavishScript.RunningTime} && !${This.MainHand.Equal[None]}
  635. {
  636. Toon:CastSpell["${This.MainHand} Weapon"]
  637. This:CustOutput["Casting ${This.MainHand} Weapon"]
  638. This.buffWaitTimer:Set[${This.InSeconds[20]}]
  639. return
  640. }
  641.  
  642. if !${Me.Equip[offhand].Enchantment[${This.OffHand}](exists)} && ${Toon.canCast[${This.OffHand} Weapon]} && ${This.DW} && !${This.OffHand.Equal[None]}
  643. {
  644. Toon:CastSpell["${This.OffHand} Weapon"]
  645. This:CustOutput["Casting ${This.OffHand} Weapon"]
  646. return
  647. }
  648.  
  649. if !${Me.Buff["${Shield}"](exists)} && ${This.canBuff["${This.Shield}"]}
  650. {
  651. Toon:CastSpell["${This.Shield}"]
  652. return
  653. }
  654. }
  655.  
  656. /**************************************/
  657. /**************Pull Buff***************/
  658.  
  659. member NeedPullBuff()
  660. {
  661. if !${Me.Buff["${This.Shield}"](exists)} && ${This.canBuff["${This.Shield}"]} && !${This.isImmune["${This.Shield}"]}
  662. return TRUE
  663.  
  664. return FALSE
  665. }
  666.  
  667. method PullBuffPulse()
  668. {
  669. if ${Me.Sitting}
  670. Toon:Standup
  671.  
  672. if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward}
  673. {
  674. Toon:Stop
  675. return
  676. }
  677.  
  678. if !${Me.Buff["${This.Shield}"](exists)} && ${This.canBuff["${This.Shield}"]} && !${This.isImmune["${This.Shield}"]}
  679. {
  680. Toon:CastSpell["${This.Shield}"]
  681. This:CustOutput["Casting ${This.Shield}"]
  682. return
  683. }
  684. return
  685. }
  686.  
  687. /**************************************/
  688. /*************Combat Buff**************/
  689.  
  690. member NeedCombatBuff()
  691. {
  692. if ${Me.Sitting}
  693. Toon:Standup
  694.  
  695. if ${Me.PctHPs} < ${This.GOTN} && ${Toon.canCast["Gift of the Naaru"]}
  696. return TRUE
  697.  
  698. if ${This.canBuff["${This.Shield}"]} && ${Target.PctHPs} > 30 && !${This.isImmune["${This.Shield}"]}
  699. return TRUE
  700.  
  701. if ${Toon.canCast["Shamanistic Rage"]} && ${Me.PctMana} < 30 && ${Target.PctHPs} > 85
  702. return TRUE
  703.  
  704. if ${Toon.canCast["Elemental Mastery"]} && ${Me.PctMana} < 30
  705. return TRUE
  706.  
  707. ;if ${Toon.canCast["Mana Spring Totem"]} && ${Me.PctMana} < 30 && ${This.HasWaterTotem}
  708. ; return TRUE
  709.  
  710. if ${Toon.canCast["Heroism"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70
  711. return TRUE
  712.  
  713. if ${Toon.canCast["Bloodlust"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70
  714. return TRUE
  715.  
  716. return FALSE
  717. }
  718.  
  719. method CombatBuffPulse()
  720. {
  721. if ${Me.Sitting}
  722. Toon:Standup
  723.  
  724. if ${Toon.canCast["Nature's Swiftness"]}
  725. {
  726. Toon:CastSpell["Nature's Swiftness"]
  727. return
  728. }
  729.  
  730. if ${Me.PctHPs} < ${This.GOTN} && ${Toon.canCast["Gift of the Naaru"]} && !${Me.Casting}
  731. {
  732. Toon:CastSpell["Gift of the Naaru"]
  733. This:CustOutput["Casting Gift of the Naaru"]
  734. return
  735. }
  736.  
  737. if ${This.canBuff["${This.Shield}", ${Me.GUID}]} && !${Me.Buff["${This.Shield}"](exists)} && !${Me.Casting} && !${This.isImmune["${This.Shield}"]}
  738. {
  739. Toon:CastSpell["${Shield}"]
  740. This:CustOutput["Casting ${Shield}"]
  741. return
  742. }
  743.  
  744. if ${Toon.canCast["Elemental Mastery"]} && ${Me.PctMana} < 30
  745. {
  746. Toon:CastSpell["Elemental Mastery"]
  747. This:CustOutput["Casting Elemental Mastery!!!"]
  748. return
  749. }
  750.  
  751. ;if ${Toon.canCast["Mana Spring Totem"]} && ${Me.PctMana} < 30 && !${This.OwnedTotemsCheck["Mana Spring Totem"]} && ${This.HasWaterTotem}
  752. ;{
  753. ; Toon:CastSpell["Mana Spring Totem"]
  754. ; This:CustOutput["Casting Mana Spring Totem!!!"]
  755. ; return
  756. ;}
  757.  
  758. if ${Toon.canCast["Heroism"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70
  759. {
  760. Toon:CastSpell["Heroism"]
  761. This:CustOutput["Casting Heroism!!!"]
  762. return
  763. }
  764.  
  765. if ${Toon.canCast["Bloodlust"]} && ${Me.PctHPs} < 30 && ${Target.PctHPs} > 70
  766. {
  767. Toon:CastSpell["Bloodlust"]
  768. This:CustOutput["Casting Bloodlust!!!"]
  769. return
  770. }
  771. }
  772.  
  773. /**************************************/
  774. /****************Pull******************/
  775.  
  776. method PullPulse()
  777. {
  778. if ${Me.Sitting}
  779. Toon:Standup
  780.  
  781. if !${Toon.ValidTarget[${Target.GUID}]} || ${Target.Dead} || !${Target(exists)}
  782. {
  783. Toon:NeedTarget[1]
  784. return
  785. }
  786.  
  787. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  788.  
  789. if ${Me.Casting} || ${Me.GlobalCooldown}
  790. return
  791.  
  792. if !${Me.Attacking} && ${Target.Distance} <= ${Toon.MaxMelee}
  793. {
  794. WoWScript AttackTarget()
  795. This:CustOutput["Turning on autoattack"]
  796. return
  797. }
  798.  
  799. if ${Target.PctHPs} > 95 && ${Target.Target.GUID.NotEqual[${Me.GUID}]} && ${Target.Target.GUID.NotEqual[${Me.Pet.GUID}]}) || ${Toon.TargetIsNew}
  800. {
  801. ; Creature is 100% life, assuming new target resetting runner logic
  802. This.RunnerDealtWith:Set[FALSE]
  803. This.BackupAttempts:Set[0]
  804. }
  805.  
  806.  
  807. if ${Me.PctHPs} < ${This.HealWave} && ${Toon.canCast["Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime}
  808. {
  809. Toon:CastSpell["Healing Wave"]
  810. This:CustOutput["Casting Healing Wave"]
  811. This.healWaitTimer:Set[${This.InSeconds[4]}]
  812. return
  813. }
  814.  
  815. if ${Me.PctHPs} < ${This.LHealWave} && ${Toon.canCast["Lesser Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime}
  816. {
  817. Toon:CastSpell["Lesser Healing Wave"]
  818. This:CustOutput["Casting Lesser Healing Wave"]
  819. This.healWaitTimer:Set[${This.InSeconds[4]}]
  820. return
  821. }
  822.  
  823. if ${Target.Distance} < ${Toon.MinRanged} || ${This.isImmune["${This.PullSpell}"]} && !${Me.Casting}
  824. {
  825. WoWScript AttackTarget()
  826. This:CustOutput["Turning on autoattack"]
  827. Toon:ToMelee
  828. return
  829. }
  830.  
  831. if !${This.UsePull}
  832. {
  833. if !${Toon.withinMelee}
  834. {
  835. Toon:ToMelee
  836. This:CustOutput["Melee Pulling ${Target.Name}"]
  837. return
  838. }
  839. }
  840.  
  841. if ${This.UsePull}
  842. {
  843. if ${Toon.withinRanged}
  844. {
  845. if ${Movement.Speed} || ${Movement.Forward} || ${Movement.Backward}
  846. {
  847. Toon:Stop
  848. return
  849. }
  850.  
  851. if (${Target.Distance} >= ${Toon.MinRanged} && ${Me.PctMana} > ${This.ConserveMana}) && (((${Target.PctHPs} > 95 && ${Target.Target.GUID.NotEqual[${Me.GUID}]} && ${Target.Target.GUID.NotEqual[${Me.Pet.GUID}]}) || ${Toon.TargetIsNew}) || (${This.SpamPull}))
  852. {
  853. if ${Toon.canCast["${This.PullSpell}"]}
  854. {
  855. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  856. Toon:CastSpell["${This.PullSpell}"]
  857. This:CustOutput["Pulling With: ${This.PullSpell}"]
  858. return
  859. }
  860. }
  861. }
  862. elseif !${Me.Casting}
  863. {
  864. if ${Target.Distance} > ${Toon.MaxRanged}
  865. {
  866. This:CustOutput["Target too far away. Moving closer."]
  867. Toon:ToRanged
  868. }
  869. elseif ${Target.Distance} < ${Toon.MinRanged}
  870. {
  871. WoWScript AttackTarget()
  872. This:CustOutput["Turning on autoattack"]
  873. This:AttackPulse
  874. }
  875. }
  876. }
  877.  
  878. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  879. return
  880. }
  881.  
  882. /**************************************/
  883. /***************Attack*****************/
  884.  
  885. method AttackPulse()
  886. {
  887. if ${Me.Sitting}
  888. Toon:Standup
  889.  
  890. if !${Toon.ValidTarget[${Target.GUID}]} || ${Target.Dead} || !${Target(exists)}
  891. {
  892. Toon:NeedTarget[1]
  893. }
  894.  
  895. if !${Toon.TargetIsBestTarget} || ${Target.IsTotem}
  896. Toon:BestTarget
  897.  
  898. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  899.  
  900. if !${Me.Attacking} && ${Target.Distance} <= ${Toon.MaxMelee}
  901. {
  902. WoWScript AttackTarget()
  903. This:CustOutput["Turning on autoattack"]
  904. }
  905.  
  906. if ${Target.Distance} >= ${Toon.MinRanged} && ${Me.PctMana} > ${This.ConserveMana} && ${This.SpamPull}
  907. {
  908. This:PullPulse
  909. }
  910.  
  911. This:SetDanger
  912.  
  913. if ${This.HaveAdds} && ${Toon.canCast["War Stomp"]} && !${Me.Casting}
  914. {
  915. Toon:CastSpell["War Stomp"]
  916. }
  917.  
  918. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  919.  
  920. This:debuffAll
  921.  
  922. if ${Target.Distance} < ${Toon.MinMelee} && ${This.BackupAttempts} < 6 && !${Me.Casting}
  923. {
  924. This:Output["Backing up... wtf"]
  925. This.BackupAttempts:Inc
  926. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  927. Navigator:MoveBackward[200]
  928. return
  929. }
  930.  
  931. if ${Target.Distance} > ${Toon.MaxMelee} && !${Me.Casting}
  932. {
  933. This:Output["Chasing down ${Target.Name}"]
  934. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  935. wowpress -hold moveforward
  936. return
  937. }
  938. else
  939. {
  940. Toon:Stop
  941. }
  942.  
  943. if ${Target.Dead}
  944. return
  945.  
  946. if !${This.RunnerDealtWith} && ${Target.PctHPs} < 40 && ${This.isRunner}
  947. {
  948. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  949. if ${Toon.canCast["Frost Shock"]} && !${This.isImmune["Frost Shock"]}
  950. {
  951. Toon:CastSpell["Frost Shock"]
  952. This:CustOutput["Casting Frost Shock on a runner"]
  953. This.RunnerDealtWith:Set[TRUE]
  954. return
  955. }
  956.  
  957. if ${Toon.canCast["Earthbind Totem"]} && !${This.OwnedTotemsCheck["Earthbind Totem"]} && ${This.HasEarthTotem}
  958. {
  959. Toon:CastSpell["Earthbind Totem"]
  960. This:CustOutput["Casting Earthbind Totem to catch a runner"]
  961. This.RunnerDealtWith:Set[TRUE]
  962. return
  963. }
  964. }
  965.  
  966. if ${Me.PctHPs} < ${This.HealWave} && ${Toon.canCast["Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime}
  967. {
  968. Toon:CastSpell["Healing Wave"]
  969. This:CustOutput["Casting Healing Wave"]
  970. This.healWaitTimer:Set[${This.InSeconds[4]}]
  971. return
  972. }
  973.  
  974. if ${Me.PctHPs} < ${This.LHealWave} && ${Toon.canCast["Lesser Healing Wave"]} && !${Me.Casting} && ${This.healWaitTimer} < ${LavishScript.RunningTime}
  975. {
  976. Toon:CastSpell["Lesser Healing Wave"]
  977. This:CustOutput["Casting Lesser Healing Wave"]
  978. This.healWaitTimer:Set[${This.InSeconds[4]}]
  979. return
  980. }
  981.  
  982. if ${Me.PctHPs} < ${This.HPot} && ${This.UseHPot} && ${Consumable.HasHPot} && ${This.PotTimer} < ${LavishScript.RunningTime}
  983. {
  984. Consumable:useHPot
  985. This:CustOutput["Quaffing a health pot"]
  986. This.PotTimer:Set[${This.InSeconds[120]}]
  987. return
  988. }
  989.  
  990. if ${Me.PctMana} < ${This.MPot} && ${This.UseMPot} && ${Consumable.HasMPot} && ${This.PotTimer} < ${LavishScript.RunningTime}
  991. {
  992. Consumable:useMPot
  993. This:CustOutput["Quaffing a mana pot"]
  994. This.PotTimer:Set[${This.InSeconds[120]}]
  995. return
  996. }
  997.  
  998. if ${Target.Dead}
  999. return
  1000.  
  1001. if ${Dangerlvl} >= 1
  1002. {
  1003. if ${Target.PctHPs} > 50 || ${This.HaveAdds}
  1004. {
  1005. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  1006. if ${This.HaveAdds} && ${Toon.canCast["Stoneclaw Totem"]} && !${This.OwnedTotemsCheck["Stoneclaw Totem"]} && ${This.HasEarthTotem}
  1007. {
  1008. Toon:CastSpell["Stoneclaw Totem"]
  1009. This:CustOutput["Casting Stoneclaw Totem because of Add!"]
  1010. return
  1011. }
  1012.  
  1013. if ${This.canCastTotem["Earth"]} && ${This.HasEarthTotem}
  1014. {
  1015. Toon:CastSpell["${This.EarthTotem}"]
  1016. This:CustOutput["Casting ${This.EarthTotem}"]
  1017. return
  1018. }
  1019.  
  1020. if ${This.canCastTotem[Air]} && ${This.HasAirTotem}
  1021. {
  1022. Toon:CastSpell["${This.AirTotem}"]
  1023. This:CustOutput["Casting ${This.AirTotem}"]
  1024. return
  1025. }
  1026.  
  1027. if ${This.canCastTotem["Fire"]} && ${This.HasFireTotem}
  1028. {
  1029. Toon:CastSpell["${This.FireTotem}"]
  1030. This:CustOutput["Casting ${This.FireTotem}"]
  1031. return
  1032. }
  1033.  
  1034. if ${This.canCastTotem["Water"]} && ${This.HasWaterTotem}
  1035. {
  1036. Toon:CastSpell["${This.WaterTotem}"]
  1037. This:CustOutput["Casting ${This.WaterTotem}"]
  1038. return
  1039. }
  1040.  
  1041. if ${This.AirTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasAirTotem}
  1042. {
  1043. Toon:CastRandom["AirTotems"]
  1044. This:CustOutput["Casting a random Air Totem"]
  1045. This.AirTotemTimer:Set[${This.InSeconds[80]}]
  1046. return
  1047. }
  1048.  
  1049. if ${This.EarthTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasEarthTotem}
  1050. {
  1051. Toon:CastRandom["EarthTotems"]
  1052. This:CustOutput["Casting a random Earth Totem"]
  1053. This.EarthTotemTimer:Set[${This.InSeconds[80]}]
  1054. return
  1055. }
  1056.  
  1057. if ${This.WaterTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasWaterTotem}
  1058. {
  1059. Toon:CastRandom["WaterTotems"]
  1060. This:CustOutput["Casting a random Water Totem"]
  1061. This.WaterTotemTimer:Set[${This.InSeconds[80]}]
  1062. return
  1063. }
  1064.  
  1065. if ${This.FireTotem.Equal["Random"]} && ${Me.PctMana} > 10 && ${This.HasFireTotem}
  1066. {
  1067. Toon:CastRandom["FireTotems"]
  1068. This:CustOutput["Casting a random Fire Totem"]
  1069. This.FireTotemTimer:Set[${This.InSeconds[80]}]
  1070. return
  1071. }
  1072. }
  1073. }
  1074.  
  1075. if ${Target.Dead}
  1076. return
  1077.  
  1078. if ${This.HaveAdds} && ${Toon.canCast["Shamanistic Rage"]}
  1079. {
  1080. Toon:CastSpell["Shamanistic Rage"]
  1081. This:CustOutput["Casting Shamanistic Rage!!!"]
  1082. return
  1083. }
  1084.  
  1085. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  1086.  
  1087. if ${This.HaveAdds} && ${Toon.canCast["Chain Lightning"]} && ${Me.PctMana} > ${This.ConserveMana} && !${This.MeleeOnly} && ${This.UseChainLight}
  1088. {
  1089. Toon:CastSpell["Chain Lightning"]
  1090. This:CustOutput["Casting Chain Lightning due to an add!"]
  1091. return
  1092. }
  1093.  
  1094. if ${Toon.canCast["Earth Shock"]} && !${This.isImmune["Earth Shock"]} && ${Target.Casting(exists)}
  1095. {
  1096. This:StopCast
  1097. This:CustOutput["Silencing ${Target} - Attack"]
  1098. Toon:CastSpell["Earth Shock"]
  1099. }
  1100.  
  1101. if ${Toon.canCast["Stormstrike"]} && !${Target.Buff["Stormstrike"](exists)} && ${Target.Distance} < ${This.MaxShockRange}
  1102. {
  1103. Toon:CastSpell["Stormstrike"]
  1104. This:CustOutput["Casting Stormstrike"]
  1105. return
  1106. }
  1107.  
  1108. if ${Target.Dead}
  1109. {
  1110. WoWScript ClearTarget()
  1111. return
  1112. }
  1113.  
  1114. Navigator:FaceXYZ[${Target.X},${Target.Y},${Target.Z}]
  1115.  
  1116. if !${This.SaveShocks} || (${This.SaveShocks} && ${Me.Buff["Focused"](exists)})
  1117. {
  1118. if ${Toon.canCast["Earth Shock"]} && !${This.isImmune["Earth Shock"]} && ${Target.Buff["Stormstrike"](exists)} && ${Target.Distance} < ${This.MaxShockRange}
  1119. {
  1120. Toon:CastSpell["Earth Shock"]
  1121. This:CustOutput["Casting Earth Shock on Stormstruck ${Target}!"]
  1122. return
  1123. }
  1124.  
  1125. if ${This.RandomShock} && !${Target.Buff["Stormstrike"](exists)} && ${Target.Distance} < ${This.MaxShockRange}
  1126. {
  1127. if (${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}
  1128. {
  1129. This:CastRandom[Shocks,"Target"]
  1130. return
  1131. }
  1132. }
  1133.  
  1134. if ${This.canCast["Flame Shock"]} && !${This.isImmune["Flame Shock"]} && ${This.UseFlameShock} && !${This.RandomShock} && !${Target.Buff["Stormstrike"](exists)} && ((${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}) && ${Target.Distance} < ${This.MaxShockRange}
  1135. {
  1136. Toon:CastSpell["Flame Shock"]
  1137. This:CustOutput["Casting Flame Shock"]
  1138. return
  1139. }
  1140.  
  1141. if ${Toon.canCast["Earth Shock"]} && !${This.isImmune["Earth Shock"]} && ${This.UseEarthShock} && !${This.RandomShock} && ((${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}) && ${Target.Distance} < ${This.MaxShockRange}
  1142. {
  1143. Toon:CastSpell["Earth Shock"]
  1144. This:CustOutput["Casting Earth Shock"]
  1145. return
  1146. }
  1147.  
  1148. if ${Toon.canCast["Frost Shock"]} && !${This.isImmune["Frost Shock"]} && ${This.UseFrostShock} && !${This.RandomShock} && !${Target.Buff["Stormstrike"](exists)} && ((${Me.PctMana} > ${This.ConserveMana}) || ${This.SaveShocks}) && ${Target.Distance} < ${This.MaxShockRange}
  1149. {
  1150. Toon:CastSpell["Frost Shock"]
  1151. This:CustOutput["Casting Frost Shock"]
  1152. return
  1153. }
  1154.  
  1155. if ${Toon.canCast["Lightning Bolt"]} && !${This.isImmune["Lightning Bolt"]} && ${This.UseLBolt} && ${Me.PctMana} > ${This.ConserveMana} && !${This.MeleeOnly}
  1156. {
  1157. Toon:CastSpell["Lightning Bolt"]
  1158. This:CustOutput["Casting Lightning Bolt"]
  1159. return
  1160. }
  1161. }
  1162. }
  1163.  
  1164. /**************************************/
  1165. /***************Totems*****************/
  1166.  
  1167. method SetTotems()
  1168. {
  1169. if ${Item[-items,-inventory,"Earth Totem"](exists)}
  1170. {
  1171. This.HasEarthTotem:Set[TRUE]
  1172. This:CustOutput["We have an Earth Totem in our bags, we can use them now!"]
  1173. }
  1174. else
  1175. {
  1176. This.HasEarthTotem:Set[FALSE]
  1177. This:CustOutput["No Earth Totem found! Not using them."]
  1178. }
  1179.  
  1180. if ${Item[-items,-inventory,"Fire Totem"](exists)}
  1181. {
  1182. This.HasFireTotem:Set[TRUE]
  1183. This:CustOutput["We have an Fire Totem in our bags, we can use them now!"]
  1184. }
  1185. else
  1186. {
  1187. This.HasFireTotem:Set[FALSE]
  1188. This:CustOutput["No Fire Totem found! Not using them."]
  1189. }
  1190.  
  1191. if ${Item[-items,-inventory,"Water Totem"](exists)}
  1192. {
  1193. This.HasWaterTotem:Set[TRUE]
  1194. This:CustOutput["We have an Water Totem in our bags, we can use them now!"]
  1195. }
  1196. else
  1197. {
  1198. This.HasWaterTotem:Set[FALSE]
  1199. This:CustOutput["No Water Totem found! Not using them."]
  1200. }
  1201.  
  1202. if ${Item[-items,-inventory,"Air Totem"](exists)}
  1203. {
  1204. This.HasAirTotem:Set[TRUE]
  1205. This:CustOutput["We have an Air Totem in our bags, we can use them now!"]
  1206. }
  1207. else
  1208. {
  1209. This.HasAirTotem:Set[FALSE]
  1210. This:CustOutput["No Air Totem found! Not using them."]
  1211. }
  1212. return
  1213. }
  1214.  
  1215. member canCastTotem(string totemType)
  1216. {
  1217. if ${Toon.canCast[${This.${totemType}Totem}]} && !${This.OwnedTotemsCheck[${This.${totemType}Totem}]} && !${This.${totemType}Totem.Equal["Random"]} && !${This.${totemType}Totem.Equal["None"]}
  1218. return TRUE
  1219.  
  1220. return FALSE
  1221. }
  1222.  
  1223. member OwnedTotemsCheck(string totem)
  1224. {
  1225. if ${Unit[-units, -owner, -range 0-20, "${totem}"](exists)}
  1226. {
  1227. return TRUE
  1228. TotemList:Clear
  1229. }
  1230. return FALSE
  1231. }
  1232.  
  1233. member ShouldCallTotems()
  1234. {
  1235. if ${This.OwnedTotemsCheck["totem"]} && !${This.OwnedTotemsCheck["Mana Spring Totem"]} && !${This.OwnedTotemsCheck["Poison Cleansing Totem"]} && !${Me.Target(exists)} && ${Toon.canCast["Totemic Call"]}
  1236. return TRUE
  1237.  
  1238. return FALSE
  1239. }
  1240.  
  1241. /**************************************/
  1242. /*************Aggro & Adds*************/
  1243.  
  1244. method SetDanger()
  1245. {
  1246. variable guidlist Aggros
  1247. Aggros:Search[-units,-nearest,-aggro,-alive,-targetingme,-range 0-40]
  1248.  
  1249. This.DangerLevel:Set[${DangerLevel} * 0.5]
  1250. This.DangerLevel:Set[${DangerLevel} + ${Aggros.Count}*6.5]
  1251. This.DangerLevel:Set[${DangerLevel} + ((100 - ${Me.PctMana})*0.10)]
  1252.  
  1253. if ${Target.Level} > ${Me.Level}
  1254. {
  1255. This.DangerLevel:Set[${DangerLevel} + ((${Target.Level} - ${Me.Level})*2)]
  1256. }
  1257. elseif ${Me.Level} > ${Target.Level}
  1258. {
  1259. This.DangerLevel:Set[${DangerLevel} + ((${Target.Level} - ${Me.Level})*1)]
  1260. }
  1261.  
  1262. if ${Target.Classification.Equal[Elite]} || ${Target.Classification.Equal[RareElite]}
  1263. This.DangerLevel:Set[${DangerLevel} + 20]
  1264.  
  1265. if ${Target.PctHPs} < 25
  1266. This.DangerLevel:Set[${DangerLevel} - 10]
  1267.  
  1268. if ${DangerLevel} < 0
  1269. This.DangerLevel:Set[0]
  1270.  
  1271. UIElement[DangerLevel@Titlebar@ClassGUI]:SetValue[${DangerLevel}]
  1272. if ${DangerLevel} >= ${DangerVeryHigh}
  1273. {
  1274. This:CustOutput["Danger - Very High ${DangerLevel}"]
  1275. This.Dangerlvl:Set[3]
  1276. return
  1277. }
  1278. elseif ${DangerLevel} > ${DangerHigh}
  1279. {
  1280. This:CustOutput["Danger - High ${DangerLevel}"]
  1281. This.Dangerlvl:Set[2]
  1282. return
  1283. }
  1284. elseif ${DangerLevel} > ${DangerMedium}
  1285. {
  1286. ;This:CustOutput["Danger - Medium ${DangerLevel}"]
  1287. This.Dangerlvl:Set[1]
  1288. return
  1289. }
  1290. else
  1291. {
  1292. ;This:CustOutput["Danger - Low ${DangerLevel}"]
  1293. This.Dangerlvl:Set[0]
  1294. return
  1295. }
  1296. }
  1297.  
  1298. member HaveAdds()
  1299. {
  1300. variable guidlist AggroList
  1301. AggroList:Clear
  1302. AggroList:Search[-units,-nearest,-nopets,-aggro,-alive,-range 0-30]
  1303. if ${AggroList.Count} >= 2
  1304. {
  1305. return TRUE
  1306. }
  1307. else
  1308. {
  1309. return FALSE
  1310. }
  1311. }
  1312.  
  1313. /**************************************/
  1314. /***********Spells & Casting***********/
  1315.  
  1316. method InitRandoms()
  1317. {
  1318. This:SetRandoms["Earth Shock","Shocks"]
  1319. This:SetRandoms["Flame Shock","Shocks"]
  1320. This:SetRandoms["Frost Shock","Shocks"]
  1321. This:SetRandoms["Lightning Bolt","Attacks"]
  1322. This:SetRandoms["Chain Lightning","Attacks"]
  1323. This:SetRandoms["Lightning Shield","Shields"]
  1324. This:SetRandoms["Water Shield","Shields"]
  1325. This:SetRandoms["Earth Shield","Shields"]
  1326. This:SetRandoms["Earthbind Totem","EarthTotems"]
  1327. This:SetRandoms["Stoneskin Totem","EarthTotems"]
  1328. This:SetRandoms["Stoneclaw Totem","EarthTotems"]
  1329. This:SetRandoms["Strength of Earth Totem","EarthTotems"]
  1330. This:SetRandoms["Tremor Totem","EarthTotems"]
  1331. This:SetRandoms["Searing Totem","FireTotems"]
  1332. This:SetRandoms["Fire Nova Totem","FireTotems"]
  1333. This:SetRandoms["Magma Totem","FireTotems"]
  1334. This:SetRandoms["Totem of Wrath","FireTotems"]
  1335. This:SetRandoms["Windwall Totem","AirTotems"]
  1336. This:SetRandoms["Grounding Totem","AirTotems"]
  1337. This:SetRandoms["Grace of Air Totem","AirTotems"]
  1338. This:SetRandoms["Wrath of Air Totem","AirTotems"]
  1339. This:SetRandoms["Healing Stream Totem","WaterTotems"]
  1340. This:SetRandoms["Mana Spring Totem","WaterTotems"]
  1341. }
  1342.  
  1343. method SetRandoms(string SpellName, string RandomSet)
  1344. {
  1345. if ${Spell[${SpellName}](exists)}
  1346. {
  1347. This:AddRandom[${RandomSet},${SpellName}]
  1348. }
  1349. else
  1350. {
  1351. This:CustOutput["Couldn't add ${SpellName} into ${RandomSet} because we don't have the spell!"]
  1352. }
  1353. }
  1354.  
  1355. method AddRandom(string spellGroup, string spellName)
  1356. {
  1357. if !${This.RandomCast.Element[${spellGroup}](exists)} && ${Bot.Started}
  1358. {
  1359. This.RandomCast:Set[${spellGroup}]
  1360. This.RandomCastCount:Set[${spellGroup},0]
  1361. }
  1362. This.RandomCast.Element[${spellGroup}]:Insert[${spellName}]
  1363. This.RandomCastCount.Element[${spellGroup}]:Inc
  1364. }
  1365.  
  1366. member CastRandom(string spellGroup, string checkBuff=NULL)
  1367. {
  1368. variable int attempts = 0
  1369. variable int spellNum = 1
  1370. spellNum:Inc[${Math.Rand[${This.RandomCastCount.Element[${spellGroup}]}]}]
  1371.  
  1372. do
  1373. {
  1374. if ${spellNum} > ${This.RandomCastCount.Element[${spellGroup}]}
  1375. {
  1376. spellNum:Inc
  1377. }
  1378. if ${Toon.canCast[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}]} && !${This.isImmune[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}]}
  1379. {
  1380. if ${checkBuff.Equal[Target]} || ${checkBuff.Equal[Me]}
  1381. {
  1382. if !${${checkBuff}.Buff[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}](exists)}
  1383. {
  1384. Toon:CastSpell[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}]
  1385. This:Output["Casting Random Buff#${spellNum}:${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}"]
  1386. return TRUE
  1387. }
  1388. }
  1389. else
  1390. {
  1391. Toon:CastSpell[${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}]
  1392. This:Output["Casting Random#${spellNum}:${This.RandomCast.Element[${spellGroup}].Get[${spellNum}]}"]
  1393. return TRUE
  1394. }
  1395. }
  1396. spellNum:Inc
  1397. }
  1398. while ${attempts:Inc} <= ${This.RandomCastCount.Element[${spellGroup}]}
  1399. return FALSE
  1400. }
  1401.  
  1402. method CastRandom(string spellGroup, string checkBuff=NULL)
  1403. {
  1404. if !${This.CastRandom[${spellGroup},${checkBuff}]}
  1405. {
  1406. This:Debug[RandomCast ${spellGroup} failed]
  1407. }
  1408. }
  1409.  
  1410. member canBuff(string buffName, string theGUID=NULL, string spellName=NULL)
  1411. {
  1412. if ${spellName.Equal["NULL"]}
  1413. spellName:Set[${buffName}]
  1414.  
  1415. if ${theGUID.Equal["NULL"]}
  1416. theGUID:Set[${Me.GUID}]
  1417.  
  1418. if !${Object[${theGUID}].Buff["${buffName}"](exists)} && ${Toon.canCast["${spellName}"]}
  1419. return TRUE
  1420.  
  1421. return FALSE
  1422. }
  1423.  
  1424. member ShouldConserveMana()
  1425. {
  1426. if ${Me.PctMana} > ${This.ConserveMana}
  1427. return TRUE
  1428.  
  1429. return FALSE
  1430. }
  1431.  
  1432. method debuffAll()
  1433. {
  1434. if ${Me.PctMana} < 15 || ${Me.Casting}
  1435. return
  1436.  
  1437. BuffNum:Set[1]
  1438. while ${BuffNum} < 16
  1439. {
  1440. BuffNum:Inc
  1441. if ${Target.Buff.DispelType.Equal["Magic"]} && !${Target.Buff.Harmful}
  1442. {
  1443. if ${Toon.canCast["Purge"]} && !${Me.Casting}
  1444. {
  1445. This:CustOutput["Purging a buff on ${Target}"]
  1446. Toon:CastSpell["Purge"]
  1447. return
  1448. }
  1449. }
  1450.  
  1451. if ${Me.Buff[${BuffNum}].Harmful}
  1452. {
  1453. if ${Me.Buff[${BuffNum}].DispelType.Equal["Disease"]}
  1454. {
  1455. if ${Toon.canCast["Cure Disease"]} && ${This.cureDiseaseTimer} < ${LavishScript.RunningTime}
  1456. {
  1457. This:CustOutput["Curing a disease"]
  1458. Toon:CastSpell["Cure Disease"]
  1459. This.cureDiseaseTimer:Set[${This.InSeconds[20]}]
  1460. return
  1461. }
  1462. elseif ${Toon.canCast["Disease Cleansing Totem"]} && !${This.OwnedTotemsCheck["Disease Cleansing Totem"]} && ${This.HasWaterTotem}
  1463. {
  1464. Toon:CastSpell["Disease Cleansing Totem"]
  1465. This:CustOutput["Casting Disease Cleansing Totem"]
  1466. }
  1467. }
  1468.  
  1469. if ${Me.Buff[${BuffNum}].DispelType.Equal["Poison"]}
  1470. {
  1471. if ${Toon.canCast["Cure Poison"]} && ${This.curePoisonTimer} < ${LavishScript.RunningTime}
  1472. {
  1473. This:CustOutput["Curing a poison"]
  1474. Toon:CastSpell["Cure Poison"]
  1475. This.curePoisonTimer:Set[${This.InSeconds[20]}]
  1476. return
  1477. }
  1478. elseif ${Toon.canCast["Poison Cleansing Totem"]} && !${This.OwnedTotemsCheck["Poison Cleansing Totem"]} && ${This.HasWaterTotem}
  1479. {
  1480. Toon:CastSpell["Poison Cleansing Totem"]
  1481. This:CustOutput["Casting Poison Cleansing Totem"]
  1482. }
  1483. }
  1484. }
  1485. }
  1486. return
  1487. }
  1488.  
  1489. member LootFirst()
  1490. {
  1491. if ${Me.Sitting} || ${Me.Casting}
  1492. return FALSE
  1493.  
  1494. if ${Unit[-dead,-lootable,-range 0-10](exists)}
  1495. return TRUE
  1496.  
  1497. if ${Toon.HasSkill["Skinning"]}
  1498. {
  1499. if ${Unit[-dead,-skinnable,-range 0-10](exists)} && ${Item[-inventory,"Skinning Knife"](exists)}
  1500. return TRUE
  1501. }
  1502.  
  1503. if ${LavishScript.RunningTime} <= ${State.LOOTState_Loot_Wait_Until}
  1504. return TRUE
  1505.  
  1506. return FALSE
  1507. }
  1508.  
  1509. /**************************************/
  1510. /*************Other Misc***************/
  1511.  
  1512. method CustOutput(string myMessage)
  1513. {
  1514. if ${This.Output}
  1515. UIElement[ClassGUI].FindChild[Console]:Echo["${Time.Time24}: ${myMessage}"]
  1516.  
  1517. return
  1518. }
  1519.  
  1520. /**************************************/
  1521. /***********GUI Load & Save************/
  1522.  
  1523. method SaveConfig()
  1524. {
  1525. Config:SetSetting["${RealmChar}","UsePull",${This.UsePull}]
  1526. Config:SetSetting["${RealmChar}","SpamPull",${This.SpamPull}]
  1527. Config:SetSetting["${RealmChar}","PullSpell",${This.PullSpell}]
  1528. Config:SetSetting["${RealmChar}","RestMP",${This.RestMP}]
  1529. Config:SetSetting["${RealmChar}","RestHP",${This.RestHP}]
  1530. Config:SetSetting["${RealmChar}","StandMP",${This.StandMP}]
  1531. Config:SetSetting["${RealmChar}","StandHP",${This.StandHP}]
  1532. Config:SetSetting["${RealmChar}","EarthTotem",${This.EarthTotem}]
  1533. Config:SetSetting["${RealmChar}","AirTotem",${This.AirTotem}]
  1534. Config:SetSetting["${RealmChar}","FireTotem",${This.FireTotem}]
  1535. Config:SetSetting["${RealmChar}","WaterTotem",${This.WaterTotem}]
  1536. Config:SetSetting["${RealmChar}","UseEarthElemental",${This.UseEarthElemental}]
  1537. Config:SetSetting["${RealmChar}","UseFireElemental",${This.UseFireElemental}]
  1538. Config:SetSetting["${RealmChar}","UseEarthShock",${This.UseEarthShock}]
  1539. Config:SetSetting["${RealmChar}","UseFlameShock",${This.UseFlameShock}]
  1540. Config:SetSetting["${RealmChar}","UseFrostShock",${This.UseFrostShock}]
  1541. Config:SetSetting["${RealmChar}","RandomShock",${This.RandomShock}]
  1542. Config:SetSetting["${RealmChar}","SaveShocks",${This.SaveShocks}]
  1543. Config:SetSetting["${RealmChar}","ConserveMana",${This.ConserveMana}]
  1544. Config:SetSetting["${RealmChar}","UseLBolt",${This.UseLBolt}]
  1545. Config:SetSetting["${RealmChar}","UseChainLight",${This.UseChainLight}]
  1546. Config:SetSetting["${RealmChar}","MainHand",${This.MainHand}]
  1547. Config:SetSetting["${RealmChar}","OffHand",${This.OffHand}]
  1548. Config:SetSetting["${RealmChar}","DW",${This.DW}]
  1549. Config:SetSetting["${RealmChar}","ShieldOnPull",${This.ShieldOnPull}]
  1550. Config:SetSetting["${RealmChar}","HealWave",${This.HealWave}]
  1551. Config:SetSetting["${RealmChar}","LHealWave",${This.LHealWave}]
  1552. Config:SetSetting["${RealmChar}","GOTN",${This.GOTN}]
  1553. Config:SetSetting["${RealmChar}","Output",${This.Output}]
  1554. Config:SetSetting["${RealmChar}","UseReincarnation",${This.UseReincarnation}]
  1555. Config:SetSetting["${RealmChar}","UseMPot",${This.UseMPot}]
  1556. Config:SetSetting["${RealmChar}","UseHPot",${This.UseHPot}]
  1557. Config:SetSetting["${RealmChar}","UseBandages",${This.UseBandages}]
  1558. Config:SetSetting["${RealmChar}","MPot",${This.MPot}]
  1559. Config:SetSetting["${RealmChar}","HPot",${This.HPot}]
  1560. Config:SetSetting["${RealmChar}","Bandage",${This.Bandage}]
  1561. Config:SetSetting["${RealmChar}","Shield",${This.Shield}]
  1562. Config:SetSetting["${RealmChar}","MeleeOnly",${This.MeleeOnly}]
  1563. }
  1564.  
  1565. method LoadConfig()
  1566. {
  1567. This.UsePull:Set[${Config.GetSetting["${RealmChar}","UsePull"]}]
  1568. This.SpamPull:Set[${Config.GetSetting["${RealmChar}","SpamPull"]}]
  1569. This.PullSpell:Set[${Config.GetSetting["${RealmChar}","PullSpell"]}]
  1570. This.RestMP:Set[${Config.GetSetting["${RealmChar}","RestMP"]}]
  1571. This.RestHP:Set[${Config.GetSetting["${RealmChar}","RestHP"]}]
  1572. This.StandMP:Set[${Config.GetSetting["${RealmChar}","StandMP"]}]
  1573. This.StandHP:Set[${Config.GetSetting["${RealmChar}","StandHP"]}]
  1574. This.EarthTotem:Set[${Config.GetSetting["${RealmChar}","EarthTotem"]}]
  1575. This.AirTotem:Set[${Config.GetSetting["${RealmChar}","AirTotem"]}]
  1576. This.WaterTotem:Set[${Config.GetSetting["${RealmChar}","WaterTotem"]}]
  1577. This.FireTotem:Set[${Config.GetSetting["${RealmChar}","FireTotem"]}]
  1578. This.UseEarthElemental:Set[${Config.GetSetting["${RealmChar}","UseEarthElemental"]}]
  1579. This.UseFireElemental:Set[${Config.GetSetting["${RealmChar}","UseFireElemental"]}]
  1580. This.UseEarthShock:Set[${Config.GetSetting["${RealmChar}","UseEarthShock"]}]
  1581. This.UseFlameShock:Set[${Config.GetSetting["${RealmChar}","UseFlameShock"]}]
  1582. This.UseFrostShock:Set[${Config.GetSetting["${RealmChar}","UseFrostShock"]}]
  1583. This.RandomShock:Set[${Config.GetSetting["${RealmChar}","RandomShock"]}]
  1584. This.SaveShocks:Set[${Config.GetSetting["${RealmChar}","SaveShocks"]}]
  1585. This.ConserveMana:Set[${Config.GetSetting["${RealmChar}","ConserveMana"]}]
  1586. This.UseLBolt:Set[${Config.GetSetting["${RealmChar}","UseLBolt"]}]
  1587. This.UseChainLight:Set[${Config.GetSetting["${RealmChar}","UseChainLight"]}]
  1588. This.MainHand:Set[${Config.GetSetting["${RealmChar}","MainHand"]}]
  1589. This.OffHand:Set[${Config.GetSetting["${RealmChar}","OffHand"]}]
  1590. This.DW:Set[${Config.GetSetting["${RealmChar}","DW"]}]
  1591. This.ShieldOnPull:Set[${Config.GetSetting["${RealmChar}","ShieldOnPull"]}]
  1592. This.HealWave:Set[${Config.GetSetting["${RealmChar}","HealWave"]}]
  1593. This.LHealWave:Set[${Config.GetSetting["${RealmChar}","LHealWave"]}]
  1594. This.GOTN:Set[${Config.GetSetting["${RealmChar}","GOTN"]}]
  1595. This.Output:Set[${Config.GetSetting["${RealmChar}","Output"]}]
  1596. This.UseReincarnation:Set[${Config.GetSetting["${RealmChar}","UseReincarnation"]}]
  1597. This.UseMPot:Set[${Config.GetSetting["${RealmChar}","UseMPot"]}]
  1598. This.UseHPot:Set[${Config.GetSetting["${RealmChar}","UseHPot"]}]
  1599. This.UseBandages:Set[${Config.GetSetting["${RealmChar}","UseBandages"]}]
  1600. This.MPot:Set[${Config.GetSetting["${RealmChar}","MPot"]}]
  1601. This.HPot:Set[${Config.GetSetting["${RealmChar}","HPot"]}]
  1602. This.Bandage:Set[${Config.GetSetting["${RealmChar}","Bandage"]}]
  1603. This.Shield:Set[${Config.GetSetting["${RealmChar}","Shield"]}]
  1604. This.MeleeOnly:Set[${Config.GetSetting["${RealmChar}","MeleeOnly"]}]
  1605. }
  1606.  
  1607. method InitShamanGUI()
  1608. {
  1609. if ${This.UsePull}
  1610. UIElement[UsePull@Main@Pages@ClassGUI]:SetChecked
  1611.  
  1612. if ${This.SpamPull}
  1613. UIElement[SpamPull@Main@Pages@ClassGUI]:SetChecked
  1614.  
  1615. if ${This.UseReincarnation}
  1616. UIElement[UseReincarnation@Main@Pages@ClassGUI]:SetChecked
  1617.  
  1618. if ${This.UseMPot}
  1619. UIElement[UseMPot@Main@Pages@ClassGUI]:SetChecked
  1620.  
  1621. if ${This.UseHPot}
  1622. UIElement[UseHPot@Main@Pages@ClassGUI]:SetChecked
  1623.  
  1624. if ${This.UseBandages}
  1625. UIElement[UseBandages@Main@Pages@ClassGUI]:SetChecked
  1626.  
  1627. if ${This.MeleeOnly}
  1628. UIElement[MeleeOnly@Main@Pages@ClassGUI]:SetChecked
  1629.  
  1630. if ${This.UseEarthElemental}
  1631. UIElement[EarthElemental@Totems@Pages@ClassGUI]:SetChecked
  1632.  
  1633. if ${This.UseFireElemental}
  1634. UIElement[FireElemental@Totems@Pages@ClassGUI]:SetChecked
  1635.  
  1636. if ${This.UseEarthShock}
  1637. UIElement[EarthShock@Spells@Pages@ClassGUI]:SetChecked
  1638.  
  1639. if ${This.UseFlameShock}
  1640. UIElement[FlameShock@Spells@Pages@ClassGUI]:SetChecked
  1641.  
  1642. if ${This.UseFrostShock}
  1643. UIElement[FrostShock@Spells@Pages@ClassGUI]:SetChecked
  1644.  
  1645. if ${This.RandomShock}
  1646. UIElement[RandomShock@Spells@Pages@ClassGUI]:SetChecked
  1647.  
  1648. if ${This.SaveShocks}
  1649. UIElement[SaveShocks@Spells@Pages@ClassGUI]:SetChecked
  1650.  
  1651. if ${This.UseLBolt}
  1652. UIElement[LightBolt@Spells@Pages@ClassGUI]:SetChecked
  1653.  
  1654. if ${This.UseChainLight}
  1655. UIElement[UseChainLight@Spells@Pages@ClassGUI]:SetChecked
  1656.  
  1657. if ${This.DW}
  1658. UIElement[DW@Buffs@Pages@ClassGUI]:SetChecked
  1659.  
  1660. if ${This.ShieldOnPull}
  1661. UIElement[ShieldOnPull@Buffs@Pages@ClassGUI]:SetChecked
  1662.  
  1663. if ${This.Output}
  1664. UIElement[EnableOutput@Other@Pages@ClassGUI]:SetChecked
  1665.  
  1666. variable int i = 1
  1667.  
  1668. for (i:Set[1] ; ${i} <= ${UIElement[PullSpell@Main@Pages@ClassGUI].Items} ; i:Inc)
  1669. {
  1670. if ${This.PullSpell.Equal["${UIElement[PullSpell@Main@Pages@ClassGUI].Item[${i}].Text}"]}
  1671. UIElement[PullSpell@Main@Pages@ClassGUI]:SelectItem[${i}]
  1672. }
  1673.  
  1674. for (i:Set[1] ; ${i} <= ${UIElement[EarthTotem@Totems@Pages@ClassGUI].Items} ; i:Inc)
  1675. {
  1676. if ${This.EarthTotem.Equal["${UIElement[EarthTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]}
  1677. UIElement[EarthTotem@Totems@Pages@ClassGUI]:SelectItem[${i}]
  1678. }
  1679.  
  1680. for (i:Set[1] ; ${i} <= ${UIElement[WaterTotem@Totems@Pages@ClassGUI].Items} ; i:Inc)
  1681. {
  1682. if ${This.WaterTotem.Equal["${UIElement[WaterTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]}
  1683. UIElement[WaterTotem@Totems@Pages@ClassGUI]:SelectItem[${i}]
  1684. }
  1685.  
  1686. for (i:Set[1] ; ${i} <= ${UIElement[FireTotem@Totems@Pages@ClassGUI].Items} ; i:Inc)
  1687. {
  1688. if ${This.FireTotem.Equal["${UIElement[FireTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]}
  1689. UIElement[FireTotem@Totems@Pages@ClassGUI]:SelectItem[${i}]
  1690. }
  1691.  
  1692. for (i:Set[1] ; ${i} <= ${UIElement[AirTotem@Totems@Pages@ClassGUI].Items} ; i:Inc)
  1693. {
  1694. if ${This.AirTotem.Equal["${UIElement[AirTotem@Totems@Pages@ClassGUI].Item[${i}].Text}"]}
  1695. UIElement[AirTotem@Totems@Pages@ClassGUI]:SelectItem[${i}]
  1696. }
  1697.  
  1698. for (i:Set[1] ; ${i} <= ${UIElement[MainHand@Buffs@Pages@ClassGUI].Items} ; i:Inc)
  1699. {
  1700. if ${This.MainHand.Equal["${UIElement[MainHand@Buffs@Pages@ClassGUI].Item[${i}].Text}"]}
  1701. UIElement[MainHand@Buffs@Pages@ClassGUI]:SelectItem[${i}]
  1702. }
  1703.  
  1704. for (i:Set[1] ; ${i} <= ${UIElement[OffHand@Buffs@Pages@ClassGUI].Items} ; i:Inc)
  1705. {
  1706. if ${This.OffHand.Equal["${UIElement[OffHand@Buffs@Pages@ClassGUI].Item[${i}].Text}"]}
  1707. UIElement[OffHand@Buffs@Pages@ClassGUI]:SelectItem[${i}]
  1708. }
  1709.  
  1710. for (i:Set[1] ; ${i} <= ${UIElement[Shield@Buffs@Pages@ClassGUI].Items} ; i:Inc)
  1711. {
  1712. if ${This.Shield.Equal["${UIElement[Shield@Buffs@Pages@ClassGUI].Item[${i}].Text}"]}
  1713. UIElement[Shield@Buffs@Pages@ClassGUI]:SelectItem[${i}]
  1714. }
  1715.  
  1716. if ${This.RestMP} != ${UIElement[RestMP@Main@Pages@ClassGUI].Value}
  1717. UIElement[RestMP@Main@Pages@ClassGUI]:SetValue[${This.RestMP}]
  1718.  
  1719. if ${This.RestHP} != ${UIElement[RestHP@Main@Pages@ClassGUI].Value}
  1720. UIElement[RestHP@Main@Pages@ClassGUI]:SetValue[${This.RestHP}]
  1721.  
  1722. if ${This.StandMP} != ${UIElement[StandMP@Main@Pages@ClassGUI].Value}
  1723. UIElement[StandMP@Main@Pages@ClassGUI]:SetValue[${This.StandMP}]
  1724.  
  1725. if ${This.StandHP} != ${UIElement[StandHP@Main@Pages@ClassGUI].Value}
  1726. UIElement[StandHP@Main@Pages@ClassGUI]:SetValue[${This.StandHP}]
  1727.  
  1728. if ${This.ConserveMana} != ${UIElement[ConserveMana@Main@Pages@ClassGUI].Value}
  1729. UIElement[ConserveMana@Main@Pages@ClassGUI]:SetValue[${This.ConserveMana}]
  1730.  
  1731. if ${This.MPot} != ${UIElement[MPot@Main@Pages@ClassGUI].Value}
  1732. UIElement[MPot@Main@Pages@ClassGUI]:SetValue[${This.MPot}]
  1733.  
  1734. if ${This.HPot} != ${UIElement[HPot@Main@Pages@ClassGUI].Value}
  1735. UIElement[HPot@Main@Pages@ClassGUI]:SetValue[${This.HPot}]
  1736.  
  1737. if ${This.Bandage} != ${UIElement[Bandage@Main@Pages@ClassGUI].Value}
  1738. UIElement[Bandage@Main@Pages@ClassGUI]:SetValue[${This.Bandage}]
  1739.  
  1740. if ${This.HealWave} != ${UIElement[HealWave@Heals@Pages@ClassGUI].Value}
  1741. UIElement[HealWave@Heals@Pages@ClassGUI]:SetValue[${This.HealWave}]
  1742.  
  1743. if ${This.LHealWave} != ${UIElement[LHealWave@Heals@Pages@ClassGUI].Value}
  1744. UIElement[LHealWave@Heals@Pages@ClassGUI]:SetValue[${This.LHealWave}]
  1745.  
  1746. if ${This.GOTN} != ${UIElement[GOTN@Heals@Pages@ClassGUI].Value}
  1747. UIElement[GOTN@Heals@Pages@ClassGUI]:SetValue[${This.GOTN}]
  1748.  
  1749. }
  1750.  
  1751. method ClassGUIChange(string Action)
  1752. {
  1753. switch ${Action}
  1754. {
  1755. case PullSpell
  1756. if ${UIElement[PullSpell@Main@Pages@ClassGUI].SelectedItem.Value(exists)}
  1757. This.PullSpell:Set[${UIElement[PullSpell@Main@Pages@ClassGUI].SelectedItem}]
  1758. break
  1759.  
  1760. case EarthTotem
  1761. if ${UIElement[EarthTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)}
  1762. This.EarthTotem:Set[${UIElement[EarthTotem@Totems@Pages@ClassGUI].SelectedItem}]
  1763. break
  1764.  
  1765. case FireTotem
  1766. if ${UIElement[FireTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)}
  1767. This.FireTotem:Set[${UIElement[FireTotem@Totems@Pages@ClassGUI].SelectedItem}]
  1768. break
  1769.  
  1770. case AirTotem
  1771. if ${UIElement[AirTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)}
  1772. This.AirTotem:Set[${UIElement[AirTotem@Totems@Pages@ClassGUI].SelectedItem}]
  1773. break
  1774.  
  1775. case WaterTotem
  1776. if ${UIElement[WaterTotem@Totems@Pages@ClassGUI].SelectedItem.Value(exists)}
  1777. This.WaterTotem:Set[${UIElement[WaterTotem@Totems@Pages@ClassGUI].SelectedItem}]
  1778. break
  1779.  
  1780. case MainHand
  1781. if ${UIElement[MainHand@Buffs@Pages@ClassGUI].SelectedItem.Value(exists)}
  1782. This.MainHand:Set[${UIElement[MainHand@Buffs@Pages@ClassGUI].SelectedItem}]
  1783. break
  1784.  
  1785. case OffHand
  1786. if ${UIElement[OffHand@Buffs@Pages@ClassGUI].SelectedItem.Value(exists)}
  1787. This.OffHand:Set[${UIElement[OffHand@Buffs@Pages@ClassGUI].SelectedItem}]
  1788. break
  1789.  
  1790. case Shield
  1791. if ${UIElement[Shield@Buffs@Pages@ClassGUI].SelectedItem.Value(exists)}
  1792. This.Shield:Set[${UIElement[Shield@Buffs@Pages@ClassGUI].SelectedItem}]
  1793. break
  1794.  
  1795. /* checkboxes */
  1796.  
  1797. case UsePull
  1798. if ${UIElement[UsePull@Main@Pages@ClassGUI].Checked}
  1799. This.UsePull:Set[TRUE]
  1800.  
  1801. if !${UIElement[UsePull@Main@Pages@ClassGUI].Checked}
  1802. This.UsePull:Set[FALSE]
  1803. break
  1804.  
  1805. case SpamPull
  1806. if ${UIElement[SpamPull@Main@Pages@ClassGUI].Checked}
  1807. This.SpamPull:Set[TRUE]
  1808.  
  1809. if !${UIElement[SpamPull@Main@Pages@ClassGUI].Checked}
  1810. This.SpamPull:Set[FALSE]
  1811. break
  1812.  
  1813. case UseReincarnation
  1814. if ${UIElement[UseReincarnation@Main@Pages@ClassGUI].Checked}
  1815. This.UseReincarnation:Set[TRUE]
  1816.  
  1817. if !${UIElement[UseReincarnation@Main@Pages@ClassGUI].Checked}
  1818. This.UseReincarnation:Set[FALSE]
  1819. break
  1820.  
  1821. case UseHPot
  1822. if ${UIElement[UseHPot@Main@Pages@ClassGUI].Checked}
  1823. This.UseHPot:Set[TRUE]
  1824.  
  1825. if !${UIElement[UseHPot@Main@Pages@ClassGUI].Checked}
  1826. This.UseHPot:Set[FALSE]
  1827. break
  1828.  
  1829. case UseMPot
  1830. if ${UIElement[UseMPot@Main@Pages@ClassGUI].Checked}
  1831. This.UseMPot:Set[TRUE]
  1832.  
  1833. if !${UIElement[UseMPot@Main@Pages@ClassGUI].Checked}
  1834. This.UseMPot:Set[FALSE]
  1835. break
  1836.  
  1837. case UseBandages
  1838. if ${UIElement[UseBandages@Main@Pages@ClassGUI].Checked}
  1839. This.UseBandages:Set[TRUE]
  1840.  
  1841. if !${UIElement[UseBandages@Main@Pages@ClassGUI].Checked}
  1842. This.UseBandages:Set[FALSE]
  1843. break
  1844.  
  1845. case MeleeOnly
  1846. if ${UIElement[MeleeOnly@Main@Pages@ClassGUI].Checked}
  1847. This.MeleeOnly:Set[TRUE]
  1848.  
  1849. if !${UIElement[MeleeOnly@Main@Pages@ClassGUI].Checked}
  1850. This.MeleeOnly:Set[FALSE]
  1851. break
  1852.  
  1853. case EarthElemental
  1854. if ${UIElement[EarthElemental@Totems@Pages@ClassGUI].Checked}
  1855. This.UseEarthElemental:Set[TRUE]
  1856.  
  1857. if !${UIElement[EarthElemental@Totems@Pages@ClassGUI].Checked}
  1858. This.UseEarthElemental:Set[FALSE]
  1859. break
  1860.  
  1861. case FireElemental
  1862. if ${UIElement[FireElemental@Totems@Pages@ClassGUI].Checked}
  1863. This.UseFireElemental:Set[TRUE]
  1864.  
  1865. if !${UIElement[FireElemental@Totems@Pages@ClassGUI].Checked}
  1866. This.UseFireElemental:Set[FALSE]
  1867. break
  1868.  
  1869. case FlameShock
  1870. if ${UIElement[FlameShock@Spells@Pages@ClassGUI].Checked}
  1871. This.UseFlameShock:Set[TRUE]
  1872.  
  1873. if !${UIElement[FlameShock@Spells@Pages@ClassGUI].Checked}
  1874. This.UseFlameShock:Set[FALSE]
  1875. break
  1876.  
  1877. case EarthShock
  1878. if ${UIElement[EarthShock@Spells@Pages@ClassGUI].Checked}
  1879. This.UseEarthShock:Set[TRUE]
  1880.  
  1881. if !${UIElement[EarthShock@Spells@Pages@ClassGUI].Checked}
  1882. This.UseEarthShock:Set[FALSE]
  1883. break
  1884.  
  1885. case FrostShock
  1886. if ${UIElement[FrostShock@Spells@Pages@ClassGUI].Checked}
  1887. This.UseFrostShock:Set[TRUE]
  1888.  
  1889. if !${UIElement[FrostShock@Spells@Pages@ClassGUI].Checked}
  1890. This.UseFrostShock:Set[FALSE]
  1891. break
  1892.  
  1893. case RandomShock
  1894. if ${UIElement[RandomShock@Spells@Pages@ClassGUI].Checked}
  1895. This.RandomShock:Set[TRUE]
  1896.  
  1897. if !${UIElement[RandomShock@Spells@Pages@ClassGUI].Checked}
  1898. This.RandomShock:Set[FALSE]
  1899. break
  1900.  
  1901. case SaveShocks
  1902. if ${UIElement[SaveShocks@Spells@Pages@ClassGUI].Checked}
  1903. This.SaveShocks:Set[TRUE]
  1904.  
  1905. if !${UIElement[SaveShocks@Spells@Pages@ClassGUI].Checked}
  1906. This.SaveShocks:Set[FALSE]
  1907. break
  1908.  
  1909. case UseLBolt
  1910. if ${UIElement[LightBolt@Spells@Pages@ClassGUI].Checked}
  1911. This.UseLBolt:Set[TRUE]
  1912.  
  1913. if !${UIElement[LightBolt@Spells@Pages@ClassGUI].Checked}
  1914. This.UseLBolt:Set[FALSE]
  1915. break
  1916.  
  1917. case UseChainLight
  1918. if ${UIElement[UseChainLight@Spells@Pages@ClassGUI].Checked}
  1919. This.UseChainLight:Set[TRUE]
  1920.  
  1921. if !${UIElement[UseChainLight@Spells@Pages@ClassGUI].Checked}
  1922. This.UseChainLight:Set[FALSE]
  1923. break
  1924.  
  1925. case DW
  1926. if ${UIElement[DW@Buffs@Pages@ClassGUI].Checked}
  1927. This.DW:Set[TRUE]
  1928.  
  1929. if !${UIElement[DW@Buffs@Pages@ClassGUI].Checked}
  1930. This.DW:Set[FALSE]
  1931. break
  1932.  
  1933. case ShieldOnPull
  1934. if ${UIElement[ShieldOnPull@Buffs@Pages@ClassGUI].Checked}
  1935. This.ShieldOnPull:Set[TRUE]
  1936.  
  1937. if !${UIElement[ShieldOnPull@Buffs@Pages@ClassGUI].Checked}
  1938. This.ShieldOnPull:Set[FALSE]
  1939. break
  1940.  
  1941. case EnableOutput
  1942. if ${UIElement[EnableOutput@Other@Pages@ClassGUI].Checked}
  1943. This.Output:Set[TRUE]
  1944.  
  1945. if !${UIElement[EnableOutput@Other@Pages@ClassGUI].Checked}
  1946. This.Output:Set[FALSE]
  1947. break
  1948.  
  1949. /* sliders */
  1950.  
  1951. case RestMP
  1952. if ${UIElement[RestMP@Main@Pages@ClassGUI].Value(exists)}
  1953. This.RestMP:Set[${UIElement[RestMP@Main@Pages@ClassGUI].Value}]
  1954. break
  1955.  
  1956. case RestHP
  1957. if ${UIElement[RestHP@Main@Pages@ClassGUI].Value(exists)}
  1958. This.RestHP:Set[${UIElement[RestHP@Main@Pages@ClassGUI].Value}]
  1959. break
  1960.  
  1961. case StandHP
  1962. if ${UIElement[StandHP@Main@Pages@ClassGUI].Value(exists)}
  1963. This.StandHP:Set[${UIElement[StandHP@Main@Pages@ClassGUI].Value}]
  1964. break
  1965.  
  1966. case StandMP
  1967. if ${UIElement[StandMP@Main@Pages@ClassGUI].Value(exists)}
  1968. This.StandMP:Set[${UIElement[StandMP@Main@Pages@ClassGUI].Value}]
  1969. break
  1970.  
  1971. case ConserveMana
  1972. if ${UIElement[ConserveMana@Main@Pages@ClassGUI].Value(exists)}
  1973. This.ConserveMana:Set[${UIElement[ConserveMana@Main@Pages@ClassGUI].Value}]
  1974. break
  1975.  
  1976. case MPot
  1977. if ${UIElement[MPot@Main@Pages@ClassGUI].Value(exists)}
  1978. This.MPot:Set[${UIElement[MPot@Main@Pages@ClassGUI].Value}]
  1979. break
  1980.  
  1981. case HPot
  1982. if ${UIElement[HPot@Main@Pages@ClassGUI].Value(exists)}
  1983. This.HPot:Set[${UIElement[HPot@Main@Pages@ClassGUI].Value}]
  1984. break
  1985.  
  1986. case Bandage
  1987. if ${UIElement[Bandage@Main@Pages@ClassGUI].Value(exists)}
  1988. This.Bandage:Set[${UIElement[Bandage@Main@Pages@ClassGUI].Value}]
  1989. break
  1990.  
  1991. case HealWave
  1992. if ${UIElement[HealWave@Heals@Pages@ClassGUI].Value(exists)}
  1993. This.HealWave:Set[${UIElement[HealWave@Heals@Pages@ClassGUI].Value}]
  1994. break
  1995.  
  1996. case LHealWave
  1997. if ${UIElement[LHealWave@Heals@Pages@ClassGUI].Value(exists)}
  1998. This.LHealWave:Set[${UIElement[LHealWave@Heals@Pages@ClassGUI].Value}]
  1999. break
  2000.  
  2001. case GOTN
  2002. if ${UIElement[GOTN@Heals@Pages@ClassGUI].Value(exists)}
  2003. This.GOTN:Set[${UIElement[GOTN@Heals@Pages@ClassGUI].Value}]
  2004. break
  2005. }
  2006. }
  2007. }
  2008.