Moderator: MacroQuest Developers
Code: Select all
|Plazmic + 1 line change by Imperfect
|** SpellCast.inc
** This will cast a spell reliably for you...
** Usage:
** /call Cast "spellname"
** It will return the following values:
** CAST_SUCCESS
** CAST_UNKNOWNSPELL
** 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
#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)
/if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL
:StartCast
/call ClearReturnValue
/if n $char(gem,"@SpellName")<0 {
/delay 0
/goto :StartCast
}
/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
Code: Select all
| mezmob.mac
| by [40oz]
|
| Usage: /macro mezmob
| -- Have mob on target you want to mez indefinately.
| -- Have your mez spell memmed, and check that it's the same as the /varset mezSpell
|
| This macro will mez the mob on your target indefinately, it does nothing but keep track
| of time and mez. If you are moving, it will catch the interrupt of the cast. It also
| takes care of resists, stuns, etc.
#include spellcast.mac
#turbo
Sub Main
| ----Declares
/declare mezSpell local
/declare recastTime local
/declare sitFlag local
| ----CHANGE THESE AS APPROPRIATE----
/varset mezSpell "Bliss" | Spell to mez with.
/varset recastTime 400 | Number of miliseconds to wait before recasting between successful mezzes
/varset sitFlag 1 | Sit after mez? 1 for yes, 0 for no.
| ----CHANGE THESE AS APPROPRIATE----
/if $target()==FALSE {
/echo No mob on target to mez.
/return
}
/declare targetID local
/varset targetID $target(id)
/echo Keeping $target(name,clean) mezzed!
:castLoop
/doevents
/stand
/call Cast "@mezSpell"
/if n $return==CAST_SUCCESS {
/if n @sitFlag==1 /sit
/delay @recastTime
}
/if n $target(id)==@targetID /goto :castLoop
/echo EXITING ---- EXITING
/returnCode: Select all
/call Cast "@mezMob"
donations for this month's patches.Code: Select all
:castLoop
/doevents
/stand
/call Cast "@mezSpell"
[color=cyan]/if n $return==CAST_SUCCESS {[/color]
/if n @sitFlag==1 /sit
/delay @recastTime
}
/if n $target(id)==@targetID /goto :castLoop
/echo EXITING ---- EXITING
/return
Code: Select all
[color=cyan]/if $return==CAST_SUCCESS {[/color]
Code: Select all
Sub Cast
/if n $char(gem,"@Param0")==0 /return CAST_UNKNOWNSPELL
:StartCast
/call ClearReturnValue
/if n $char(gem,"@Param0")<0 {
/delay 0
/goto :StartCast
}
/cast "@Param0"
: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
Code: Select all
| mezmob.mac
| by [40oz]
|
| Usage: /macro mezmob
| -- Have mob on target you want to mez indefinately.
| -- Have your mez spell memmed, and check that it's the same as the /varset mezSpell
|
| This macro will mez the mob on your target indefinately, it does nothing but keep track
| of time and mez. If you are moving, it will catch the interrupt of the cast. It also
| takes care of resists, stuns, etc.
#include spellcast.mac
#turbo
Sub Main
| ----Declares
/declare mezSpell local
/declare recastTime local
/declare sitFlag local
| ----CHANGE THESE AS APPROPRIATE----
/varset mezSpell "Bliss" | Spell to mez with.
/varset recastTime 400 | Number of miliseconds to wait before recasting between successful mezzes
/varset sitFlag 1 | Sit after mez? 1 for yes, 0 for no.
| ----CHANGE THESE AS APPROPRIATE----
/if $target()==FALSE {
/echo No mob on target to mez.
/return
}
/declare targetID local
/varset targetID $target(id)
/echo Keeping $target(name,clean) mezzed!
:castLoop
/doevents
/stand
/call Cast "@mezSpell"
/if n $return==CAST_SUCCESS {
/if n @sitFlag==1 {
[b]/delay 5[/b]
/sit
}
/delay @recastTime
}
/if n $target(id)==@targetID /goto :castLoop
/echo EXITING ---- EXITING
/returnCode: Select all
|Plazmic + 1 line change by Imperfect
[b]| SpellCast.inc
| This will cast a spell reliably for you...
| Usage:
| /call subCast "spellname"
| It will return the following values:
| CAST_SUCCESS
| CAST_UNKNOWNSPELL
| CAST_OUTOFMANA
| CAST_OUTOFRANGE
| CAST_CANNOTSEE
| CAST_STUNNED
| CAST_RESISTED
| New Vars Modification [/b]
|* 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
#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)
/if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL
:StartCast
/call ClearReturnValue
/if n $char(gem,"@SpellName")<0 {
/delay 0
/goto :StartCast
}
/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 Code: Select all
/if n $return==CAST_SUCCESS {
/if n @sitFlag==1 {
/delay 5
/sit
}

Code: Select all
| mezmob.mac
| by [40oz]
|
| Usage: /macro mezmob
| -- Have mob on target you want to mez indefinately.
| -- Have your mez spell memmed, and check that it's the same as the /varset mezSpell
|
| Seconday Usage: /macro mezmob MezSpell RecastTime SitFlag
| -- Have mob on target to mez
| -- Must pass parameters in this order or it will not work.
| -- You may pass just the MezSpell, or you may pass MezSpell and RecastTime, but you cannot pass
| a parameter without passing the ones before it.
|
| This macro will mez the mob on your target indefinately, it does nothing but keep track
| of time and mez. If you are moving, it will catch the interrupt of the cast. It also
| takes care of resists, stuns, etc.
#include Spellcast.inc
#turbo
Sub Main
| ----Declares
/declare mezSpell local
/declare recastTime local
/declare sitFlag local
| ----CHANGE THESE DEFAULT SETTINGS AS APPROPRIATE----
/varset mezSpell "Bliss" | Spell to mez with.
/varset recastTime 500 | Number of miliseconds to wait before recasting between successful mezzes
/varset sitFlag 1 | Sit after mez? 1 for yes, 0 for no.
| ----CHANGE THESE DEFAULT SETTINGS AS APPROPRIATE----
/if $defined(Param0)==TRUE /varset mezSpell @Param0
/if $defined(Param1)==TRUE /varset recastTime @Param1
/if $defined(Param2)==TRUE /varset sitFlag @Param2
/if $target()==FALSE {
/echo No mob on target to mez.
/return
}
/declare targetID local
/varset targetID $target(id)
/echo Keeping $target(name,clean) mezzed!
:castLoop
/doevents
/stand
/call Cast "@mezSpell"
/delay 1
/if $return==CAST_SUCCESS {
/if n @sitFlag==1 /sit
/delay @recastTime
}
/if n $target(id)==@targetID /goto :castLoop
/echo EXITING ---- EXITING
/return