CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

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

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by BardsAreTooEasy » Sun Oct 09, 2005 6:56 pm

I basically stole most of this from spell_routines.inc as it is broken. This will at least get you casting again, however it wont cast items, or any of the other goodies that spell_routines.inc did. I'm also posting this in my canniv4.mac. I don't want to update this. If someone wants additional features like spell_routines.inc had then add them yourself and post it here, because I'm not doin it!

/call Cast "YourSpell" gem#
ex. /call Cast "Quiescence" gem1

CrappySpell.inc

Code: Select all


#event Collapse "Your gate is too unstable, and collapses.#*#" 
#event FDFail "#1# has fallen to the ground.#*#" 
#event Fizzle "Your spell fizzles#*#" 
#event Immune "Your target is immune to changes in its attack speed#*#" 
#event Immune "Your target is immune to changes in its run speed#*#" 
#event Immune "Your target cannot be mesmerized#*#" 
#event Interrupt "Your casting has been interrupted#*#" 
#event Interrupt "Your spell is interrupted#*#" 
#event NoHold "Your spell did not take hold#*#" 
#event NoLOS "You cannot see your target.#*#" 
#event NoTarget "You must first select a target for this spell!#*#" 
#event NotReady "Spell recast time not yet met.#*#" 
#event OutOfMana "Insufficient Mana to cast this spell!#*#" 
#event OutOfRange "Your target is out of range, get closer!#*#" 
#event Recover "You haven't recovered yet...#*#" 
#event Recover "Spell recovery time not yet met#*#" 
#event Resisted "Your target resisted the #1# spell#*#" 
#event Standing "You must be standing to cast a spell#*#" 
#event Stunned "You are stunned#*#" 
#event Stunned "You can't cast spells while stunned!#*#" 
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"

Sub Cast(string CastSpell,string spellType)
	/if (!${Defined[SpellCT]}) /declare SpellCT int outer
	/if (!${Defined[SpellCTTimer]}) /declare SpellCTTimer timer outer
	/if (!${Defined[SpellName]}) /declare SpellName string outer ${CastSpell}
	/if (!${Defined[WaitMem]}) /declare WaitMem int outer
	/varset WaitMem 0
	/varset SpellName ${CastSpell}
	/varcalc SpellCT ${Spell[${CastSpell}].CastTime}*10+40
	/if (!${Int[${Me.Book[${SpellName}]}]}) { 
		/echo Spell: "${SpellName}" was not found in your book.
		/return
}
	/if (!${Me.Gem[${SpellName}]}) { 
		:mem_spell 
			/if ( ${Cursor.ID} ) { 
				/autoinventory 
				/delay 5 
		/goto :mem_spell  
	}	
		/if (${spellType.Left[3].Equal[gem]}) { 
			/memspell ${spellType.Right[1]} "${SpellName}"
			/delay 9s
			:mem
				/if (!${Me.SpellReady[${SpellName}]} && ${WaitMem}==0) {
					/varset WaitMem 1
					/delay 6s
			/goto :mem
		}
	} else {
			/echo No gem# given, and ${SpellName} not memmed.
			/return
	}
		:close_spell_book 
			/if ( ${Window[SpellBookWnd].Open} ) { 
				/echo *** SpellBookWnd Stuck Open *** 
				/notify SpellBookWnd DoneButton leftmouseup 
		/goto :close_spell_book 
	}
}
	/if ( ${Me.Sitting} ) { 
		/sit 
}
	/if (!${Me.Gem[${SpellName}]}) {
		/echo Spell mem interrupted...
		/return
}
	/cast "${CastSpell}"
	/varset SpellCTTimer ${SpellCT}
	:Casting
		/doevents
	/if (${SpellCTTimer}!=0) /goto :Casting
	|/echo Done casting ${CastSpell}
/return

Sub Event_Collapse
	/echo Gate Colapsed!
	/call Cast "${SpellName}"
/return

Sub Event_FDFail
	/echo FD Failed!
	/call Cast "${SpellName}"
/return

Sub Event_Fizzle
	/delay 15
	/call Cast "${SpellName}"
/return

Sub Event_Immune
	/echo ${Target.Name} is immune!
/return

Sub Event_Interrupt
	/delay 15
	/call Cast "${SpellName}"
/return

Sub Event_NoHold
	/echo ${SpellName} did not take hold on ${Target.Name}!
/return

Sub Event_NoLOS
	/echo ${Target} is out of sight.
/return

Sub Event_NoTarget
	/echo Target something first.
/return

Sub Event_OutOfMana
	/echo I need to med.
/return

Sub Event_OutOfRange
	/echo ${Target} is out of range!
/return

Sub Event_Recover
	/echo Spell recover time not met.
/return

Sub Event_Resisted
	/echo ${Target} resisted ${SpellName}!
/return

Sub Event_Standing
	/stand
	/delay 10
	/call Cast "${SpellName}"
/return

Sub Event_Stunned
	/echo Stunned!
	/delay 10
/return

Last edited by BardsAreTooEasy on Sat Oct 15, 2005 12:32 am, edited 4 times in total.

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Sun Oct 09, 2005 7:28 pm

There's nothing wrong with spell_routines.inc

Donate to ViP

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

Post by BardsAreTooEasy » Sun Oct 09, 2005 9:04 pm

spell_routines.inc's not the problem then, my wallet is. But, for the rest of you "poor" bastards, here's this that works, as spell_routines.inc in the section "poor" people can access is b00rked!

ultimateq
a lesser mummy
a lesser mummy
Posts: 44
Joined: Sun Aug 07, 2005 11:50 am

Post by ultimateq » Tue Oct 11, 2005 1:40 pm

Kewl shit. I'll try it out. Thanks BardsAre

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:49 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:51 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:52 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:53 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:54 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:55 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:56 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:57 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 2:59 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 3:00 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: CrappySpell.inc -- POOR MANS SPELL_ROUTINES.INC

Post by xyilla » Thu Jun 19, 2025 3:01 am