target selection

Status
Not open for further replies.

Declim

New member
Joined
Sep 24, 2006
Messages
14
Reaction score
0
Points
0
i'm looking for a piece of a mac/snippet that targets the highest mobs from a group of mobs within a certain radius.

if there's 5-6 mobs around targets the highest one.

anyone know of something that does that?


Declim
 
Last edited:
Z1 Wrote this for me to use.. IT Targets the Closest Mob to me with a Certain Z Axis Level.. I am sure it can be Modified to Target the Highest Level Mob within a Certain Raidius or group...

Code:
Sub GetTarget2
/declare count int local
/declare mobcheck int local
:Acquire 
/if (${SpawnCount[npc radius ${RV_MaxRadius}]}) {
	/for count 1 to ${SpawnCount[npc radius ${RV_MaxRadius}]}
		/if (${NearestSpawn[${count},npc radius ${RV_MaxRadius}].Z}<${RV_MinZRange}) /goto :next
		/if (${NearestSpawn[${count},npc radius ${RV_MaxRadius}].Z}>${RV_MaxZRange}) /goto :next
		/for mobcheck 1 to ${RV_MobArray.Size}
			/if (${NearestSpawn[${count},npc radius ${RV_MaxRadius}].CleanName.Equal[${RV_MobArray[${mobcheck}]}]}) /goto :goodname
		/next mobcheck
		/goto :next

		:goodname
		/squelch /tar ID ${NearestSpawn[${count},npc radius ${RV_MaxRadius}].ID}
		/delay 1s (${Target.ID}==${NearestSpawn[${count},npc radius ${RV_MaxRadius}].ID})
		/if (${Target.PctHPs}<100) {
			/squelch /target clear
			/goto :next
		}

		/varset RV_HasTarget 1 
		/varset RV_MyTargetName ${Target.CleanName} 
		/echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]}
		/return
		
		:next
	/next count
}
/delay 2s 
/varcalc RV_FailCounter ${RV_FailCounter}+1 
/echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s) 
/if (${RV_FailCounter}>=${RV_FailMax}) { 
	/echo Waiting for Respawns, Resetting Failure Counter... 
	/delay 60s 
	/varset RV_FailCounter 0 
	} 
/goto :Acquire 
/return
 
Code:
Sub HighestTarget
/declare HighMobID int local 0
/declare MobLevel int local 0
/declare loopcount int local 0
/if (${SpawnCount[npc radius 50]}==0) /multiline ; /echo No mobs in range ; /return
/for loopcount 1 to ${SpawnCount[npc radius 50]}
  /if (${loopcount}==1) /tar npc radius 50
  /if (${loopcount}>1) /tar npc radius 50 next
  /if (${Target.Level}>${MobLevel}) {
    /varset HighMobID ${Target.ID}
    /varset MobLevel ${Target.Level}
  }
/next loopcount
/tar id ${HighMobID}
/echo Targetted ${Target.CleanName} at level ${Target.Level} as highest
/return
 
Last edited:
Status
Not open for further replies.