kkester1963
Member
When you are the MT and you detect incoming mobs and need to run to them FASTMOVE causes you to run where they were when you found them then readjust move to where they are when you got where they were. Hehe makes you bounce like a ping-pong ball for a few secs. My idea was for the MT and only the MT charge the mob itself so keep checking for it's position relative to your own. To implement this make the changes below and you charge the target stop on a dime and kick his butt!
In the CheckPosition function find the line that calls FASTMOVE and replace it as below:
In the CheckPosition function find the line that calls FASTMOVE and replace it as below:
Code:
;;
;; kkester1963 11/17/09
;; if we are the main tank we don't want to run to where the target was but where the target IS
;; so we will fastmove "charge" the actor not a fixed X,Z. Otherwise for the tagalongs fastmove
;; is the correct way to go.
;;
if ${MainTank}
{
call MainTankCharge ${TID}
}
else
{
call FastMove ${destpoint.X} ${destpoint.Z} 2
}
Then add the function:
function MainTankCharge(uint TargetID)
{
variable float xDist
variable float SavDist = ${Math.Distance[${Me.X},${Me.Z},${Actor[${TargetID}].X},${Actor[${TargetID}].Z}]}
variable int xTimer
Debug:Echo["Charging ${Actor[${TargetID}].Name!"]
IsMoving:Set[TRUE]
if ${Me.ToActor.InCombatMode}
{
if ${NoAutoMovementInCombat}
{
IsMoving:Set[FALSE]
return "NOAUTOMOVEMENTINCOMBAT"
}
if (!${Actor[${TargetID}](exists)} || ${Actor[${TargetID}].IsDead})
{
IsMoving:Set[FALSE]
return "TARGETDEAD"
}
}
face ${Actor[${TargetID}].X} ${Actor[${TargetID}].Z}
press -release ${forward}
wait 1
press -hold ${forward}
xTimer:Set[${Script.RunningTime}]
do
{
;if we appear to be stuck strafe to get loose
xDist:Set[${Math.Distance[${Me.X},${Me.Z},${Actor[${TargetID}].X},${Actor[${TargetID}].Z}]}]
if ${Math.Calc[${SavDist}-${xDist}]} < 0.8
{
if (${Script.RunningTime}-${xTimer}) > 500
{
;Debug:Echo["We are stuck strafing to get loose"]
press -hold ${strafeleft}
wait 8
press -release ${strafeleft}
if ${Math.Calc[${SavDist}-${xDist}]} < 0.8
{
press -hold ${straferight}
wait 8
press -release ${straferight}
}
xDist:Set[${Math.Distance[${Me.X},${Me.Z},${Actor[${TargetID}].X},${Actor[${TargetID}].Z}]}]
if ${Math.Calc[${SavDist}-${xDist}]} > 0.8
{
continue
}
isstuck:Set[TRUE]
if !${pulling}
{
press -release ${forward}
wait 20 !${Me.IsMoving}
}
IsMoving:Set[FALSE]
return "STUCK"
}
}
else
{
xTimer:Set[${Script.RunningTime}]
SavDist:Set[${Math.Distance[${Me.X},${Me.Z},${Actor[${TargetID}].X},${Actor[${TargetID}].Z}]}]
;Debug:Echo["Target distance: ${SavDist}"]
}
face ${Actor[${TargetID}].X} ${Actor[${TargetID}].Z}
}
while ${Math.Distance[${Me.X},${Me.Z},${Actor[${TargetID}].X},${Actor[${TargetID}].Z}]} > 2
;Debug:Echo["We should be in his face now! ${Math.Distance[${Me.X},${Me.Z},${Actor[${TargetID}].X},${Actor[${TargetID}].Z}]}"]
press -release ${forward}
wait 20 !${Me.IsMoving}
IsMoving:Set[FALSE]
return "SUCCESS"
}
Last edited by a moderator: