Post
by CaM3Lt0Sis » Thu Jul 03, 2003 10:55 am
Answered my own question, but here's the stuff if any of you guys want it :)
PRIMARY MACRO
[color=red]| Name: ShamanBind.mac
| Author: YKW-28983 & Whoever made bind.mac
#turbo
#include spellcast.mac
#event NoBandages "You cannot bind wounds without bandages. Go buy some."
#event DoneBandaging "The bandaging is complete."
#event TargetFull "You cannot bandage your target past"
#define MAXBIND 50
Sub Main
/if n $char(ability,"bind wound")!=-2 {
/if n $char(ability,"bind wound")<1 {
/echo You do not have "Bind Wound" on a /doability
/return
}
}
/if "$target()"=="FALSE" {
/target myself
/delay 0
}
/if n $target(hp,pct)>=MAXBIND {
/echo $target(name) is already above MAXBIND% health.
/goto :Canni
}
:BindLoop
/varset v1 0
/doability "bind wound"
:WaitLoop
/doevents
/if n $char(ability,"bind wound")==-2 /goto :WaitLoop
/if n $v1==0 /goto :WaitLoop
/if n $v1==2 /goto :Canni
/if n $target(hp,pct)<MAXBIND /goto :BindLoop
:Canni
/if n $char(hp,pct)>25 {
/call Cast "Cannibalize IV"
/delay 3.5s
}
/if n $char(hp,pct)<25 {
/goto :BindLoop
}
/goto :Canni
/return
Sub Event_NoBandages
/endmacro
/return
Sub Event_DoneBandaging
/varset v1 1
/return
Sub Event_TargetFull
/varset v1 2
/return[/color]
SPELLCAST.MAC (which was previously left out)
[color=orange][/color]|Plazmic + 1 line change by Imperfect
|** SpellCast.mac
** 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
**|
#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."
#define CastStatus v59
#define CastTimer t7
#define CAST_SUCCESS 0
#define CAST_UNKNOWNSPELL 1
#define CAST_RESTART 2
#define CAST_OUTOFMANA 3
#define CAST_OUTOFRANGE 4
#define CAST_CANNOTSEE 5
#define CAST_STUNNED 6
#define CAST_RESISTED 7
Sub Cast
/if n $char(gem,"$p0")==0 /return CAST_UNKNOWNSPELL
:StartCast
/if n $char(gem,"$p0")<0 /call WaitForRefresh "$p0"
/cast "$p0"
/varset CastTimer $int($spell("$p0",casttime)*10+$spell("$p0",recoverytime)*10)
/varset CastStatus CAST_SUCCESS
:WaitCast
/doevents Fizzle
/doevents Interrupt
/doevents Recover
/doevents Standing
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted
/if n $CastStatus==CAST_RESTART /goto :StartCast
/if n $CastStatus>=CAST_RESTART /return $CastStatus
/if n $CastTimer>0 /goto :WaitCast
/varset CastTimer 0
/return CAST_SUCCESS
Sub WaitForRefresh
:LoopWaitForRefresh
/delay 0
/if n $char(gem,"$p0")<0 /goto :LoopWaitForRefresh
/return
Sub Event_Fizzle
/varset CastStatus CAST_RESTART
/return
Sub Event_Interrupt
/varset CastStatus CAST_RESTART
/return
Sub Event_Recover
/varset CastStatus CAST_RESTART
/delay 5
/return
Sub Event_Standing
/varset CastStatus CAST_RESTART
/stand
/return
Sub Event_Collapse
/varset CastStatus CAST_RESTART
/return
Sub Event_OutOfMana
/varset CastStatus CAST_OUTOFMANA
/return
Sub Event_OutOfRange
/varset CastStatus CAST_OUTOFRANGE
/return
Sub Event_NoLOS
/varset CastStatus CAST_CANNOTSEE
/return
Sub Event_Stunned
/varset CastStatus CAST_STUNNED
/return
Sub Event_Resisted
/varset CastStatus CAST_RESISTED
/return