;Stealthy's Mage Routine
;Designing Stages 0.0
;Designed for use with WoWBot 15b.
;notes: WORK ON AOES! ex adds and superaoeing, work on hilly targeting
if sitting, stand
if no water elemental out and spell exists, summon water elemental
check for targets, if none grab one
check to see if they're allied/enemy
handle any elites that may have aggroed
attack
define frostspec
check if we're in pull range and -haven't- pulled and have hp/mana
combatprep
if not enough hp/mana, downtime
if yes, if fire mage, and you have no adds attacking you, pop off pyro
if firemage and you have adds or you don't have pyro, use fireball
if frostmage, open with frostbolt
if spell finishes casting, set pulled flag. else repull
if not, get closer and pull
else start nukes
if target under 30yrds and firespec and target not fire immune, fireball
if target under 30yrds and firespec and target fire immune, frostbolt
if target under 30 yrds and frostspec and target not frost immune, frostbolt
if target under 30yrds and frostspec and target frost immune, firebolt
if target under 30yrds and immune to frost and fire, arcane missiles
if one extra aggroed exist, resheep, run to safe loc, if mana under x%, evocate
if target is casting a spell, counterspell
if targe tunder 20yrds and not cooldown, fireblast
if under 25%hp, pop mana shield
manastone/pots
if target in melee range and not frost immune, frostnova
find save point to right or left, strafe to it, face target
if one add, target it and poly it
if one add and can't poly, pick safe point and run
if two adds and >1 lvl under you, aoe, might have to set flag and make function
if two adds and <2 lvl under you, pick safe point and run
if arc power exists, and my mana >50%, pop it
if clearcast exists, and cold spec, cone of cold
if clearcast exists, and not cold, blast wave
if target frostbitten, frostnovad, or frozen, ice lance
if pom exists and isn't cooldown, pop it
if firespec and target not fire immune and pyro exists, pyroblast
if firespec and target not fire immune and no pyro, fireball
if firespec and target fire immune, frostbolt
if frostspec and target not frost immune, frsotbolt
if frostspec and target frost immune, fireball
manastone/pots
if exists and range <10yrds, use dragon's breath
if me > 75% hp and target under10%hp, wand
if me > 50% hp and target under5%+ignited, wand
if target under 10%hp, scorch
if target under 4% hp, wand
if me < 40%hp and target > 60%hp, instacasts
blastwave
cone of cold
fireblast
if me < 25% hp and < 25% mp, evocate
if me < 25%hp and bandages exist, and not recently bandaged, use bandage
if target dead and no adds, reset pulled
if target dead and adds, work on adds
when adds dead, reset pulled
downtime
downtime
check to see if I'm in combat, if yes, wait 5 and recheck
if no, proceed
check to see if I'm buffed, if yes, and >x hp/mp, don't bother
if not buffed, and if have >x hp/mp, call buff
if (variable food) doesn't exist, call make food
if (variable water) doesn't exist, call make water
if under X hp, and (variable food) exists, call eat
if under x mp, and (variable water) exists, call drink
if sitting, wowpress sitorstand
if combatprep var, enter attack phase
summonwater
same as food, but needs to be done first
summonfood
check what level you are, summon food based on your level
use a switch/class to do so
based on this, set food variable to your level food
cast twice
usewater/food
if safe, and if have food + water, use
if just food or just water, use
wait til HP/MP full, use again if needed
pots
check for hp pots from highest to lowest potency, use if exist and if under certain HP in fight, and can use
same for mp pots
manastonesummon
check for highest mana stone conjure that exists
set variable for it
summon based on variable
manastoneuse
use manastone based on variable if in combat and under %mp
bandageset
check for existing bandages, set var based on highest existing usable
combatprep
if arc int is gone, pop it.
if frost/ice armor is gone, pop it.
if mob is a caster, pop dampen magic.
if mob uses frost/fire, use frostward/fireward.
if combustion exists and isn't cooldown or on me, pop it.
if ice barrier exists and isn't cooldown or on me, pop it.
if ice barrier exists and is cooldown but isn't on me, and coldsnap exists
pop coldsnap
pop ice barrier
if my mana's now low and evocate exists and isn't cooldown, use it
if my mana's now low and no evocate/evocate but cooldown, set special downtime var and trigger downtime
if my mana's fine, proceed to attack
function Attack(string AttackGUID)
{
;will assume either fire or fire/arcane if false, set it according to your spec
declare frostspec bool local false
;don't touch these, they're autoset
declare Pulled bool local false
declare UseFrostWard bool global false
declare UseFireWard bool global false
declare Immune-Frost bool global false
declare Immune-Fire bool global false
declare Dampen bool global false
declare Ranged bool local true
declare hastarget global false
SavedWaypointX:Set[${Me.X}]
SavedWaypointY:Set[${Me.Y}]
if ${Me.Sitting}
{
wowpress SITORSTAND
}
if ${AttackGUID[NULL]}||${AttackGUID.Equal[NOTARGET]}
{
call UpdateHudStatus "No Target."
Return
}
;elites code borrowed from eqjoe, not much improvement to make. RLG is getting improved, however.
if ${Unit[${AttackGUID}].Classification.Equal[Elite]}
{
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
}
}
call UpdateHudStatus "Attacking ${Object[${AttackGUID}].Name}"
if ${Unit[${AttackGUID}].Distance}<${PullingRange}&&!${HavePulled}
{
move -stop
wait 3
Target ${AttackGUID}
}
do
{
if ${Me.Sitting}
{
wowpress SITORSTAND
}
;save XYZ for stuck dist checking later, that's getting improved as well
DistX:Set[${Me.X}]
DistY:Set[${Me.Y}]
DistZ:Set[${Me.Z}]
;Do we still have a target?
if !${Unit[${AttackGUID}](exists)
{
call UpdateHudStatus "Target is gone."
TargetGUID:Set[NOTARGET]
Return
}
;Check to see if it's been tapped
if ${Unit[${AttackGUID}].Tapped}
{
call UpdateHudStatus "Target stolen; tapped."
TargetGUID:Set[NOTARGET]
Return
}
;Check to see if it's not tapped yet, but has a target
if ${Unit[${AttackGUID}](exists)
{
Target ${AttackGUID}
call checkassist
wowpress ASSIST
call removecheckassist
if ${hastarget}
{
call UpdateHudStatus "It's got a target; ignore."
TargetGUID:Set[NOTARGET]
Return
}
}
;If our target's in range and not targetted, target him.
if (!${Target.GUID.Equal[${AttackGUID}]) && (${Unit[${AttackGUID}].Distance<${TargettingRange})
{
call UpdateHudStatus "Targetting ${AttackGUID}"
Target ${AttackGUID}
}
}
function Downtime()
{
}
function summonfood()
{
}
function eatfood()
{
}
function summonwater()
{
}
function pots()
{
}
function combatprep()
{
}
function buffs()
{
}
function manastone()
{
}
function events()
{
Event[PLAYER_TARGET_CHANGED]:AttachAtom[assistcheck]
}
atom checkassist()
{
Event[PLAYER_TARGET_CHANGED]:AttachAtom[assistcheck]
}
atom removecheckassist()
{
Event[PLAYER_TARGET_CHANGED]:DetachAtom[assistcheck]
}
atom(script) assistcheck()
{
declare hastarget bool global TRUE
}
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"]}
{
declare Immune-Frost bool global TRUE
}
if ${Message.Find["afflicted by Chilled"]}||${Message.Find["Frostbolt hits"]}||${Message.Find["Cone of Cold hits"]}||${Message.Find["Frost Nova hits"]}
{
declare Immune-Frost bool global FALSE
}
if ${Message.Find["Pyroblast"]}||${Message.Find["Fireball"]}||${Message.Find["Fireblast"]}||${Message.Find["Scorch"]}&&${Message.Find["failed"]}&&${Message.Find["immune"]}
{
declare Immune-Fire bool global TRUE
}
if ${Message.Find["Pyroblast"]}||${Message.Find["Fireball"]}||${Message.Find["Fireblast"]}||${Message.Find["Scorch"]}&&!${Message.Find["immune"]}
{
declare Immune-Fire bool global 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"]}
{
declare DampenMagic bool global TRUE
}
}
atom(script) damagecheck(string eventid , text, Message)
{
if ${Message.Find["hits you"]}&&${Message.Find["Frost damage"]}
{
declare UseFrostWard bool global TRUE
}
if ${Message.Find["hits you"]}&&${Message.Find["Fire damage"]}
{
declare UseFireWard bool global TURE
}
}