anchor instead of a warp

Status
Not open for further replies.

Anything

Anytime!
Joined
Apr 3, 2006
Messages
232
Reaction score
0
Points
0
Location
Chico, Ca.
im trying to build a anchor after a fight is done to a loc its sounds simple but im not having good luck in writing it ??
 
You can change the homeY/homeX to your own declares this basically just stores your starting location + direction. When called it moves back to within a few units of the location and turns you in the general direction, it wont move to the exact spot every time or face the same heading ever time, it also has a small delay in return home that is between .5s and 1.5s.

HTML:
/declare  homeY              int        outer   ${Me.Y}
/declare  homeX              int        outer   ${Me.X}
/declare  MeHeading          int        outer   ${Me.Heading.DegreesCCW}

Sub ReturnHome
/delay ${Math.Calc[5+${Math.Rand[10]}]}
  /if (${Math.Distance[${homeY}, ${homeX}]}>=${Math.Calc[40+${Math.Rand[10]}]}  ) {
    /call MoveToLoc ${Math.Calc[${homeY}+${Math.Rand[10]}]} ${Math.Calc[${homeX}+${Math.Rand[10]}]}
   /face heading ${Math.Calc[${MeHeading}+${Math.Rand[15]}]}
    /return
  }    
 /return
 
Status
Not open for further replies.