spellcast.inc - generic casting include file.

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Wed May 12, 2004 7:15 pm

Ok both of those look valid. I'll get it added.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Wed May 12, 2004 9:43 pm

Updated:

Changed the way stuns are handled. It should now just wait until the stun is finished and start casting.

Changed the way casts are handled if you lose target or the target dies.

If this happens and you aren't on a mount it will make you duck, stand up and then send a /return CAST_LOSTTARGET.

If this happens while you are on a mount, you have used the 'nodismount' or didn't set the dismount parameter at all it will move you forward and backward to interrupt the casting (it can't cancel the cast, just makes it fail) then sends a /return CAST_LOSTTARGET.

If this happens while you are on a mount, you have used the 'dismount' parameter it will /dismount you off your mount, make you duck and then make you stand up, then sends a /return CAST_LOSTTARGET.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Thanks!

Post by Chill » Thu May 13, 2004 12:17 am

Rock on ml2517!

Using the new version and I love it! Thank you for the changes.

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Thu May 13, 2004 4:19 am

i came up with this when making my own spellcast subroutine. it lets you use the name of the aa ability, or the number. since most people dont know the number for the ability though it makes it a bit easier

Code: Select all

/alt activate ${AltAbility[${spellName}].ID}

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu May 13, 2004 6:10 am

Thats handy, thanks Rusty~.

Updated:
spellcast.inc

Added the ability to issue 'activate' skills via name or number.

Azum
a hill giant
a hill giant
Posts: 229
Joined: Wed Jun 04, 2003 5:04 am

Post by Azum » Thu May 13, 2004 5:05 pm

This seems a little buggy now with the new mount changes. For instance, I'm running a macro, it's just standing there doing nothing because there are no current targets. I am not passing it a dismount parameter, so it defaults to nodismount. It detects a buff faded, it recasts the buff. After the cast completes, it moves forward, and then backward.

I'll see if I can fix it myself, but just a heads up.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu May 13, 2004 5:24 pm

Its not a bug, just make sure you have a target before you /call Cast.

Even if it is just /target myself that is fine.

I'll look into storing your current target or lack of a target right at the beginning of the call. If you don't have a target going into it maybe I'll just bypass the new "cancel cast" code.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu May 13, 2004 5:43 pm

Updated:
spellcast.inc

The dismount/nodismount spell cancel routines will now be skipped if you didn't have a target when the Sub Cast was first called.

User avatar
Seagreen500
crash test
Posts: 47
Joined: Mon Nov 10, 2003 1:04 am

Post by Seagreen500 » Fri May 14, 2004 12:35 am

should this

Code: Select all

Sub Event_Stunned
   /delay 2s !{Me.Stunned}
/return CAST_RESTART
be this ?

Code: Select all

Sub Event_Stunned
   /delay 2s !${Me.Stunned}
/return CAST_RESTART
got an error, trying this.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri May 14, 2004 1:03 am

Eeeep.. good catch. I'd never had a stunned triggered hehe. Will fix it up.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri May 14, 2004 1:04 am

Updated:
spellcast.inc

Fixed the typo in the stun event.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri May 14, 2004 2:10 am

Updated:
spellcast.inc

Just added in a checking to see if you were standing. If you aren't, it will stand you up.

Azum
a hill giant
a hill giant
Posts: 229
Joined: Wed Jun 04, 2003 5:04 am

Post by Azum » Fri May 14, 2004 4:10 pm

Hey ml2517, really nice work on this, but I have a request.

Can you make the new autoduck and move if mounted code optional? Not long ago Sony made a change - so that spells that land on a corpse or empty target no longer expend your mana. So while this is nice (and woulda been even nicer a couple months or more ago) it's unnecessary, for me anyway.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri May 14, 2004 10:41 pm

Updated:
spellcast.inc

Added in a third choice for the "loss of target" checking. The new parameter is nocheck. This is now the default.

The behavior would be:

This would not check or care if you lost your target midcast:
/call Cast "Heroic Bond"

This would not check or care if you lost your target midcast:
/call Cast "Heroic Bond" nocheck

This would not check or care if you lost your target midcast:
/call Cast "White Rope Bridle" item

This would not check or care if you lost your target midcast:
/call Cast "White Rope Bridle" item nocheck

If you specify the dismount or nodismount instead of the nocheck parameter it will do the "loss of target" checking and dismount etc.

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

event parsing

Post by fantum409 » Tue May 25, 2004 12:57 am

For me, this just won't seem to parse events right, and returns CAST_SUCCESS even if spells get resisted. Not sure if its missing other events, but I think it is. Since the new event system my mac's that use this no longer recast things that they used to, so I inserted:
/echo ${Macro.Return}
in a few spots and confirmed this.

Is anyone else having this problem or is it just me:?: