Page 1 of 3

Retard useable safe to pull sub

Posted: Thu Oct 30, 2008 9:01 pm
by tums2004
I'm looking for a sub that will let me target a mob, and tell me if that mob is safe to pull with a debuff spell. (relatively). I dont want an afk puller or anything like that, but something that lets me know which of a cluster of mobs is most likely to be able to be pulled safely.
There are things similar, but I can't make any of them work correctly.

Posted: Fri Oct 31, 2008 7:05 am
by A_Enchanter_00
this will check for adds around a spawn a target with PullSingleDistance as monster aggro distance, other than that it should give you an idea on how you could do it.

Code: Select all

 
Sub CheckAdds(int SpawnSearchID, int aggroCount)
	/if ( !${PullSingleDistance} ) /return 0
	/if ( !${Defined[aggroCount]} ) /declare aggroCount int local 1
	/declare i int local 0
	/declare AggroMonsters int local 0
	/declare SpawnID int local 0
	/for i 1 to ${SpawnCount[npc loc ${Spawn[id ${SpawnSearchID}].X} ${Spawn[id ${SpawnSearchID}].Y} radius ${PullDistance} zradius ${PullDistanceZ}]}
		/varset SpawnID ${NearestSpawn[${i},npc loc ${Spawn[id ${SpawnSearchID}].X} ${Spawn[id ${SpawnSearchID}].Y} radius ${PullDistance} zradius ${PullDistanceZ}].ID}		
		/if ( ${SpawnID} != ${SpawnSearchID} && ${PullSingleDistance} ) {
			/if ( d_ValidSpawnID && ${Spawn[id ${SpawnID}].Z} > ${Math.Calc[${Spawn[id ${SpawnSearchID}].Z}-${PullDistanceZ}]} && ${Spawn[id ${SpawnID}].Z} < ${Math.Calc[${Spawn[id ${SpawnSearchID}].Z}+${PullDistanceZ}]} ) {								
				/if ( ${Spawn[id ${SpawnID}].Speed} ) {
					/if ( ${Math.Distance[${Spawn[id ${SpawnSearchID}].Y},${Spawn[id ${SpawnSearchID}].X},${Spawn[id ${SpawnSearchID}].Z}:${Spawn[id ${SpawnID}].Y},${Spawn[id ${SpawnID}].X},${Spawn[id ${SpawnID}].Z}]} < ${Math.Calc[${PullSingleDistance}*1.5]} ) {
						/varset AggroMonsters ${Math.Calc[${AggroMonsters}+1]}
						/if ( ${AggroMonsters} >= ${aggroCount} ) /return ${SpawnID}
					}
				} else {
					/if ( ${Math.Distance[${Spawn[id ${SpawnSearchID}].Y},${Spawn[id ${SpawnSearchID}].X},${Spawn[id ${SpawnSearchID}].Z}:${Spawn[id ${SpawnID}].Y},${Spawn[id ${SpawnID}].X},${Spawn[id ${SpawnID}].Z}]} < ${PullSingleDistance} ) {
						/varset AggroMonsters ${Math.Calc[${AggroMonsters}+1]}
						/if ( ${AggroMonsters} >= ${aggroCount} ) /return ${SpawnID}
					}
				}
			}
		}
	/next i
/return 0

tried but failed

Posted: Sun Nov 02, 2008 3:40 am
by tums2004
I tried to use the code you wrote, but failed. I always get back 0 no matter what? What did I do wrong?

Better yet

Posted: Sun Nov 02, 2008 3:54 am
by tums2004
I'll throw you 20$ on paypal if you write a sub, that takes my current target, and echos back whether it is safe to pull or not with a debuff mala/malo one of those types.

Posted: Mon Nov 03, 2008 6:29 pm
by A_Enchanter_00
could be several things ...

---> /if ( !${PullSingleDistance} ) /return 0


---> d_ValidSpawnID what ever code you use to check if SpawnID is a valid spawn

Code: Select all

