示例#1
0
        private void btn_ShowTarget_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                int targetID = MemoryFunctions.GetTarget();
                Character selected = new Character((uint)targetID, true);
                Character selectedtargetTarget = MemoryFunctions.GetCharacterFromID(selected.TargetID);
                selected.ContainsStatusEffect(1, 1, false, (float) 1.0);
                Debug.Print(selected.Name);
                Debug.Print("Address: " + selected.Address.ToString("X") + "   ID: " +
                                   selected.ID.ToString("X") + "   Dist: " +
                                   _user.DistanceFrom(selected));
                if (selectedtargetTarget != null)
                    Debug.Print("Targets Target: " + selectedtargetTarget.Name);

                foreach (StatusEffect statusEffect in selected.StatusEffects())
                {
                    Debug.Print("SE: " + statusEffect.ID + " From: " + statusEffect.RecievedFrom.ToString("X"));
                }
                Debug.Print(selected.UsingAbilityID.ToString());
                Debug.Print(selected.Owner.ToString());

                List<Gathering> gathering = new List<Gathering>();

                MemoryFunctions.GetGathering(gathering);
                foreach (Gathering gather in gathering)
                {
                    if (gather.Address == targetID)
                        Debug.Print("Target: " + gather.Address.ToString("X") + "   ID: " + gather.ID.ToString("X") + "   Dist: " + _user.Coordinate.Distance2D(gather.Coordinate));

                }
            }
            catch (Exception ex)
            {

            }
        }
