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]
}