libai 2 Posted March 31, 2023 Share Posted March 31, 2023 When the boss is casting AOE damage, in order to avoid deep damage, I hope the robot can follow a path or auto find a way to reach a safe area. I made a plugin, but it not works, it only move very little little step then keep fighting without moving to the right place,. can you help me ,thanks. public void OnFightLoop(WoWUnit unit,CancelEventArgs cancelable) { foreach(var boss in Bosses){ if(unit.Name == boss && unit.IsCast && unit.InCombat) { Logging.Write("Boss is casting,run now! ); RunWhenBossCastAOE(unit); } } } public void RunWhenBossCastAOE(WoWUnit boss) { switch (boss.Entry) { case 28586: { // General Bjarngrim var x = ObjectManager.Me.Position.X; var y = ObjectManager.Me.Position.Y; var z = ObjectManager.Me.Position.Z; List<Vector3>pathList = new List<Vector3>(); for(int i = 0;i<20;i++) { var newX = x; var newY = y + i; var newZ = z; Vector3 tmpPos = new Vector3(newX,newY,newZ); pathList.Add(tmpPos); } GoToSafePosition(pathList); break; } } } public bool GoToSafePosition(List<Vector3> pathList) { wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = true; MovementManager.Go(pathList); wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = false; return true; } Link to comment https://wrobot.eu/forums/topic/15118-how-to-avoid-boss-aoe-in-fight/ Share on other sites More sharing options...
TechMecca 7 Posted March 31, 2023 Share Posted March 31, 2023 i found this, Might help. use google next time. https://github.com/Talamin/Wholesome-Dungeon-Crawler/blob/master/States/AvoidAOE.cs, also i do not know if wrobot ObjectManager has this type of info but Aoe ability's and ground effect can be found as Dynamic Game Objects. Here is the code for creating your own function using wrobot Descriptors, https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/300463-wow-3-3-5-12340-info-dump-thread.html libai 1 Link to comment https://wrobot.eu/forums/topic/15118-how-to-avoid-boss-aoe-in-fight/#findComment-67931 Share on other sites More sharing options...
Zer0 148 Posted March 31, 2023 Share Posted March 31, 2023 The reason your character only moves a little step is because you're still on the fight thread, so your code only executes for one fight loop iteration. The next iteration, you're back on the normal fight loop which forces you to get in your fight class range. There are two ways I know to prevent this. 1 - Lock the thread in your method. Which in your case would mean calling MovementManager.Go(pathList); and the next line, lock the thread in a while (MovementManager.InMovement) loop. I wouldn't necessary recommend this, because you're blocking the entire fight loop and you will need mutliple conditions to set it right. 2 - Cancel the fight event. This is my preferred option, but it's more complicated to set up. The code Nax has linked you is one I've written. It uses a manager that listens to multiple events. On the ObjectManagerEvents.OnObjectManagerPulsed event, I check and record a list of all the AOEs present in the object manager range. On MovementEvents.OnMovementPulse and MovementEvents.OnMoveToPulse I make sure I don't walk into an AOE, and make sure I never cancel an escape On FightEvents.OnFightStart, I make sure I don't start any fight during an escape This code doesn't really fit your need, because it avoids AOEs that stand on the ground (like a puddle of poison), and uses a "grid" to look for a safe position. In your case, you react to a single action. What you need to do is: - Detect the moment you need to escape. - Cancel the current fight, using cancelable.Cancel = true; - Calculate a safe route. - Turn an escape flag to true (a simple boolean) - Make sure you don't start a new fight during the escape using your flag - Turn back the flag to false when your safe condition is met TechMecca and libai 2 Link to comment https://wrobot.eu/forums/topic/15118-how-to-avoid-boss-aoe-in-fight/#findComment-67932 Share on other sites More sharing options...
TechMecca 7 Posted March 31, 2023 Share Posted March 31, 2023 Interesting stuff. Link to comment https://wrobot.eu/forums/topic/15118-how-to-avoid-boss-aoe-in-fight/#findComment-67933 Share on other sites More sharing options...
Matenia 628 Posted March 31, 2023 Share Posted March 31, 2023 2 hours ago, Zer0 said: - Detect the moment you need to escape. - Cancel the current fight, using cancelable.Cancel = true; - Calculate a safe route. - Turn an escape flag to true (a simple boolean) - Make sure you don't start a new fight during the escape using your flag - Turn back the flag to false when your safe condition is met For anyone wondering, this is pretty much the preferred method. You could set WRobot's settings to completely ignore fights after calling Fight.StopFight as well. But this is essentially what I use to escape mobs in HMP too. Unfortunately dynamic escape while avoiding new groups of mobs is quite complicated and will probably never be 100% perfect as you need to also make sure you won't just run in circles etc. Mostly just came here to say Zer0's approach is the one I found to be working best and most reliably. libai 1 Link to comment https://wrobot.eu/forums/topic/15118-how-to-avoid-boss-aoe-in-fight/#findComment-67934 Share on other sites More sharing options...
libai 2 Posted April 3, 2023 Author Share Posted April 3, 2023 On 3/31/2023 at 5:03 PM, Zer0 said: The reason your character only moves a little step is because you're still on the fight thread, so your code only executes for one fight loop iteration. The next iteration, you're back on the normal fight loop which forces you to get in your fight class range. There are two ways I know to prevent this. 1 - Lock the thread in your method. Which in your case would mean calling MovementManager.Go(pathList); and the next line, lock the thread in a while (MovementManager.InMovement) loop. I wouldn't necessary recommend this, because you're blocking the entire fight loop and you will need mutliple conditions to set it right. 2 - Cancel the fight event. This is my preferred option, but it's more complicated to set up. The code Nax has linked you is one I've written. It uses a manager that listens to multiple events. On the ObjectManagerEvents.OnObjectManagerPulsed event, I check and record a list of all the AOEs present in the object manager range. On MovementEvents.OnMovementPulse and MovementEvents.OnMoveToPulse I make sure I don't walk into an AOE, and make sure I never cancel an escape On FightEvents.OnFightStart, I make sure I don't start any fight during an escape This code doesn't really fit your need, because it avoids AOEs that stand on the ground (like a puddle of poison), and uses a "grid" to look for a safe position. In your case, you react to a single action. What you need to do is: - Detect the moment you need to escape. - Cancel the current fight, using cancelable.Cancel = true; - Calculate a safe route. - Turn an escape flag to true (a simple boolean) - Make sure you don't start a new fight during the escape using your flag - Turn back the flag to false when your safe condition is met Thank you for your detailed and patient explanation. Link to comment https://wrobot.eu/forums/topic/15118-how-to-avoid-boss-aoe-in-fight/#findComment-67946 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