;Stealthy's Mage Routine ;Debugging/Testing Stages 0.34 ;Current status: Stable, 95% bug free (the way to be!) ;Designed for use with WoWBot 15b. ;Conjuring/eating/drinking borrowed from EQJoe, can't get much better than how he has it. ;notes: work on hilly targeting, add use of scrolls (Scroll of Stamina, etc) ;notes: Totem code, add code to deal with pets (NPC warlocks, hunters) ;notes: finish combat (currently works, just not all there), finish HP test, finish a lot of things ;Working on now: AoEing/Polymorphing/add handling, not pulling an entire group. ;Up next: Running from dead target bug, fixing loot issues (if any exist), buff issue, track downtime FPS drop ; : refixing the 0 xp/h bug which keeps resurfacing ;notes: 0xp/h bug seems to trigger on death. Left off - working on polymorph, making it not pull groups of 3+ ;History: 0.34, Debugging conversion, fixing a few old bugs in the process. Yippee. ;History: 0.33, Started conversion to pulse-style format. ;History: 0.32, Squashed a nasty bug with downtime/buffs wanting to loop eachother, did some work on aggro handling ;History: 0.31, Added water elemental code, more work on polymorphing, this time for pulls. ;History: 0.30, Fixed the polymorph then pull sheep bug. Whole polymorphing thing still needs some debugging. ;History: 0.29, Some debugging, using managems should now work, arc missiles/other clearcast spells conflict fixed, upped detect range on getsafespot, same on pullmobs ;History: 0.28, Did a lot of work on aggro handling, much higher chance of survival now. Still does weird things. ;History: 0.27, Buffs seem fixed. Run from dead target semi fixed, can't find that dam FPS drop. Added base CC code. ;History: 0.26, Finished adding the immunechecks and damagechecks. ;History: 0.25, Fixed a couple bugs with GetSafeSpot, it now works correctly. XP/H counter fixed, manastone function added. ;History: 0.24, Fixed run to bum fuck egypt bug, fixed a minor pull issue and a few typos ;History: 0.23, Pull bug fixed. Will no longer try to spam pull until too close. ;History: 0.22, Many bugs ironed out, quite stable although incomplete. Safe to use when not around water. ;History: 0.21, somewhat works, quite buggy. Too long a list. ;Credits: EQJoe - Mage eat/drink/summon code. b7731 - Water Elemental code. #define ROUTINES #define DEBUG function Attack(string AttackGUID) { ;These need to be set. ;frostspec - if you're frost spec, set this to true. declare frostspec bool global FALSE ;Pyropull - if you want to pull with pyroblast, set to true. Else, whatever for your spec. declare Pyropull bool global TRUE ;ArcMissileTalent - if you have 5/5 Imp Arc Missiles, set this true. declare ArcMissileTalent bool global TRUE ;UseFlamestrike - allow use of Flamestrike in multimob situations. declare UseFlamestrike bool global TRUE ;UseBlizzard - allow use of Blizzard in multimob situations. This will burn mana quick, but can be fun. declare UseBlizzard bool global FALSE ;UseCoC - allow use of Cone of Cold in multimob situations. declare UseCoC bool global TRUE ;ElementalPull - Pull with water elemental's freeze, if you have it. declare ElementalPull bool global FALSE ;UseAoEMultiMob - use AoEs at all in multimob situations. declare UseAoEMultiMob bool global TRUE ;don't touch these, they're autoset ;seriously ,don't touch 'em declare HavePulled bool global declare UseFrostWard bool global declare UseFireWard bool global declare Immune-Frost bool global declare Immune-Fire bool global declare Dampen bool global declare RangedMode bool local declare hastarget bool global declare testx float global declare testy float global declare safex1 float global declare safey1 float global declare angle float global declare NoSafeSpot bool global declare testfail int global declare Adds1 guidlist global declare AoEs1 guidlist global declare Mobs guidlist global declare Pullmobs guidlist global declare angle2 float global declare bandages string global declare Adds2 guidlist global declare Adds3 guidlist global declare CCing bool global declare PetSent bool global declare SavedTarget1 string global declare SavedTarget2 string global declare CrowdControlDone bool global SavedWaypointX:Set[${Me.X}] SavedWaypointY:Set[${Me.Y}] ;If I'm dead, update stats and do what's needed. if ${Me.Dead} { #ifdef DEBUG call Debug "Updating Status" #endif call UpdateStats } if ${Me.Sitting} { wowpress SITORSTAND } echo "${AttackGUID} - AttackGUID" if ${AttackGUID[NULL]}||${AttackGUID.Equal[NOTARGET]} { call UpdateHudStatus "No Target." Return } ;Call code to handle elites if needed. if ${Unit[${AttackGUID}].Classification.Equal[Elite]} { call Elites ${AttackGUID} } ;If we've got a dead target, do nothing. if ${Unit[${AttackGUID}].Dead} || !${Unit[${AttackGUID}](exists)} { call FindTarget } ;If I'm not close enough, call the code to get closer if ${Unit[${AttackGUID}].Distance}>${PullingRange}&&!${HavePulled} { call GetCloser ${AttackGUID} ${PullingRange} } ;Do my combat prep. if !${HavePulled} && !${Me.InCombat} { call CombatPrep } ;If I'm close enough and haven't pulled, pull. Pullchecks and how to pull will be handled ; in the pull function. if ${Unit[${AttackGUID}].Distance}<${PullingRange}&&!${HavePulled} { call Pull ${AttackGUID} } ;If mob's in pull range and is pulled, combat prep (downtime if needed) and nuke. If this ; was the last pulse, skip the combat prep because it's already done, and start the nuking. if ${Unit[${AttackGUID}].Distance}<${PullingRange}&&${HavePulled} { call Nuke ${AttackGUID} } ;If my target's dead or doesn't exist and I'm still in combat, call aggrokill - will check for aggros and respond accordingly. if (${Unit[${AttackGUID}].Dead}||!${Unit[${AttackGUID}](exists)}) && ${Me.InCombat} { call AggroKill } ;If target's dead and I'm not in combat, see if I need downtime. if ${Unit[${AttackGUID}].Dead} && !${Me.InCombat} { call DowntimeCheck } } function Elites(string AttackGUID) { if !${Me.InCombat} { call UpdateHudStatus "Target is an elite, don't bother attacking them" GUIDBlacklist:Set[${AttackGUID},AVOID] TargetGUID:Set[NOTARGET] Return } else { call UpdateHudStatus "Aggrod an elite RUN after we sheep!!" if !${Spell[Polymorph].Cooldown}&&${Spell[Polymorph](exists)} { call CastSpell Polymorph ${AttackGUID} } ; RLG:Set[TRUE] GUIDBlacklist:Set[${AttackGUID},AVOID] TargetGUID:Set[NOTARGET] Return } } function GetCloser(string AttackGUID,int distance1) { if ${Unit[${AttackGUID}].Distance}>${distance1} { do { move forward } while ${Unit[${AttackGUID}].Distance}>${distance1} && !${HavePulled} && !${HaveAggroed} } } function Pull(string AttackGUID) { if !${HavePulled} && !${Unit[${AttackGUID}].Dead} { if !${Target(exists)} { Target ${AttackGUID} } echo "x ${Unit[${AttackGUID}].X} y ${Unit[${AttackGUID}].Y}" face -fast ${Unit[${AttackGUID}].X} ${Unit[${AttackGUID}].Y} call CheckFacing move -stop wait 5 echo "Pulling" ;Attach atom for pullcheck Event[UNIT_SPELLCAST_SUCCEEDED]:AttachAtom[pullcheck] ;Check for what spell would be best to pull with and use it. ;If you're a frosty with an elemental, freezepull. Optional. do { if ${frostspec} && ${ElementalPull} && ${Me.Pet(exists)} && !${HavePulled} { echo "Elemental pulling" call UpdateHudStatus "Pulling with elemental freeze" wowpress BONUSACTIONBUTTON5 wait 5 ISXWoW:ClickTerrain[${Me.Target.X}, ${Me.Target.Y}, ${Me.Target.Z}] PetSent:Set[TRUE] HavePulled:Set[TRUE] } ;If you're fire and got pyro, use it. if !${frostspec} && ${Pyropull} && ${Spell["Pyroblast"](exists)} && !${Immune-Fire} && !${HavePulled} { echo "pyroblast pulling" call UpdateHudStatus "Pulling with Pyroblast" call CastSpell "Pyroblast" ${AttackGUID} HavePulled:Set[TRUE] echo "${HavePulled} pulled" } ;Pull with a fireball if pyro doesn't exist if !${frostspec} && (!${Spell["Pyroblast"](exists)}||!${Pyropull}) && !${Immune-Fire} && !${HavePulled} { echo "fireball pulling" call UpdateHudStatus "Pulling with Fireball" call CastSpell "Fireball" ${AttackGUID} HavePulled:Set[TRUE] echo "${HavePulled} pulled" } ;Frost spec? Frostbolt! if ${frostspec} && !${Immune-Frost} && !${HavePulled} { echo "Frostbolt pulling" call UpdateHudStatus "Pulling with Frostbolt" call CastSpell "Frostbolt" ${AttackGUID} HavePulled:Set[TRUE] } ;If you're a frosty and it's frost immune, you can't exactly frostbolt it... if ${frostspec} && ${Immune-Frost} && !${HavePulled} { echo "firebolt pulling - frost immune" call UpdateHudStatus "Pulling with Fireball" call CastSpell "Fireball" ${AttackGUID} HavePulled:Set[TRUE] } ;Likewise, if you're fire and it's fire immune, can't use fire. if !${frostspec} && ${Immune-Fire} && !${HavePulled} { echo "Frostbolt pulling - fire immune" call UpdateHudStatus "Pulling with Frostbolt" call CastSpell "Frostbolt" ${AttackGUID} HavePulled:Set[TRUE] } } while !${HaveAggroed} && !${HavePulled} } } function Nuke(string AttackGUID) { if ${${AttackGUID}.Find[NULL]} { DoDowntime:Set[TRUE] } do { if ${Unit[${AttackGUID}].Distance}>30 { call Getcloser ${AttackGUID} 30 } if (${HavePulled}&&${Unit[${AttackGUID}].Distance}<=30)||${HaveAggroed} { if ${HavePulled} && !${CrowdControlDone} { PullCrowdControl:Set[TRUE] } if !${HavePulled} && !${CrowdControlDone} { AggroCrowdControl:Set[TRUE] } call CrowdControlCheck ${AttackGUID} ;If you've got AoEs allowed (multiple mob situations), they'll do their check. if ${UseAoEMultimob} { call AoECheck ${AttackGUID} } ;A long wand check done with our HP in mind. if (${Unit[${AttackGUID}].PctHPs}<=7.5&&${Me.PctHPs}>=15)||(${Unit[${AttackGUID}].Buff["Ignite"](exists)}&&${Unit[${AttackGUID}].PctHPs}<=10&&${Me.PctHPs}>=15) { echo "${Unit[${AttackGUID}].PctHPs} HP Pct, wanding." call UpdateHudStatus "Wanding" call CastSpell "Shoot" ${AttackGUID} } ;A scorch check, for mana efficiency. if (${Unit[${AttackGUID}].PctHPs}<=12.5&&${Me.PctHPs}>=15&&${Spell["Scorch"](exists)}||(${Unit[${AttackGUID}].Buff["Ignite"](exists)}&&${Unit[${AttackGUID}].PctHPs}<=17.5&&${Me.PctHPs}>=20&&${Spell["Scorch"](exists)} { echo "${Unit[${AttackGUID}].PctHPs} HP Pct, scorching." call UpdateHudStatus "Casting Scorch" call CastSpell "Scorch" ${AttackGUID} } ;Counterspell. if ${Unit[${AttackGUID}].Casting(exists)} && ${Spell["Counterspell"](exists)} && !${Spell["Counterspell"].Cooldown} { if ${Unit[${AttackGUID}].Distance}>30 { echo "Too far to counterspell" do { move forward waitframe } while ${Unit[${AttackGUID}].Distance}>30 } echo "Counterspelling" call UpdateHudStatus "Casting Counterspell" call CastSpell "Counterspell" ${AttackGUID} ;It's obviously tried to cast, so flip the DampenMagic flag DampenMagic:Set[TRUE] } ;If we have clearcast, use it well. If you're not 5/5 arc missiles, it'll be used for whatever. if ${Me.Buff["Clearcasting"](exists)} && ${ArcMissileTalent} { echo "Clearcasting, Arcane Missiles." call CastSpell "Arcane Missiles" ${AttackGUID} } ;Same goes for Arc Power/Presence of Mind. if ${Spell["Arcane Power"](exists)} && !${Spell["Arcane Power"].Cooldown} && ${Me.PctMana}>=45 { echo "Arcane Power" call CastSpell "Arcane Power" ${Me.GUID} } if ${Spell["Presence of Mind"](exists)} && !${Spell["Presence of Mind"].Cooldown} { echo "Presence of Mind" call PresenceOfMindAttackSet ${AttackGUID} } ;If mob's frozen, we're going to want to icelance it... if we have Ice Lance. if (${Unit[${AttackGUID}].Buff["Frostbite"](exists)}||${Unit[${AttackGUID}].Buff["Frozen"](exists)})&&${Spell["Ice Lance"](exists)} { echo "${AttackGUID} Frozen or Frostbite'd, Ice Lancing." call UpdateHudStatus "Casting Ice Lance" call CastSpell "Ice Lance" ${AttackGUID} } ;Use Fireblast if we can. if ${Spell["Fireblast"](exists)}&&!${Spell["Fireblast"].Cooldown}&&${Unit[${AttackGUID}].Distance}<=20 { echo "${Unit[${AttackGUID}].Distance} Distance, Fireblasting." call UpdateHudStatus "Casting Fireblast" call CastSpell "Fireblast" ${AttackGUID} } ;Get away if the mob's close. if ${Unit[${AttackGUID}].Distance}<=5&&${Unit[${AttackGUID}].PctHPs}>=7.5 { echo "${Unit[${AttackGUID}].Distance} Distance, Frost Nova Attack Set." call FrostNovaAttackSet ${AttackGUID} ;Do our in-combat health checks. call HealthChecks ${AttackGUID} } ;Now for the rest of the nukes - Spamming fireball/frostbolt, blastwave and cone of cold if you allow. if ${Unit[${AttackGUID}].Distance}<=30 && !${Unit[${AttackGUID}].Dead} && ${Unit[${AttackGUID}].PctHPs}>12.5 { echo "Plain 'ole nukes." call Nukes2 ${AttackGUID} } } } while !${Unit[${AttackGUID}].Dead} && !${Me.Dead} if ${Unit[${AttackGUID}].Dead} { echo "Nukes - After Combat Downtime" DoDowntime:Set[TRUE] } } function Nukes2(string AttackGUID) { ;Fireblast. if !${Immune-Fire} && ${Spell["Fire Blast"](exists)} && !${Spell["Fire Blast"].Cooldown} && ${Unit[${AttackGUID}].Distance}<=20 { echo "Nukes2 - Fireblast" call UpdateHudStatus "Casting Fire Blast" call CastSpell "Fire Blast" ${AttackGUID} } ;Good 'ole Fireball and Frostbolt. It'll use whatever it needs to. if (!${Immune-Fire} && !${frostspec})||(${Immune-Frost} && ${frostspec}) { echo "Nukes2 - Fireball" call UpdateHudStatus "Casting Fireball" call CastSpell "Fireball" ${AttackGUID} } if (${Immune-Fire} && !${frostspec})||(!${Immune-Frost} && ${frostspec}) { echo "Nukes2 - Frostbolt" call UpdateHudStatus "Casting Frostbolt" call CastSpell "Frostbolt" ${AttackGUID} } } function PresenceOfMindAttackSet(string AttackGUID) { ;Use PoM and nuke something. Check for PoM's exist and cooldown was already done, not needed here. echo "PoMAttackSet - Presence of Mind" call UpdateHudStatus "Casting Presence of Mind" call CastSpell "Presence of Mind" ${Me.GUID} ;Now, what spell are we going to use with PoM? There are both arcfire and arcfrost mages. ;There are also noobs that go Arcane before Fire. if ${Spell["Pyroblast"](exists)} && !${Immune-Fire} { echo "PoMAttackSet - Pyroblast" call UpdateHudStatus "Casting Pyroblast" call CastSpell "Pyroblast" ${AttackGUID} } if (!${frostspec} && !${Immune-Fire} && !${Spell["Pyroblast"](exists)})||(${frostspec} && ${Immune-Frost}) { echo "PoMAttackSet - Fireball" call UpdateHudStatus "Casting Fireball" call CastSpell "Fireball" ${AttackGUID} } if (!${frostspec} && ${Immune-Fire})||(${frostspec} && !${Immune-Frost}) { echo "PoMAttackSet - Frostbolt" call UpdateHudStatus "Casting Frostbolt" call CastSpell "Frostbolt" ${AttackGUID} } } function FrostNovaAttackSet(string AttackGUID) { if !${Immune-Frost} && ${Spell["Frost Nova"](exists)} { if !${Spell["Frost Nova"].Cooldown} && !${Immune-Frost} && ${Spell["Frost Nova"](exists)} { call GetSafeSpot ${Me.Heading.DegreesCCW} if !${NoSafeSpot} && !${Target.Dead} { echo "Entrapping and getting away" call CastSpell "Frost Nova" ${AttackGUID} wait 3 call SmartFace ${safex1} ${safey1} wait 5 if ${Spell["Blink"](exists)} && !${Spell["Blink"].Cooldown} { echo "Blinking" call CastSpell "Blink" ${Me.GUID} } face ${safex1} ${safey1} call moveto ${safex1} ${safey1} 2 face ${Target.X} ${Target.Y} } } ;Sometimes trap and get away won't work... so just get away. if !${Spell["Blink"].Cooldown} && ${Spell["Blink"](exists)} && (${Spell["Frost Nova"].Cooldown} || ${Immune-Frost}) { call GetSafeSpot ${Me.Heading.DegreesCCW} if !${NoSafeSpot} && !${Target.Dead} { echo "Can't entrap, just getting away" call SmartFace ${safex1} ${safey1} wait 5 echo "Blinking" call CastSpell "Blink" ${Me.GUID} face ${safex1} ${safey1} call moveto ${safex1} ${safey1} 2 face ${Target.X} ${Target.Y} } } ;And sometimes, you just can't get away. if ${Spell["Blink"].Cooldown} || ${NoSafeSpot} { if !${Spell["Frost Nova"].Cooldown} && ${Spell["Frost Nova"](exists)} && !${Immune-Frost} { echo "Can't get away, FN'ing for the hell of it" call UpdateHudStatus "Casting Frost Nova" call CastSpell "Frost Nova" ${AttackGUID} } } } } function CrowdControlCheck(string AttackGUID) { echo "CrowdControlCheck" if ${AggroCrowdControl} { Adds1:Search[-alive,-aggro,-targetingme,-range 0-30] echo "AggroCrowdControl Search - ${Adds1.Count} Mobs" if ${Adds1.Count}>1 { SavedTarget1:Set[${AttackGUID}] if ${Adds1[1].GUID.Equal[${AttackGUID}]} { Target ${Adds1[2]} } if !${Adds1[1].GUID.Equal[${AttackGUID}]} { Target ${Adds1[1]} } echo "CrowdControlCheck - Aggro - Polymorphing" call UpdateHudStatus "Casting Polymorph" call CastSpell "Polymorph" ${Target.GUID} AttackGUID:Set[${SavedTarget1}] Target ${SavedTarget1} } CrowdControlDone:Set[TRUE] } if ${PullCrowdControl} { Adds2:Search[-alive,-hostile,-origin,${Unit[${AttackGUID}].Location},-range 0-15] echo "PullCrowdControl Search - ${Adds2.Count} Mobs" if ${Adds2.Count}>2 { SavedTarget2:Set[${AttackGUID}] if ${Adds2[1].GUID.Equal[${AttackGUID}]} { Target ${Adds2[2]} } if !${Adds2[1].GUID.Equal[${AttackGUID}]} { Target ${Adds2[1]} } echo "CrowdControlCheck - Pull - Polymorphing" call UpdateHudStatus "Casting Polymorph" call CastSpell "Polymorph" ${Target.GUID} Target ${SavedTarget2} } CrowdControlDone:Set[TRUE] } } function HealthChecks(string AttackGUID) { ;Let's try to use bandages. What bandage used is set with the setmagesummons function. if ${Item[${bandages}](exists)} && !${Me.Buff["Recently Bandaged"](exists)} && ${Me.PctHPs}<=25 && ${Unit[${AttackGUID}].Distance}>=10 { echo "HealthChecks - Using ${bandages}" Item[${bandages}]:Use do { waitframe } while ${Me.Casting} } ;Ok, that should have taken care of HP. Now for mana, so evocation. if ${Spell["Evocation"](exists)} && !${Spell["Evocation"].Cooldown} && ${Me.PctMana}<=35 { ;If the mob's too close and we really need mana, pop manashield. if ${Unit[${AttackGUID}].Distance}<=10 { echo "HealthChecks - Mana Shield" call UpdateHudStatus "Casting Mana Shield" call CastSpell "Mana Shield" ${Me.GUID} } ;And now, continue on as usual. echo "HealthChecks - Evocation" call UpdateHudStatus "Casting Evocation" call CastSpell "Evocation" ${Me.GUID} do { waitframe } while ${Me.Casting} } ;And we might have mana stones... if ${Item[${MANASTONE}](exists)} && !${Item[${MANASTONE}].Usable} && ${Me.PctMana}<=15 && ${Unit[${AttackGUID}].PctHPs}>=30 { echo "HealthChecks - Mana Stone" Item[${MANASTONE}]:Use } ;Awesome, so that's bandaging, evocation, and manastones. What about potions? Health first. if ${Me.PctHPs}<=15&&${Unit[${AttackGUID}].PctHPs}>=30 { echo "HealthChecks - Healing Potion" call DrinkBestHealingPotion } ;Now for mana potions. if ${Me.PctMana}<=15&&${Unit[${AttackGUID}].PctHPs}>=30 { echo "HealthChecks - Mana Potion" call DrinkBestManaPotion } } function AoECheck(string AttackGUID) { AoEs1:Search[-units,-aggro,-targetingme,-range 0-10] echo "AoECheck - ${AoEs1.Count} mobs near me. ;If there are enough mobs, we're going to AoE the shit out of them. if ${AoEs1.Count}>=3 { ;Blast Wave is always fun. if ${Spell["Blast Wave"](exists)} && !${Spell["Blast Wave"].Cooldown} && !${Immune-Fire} { echo "AoECheck - Blast Wave" call UpdateHudStatus "Casting Blast Wave" call CastSpell "Blast Wave" ${AttackGUID} } ;Flamestrike, anyone? if ${Spell["Flamestrike"](exists)} && ${UseFlamestrike} { echo "AoECheck - Flamestrike" call UpdateHudStatus "Casting Flamestrike" call CastSpell "Flamestrike" ${AttackGUID} ISXWoW:ClickTerrain[${Unit[${AttackGUID}].Location}] } ;And what about Blizzard? This can eat your mana pretty fast. if ${Spell["Blizzard"](exists)} && ${UseBlizzard} { echo "AoECheck - Blizzard" call UpdateHudStatus "Casting Blizzard" call CastSpell "Blizzard" ${AttackGUID} ISXWoW:ClickTerrain[${Unit[${AttackGUID}].Location}] } ;And that's that. Arcane Explosion if our target is low on HP. if ${Spell["Arcane Explosion"](exists)} && ${Unit[${AttackGUID}].PctHPs}<=10 { echo "AoECheck - Arcane Explosion" call UpdateHudStatus "Casting Arcane Explosion" call CastSpell "Arcane Explosion" ${AttackGUID} } } } function AggroKill() { echo "Hi" } function CombatPrep() { if !${Me.InCombat}&&!${HavePulled} { echo "combatprep test notcombat notpulled" if ${Spell["Summon Water Elemental"](exists)} && !${Spell["Summon Water Elemental"].Cooldown} { echo "Combatprep: Summon Water Elemental" call UpdateHudStatus "Casting Summon Water Elemental" call CastSpell "Summon Water Elemental" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${UseFrostWard} && !${Spell["Frost Ward"].Cooldown} && ${Spell["Frost Ward"](exists)} { echo "Combatprep: Frost Ward" call UpdateHudStatus "Casting Frost Ward" call CastSpell "Frost Ward" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${UseFireWard} && !${Spell["Fire Ward"].Cooldown} && ${Spell["Fire Ward"](exists)} { echo "Combatprep: Fire Ward" call UpdateHudStatus "Casting Fire Ward" call CastSpell "Fire Ward" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${DampenMagic} && !${Me.Buff["Dampen Magic"](exists)} && ${Spell["Dampen Magic"](exists)} { echo "Combatprep: Dampen Magic" call UpdateHudStatus "Casting Dampen Magic" call CastSpell "Dampen Magic" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${Spell["Combustion"](exists)} && !${Spell["Combustion"].Cooldown} && !${Me.Buff["Combustion"](exists)} { echo "Combatprep: Combustion" call UpdateHudStatus "Casting Combustion" call CastSpell "Combustion" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${Spell["Cold Snap"](exists)} && ${Spell["Ice Barrier"].Cooldown} && !${Spell["Cold Snap"].Cooldown} && !${Me.Buff["Ice Barrier"](exists)} { echo "Combatprep: cold Snap" call UpdateHudStatus "Casting Cold Snap" call CastSpell "Cold Snap" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${Spell["Ice Barrier"](exists)} && !${Spell["Ice Barrier"]Cooldown} && !${Me.Buff["Ice Barrier"](exists)} { echo "Combatprep: Ice Barrier" call UpdateHudStatus "Casting Ice Barrier" call CastSpell "Ice Barrier" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if !${Spell["Ice Armor"](exists)} && !${Me.Buff["Frost Armor"](exists)} { echo "Combatprep: Frost Armor" call UpdateHudStatus "Casting Frost Armor" call CastSpell "Frost Armor" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if ${Spell["Ice Armor"](exists)} && !${Me.Buff["Ice Armor"](exists)} { echo "Combatprep: Ice Armor" call UpdateHudStatus "Casting Ice Armor" call CastSpell "Ice Armor" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if !${Item[${MANASTONE}](exists)} && ${Spell[${MANASTONE_SPELLNAME}](exists)} { echo "Conjuring me a Mana Gem" call UpdateHudStatus "Conjuring ${MANASTONE}" call CastSpell "${MANASTONE_SPELLNAME}" ${Me.GUID} DoCombatPrep:Set[TRUE] Return } if (${Me.PctMana}<${MinManaPct})||(${Me.PctHPs}<${MinHealthPct}) { call Downtime } DoCombatPrep:Set[FALSE] echo "testing combatprep" Return } DoCombatPrep:Set[FALSE] echo "testing combatprep end false" Return } function Downtime() { if !${Variable[MAGICWATER_NAME](exists)}&&${Spell[Conjure Water](exists)} { call SetMageSummons DoDowntime:Set[TRUE] } if (${Me.PctMana}<${MinManaPct})||(${Me.PctHPs}<${MinHealthPct}) { do { call MakeFood call MageEat call MakeDrink call MageDrink waitframe } while (${Me.PctMana}<100)||(${Me.PctHPs}<100) DoDowntime:Set[FALSE] } if (${Me.PctMana}>=${MinManaPct})||(${Me.PctHPs}>=${MinHealthPct}) { DoDowntime:Set[FALSE] } } ;EQJoe's MakeFood section. function MakeFood() { if !${Item[${MAGICFOOD_NAME}](exists)}&&${Spell[Conjure Food](exists)}&&!${Me.Buff[Food](exists)}&&!${Me.Buff[Drink](exists)} { if ${Me.CurrentMana}>${Spell[Conjure Food].Mana} { if ${Me.Sitting} { wowpress SITORSTAND } call UpdateHudStatus "Making ${MAGICFOOD_NAME}" call CastSpell "Conjure Food" ${Me.GUID} wait 5 } if (${Item[${MAGICFOOD_NAME}].StackCount}<3) { call UpdateHudStatus "Making More ${MAGICFOOD_NAME}" call CastSpell "Conjure Food" ${Me.GUID} if !${Me.InCombat} { wait 5 } else { return } } return } } ;EQJoe's MageEat section. function MageEat() { if ${Me.CurrentHPs}<${Me.MaxHPs}&&${Item[${MAGICFOOD_NAME}](exists)}&&!${Me.Buff[Food](exists)} { call UpdateHudStatus "Eating Food Now" Item[${MAGICFOOD_NAME}]:Use wait 15 } } ;EQJoe's MakeDrink section. function MakeDrink() { if !${Item[${MAGICWATER_NAME}](exists)}&&${Spell[Conjure Water](exists)}&&!${Me.Buff[Drink](exists)} { if ${Me.CurrentMana}>${Spell[Conjure Water].Mana} { if ${Me.Sitting} { wowpress SITORSTAND } call UpdateHudStatus "Making ${MAGICWATER_NAME}" call CastSpell "Conjure Water" ${Me.GUID} if !${Me.InCombat} { wait 5 } if (${Item[${MAGICWATER_NAME}].StackCount}<3) { call UpdateHudStatus "Making More ${MAGICWATER_NAME}" call CastSpell "Conjure Water" ${Me.GUID} if !${Me.InCombat} { wait 5 } else { return } } } } return } ;EQJoe's MageDrink section. function MageDrink() { if ${Me.CurrentMana}<${Me.MaxMana}&&${Item[${MAGICWATER_NAME}](exists)}&&!${Me.Buff[Drink](exists)} { call UpdateHudStatus "Drinking water now " Item[${MAGICWATER_NAME}]:Use wait 25 } } ;EQJoe's SetMageSummons section. function SetMageSummons() { declare MageFoodSummon int declare MageDrinkSummon int declare MAGICFOOD_NAME string script declare MAGICWATER_NAME string script declare MANASTONE string script declare MANASTONE_SPELLNAME string script MageFoodSummon:Set[${Spell[Conjure Food].Level}] ;echo ${Spell[Conjure Food].Level} ;echo ${MageFoodSummon} Switch ${MageFoodSummon} { case 6 MAGICFOOD_NAME:Set[Conjured Muffin] break case 12 MAGICFOOD_NAME:Set[Conjured Bread] break case 22 MAGICFOOD_NAME:Set[Conjured Rye] break case 32 MAGICFOOD_NAME:Set[Conjured Pumpernickel] break case 42 MAGICFOOD_NAME:Set[Conjured Sourdough] break case 52 MAGICFOOD_NAME:Set[Conjured Sweet Roll] break case 60 MAGICFOOD_NAME:Set[Conjured Cinnamon Roll] break ; case 70 ; MAGICFOOD_NAME:Set[Conjured Croissants] ; break } MageDrinkSummon:Set[${Spell[Conjure Water].Level}] Switch ${MageDrinkSummon} { case 4 MAGICWATER_NAME:Set[Conjured Water] break case 10 MAGICWATER_NAME:Set[Conjured Fresh Water] break case 20 MAGICWATER_NAME:Set[Conjured Purified Water] break case 30 MAGICWATER_NAME:Set[Conjured Spring Water] break case 40 MAGICWATER_NAME:Set[Conjured Mineral Water] break case 50 MAGICWATER_NAME:Set[Conjured Sparkling Water] break case 60 MAGICWATER_NAME:Set[Conjured Crystal Water] break case 65 MAGICWATER_NAME:Set[Conjured Mountain Spring Water] break case 70 MAGICWATER_NAME:Set[Conjured Glacier Water] break } if ${Spell[Conjure Mana Agate](exists)}&&!${Spell[Conjure Mana Jade](exists)} { MANASTONE:Set[Mana Agate] MANASTONE_SPELLNAME:Set[Conjure Mana Agate] } if ${Spell[Conjure Mana Jade](exists)}&&!${Spell[Conjure Mana Citrine](exists)} { MANASTONE:Set[Mana Jade] MANASTONE_SPELLNAME:Set[Conjure Mana Jade] } if ${Spell[Conjure Mana Citrine](exists)}&&!${Spell[Conjure Mana Ruby](exists)} { MANASTONE:Set[Mana Citrine] MANASTONE_SPELLNAME:Set[Conjure Mana Citrine] } if ${Spell[Conjure Mana Ruby](exists)} { MANASTONE:Set[Mana Ruby] MANASTONE_SPELLNAME:Set[Conjure Mana Ruby] } if ${Item[-inventory,Linen Bandage](exists)} && !${Item[-inventory,Heavy Linen Bandage](exists)} { bandages:Set[Linen Bandage] } if ${Item[-inventory,Heavy Linen Bandage](exists)} && !${Item[-inventory,Silk Bandage](exists)} { bandages:Set[Heavy Linen Bandage] } if ${Item[-inventory,Silk Bandage](exists)} && !${Item[-inventory,Heavy Silk Bandage](exists)} { bandages:Set[Silk Bandage]] } if ${Item[-inventory,Heavy Silk Bandage](exists)} && !${Item[-inventory,Mageweave Bandage](exists)} { bandages:Set[Heavy Silk Bandage] } if ${Item[-inventory,Mageweave Bandage](exists)} && !${Item[-inventory,Heavy Mageweave Bandage](exists)} { echo "setting bandages to mageweave" bandages:Set[Mageweave Bandage] } if ${Item[-inventory,Heavy Mageweave Bandage](exists)} && !${Item[-inventory,Runecloth Bandage](exists)} { echo "setting bandages to heavy mageweave" bandages:Set[Heavy Mageweave Bandage] } if ${Item[-inventory,Runecloth Bandage](exists)} && !${Item[-inventory,Heavy Runecloth Bandage](exists)} { bandages:Set[Runecloth Bandage] } if ${Item[Heavy Runecloth Bandage](exists)} { echo "setting bandages to heavy runecloth." bandages:Set[Heavy Runecloth Bandage] } call UpdateHudStatus "Setting bandage to ${bandages}" call UpdateHudStatus "Setting Drink to ${MAGICWATER_NAME}" call UpdateHudStatus "Setting Food to ${MAGICFOOD_NAME}" call UpdateHudStatus "Setting Mana Stone to ${MANASTONE}" } function GetSafeSpot(angle) { if ${testfail}==8 { echo "Setting NoSafeSpot TRUE" NoSafeSpot:Set[TRUE] } if ${testfail}<8 { safex1:Set[0] safey1:Set[0] testx:Set[19*${Math.Cos[${angle}]}+${Me.X}] testy:Set[19*${Math.Sin[${angle}]}+${Me.Y}] echo "${testx} test x" echo "${testy} test y" echo "${Me.X} my X" echo "${Me.Y} my Y" echo "${Me.Heading} my angle" echo "${angle} angle being used" Mobs:Search[-units,-alive,-range 0-20,-origin,${testx},${testy},${Me.Z}] echo "${Mobs.Count} mobs count" if ${Mobs.Count}==0 { echo "Safe spot good." safex1:Set[${testx}] safey1:Set[${testy}] echo "${safex1} safe X, ${testx} test X" echo "${safey1} safe y, ${testy} test Y" testfail:Set[0] angle2:Set[0] } if ${Mobs.Count}>0 { echo "Our spot sucks, trying to get another..." testfail:Set[${Math.Calc[${testfail}+1]}] angle2:Set[${Math.Calc[${angle}+45]}] call GetSafeSpot ${angle2} } } } function inittriggers() { Event[PLAYER_TARGET_CHANGED]:AttachAtom[assistcheck] Event[CHAT_MSG_COMBAT_XP_GAIN]:AttachAtom[resetbugcheck] Event[CHAT_MSG_COMBAT_CREATURE_VS_SELF_HITS]:AttachAtom[damagecheck] Event[CHAT_MSG_SPELL_CREATURE_VS_SELF_DAMAGE]:AttachAtom[damagecheck] Event[CHAT_MSG_SPELL_SELF_DAMAGE]:AttachAtom[immunechecks] } function checkassist() { Event[PLAYER_TARGET_CHANGED]:AttachAtom[assistcheck] } function removecheckassist() { Event[PLAYER_TARGET_CHANGED]:DetachAtom[assistcheck] } function assistcheck() { if !${Target.GUID.Equal[${Me.GUID}]} { hastarget:Set[TRUE] } else { hastarget:Set[FALSE] } } atom(script) immunechecks(string eventid , text, Message) { if ${Message.Find["Chilled"]}||${Message.Find["Frostbolt"]}||${Message.Find["Cone of Cold"]}||${Message.Find["Frost Nova"]}&&${Message.Find["failed"]}&&${Message.Find["immune"]} { Immune-Frost:Set[TRUE] } if ${Message.Find["afflicted by Chilled"]}||${Message.Find["Frostbolt hits"]}||${Message.Find["Cone of Cold hits"]}||${Message.Find["Frost Nova hits"]} { Immune-Frost:Set[FALSE] } if ${Message.Find["Pyroblast"]}||${Message.Find["Fireball"]}||${Message.Find["Fireblast"]}||${Message.Find["Scorch"]}&&${Message.Find["failed"]}&&${Message.Find["immune"]} { Immune-Fire:Set[TRUE] } if ${Message.Find["Pyroblast"]}||${Message.Find["Fireball"]}||${Message.Find["Fireblast"]}||${Message.Find["Scorch"]}&&!${Message.Find["immune"]} { Immune-Fire:Set[FALSE] } if ${Message.Find["hits you for"]}&&${Message.Find["Nature damage"]}||${Message.Find["Shadow damage"]}||${Message.Find["Holy damage"]}||${Message.Find["Fire damage"]}||${Message.Find["Frost damage"]} { DampenMagic:Set[TRUE] } } atom(script) damagecheck(string eventid , text, Message) { if ${Message.Find["hits you"]}&&${Message.Find["Frost damage"]} { echo "damagecheck - UseFrostWard" UseFrostWard:Set[TRUE] } if ${Message.Find["hits you"]}&&${Message.Find["Fire damage"]} { echo "damagecheck - UseFireWard" UseFireWard:Set[TRUE] } } atom(script) pullcheck(string EventName, uint EventID, string playerid, string spellcast) { if ${playerid.Find["player"]} && (${spellcast.Find["Fireball"]}||${spellcast.Find["Frostbolt"]}||${spellcast.Find["Pyroblast"]}) { echo "Pullcheck passed" HavePulled:Set[TRUE] Event[UNIT_SPELLCAST_SUCCEEDED]:DetachAtom[pullcheck] } }