示例#2
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);
            bool ignoreDOT = false;
            Hotkeys hotkeys = new Hotkeys();
            hotkeys.RefreshAbilities();

            if (hotkeys[STRAIGHTSHOT].InRange == 0)
                return;

            UIWindow ui = new UIWindow();
            ui.RefreshPointers();

            //  if (ui.GetActiveWindowName() == "chatlog")
            //      return;

            monster.Target();
            recast.Refresh(2.1);
            user.Refresh();

            if (user.ContainsStatusEffect2(451, (float) 3.5))
            {
                Debug.Print("Cursed Voice");
                SoundModule.PlayAsyncSound("cursedVoice.wav");

                while (user.ContainsStatusEffect(451, 0, false))
                {
                    Thread.Sleep(100);
                }

                Thread.Sleep(200);
                user.Refresh();
            }

            if (monster.Name.ToLower().Contains("renaud"))
                return;

            // Stop for turn 6 ability
            if (monster.UsingAbilityID == 1949)
            {
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }

            List<Character> nearMobs = monster.MonstersNear(100.0);

            // Blight Turn 6
            if (nearMobs.Any(mob => mob.UsingAbilityID == 1949))
            {
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }

            // Turn 7 Petrification
            if (nearMobs.Any(mob => mob.UsingAbilityID == 1979))
            {
                SoundModule.PlayAsyncSound("petrification.wav");
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }
            if (nearMobs.Any(mob => mob.UsingAbilityID == 1969))
            {
                SoundModule.PlayAsyncSound("petrification.wav");
                //Utilities.Keyboard.KeyBoardHelper.Ctrl(Keys.D6);
                return;
            }

            if (user.ContainsStatusEffect(452, 0, false))
            {
                SoundModule.PlayAsyncSound("Shriek.wav");
            }

            //if (nearMobs.Any(mob => mob.UsingAbilityID == 1967))
            //{
            //    if (user.ContainsStatusEffect(452, 0, false))
            //    {
            //        SoundModule.PlayAsyncSound("Shriek.wav");
            //    }
            //    else
            //    {
            //        SoundModule.PlayAsyncSound("Shriek2.wav");
            //    }
            //}

            if (MemoryFunctions.GetGroundCursor() > 0)
                return;

            foreach (string mobToIgnore in _ignoreDOTMobs)
            {
                if (monster.Name.ToLower().Contains(mobToIgnore.ToLower()) &&
                    monster.Name.ToLower().Contains("gaoler") == false)
                {
                    ignoreDOT = true;
                }
            }

            if (MemoryFunctions.GetMapID() == 364 && monster.Name.Contains("Good King") == false)
                ignoreDOT = true;

            if (hotkeys[INTERNALRELEASE].PercentReady >= 99 &&
                user.Level >= 26 && Global.DisableBuffs == false && user.TP_Current >= 40 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(INTERNALRELEASE, 21, MemoryFunctions.ActionType.Ability);
                hotkeys[INTERNALRELEASE].UseAbility();
            }
            else if (recast.WeaponSpecials.Count == 0)
            {
                if ((user.ContainsStatusEffect(130, 0, false, (float) 3.0) == false ||
                     user.ContainsStatusEffect(122, 0, false)) && user.Level >= 2 && user.TP_Current >= 70)
                {
                    //MemoryFunctions.ForceAction(STRAIGHTSHOT, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[STRAIGHTSHOT].UseAbility();
                }
                else if (monster.ContainsStatusEffect(124, user.ID, true, (float) 2.5) == false &&
                         user.Level >= 6 && user.TP_Current >= 100 && ignoreDOT == false && monster.StatusEffects().Count < 29)
                {
                    //MemoryFunctions.ForceAction(VENOMOUSBITE, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[VENOMOUSBITE].UseAbility();
                }
                else if (monster.ContainsStatusEffect(129, user.ID, true, (float) 2.5) == false &&
                         user.Level >= 30 && user.TP_Current >= 100 && monster.StatusEffects().Count < 29 &&
                         (ignoreDOT == false || monster.Name.ToLower().Contains("infernal nail")))
                {
                    //MemoryFunctions.ForceAction(WINDBITE, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[WINDBITE].UseAbility();
                }
                else if (hotkeys[HAYMAKER].Highlighted && user.Level >= 10 && user.TP_Current >= 40)
                {
                    //MemoryFunctions.ForceAction(HAYMAKER, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[HAYMAKER].UseAbility();
                }
                else if (user.TP_Current >= 60)
                {
                    //MemoryFunctions.ForceAction(HEAVYSHOT, 20, MemoryFunctions.ActionType.WS);
                    hotkeys[HEAVYSHOT].UseAbility();
                }
            }
            else if (hotkeys[INVIGORATE].PercentReady >= 100 && user.Level >= 4 &&
                     user.TP_Current <= 550 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(INVIGORATE, 20, MemoryFunctions.ActionType.Ability);
                hotkeys[INVIGORATE].UseAbility();

            }
            else if (hotkeys[RAGINGSTRIKES].PercentReady >= 100 && user.Level >= 4 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(RAGINGSTRIKES, 19, MemoryFunctions.ActionType.Ability);
                hotkeys[RAGINGSTRIKES].UseAbility();
            }
            else if (hotkeys[BLOODFORBLOOD].PercentReady >= 100 && user.Level >= 38 &&
                     monster.Name.Contains("Twintania") == false &&
                     monster.Name.Contains("Conflagration") == false && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
                // && user.ContainsStatusEffect(125, 0, false) == false
            {
                //MemoryFunctions.ForceAction(BLOODFORBLOOD, 20, MemoryFunctions.ActionType.Ability);
                hotkeys[BLOODFORBLOOD].UseAbility();
            }
            else if (
                hotkeys[BLOODFORBLOOD].PercentReady >= 100 && user.Level >= 38 && monster.Name.Contains("Twintania") &&
                monster.Health_Percent <= 55 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
                // && user.ContainsStatusEffect(125, 0, false) == false
            {
                //MemoryFunctions.ForceAction(BLOODFORBLOOD, 20, MemoryFunctions.ActionType.Ability);
                hotkeys[BLOODFORBLOOD].UseAbility();
            }
            else if (hotkeys[HAWKSEYE].PercentReady >= 100 && user.Level >= 26 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(HAWKSEYE, 15, MemoryFunctions.ActionType.Ability);
                hotkeys[HAWKSEYE].UseAbility();
            }
            else if (hotkeys[BARRAGE].PercentReady >= 100 &&
                     user.Level >= 38 && monster.Name.Contains("Twintania") == false &&
                     monster.Name.Contains("Conflagration") == false && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BARRAGE, 12, MemoryFunctions.ActionType.Ability);
                hotkeys[BARRAGE].UseAbility();
            }
            else if (hotkeys[BARRAGE].PercentReady >= 100 &&
                     user.Level >= 38 && monster.Name.Contains("Twintania") &&
                     monster.Health_Percent <= 55 && Global.DisableBuffs == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BARRAGE, 12, MemoryFunctions.ActionType.Ability);
                hotkeys[BARRAGE].UseAbility();
            }

            else if (hotkeys[BLOODLETTER].PercentReady >= 99 && user.Level >= 12 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BLOODLETTER, 16, MemoryFunctions.ActionType.Ability);
                hotkeys[BLOODLETTER].UseAbility();
            }
            else if (monster.Health_Percent <= 20 &&
                     hotkeys[MISERYSEND].PercentReady >= 99 && user.Level >= 8 && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(MISERYSEND, 16, MemoryFunctions.ActionType.Ability);
                hotkeys[MISERYSEND].UseAbility();
            }
            else if (
                hotkeys[BLUNTARROW].PercentReady >= 99 && user.Level >= 42 && Global.StunBotOpen == false && hotkeys[HEAVYSHOT].PercentReady <= 78)
            {
                //MemoryFunctions.ForceAction(BLUNTARROW, 16, MemoryFunctions.ActionType.Ability);
                hotkeys[BLUNTARROW].UseAbility();
            }
        }