Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ObjectManager.GetWoWUnitHostile() in c# Fight class

Featured Replies

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

        if (Clap.KnownSpell && !ObjectManager.Target.HaveBuff("Thunder Clap") && ObjectManager.Me.Rage >= 15 && enemiesNearMe >= 2))<-remove this one?
        {
            Clap.Launch();
        }    

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 by iMod

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.