Sub CheckAdds(int SpawnSearchID, int PullSingleDistance, int aggroCount)
   /if ( !${Defined[aggroCount]} ) /declare aggroCount int local 1
   /declare i int local 0

   /declare AggroMonsters int local 0
   /declare SpawnID int local 0
   /for i 1 to ${SpawnCount[npc loc ${Spawn[id ${SpawnSearchID}].X} ${Spawn[id ${SpawnSearchID}].Y} radius 150 zradius 50]}
      /varset SpawnID ${NearestSpawn[${i},npc loc ${Spawn[id ${SpawnSearchID}].X} ${Spawn[id ${SpawnSearchID}].Y} radius 150 zradius 50].ID}      
      /if ( ${SpawnID} != ${SpawnSearchID} && ${PullSingleDistance} ) {
         /if ( ${Spawn[id ${SpawnID}].Z} > ${Math.Calc[${Spawn[id ${SpawnSearchID}].Z}-50]} && ${Spawn[id ${SpawnID}].Z} < ${Math.Calc[${Spawn[id ${SpawnSearchID}].Z}+50]} ) {                        
            /if ( ${Spawn[id ${SpawnID}].Speed} ) {
               /if ( ${Math.Distance[${Spawn[id ${SpawnSearchID}].Y},${Spawn[id ${SpawnSearchID}].X},${Spawn[id ${SpawnSearchID}].Z}:${Spawn[id ${SpawnID}].Y},${Spawn[id ${SpawnID}].X},${Spawn[id ${SpawnID}].Z}]} < ${Math.Calc[${PullSingleDistance}*1.5]} ) {
                  /varset AggroMonsters ${Math.Calc[${AggroMonsters}+1]}
                  /if ( ${AggroMonsters} >= ${aggroCount} ) /return ${SpawnID}
               }
            } else {
               /if ( ${Math.Distance[${Spawn[id ${SpawnSearchID}].Y},${Spawn[id ${SpawnSearchID}].X},${Spawn[id ${SpawnSearchID}].Z}:${Spawn[id ${SpawnID}].Y},${Spawn[id ${SpawnID}].X},${Spawn[id ${SpawnID}].Z}]} < ${PullSingleDistance} ) {
                  /varset AggroMonsters ${Math.Calc[${AggroMonsters}+1]}
                  /if ( ${AggroMonsters} >= ${aggroCount} ) /return ${SpawnID}
               }
            }
         }
      }
   /next i
/return 0 

/call CheckAdds ${Target.ID} "int agro distance" "int number of how manny adds you allow.(if not defined then it will use 1)"

eg:

/call CheckAdds ${Target.ID} 50 2


returning 0 of no adds founed.... if not it will return an Spawn.ID

always a spawn id return

Posted: Wed Nov 05, 2008 4:16 pm
by tums2004
So I tried the second code, and it always returns a spawn id. Even when mobs are really close.

Posted: Thu Nov 06, 2008 10:42 am
by simonh
I'd have to say that this sounds like a very good addition to the Macro archive.

Maybe make something for a HUD that just puts the targets name in green if it's a single pull and red if it got adds?

If that's at all possible, but so far over the years with using and abusing MQ2, it seems like the sky is the limit...

Re: always a spawn id return

Posted: Thu Nov 06, 2008 10:52 am
by toomanynames
tums2004 wrote:So I tried the second code, and it always returns a spawn id. Even when mobs are really close.
I don't think you're doing it right (but I only briefly looked at the code)

Mobs close = number
No Mobs close = 0

Re: always a spawn id return

Posted: Thu Nov 06, 2008 12:37 pm
by A_Enchanter_00
toomanynames wrote:
tums2004 wrote:So I tried the second code, and it always returns a spawn id. Even when mobs are really close.
I don't think you're doing it right (but I only briefly looked at the code)

Mobs close = number
No Mobs close = 0
correct

Posted: Thu Nov 06, 2008 12:42 pm
by A_Enchanter_00
simonh wrote:I'd have to say that this sounds like a very good addition to the Macro archive.

Maybe make something for a HUD that just puts the targets name in green if it's a single pull and red if it got adds?

If that's at all possible, but so far over the years with using and abusing MQ2, it seems like the sky is the limit...
Could use /mapfilter targetradius # ( aggro distance )

This will made a circle around your target then if there is no monsters within the aggro distance then you can single pull it...

Works

Posted: Thu Nov 13, 2008 12:52 pm
by tums2004
Ok it does work, I was screwing it up. I get paid tom,. Ill donate then

payment Made

Posted: Fri Nov 14, 2008 12:09 pm
by tums2004
Payment made as promised :) Thanks.

Posted: Mon Nov 17, 2008 3:40 pm
by A_Enchanter_00
welcome and thanks

Re: Retard useable safe to pull sub

Posted: Tue Sep 02, 2025 6:20 pm
by xyilla

Re: Retard useable safe to pull sub

Posted: Tue Sep 02, 2025 6:57 pm
by xyilla