arkhan 11 Posted February 24, 2017 Share Posted February 24, 2017 hi, It's me agin, I'm doing some quest profile and i've got an issue At Redridge Mountains. For the quest where I need to control an Ettin called "Saving Foreman Oslow". As i've to do 2 task : UseItemOn and FollowPath i can't use the predifined class to do it. So, I've add Some line of code. 1. RunMacroLua > /tar Canyon Ettin 2. IF > ObjectManager.Target.Entry == 43094 && ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive 3. RunCode > ItemsManager.UseItem(58895); 4. endIf > That works but I need to get closer to the target and as is write here that doesn't check the distance of target. if you can help me to find a solution. I need something like that : ObjectManager.Target.Distance <= 5 if Object.Manager.Target.Distance > 5 : Move to target or Attack Him Link to comment https://wrobot.eu/forums/topic/5206-im-looking-for-distance-of-target/ Share on other sites More sharing options...
arkhan 11 Posted February 25, 2017 Author Share Posted February 25, 2017 I have finaly found how to check the distance of target with lua. But i need one more data to be sure to go to the next step. When I use item on the Ettin, he dissapear and a new one appear and this one is friendly. So, how can i detect is this unit exist ? Link to comment https://wrobot.eu/forums/topic/5206-im-looking-for-distance-of-target/#findComment-24068 Share on other sites More sharing options...
iMod 99 Posted February 25, 2017 Share Posted February 25, 2017 Distance check: ObjectManager.Me.TargetObject.GetDistance Unit check: //Exists? if (ObjectManager.GetWoWUnitHostile().Where(u => u.Entry == 12345).Any()) { // Do something } You can easy extent the conditions for example "&& u.Distance < 40" ect. arkhan 1 Link to comment https://wrobot.eu/forums/topic/5206-im-looking-for-distance-of-target/#findComment-24072 Share on other sites More sharing options...
arkhan 11 Posted February 25, 2017 Author Share Posted February 25, 2017 Thank you a lot, it's exaclty what i need Link to comment https://wrobot.eu/forums/topic/5206-im-looking-for-distance-of-target/#findComment-24075 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now