Inheritance: WoWObject
Ejemplo n.º 1
0
        //private Queue<Location> CreatePathFrom(Location start)
        //{
        //    var synclist = Locations;
        //    var position = synclist.FindIndex(l => l == start);
        //    var queue = new Queue<Location>(synclist);
        //    for (int i = 0; i < position; i++)
        //        queue.Dequeue();
        //    return queue;
        //}
        public override void OnStart()
        {
            LastIndex = 0;
            currentLocation = null;
            Locations.Clear();

            Print("Starting breadcrumb system!");

            var tank = WoWParty.Members.OrderByDescending(m => m.MaxHealth).First() ?? WoWUnit.Invalid;
            if (tank.IsValid)
            {
                if (tank.InLoS)
                {
                    FollowUnit = tank;
                    UnitFacing = tank.Facing;
                    Locations.Add(FollowUnit.Location);
                    currentLocation = Locations[0];
                }
                else
                {
                    Print("Get in LoS of {0}.", tank.Name);
                    Stop();
                }
            }
            else
            {
                Print("No suitable unit to follow found, are you in group?");
                Stop();
            }
        }
Ejemplo n.º 2
0
        public override void Run()
        {
            CurrentLootable = Lootables.FirstOrDefault() ?? WoWUnit.Invalid;

            if (CurrentLootable != null && CurrentLootable.IsValid)
            {
                if (CurrentLootable.Distance > 4f)
                {
                    if (Mover.Status != MovementStatus.Moving || Mover.Destination != CurrentLootable.Location)
                    {
                        _parent.Print("Moving to loot {0}", CurrentLootable.Name);
                        if (!Mover.PathTo(CurrentLootable.Location))
                            _parent.Blacklisted.Add(CurrentLootable.Guid);

                    }
                    _parent.FSM.DelayNextPulse(500);
                }
                else
                {
                    CurrentLootable.Interact();
                    if (Manager.LocalPlayer.IsLooting)
                    {
                        WoWScript.ExecuteNoResults(
                            "local res = GetCVar(\"AutoLootDefault\") if res == \"0\" then for i = GetNumLootItems(), 1, -1 do LootSlot(i) end end CloseLoot()");
                    }
                    _parent.FSM.DelayNextPulse(2000);
                }
            }
        }
Ejemplo n.º 3
0
        public override void Run()
        {
            CurrentEnemy = Enemies.FirstOrDefault() ?? WoWUnit.Invalid;

            if (CurrentEnemy != null && CurrentEnemy.IsValid)
            {
                if (CurrentEnemy.Distance > 20f) //tmp distance
                {
                    if (Mover.Status != MovementStatus.Moving || CurrentEnemy.Location.DistanceTo(Mover.Destination) > 15f)
                    {
                        _parent.Print("Moving to {0}", CurrentEnemy.Name);
                        if (!Mover.PathTo(CurrentEnemy.Location))
                            _parent.Blacklisted.Add(CurrentEnemy.Guid);
                    }
                    _parent.FSM.DelayNextPulse(500);
                }
                else
                {
                    if (!Manager.LocalPlayer.IsCasting)
                    {
                        Combat.Brain.Pull(CurrentEnemy);
                    }
                    _parent.FSM.DelayNextPulse(1000);
                }
            }
        }
Ejemplo n.º 4
0
 public void ExecuteEx(WoWUnit unit)
 {
     Log.WriteLine("Casting {0} on {1}", SpellName, unit.Name);
     WoWSpell.GetSpell(SpellName).Cast(unit);
     Sleep(Globals.SpellWait);
 }
Ejemplo n.º 5
0
 public void Pull(WoWUnit unit)
 {
     if (unit == null || !unit.IsValid)
         return;
     try
     {
         Mover.StopMoving();
         unit.Face();
         unit.Select();
         Manager.LocalPlayer.StartAttack();
         PullSpell.ExecuteEx(unit);
     }
     catch (Exception) { }
 }
Ejemplo n.º 6
0
        public void Cast(WoWUnit target)
        {
            if (!IsValid)
                return;

            if (target == null || !target.IsValid)
                return;

            //target.Select();
            //WoWScript.ExecuteNoResults("CastSpellByID(" + Id + ")");
            castSpell(Id, guid: target.Guid);
        }