eeny 523 Posted November 15, 2017 Share Posted November 15, 2017 Im trying to make FC's for vanilla and ship them as .cs files. For the life of me i cant get a "hostile unit near=x" condition to work like it does in the xml FC editor. I cant find any Working examples i can copy the structure from either. Attached is what i currently have- trying to get it to work for Thunderclap... once i have something working i can go apply it to other classes. Anyone got a file i can look at to see how it should work? Warrior_Aoe2.cs Link to comment https://wrobot.eu/forums/topic/7680-objectmanagergetwowunithostile-in-c-fight-class/ Share on other sites More sharing options...
Zan 99 Posted November 15, 2017 Share Posted November 15, 2017 I'll take a look when I get home. Hopefully what I have works on vanilla. Link to comment https://wrobot.eu/forums/topic/7680-objectmanagergetwowunithostile-in-c-fight-class/#findComment-35085 Share on other sites More sharing options...
reapler 154 Posted November 15, 2017 Share Posted November 15, 2017 Hello, you may take a look into: https://wrobot.eu/files/file/1352-apexx-protection-warrior-wotlk-335a-levels-1-52/ Link to comment https://wrobot.eu/forums/topic/7680-objectmanagergetwowunithostile-in-c-fight-class/#findComment-35087 Share on other sites More sharing options...
Zan 99 Posted November 15, 2017 Share Posted November 15, 2017 if (Clap.KnownSpell && !ObjectManager.Target.HaveBuff("Thunder Clap") && ObjectManager.Me.Rage >= 15 && enemiesNearMe >= 2))<-remove this one? { Clap.Launch(); } Link to comment https://wrobot.eu/forums/topic/7680-objectmanagergetwowunithostile-in-c-fight-class/#findComment-35089 Share on other sites More sharing options...
iMod 99 Posted November 15, 2017 Share Posted November 15, 2017 (edited) 1 hour ago, eeny said: Im trying to make FC's for vanilla and ship them as .cs files. For the life of me i cant get a "hostile unit near=x" condition to work like it does in the xml FC editor. I cant find any Working examples i can copy the structure from either. Attached is what i currently have- trying to get it to work for Thunderclap... once i have something working i can go apply it to other classes. Anyone got a file i can look at to see how it should work? Warrior_Aoe2.cs bool thunderClapConditions = (ObjectManager.Me.GetAttackableUnits(8).Count() >= 2) && this.AoeMode; if (this.ThunderClap.Cast(ObjectManager.Me.TargetObject, thunderClapConditions)) { return true; } /// <summary> /// Gets the units around our unit in the given range. /// </summary> /// <param name="range">The range we are looking in.</param> /// <param name="objectType">The object type we are looking for.</param> /// <returns>Returns a list of units if we found one, otherwise a empty list.</returns> public static IEnumerable<WoWUnit> GetAttackableUnits(this WoWUnit instance, int range, WoWObjectType objectType = WoWObjectType.Unit) { // Get units IEnumerable<WoWUnit> results = ObjectManager.GetObjectWoWUnit().Where(u => u.Type == objectType && u.IsAlive && u.MaxHealth > 1 && ((instance.Position.DistanceTo2D(u.Position) - instance.CombatReach) <= range) && u.IsAttackable && !TraceLine.TraceLineGo(u.Position)); // Return return results; } Edited November 15, 2017 by iMod Link to comment https://wrobot.eu/forums/topic/7680-objectmanagergetwowunithostile-in-c-fight-class/#findComment-35090 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