Moderator: MacroQuest Developers

Code: Select all
:WaitCast
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :WaitCast
}
/delay 5
/doevents Fizzle
/doevents Interrupt
/doevents Recover
/doevents Standing
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted
Code: Select all
Sub KeepAway
/if $char(class)!="druid" /return | check your a druid before running
:Loop
/echo keepaway
/face $target(heading)
/if Combatstatus==0 /return
/if n $target(distance)<40 {
[color=red]/sendkey down up [/color]
/delay 8s
}
/if n $target(distance)>120 {
[color=red] /sendkey up up [/color]
/do events
/return
}
/delay 0
/if "$target()"=="TRUE" /goto :Loop
/return

Code: Select all
** CAST_OUTOFMANA
** CAST_OUTOFRANGE
** CAST_CANNOTSEE
** CAST_STUNNED
** CAST_RESISTED
**
** New Vars Modification
** Plazmic's no globals needed version
**|
|Oct 9, 2003 - Updated to work with new vars and $char(casting) - gf
|Oct 11, 2003 - switched some logic, removed defines - gf
|Oct 15, 2003 - Item support added by EqMule
|April 4, 2004 - Edited to use new MQ2 System
#event Fizzle "Your spell fizzles!"
#event Interrupt "Your casting has been interrupted!"
#event Interrupt "Your spell is interrupted."
#event Recover "You haven't recovered yet..."
#event Recover "Spell recovery time not yet met."
#event Resisted "You target resisted the "
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event NoLOS "You cannot see your target."
#event Stunned "You cannot cast while stunned"
#event Standing "You must be standing to cast a spell"
#event Collapse "Your gate is too unstable, and collapses."
Sub Cast[(SpellName,Item)]
/if n $char(gem[,"@SpellName")==0 /return CAST_UNKNOWNSPELL
:StartCast
/call ClearReturnValue
/if n $char(gem[,"@SpellName")<0 {
/delay 0
/goto :StartCast
}
/if $defined(Item)==TRUE {
/cast item ["@SpellName"]
} else /cast ["@SpellName"]
:WaitCast
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :WaitCast
}
/doevents Fizzle
/doevents Interrupt
/doevents Recover
/doevents Standing
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted
/if "$return"=="CAST_RESTART" /goto :StartCast
/if "$return"!="CAST_SUCCESS" /return "$return"
/return CAST_SUCCESS
Sub ClearReturnValue
/return CAST_SUCCESS
Sub Event_Fizzle
/return CAST_RESTART
Sub Event_Interrupt
/return CAST_RESTART
Sub Event_Recover
/delay 5
/return CAST_RESTART
Sub Event_Standing
/stand
/return CAST_RESTART
Sub Event_Collapse
/return CAST_RESTART
Sub Event_OutOfMana
/return CAST_OUTOFMANA
Sub Event_OutOfRange
/return CAST_OUTOFRANGE
Sub Event_NoLOS
/return CAST_CANNOTSEE
Sub Event_Stunned
/return CAST_STUNNED
Sub Event_Resisted
/return CAST_RESISTED

