Esempio n. 1
0
        public void BasicHeal(PEntity p)
        {
            PSelect(p.Name.ToString());


            if (p.Health < 40 && ElapsedTime(hFRTime) > (double)FlashofRecovery.Cool && hFRCheck.Checked)
            {
                keys.SendKey(FindKey(hFRKey.Text));
                System.Threading.Thread.Sleep((int)FlashofRecovery.Cast);
                hFRTime = DateTime.Now;
            }
            else if (p.Health < 60 && ElapsedTime(hLRTime) > (double)LightofRecovery.Cool && hLRCheck.Checked)
            {
                keys.SendKey(FindKey(hLRKey.Text));
                System.Threading.Thread.Sleep((int)LightofRecovery.Cast);
                hLRTime = DateTime.Now;
            }
            else if (p.Health < 90 && ElapsedTime(hHLTime) > (double)HealingLight.Cool && hHLCheck.Checked)
            {
                keys.SendKey(FindKey(hHLKey.Text));
                System.Threading.Thread.Sleep((int)HealingLight.Cast);
                hHLTime = DateTime.Now;
            }


            following = false;
        }
Esempio n. 2
0
        // The following functions heal based on class type, really only mages and main tanks
        // need special healing patterns, but we may deversify this later if needed.
        // NOTE: We will eventually move all these percentages into the UI so they can be
        // customized per user.
        public void TankHeal(PEntity p)
        {
            PSelect(p.Name.ToString());


            if (p.Health < 50 && ElapsedTime(hFRTime) > (double)FlashofRecovery.Cool && hFRCheck.Checked)
            {
                lblStatus.Text = "Status: Heal FlashofRecovery";
                keys.SendKey(FindKey(hFRKey.Text));
                System.Threading.Thread.Sleep((int)FlashofRecovery.Cast);
                hFRTime = DateTime.Now;
            }
            else if (p.Health < 79 && ElapsedTime(hRCTime) > (double)RadiantCure.Cool && hRCCheck.Checked)
            {
                lblStatus.Text = "Status: Heal RadiantCure";
                keys.SendKey(FindKey(hRCKey.Text));
                System.Threading.Thread.Sleep((int)RadiantCure.Cast);
                hRCTime = DateTime.Now;
            }
            else if (p.Health < 85 && ElapsedTime(hHLTime) > (double)HealingLight.Cool &&
                     (ElapsedTime(hRCTime) < (double)RadiantCure.Cool || !hRCCheck.Checked) && hHLCheck.Checked)
            {
                lblStatus.Text = "Status: Heal HealingLight";
                keys.SendKey(FindKey(hHLKey.Text));
                System.Threading.Thread.Sleep((int)HealingLight.Cast);
                hHLTime = DateTime.Now;
            }
            else if (p.Health < 90 && ElapsedTime(hLRTime) > (double)LightofRecovery.Cool && hLRCheck.Checked)
            {
                keys.SendKey(FindKey(hLRKey.Text));
                System.Threading.Thread.Sleep((int)LightofRecovery.Cast);
                hLRTime = DateTime.Now;
            }


            following = false;
        }
Esempio n. 3
0
        // Find all our players in the list at start up.
        private void LoadPlayers()
        {
            if (p1Name.Text != "")
            {
                players[0] = new PEntity(FindPlayer(p1Name.Text), p1Type.Text);
                if (players[0].PtrEntity > 0)
                {
                    p1Ico.Show();
                }
                else
                {
                    p1Ico.Hide();
                }
            }

            if (p2Name.Text != "")
            {
                players[1] = new PEntity(FindPlayer(p2Name.Text), p2Type.Text);
                if (players[1].PtrEntity > 0)
                {
                    p2Ico.Show();
                }
                else
                {
                    p2Ico.Hide();
                }
            }

            if (p3Name.Text != "")
            {
                players[2] = new PEntity(FindPlayer(p3Name.Text), p3Type.Text);
                if (players[2].PtrEntity > 0)
                {
                    p3Ico.Show();
                }
                else
                {
                    p3Ico.Hide();
                }
            }

            if (p4Name.Text != "")
            {
                players[3] = new PEntity(FindPlayer(p4Name.Text), p4Type.Text);
                if (players[3].PtrEntity > 0)
                {
                    p4Ico.Show();
                }
                else
                {
                    p4Ico.Hide();
                }
            }

            if (p5Name.Text != "")
            {
                players[4] = new PEntity(FindPlayer(p5Name.Text), p5Type.Text);
                if (players[4].PtrEntity > 0)
                {
                    p5Ico.Show();
                }
                else
                {
                    p5Ico.Hide();
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Follow the main player around.
        /// </summary>
        void Follow()
        {
            // This will eventually switch who it is following if the main player
            // is out of range or dead.
            PEntity p1 = players[0];

            if (p1 != null)
            {
                // May not need this, just being safe.
                if (p1.PtrEntity != 0)
                {
                    // Find our flight time
                    double flighttime = ((double)player.FlightTime / (double)player.MaxFlightTime) * 100;

                    // Find out if the player we are following is flying
                    bool mainflight = p1.Stance == eStance.Flying || p1.Stance == eStance.FlyingCombat;

                    // If they are flying and we have more than half our flight time lets fly as well
                    if (mainflight && !flying && flighttime > 50)
                    {
                        flying    = true;
                        following = false;
                        keys.SendKey(KeyConstants.VK_PRIOR); // hit the page up key
                        System.Threading.Thread.Sleep(3000); // allow time to get airborne
                    }
                    // If they stopped flying so should we
                    else if (!mainflight && flying)
                    {
                        flying    = false;
                        following = false;
                        keys.SendKey(KeyConstants.VK_NEXT);
                        System.Threading.Thread.Sleep(1000);
                    }
                    // Were still flying and running out time, oh crap!
                    else if (flighttime < 25 && flying && ElapsedTime(flightWarn) > 10000)
                    {
                        flightWarn = DateTime.Now;
                        keys.SendLine("/w " + players[0].Name.ToString() + " I need to land soon.");
                    }
                    // If we hit this were probably in trouble and will want to try to re-open
                    // our wings on the next cycle if they are still flying and we have fallen.
                    else if (flighttime < 1 && flying)
                    {
                        flying = false;
                    }


                    // find range
                    double range = player.Distance2D(p1.X, p1.Y);

                    // See if we are close enough to use /follow and not already doing so.
                    if (range < 15 && !following)
                    {
                        PSelectMain();
                        following = true;
                        lost      = false;
                    }
                    // Target is to far for /follow so lets try to catch up if were not lost.
                    else if (range > 15 && range < 100 && !lost)
                    {
                        if (ElapsedTime(chaseTime) > 500)
                        {
                            keys.SendKey(KeyConstants.VK_C);
                            chaseTime = DateTime.Now;
                        }

                        following = false;
                        lost      = false;
                    }
                    // Target is way out there and no way we can follow so let them know and become lost.
                    else if (range > 200 && !lost)
                    {
                        lost      = true;
                        following = false;
                        keys.SendLine("/w " + players[0].Name.ToString() + " You lost me.");
                    }
                }
            }
        }