Ok, glad to see it is acceptable now. Now, I am trying to dissect and understand what this code means that I copy / pasted. This is my little rant to help me understand, I answer some of my questions but I would like clarification on if I am correct or not.
Code:
public static void FaceTarget(WoWUnit target)
{
if (!Me.IsSafelyFacing(target, 70f) && !Me.IsMoving && target != null)
{
target.Face();
}
}
Ok, this should be simple, it checks if it is facing its' target. If I am not facing the target and I am not moving, and I have a target then run the "face the target" script. What does the 70f part mean exactly? The syntax shows it is the "view degrees" but I cannot understand it, does that mean the target is 70? from my current view line and I must turn there or can someone explain this better to me?
<hr />
Next:
Code:
public static void MovetoLos(WoWUnit target)
{
if (!target.InLineOfSpellSight && target != Me)//InLineOfSpellsight is better than the odd one because here we can make sure that we are in a "real" LOS
{
Navigator.MoveTo(target.Location);
}
}
Ok, simple code as well, If the target is not in my Line of Sight for my spells and the target is not me, move to the target. This just puts you closer to the target, doesn't it? Instead of moving you side to side for LoS I would assume.
<hr />
Ok, last huge chunk of code here:
Code:
public static void Movetotarget(WoWPoint targetlocation, bool stopinrange, float range)
{
if (stopinrange && Me.Location.Distance(targetlocation) + 0.6f < range)
{
Navigator.PlayerMover.MoveStop();
}
else if (!Me.WithinInteractRange || !Me.IsWithinMeleeRange ||
Me.Location.Distance(targetlocation) + 0.6f > range)
{
Navigator.MoveTo(targetlocation);
}
}
Let me see if I understand this part of the code. The public static void of the title is telling the bot to MoveToTarget(target's location, stop at X range, with an adjustable stopping range? Or did I chop that all up and misunderstand it?) Ok, back to the core code of this line. If (stopinrange [where is this value at?] and me.location.distance(targetlocation) [should my distance be the location of my target?] + 0.6f < range [again, what does the 0.6f represent and what value is range?] then run Navigator.PlayerMover.MoveStop(); [telling the script to stop moving your player]. Else, if my interact range [where is interact's range value?] OR I am not within melee range [where is this value for the range?] OR my location distance form my target +0.6f [cant understand this one either] is > range [again, where is range's value?] then move to the target's location. So, saying if you are in casting range, stop moving and start casting, else, move to the target. I understand that simple code but the jumble in the middle confuse me.
<hr />
Ok, now for the runtime command under Pull() [for me this is where I have it, it can probably be placed in other places as well but to keep it simple I just left it here until I understand it]
Code:
public override void Pull()
{
FaceTarget(Me.CurrentTarget);
MovetoLos(Me.CurrentTarget);
//Your combat thing
Movetotarget(Me.CurrentTarget.Location, true, 5f);
}
Ok, duing the Pull() runtime, it checks if I am facing the current target, got it. Then it checks if I am in LoS of the target, got it, then it tells me to move to my range of the target, gives the stopinrange command a value of true, meaning use this stopping range, and the value of it is 5f [and the F represents a float value, again, no idea what this means can someone explain it to me?] Then the rest of my code goes into there under the MoveToTarget command line, meaning I am already in optimal range of the mob, start engaging.