hitallmobs.mac

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

Harden
a hill giant
a hill giant
Posts: 244
Joined: Thu Aug 25, 2005 8:23 pm

hitallmobs.mac

Post by Harden » Sat Jul 08, 2006 9:10 am

This is an include file and macro file with one event, made for hitting all mobs within 50 Range of you. I designed this for use during power leveling, with the throw Stone ability in mind. (will work for any AA just by changing the ABILITY_NAME define)

Useage = /hitallmobs

Requires spell_routines.inc

Basically, it will target the closest NPC, make sure you ability is ready, and make sure you can see the mob, then it will /face you target, throw stone, then move to the next mob, if your target is not in LoS, it will skip it, it wil also loop and wait for your ability to be ready. When finished, it will tell you how many mobs were hit.


If you have any problems, or suggestions, post or PM me.

hitallmobs.mac

Code: Select all

|hitallmobs.mac By: Harden 07/08/06
|-------------------------------------------------------------------
|Description: Hit's all mobs within 50 range of you with a specified 
|ability. Keep's count of how many mobs were hit, and reports when 
|done. (Requires spell_routines.inc)
--------------------------------------------------------------------
|-Useage: /hitallmobs
|===================================================================
#include spell_routines.inc

Sub Main
/squelch /alias /hitallmobs /echo hitallmobs
	:loop
		/doevents
	/goto :loop
/return

#Event HitAllMobs        "[MQ2] HitAllMobs"
Sub Event_HitAllMobs
|=========================================|
|==Edit Throw Stone, for your AA ability==|
|=========================================|
	/declare ABILITY_NAME string local Throw Stone
	/echo *Attempting to hit all mobs in Range with ${ABILITY_NAME}.	
	/if (!${SpawnCount[npc radius 50]}) {
	/echo No Mobs in Range, Aborting...
	/return
}	
	/target npc
	/declare i int local 0
	/declare cnt int local 0	
		/for i 1 to ${SpawnCount[npc radius 50]} {
			:loop	
				/if (${Me.AltAbilityReady[${ABILITY_NAME}]} && ${Target.LineOfSight}) {
					/face
					/delay 1s
					/aa act ${ABILITY_NAME}
               /delay 3s
				} else {
				/if (!${Me.AltAbilityReady[${ABILITY_NAME}]}) }{
					/goto :loop
				} else {
				/if (!${Target.LineOfSight}) }{
					/echo ${Target.CleanName} Not in Line of sight, Skipping...
					/next i
						}
					}
				}
			/varcalc cnt ${cnt}+1
			/target npc next radius 50
		/next i
	/echo *Done Hitting mobs all mobs in range.
	/echo *Total of ${cnt} Mob(s) hit.
/return
Last edited by Harden on Sun Jul 09, 2006 9:47 am, edited 2 times in total.
-Harden
I wanna be a Macro Writer when I grow up!

Harden
a hill giant
a hill giant
Posts: 244
Joined: Thu Aug 25, 2005 8:23 pm

Post by Harden » Sun Jul 09, 2006 8:58 am

Code: Select all

|hitallmobs.inc By: Harden 07/08/06
|-------------------------------------------------------------------
|Description: Hit's all mobs within 50 range of you with a specified 
|ability. Keep's count of how many mobs were hit, and reports when 
|done. (Requires spell_routines.inc)
--------------------------------------------------------------------
|-Useage: /hitallmobs
--------------------------------------------------------------------
|Make sure your Macro has #include spell_routines.inc at the top
|add /squelch /alias /hitallmobs /echo hitallmobs to your sub main
|
|=================================================  ==================

#Event HitAllMobs        "[MQ2] HitAllMobs"
Sub Event_HitAllMobs
|=========================================|
|==Edit Throw Stone, for your AA ability==|
|=========================================|
	/declare ABILITY_NAME string local Throw Stone
	/echo *Attempting to hit all mobs in Range with ${ABILITY_NAME}.	
	/if (!${SpawnCount[npc radius 50]}) {
	/echo No Mobs in Range, Aborting...
	/return
}	
	/target npc
	/declare i int local 0
	/declare cnt int local 0	
		/for i 1 to ${SpawnCount[npc radius 50]} {
			:loop	
				/if (${Me.AltAbilityReady[${ABILITY_NAME}]} && ${Target.LineOfSight}) {
					/face
					/delay 1s
					/aa act ${ABILITY_NAME}
					/delay 3s
				} else {
				/if (!${Me.AltAbilityReady[${ABILITY_NAME}]}) }{
					/goto :loop
				} else {
				/if (!${Target.LineOfSight}) }{
					/echo ${Target.CleanName} Not in Line of sight, Skipping...
					/next i
						}
					}
				}
			/varcalc cnt ${cnt}+1
			/target npc next radius 50
		/next i
	/echo *Done Hitting mobs all mobs in range.
	/echo *Total of ${cnt} Mob(s) hit.
/return
-Harden
I wanna be a Macro Writer when I grow up!

gome0ne
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Oct 22, 2006 11:43 pm

Post by gome0ne » Sun Nov 26, 2006 6:02 pm

how would you alter this for PL ing a caster, say a shaman?

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Mon Nov 27, 2006 3:14 am

You should be able to use it for any class, all classes have Throw ability dont they?
Personally I pl:ed a shammy to 35 or something with DS & melee only (same idea as Throw in this macro).
He was the fizzle king for a while after :)

Orduhre
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Dec 06, 2006 7:08 pm

Post by Orduhre » Wed Dec 06, 2006 7:23 pm

shroud em into a melee and use throw stone :D

Pugs
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue May 11, 2004 11:38 pm

Post by Pugs » Fri Dec 08, 2006 11:58 am

Thanks for this Handly little bit, it should make Pling to easy now lol.

Mattr35
a lesser mummy
a lesser mummy
Posts: 43
Joined: Wed Dec 29, 2004 12:27 am

Post by Mattr35 » Sat Dec 23, 2006 11:17 am

Nice snippet.

One question I have is that once it runs out of mobs to find in the specified radius, it will then target 1 or 2 more NPCs outside of the radius and try to use the ability on them. And I mean well outside the specified radius (range set to 50, it will target a NPC at 150). The NPCs it targets never were in the specified range either (I thought maybe a wandering mob through the initial spawncount, but that proved wrong).

Any ideas what is causing that?

Matt

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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:07 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:08 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:09 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:10 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:48 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:49 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 4:50 am


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

Re: hitallmobs.mac

Post by xyilla » Sat Jul 19, 2025 5:27 am