November 15, 20178 yr 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
November 15, 20178 yr Hello, you may take a look into: https://wrobot.eu/files/file/1352-apexx-protection-warrior-wotlk-335a-levels-1-52/
November 15, 20178 yr if (Clap.KnownSpell && !ObjectManager.Target.HaveBuff("Thunder Clap") && ObjectManager.Me.Rage >= 15 && enemiesNearMe >= 2))<-remove this one? { Clap.Launch(); }
November 15, 20178 yr 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, 20178 yr by iMod
Create an account or sign in to comment