Casting help.

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Shocks
a ghoul
a ghoul
Posts: 101
Joined: Tue Feb 18, 2003 3:26 pm
Contact:

Casting help.

Post by Shocks » Thu May 08, 2003 4:13 pm

To the point. I used to include spellcast.mac or something ot that effect in my macro to make sure that my spells got cast. It now crashes the macro I removed it a while ago. I was wondering if there was a way to cast a spell reliably that anyone knows. This is how I currently do it.(very simple)



/rtarget
/delay 6
/cast 1
/delay 3
/cast 1
/delay 1
/cast 1
/delay 55
ect..

Any help would be very kewl.

A special thanks to all devs and ppl that get those nasty offsets. Thanks again... :)

Sorry for no spell check in a hurry heheh .

|| Napolion ||
a ghoul
a ghoul
Posts: 96
Joined: Sat Dec 28, 2002 7:45 am

Use this

Post by || Napolion || » Thu May 08, 2003 5:33 pm

Code: Select all

|** 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 spell is interrupted."
#event Recover "You haven't recovered yet..."
#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
I use this one. Hope it helps you.

Shocks
a ghoul
a ghoul
Posts: 101
Joined: Tue Feb 18, 2003 3:26 pm
Contact:

Dam

Post by Shocks » Fri May 09, 2003 1:00 pm

You are good. Thanks so very much for the help. It will help greatly to know that my spells will go correctly

Shocks
a ghoul
a ghoul
Posts: 101
Joined: Tue Feb 18, 2003 3:26 pm
Contact:

This working for you ?

Post by Shocks » Sat May 10, 2003 11:15 pm

Does this code work for anyone right now? My client does not crash but its just like they never try to cast the spell. Any help would be great.

merkzu
a ghoul
a ghoul
Posts: 99
Joined: Wed May 14, 2003 2:08 pm

Post by merkzu » Wed May 14, 2003 4:10 pm

I was using this last night, worked great

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed May 14, 2003 5:39 pm

Actually I was having trouble with a macro yesterday... the only way I can describe the problem is that /call wasn't working. No idea why.

merkzu
a ghoul
a ghoul
Posts: 99
Joined: Wed May 14, 2003 2:08 pm

Post by merkzu » Wed May 14, 2003 7:20 pm

weird, was working yesterday. isnt working for me now either