February 24, 20179 yr 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
February 25, 20179 yr Author 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 ?
February 25, 20179 yr 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.
Create an account or sign in to comment