Jump to content

Apexx

Elite user
  • Posts

    332
  • Joined

Posts posted by Apexx

  1. You can Subscribe to the events inside the Initialize() Method like the following (be sure to Unsubscribe from the event on Dispose):

    ** Code is not tested **

    public void Initialize()
    {
    	wManager.Events.FightEvents.OnFightEnd += FightEventsOnFightEnd;	// Subscribe to the Event
    	_isLaunched = true;
    	// ...
    }
    
    public void Dispose()
    {
     	wManager.Events.FightEvents.OnFightEnd -= FightEventsOnFightEnd;	// Unsubscribe from the Event
    	_isLaunched = false;
    	// ...
    }
    
    private void FightEventsOnFightEnd (ulong guid)
    {
    	Random _rand = new Random();
        Logging.WriteDebug("FightEventsOnFightEnd()");
      	// Wait some random time
      	Thread.Sleep(_rand.Next(2000, 5000));
    }


     

  2. I am not sure if this works, as I have not tested it, but try and play around with this:

    private bool IsRangedPullBetter()
    {
        // Create a list
        var mobsAroundMe = new List<WoWUnit>();
    
        // Check my target's surroundings for mobs that are valid, alive, attackable, and within
        // 7 yards of target and sort them in the list from closest to furthest from player's position
        if (ObjectManager.Me.HasTarget)
        {
            mobsAroundMe.AddRange(ObjectManager.GetObjectWoWUnit().Where(u =>
            u != null && u.IsValid && u.IsAlive && u.IsAttackable &&
            u.Position.DistanceTo(ObjectManager.Target.Position) <= 7.0f).OrderBy(n =>
            ObjectManager.Me.Position.DistanceTo(n.Position)));
        }
    
        // Number of mobs within 7 yards of my target = mobsAroundMe.Count();
    
        // I may want to use a pull spell if there are more than 2 mobs near my target
        if (mobsAroundMe.Count() > 2)
        {
            return true;
        }
        return false;
    }

     

  3. Hello, I was wondering if anyone had the offset value for MoP 5.4.8 (18414) Main hand item id for player as well as unit? Thanks in advance!

    public static int MainHandId(WoWUnit unit)
    {
        // Using 3.3.5a(12340) offsets.
        if (unit.PlayerControlled)
            return wManager.Wow.Memory.WowMemory.Memory.ReadInt32(unit.GetDescriptorAddress(0x4E4));
    
        return wManager.Wow.Memory.WowMemory.Memory.ReadInt32(unit.GetDescriptorAddress(0xE0));
    }

     

  4. Hey there, just briefly looking at your code, I was wondering if declaring those boolean variables at the top of your class changes anything? Just a thought...

    private bool burstMode;
    private bool aoeMode;
    public class Main : ICustomClass
    {
        public float Range { get { return 30; } }
    
        private bool _isLaunched;
        private ulong _lastTarget;
    	
        private bool burstMode;
        private bool aoeMode;
    
    
        public void Initialize() // When product started, initialize and launch Fightclass
        {

     

×
×
  • Create New...