March 7, 20206 yr Hi! I'm writing a new product but I don't quite know how to call a fight class from it. for another bot, I simply called CustomClasses.Instance.Current.Fight(ObjectManager.Instance.Units.Where(x => x.IsInCombat)); but for wRobot, I don't quite know what to call... do I simply do this? internal class Fight : TreeTask { public override int Priority => 1000; public override bool Activate() { return Party.GetParty().Any(x => x.InCombat) && !ObjectManager.Me.IsSwimming; } public override void Execute() { CustomClass.LoadCustomClass(); } } Edited March 7, 20206 yr by krycess
March 8, 20206 yr You only load CustomClass once when the product starts. The fightclass runs on its own thread. For starting an actual fight, look into the "Grinding" state .
March 8, 20206 yr Author It still isn't clicking for me. Is this the right "state" that you are talking about? internal class Fight : TreeTask { public Fight() { GrindingState = new Grinding(); } public override int Priority => 1000; public override bool Activate() { return Party.GetParty().Any(x => x.InCombat) && !ObjectManager.Me.IsSwimming; } public override void Execute() { GrindingState.Run(); } Grinding GrindingState { get; } } Edited March 8, 20206 yr by krycess
March 8, 20206 yr If you're not using the FSM, you need to write your combat behavior completely from scratch. Look into what the class "Fight" actually does. Just instantiating a state does nothing. Decompile and look at it. Take a look at the Grinder project that Droidz uploaded as an example for products.
March 8, 20206 yr Author yeah I wasn't planning on using the FSM so I would need to add combat behavior from scratch. I have written all of this before for another platform so I would just have to port it over. It would require a totally different type of "fightclass" however... so maybe it should be all inclusive before I release Edited March 8, 20206 yr by krycess
Create an account or sign in to comment