Finding Auto Attack Range

marcusw03

Active Member
Is there a way to find out how close you need to be to a mob to have your auto attack hit?
VianSK, this is usually 25-30 meters. This can also be affected by many other things though. 1. Items and ammo can give a +/- distance to your range. 2. Some ranged attacks that are not auto attacks can be further or shorter. The best way to find out the distance is to right click the icon and examine it.
 

Poserklr187

Active Member
melee auto attack is going to be something like 5 meters or less. Know of no way to definitively quantify it though.
 

Valerian

ISX Specialist
I could have sworn there was a similar question on these forums within a month ago. there is an object provided by positionutils.iss that will give you this info on a mob by mob basis.
 

VianSK

Well-Known Member
I looked at positionutils.iss... found this

Code:
	member:float GetMeleeMaxRange(uint ActorID, float PercentMod = 0, float MeleeRange = 2)
	{
		PercentMod:Set[${Math.Calc[(100+${PercentMod})/100]}]
		MeleeRange:Set[${Math.Calc[${MeleeRange}*${PercentMod}]}]
		return ${Math.Calc[${Actor[${ActorID}].CollisionRadius} * ${Actor[${ActorID}].CollisionScale} + ${MeleeRange}]}
	}
this does not return accuracte numbers. Infact some times it is 1.5 or more off.

I also was wondering where "CollisionRadius" & "CollisionScale" came from on the actor object. I could not find anything on these from the ISXEQ2 wikia or the lavishscript wikia in the search.

Thanks again for your help.
 

Valerian

ISX Specialist
I looked at positionutils.iss... found this

<snip>

this does not return accuracte numbers. Infact some times it is 1.5 or more off.

I also was wondering where "CollisionRadius" & "CollisionScale" came from on the actor object. I could not find anything on these from the ISXEQ2 wikia or the lavishscript wikia in the search.

Thanks again for your help.
By all means, feel free to improve things, this is open source. just don't break everything else that PositionUtils DOES work with. If you plan on changing anything in there, you better make damn sure it's accurate through a large array of mobs, from the very small to the very large and everything in between.

The radius and scale members aren't documented because not even Amadeus knows how those are used. Feel free to experiment.
 

Pygar

EQ2Bot Specialist
I've not found that member to be off at all.

In fact, I set up a HuD that shows the value of that member on target with my distance to target under it. Providing my distance to target was less than the value returned by member, I was in auto attack range.

Test it that way and post results.
 

Poserklr187

Active Member
No idea how but wouldn't mind testing this. How would I go about getting the numbers its putting out for distance? I can't read code for shit so don't even know where to start heh.

If it works properly and could get something like shadow.iss to use those numbers, and be able to make the script run on whatever I am targeting I'd be set for a distance script I want.
 

VianSK

Well-Known Member
I did the same thing Pygar except i used the console for output.

Here is how I tested it. However, this was my version after making my changes. I added my characters CollisionRadius * CollisionScale to the math. This has returned an almost near perfect result for me on the mobs I have tested. This works for me... shrug.

My original post was asking if there was an object or something existing already to find this. I hope any of you don't take anything said as negative, we are all very fortunate to have the code you guys put so much time into. However like Valerian said this is open source... were all here to try and make it better for us all no?

Code:
function main()
{
	Event[EQ2_onIncomingText]:AttachAtom[IncTxt]
	declare strAbi string script "Cheap Shot"
	do
	{
		call F_MeleeMaxRange "${Target.ID}" 2 ${Me.Ability[${strAbi}].Range}
		wait 10
	}
	while 1
}

function F_MeleeMaxRange(uint ActorID, float MeleeRange = 2, float CARange)
{
	declare MyMass float local
	declare TarMass float local

	MyMass:Set[${Math.Calc[${Actor[me].CollisionRadius}*${Actor[me].CollisionScale}]}]
	TarMass:Set[${Math.Calc[${Actor[${ActorID}].CollisionRadius}*${Actor[${ActorID}].CollisionScale}]}]
	
	echo 1) Melee Range: ${Math.Calc[${TarMass} + ${MeleeRange} + ${MyMass}]}
	echo 2) CA Range: ${Math.Calc[${TarMass} + ${CARange} + ${MyMass}]}
	
	echo MyPOS: ${Target.Distance}
}

atom IncTxt(string Text)
{
 	if (${Text.Find[YOU ]}>=1
 	{
		echo  >> ${Text} <<
 	}
}

function atexit()
{
	Event[EQ2_onIncomingText]:DetachAtom[IncTxt]
}
 

Valerian

ISX Specialist
Oh, good call on the character's hitbox, I never even thought to take that into account. That might explain a few of the slightly off calculations that only really show up around large hitboxes.
 
Top Bottom