示例#1
0
        public KillIndex(Mobile from, KillBook book, ArrayList list) : base(100, 100)
        {
            m_Book     = book;
            m_KillList = list;

            PlayerMobile m = from as PlayerMobile;

            from.CloseGump(typeof(KillIndex));

            AddPage(0);

            AddImage(3, 18, 2200);             //Book
            AddImage(63, 89, 9804);            //Skull
            AddLabel(70, 132, 136, "Kill Book");

            AddLabel(204, 32, 0, "Kill List");
            AddButton(271, 34, 5601, 5605, 1, GumpButtonType.Reply, 0);

            //Seperators
            for (int s = 0; s < 5; s++)
            {
                AddImage(216 + (s * 16), 53, 58);
                AddImage(186, 53, 57);
                AddImage(296, 53, 59);
            }

            if (from == m_Book.BookOwner && m_Book.BookOwner != null)
            {
                Owner(m);
            }
            else
            {
                Spectator(m_Book.BookOwner, m_Book.TotKills, m_Book.TotDeaths);
            }
        }
示例#2
0
        public KillSearch(string searchString, KillBook book, ArrayList list) : base(100, 100)
        {
            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            m_SearchString = searchString;
            m_KillList     = list;
            m_Book         = book;

            AddPage(0);

            AddImage(3, 18, 2200);             //Book
            AddImage(63, 89, 9804);            //Skull
            AddLabel(70, 132, 136, "Kill Book");

            //Search
            AddLabel(35, 170, 0, "Search Name");
            AddTextEntry(33, 193, 125, 20, 0, 0, "Name");
            AddButton(122, 173, 5601, 5605, 2, GumpButtonType.Reply, 0);

            AddLabel(204, 32, 0, "Back");
            AddButton(271, 34, 5601, 5605, 1, GumpButtonType.Reply, 0);

            //Seperators
            for (int s = 0; s < 5; s++)
            {
                AddImage(216 + (s * 16), 53, 58);
                AddImage(186, 53, 57);
                AddImage(296, 53, 59);
            }

            AddPage(1);

            for (int i = 0; i < m_KillList.Count; i++)
            {
                foreach (DeathEntry o in m_KillList)
                {
                    if (o.Name == m_SearchString)
                    {
                        AddHtml(204, 75, 100, 17, m_SearchString, false, false);
                        AddHtml(294, 75, 60, 17, o.Deaths.ToString(), false, false);
                    }
                }

                /*else
                 * {
                 *      AddLabel( 204, 75, 0x25, "No entries found");
                 * }*/
            }
        }
示例#3
0
        public static void Killed(Mobile m)           //done
        {
            PlayerMobile owner    = m as PlayerMobile;
            PlayerMobile m_Killer = owner;

            TimeSpan lastTime = TimeSpan.MaxValue;

            for (int i = 0; i < owner.Aggressors.Count; ++i)
            {
                AggressorInfo info = (AggressorInfo)owner.Aggressors[i];

                if (info.Attacker.Player && (DateTime.Now - info.LastCombatTime) < lastTime)
                {
                    m_Killer = info.Attacker as PlayerMobile;
                    lastTime = (DateTime.Now - info.LastCombatTime);
                }
            }

            if (m_Killer != null && m_Killer.Player && owner != null && owner.Player)
            {
                KillBook book = m_Killer.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (book != null)
                {
                    if ((owner != book.BookOwner) && (m_Killer == book.BookOwner))
                    {
                        book.AddEntry(owner.Name, 1);
                        book.TotKills++;
                    }
                }
            }

            if (owner != null && owner.Player && m_Killer != null && m_Killer.Player)
            {
                KillBook deathbook = owner.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (deathbook != null)
                {
                    if (owner == deathbook.BookOwner)
                    {
                        if (deathbook.TotDeaths >= 0)
                        {
                            deathbook.TotDeaths++;
                        }
                    }
                }
            }
        }
示例#4
0
        public static void Killed(Mobile m)           //done
        {
            PlayerMobile owner = m as PlayerMobile;

            Mobile m_Killer = m.LastKiller;


            if (m_Killer != null && m_Killer.Player && owner != null && owner.Player)
            {
                KillBook book = null;

                if (m_Killer.Backpack != null)
                {
                    book = m_Killer.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;
                }

                if (book != null)
                {
                    if ((owner != book.BookOwner) && (m_Killer == book.BookOwner))
                    {
                        book.AddEntry(owner.Name, 1);
                        book.TotKills++;
                    }
                }
            }

            if (owner != null && owner.Player && m_Killer != null && m_Killer.Player)
            {
                KillBook deathbook = owner.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (deathbook != null)
                {
                    if (owner == deathbook.BookOwner)
                    {
                        if (deathbook.TotDeaths >= 0)
                        {
                            deathbook.TotDeaths++;
                        }
                    }
                }
            }
        }
示例#5
0
        public KillGump(Mobile from, KillBook book, ArrayList list) : base(100, 100)
        {
            m_KillList = list;
            m_Book     = book;

            AddPage(0);

            AddImage(3, 18, 2200);             //Book

            AddLabel(88, 27, 196, "My Kill Book");
            AddButton(73, 32, 2103, 2103, 1, GumpButtonType.Reply, 0);             //Kill Menu

            //Seperators
            for (int s = 0; s < 10; s++)
            {
                AddImage(27, 64, 57);
                AddImage(137, 64, 59);

                if (s < 5)
                {
                    AddImage(57 + ((s % 5) * 16), 64, 58);
                }
                else
                {
                    AddImage(218 + ((s % 5) * 16), 64, 58);
                }

                AddImage(188, 64, 57);
                AddImage(298, 64, 59);
            }

            //Headings
            AddLabel(041, 47, 0, "Name");
            AddLabel(121, 47, 0, "Kills");
            AddLabel(201, 47, 0, "Name");
            AddLabel(281, 47, 0, "Kills");

            if (m_KillList.Count == 0)
            {
                AddLabel(35, 82, 0x25, "No victims killed");
            }

            for (int i = 0, l = 0; i < m_KillList.Count && l <= 18; i++, l++)
            {
                if ((i % 18) == 0)
                {
                    if (i != 0)
                    {
                        AddButton(297, 22, 2206, 2206, 0, GumpButtonType.Page, (i / 18) + 1);                            //Next page
                    }
                    if (i != 0)
                    {
                        l = 0;
                    }

                    AddPage((i / 18) + 1);

                    if (i != 0)
                    {
                        AddButton(25, 22, 2205, 2205, 0, GumpButtonType.Page, (i / 18));                           //Previous Page
                    }
                }

                DeathEntry o = (DeathEntry)m_KillList[i];

                if (l <= 8)
                {
                    AddLabelCropped(40, 75 + ((l % 9) * 15), 100, 17, 0, o.Name);
                    AddLabelCropped(140, 75 + ((l % 9) * 15), 60, 17, 0, o.Deaths.ToString());
                }
                else
                {
                    AddLabelCropped(204, 75 + ((l % 9) * 15), 100, 17, 0, o.Name);                          //Right
                    AddLabelCropped(294, 75 + ((l % 9) * 15), 60, 17, 0, o.Deaths.ToString());
                }
            }
        }
示例#6
0
        //28MAR2007 Adding Web Based List *** END ***

        public static void Killed(Mobile m) //done
        {
            PlayerMobile owner = m as PlayerMobile;

            Mobile m_Killer = (Mobile)m.LastKiller;

            Mobile from = (Mobile)m.LastKiller;

            if (m_Killer != null && m_Killer.Player && owner != null && owner.Player)
            {
                KillBook book = m_Killer.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (book != null)
                {
                    if ((owner != book.BookOwner) && (m_Killer == book.BookOwner))
                    {
                        book.AddEntry(owner.Name, 1);
                        book.TotKills++;

                        //28MAR2007 Adding Web Based List *** START ***
                        /*********************************************************/
                        /*             path to where your website is stored      */
                        string path = "C:/Inetpub/wwwroot/status/web/kills";
                        /*********************************************************/

                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }

                        //if (!File.Exists(path + "/index.html"))
                        //{
                        //    //29MAR2006 Checks for index.html file if not present it creates one
                        //    using (StreamWriter op = new StreamWriter(path + "/index.html"))
                        //    {
                        //        op.WriteLine("<html>");
                        //        op.WriteLine("   <head>");
                        //        op.WriteLine("      <title>Book of Kills - updated by Ravon of An Nox</title>");
                        //        op.WriteLine("   </head>");
                        //        op.WriteLine("   <body bgcolor=\"black\">");
                        //        op.WriteLine("      <a href='http://annox.no-ip.com'><img border='0' src='http://bp2.blogger.com/_CGKuPVAFxb0/Rgp566xjEaI/AAAAAAAAAFo/Dv4bJaNU_xs/s200/Cemetery.jpg' alt='http://annox.no-ip.com' /></a>");
                        //        op.WriteLine("      <h1><font color='red'>Book of Kills Index</h1>");
                        //        op.WriteLine("      <font color='yellow'><a href='http://annox.no-ip.com/status/web/kills/{0}.html'>{1}</a><font color='white'> began killing on {2}.<br>", Encode(m_Killer.Name), Encode(m_Killer.Name), DateTime.Now);
                        //        op.WriteLine("   </body>");
                        //        op.WriteLine("</html>");
                        //    }
                        //}
                        //else
                        //{
                        //    //29MAR2006 Checks for index.html file it is present and adds information
                        //    using (StreamWriter op = File.AppendText(path + "/index.html"))
                        //    {
                        //        op.WriteLine("<html>");
                        //        op.WriteLine("   <body bgcolor=\"black\">");
                        //        op.WriteLine("      <font color='yellow'><a href='http://annox.no-ip.com/status/web/kills/{0}.html'>{1}</a><font color='white'> began killing on {2}.<br>", Encode(m_Killer.Name), Encode(m_Killer.Name), DateTime.Now);
                        //        op.WriteLine("   </body>");
                        //        op.WriteLine("</html>");
                        //    }
                        //}

                        //if (!File.Exists(path + "/" + Encode(m_Killer.Name) + ".html"))
                        if (!File.Exists(path + "/index.html"))
                        {
                            //29MAR2006 Creates m_Killer.Name.html file
                            //using (StreamWriter op = new StreamWriter(path + "/" + Encode(m_Killer.Name) + ".html"))
                            using (StreamWriter op = new StreamWriter(path + "/index.html"))
                            {
                                op.WriteLine("<html>");
                                op.WriteLine("   <head>");
                                op.WriteLine("      <title>Book of Kills - updated by Ravon of An Nox</title>");
                                op.WriteLine("   </head>");
                                op.WriteLine("   <body bgcolor=\"black\">");
                                op.WriteLine("      <a href='http://annox.no-ip.com'><img border='0' src='http://bp2.blogger.com/_CGKuPVAFxb0/Rg2-IKxjEdI/AAAAAAAAAGE/tyKWGQFaFic/s200/laugh.jpg' alt='http://annox.no-ip.com' /></a>");
                                //op.WriteLine("      <h1><font color='red'>{0} Kill Status</font></h1>", Encode(m_Killer.Name));
                                op.WriteLine("      <h1><font color='red'>The Book of Kills</font></h1>");
                                //op.WriteLine("      <font color='white'>Kill #{0}</font><br>", book.TotKills);
                                op.WriteLine("      <font color='yellow'>{0}</font><font color='white'> has killed {1} people.  {2}'s last kill was </font><font color='cyan'>{3}</font> ", Encode(m_Killer.Name), book.TotKills, Encode(m_Killer.Name), Encode(owner.Name));
                                op.WriteLine("      <font color='white'>in </font><font color='gold'>{0}</font> ", m.Region.Name);
                                op.WriteLine("      <font color='white'>(</font> <font color=\"khaki\">{0}, {1}, {2}</font>)<font color='white'>) in the land of {3}</font> ", from.X, from.Y, from.Z, from.Map);
                                op.WriteLine("      <font color='white'>on </font><font color=\"red\">{0}.</font><br>", DateTime.Now);
                                op.WriteLine("   </body>");
                                op.WriteLine("</html>");
                            }
                        }
                        else
                        {
                            //29MAR2006 Update m_Killer.Name.html file (Yes, this seems repetive, my mental block)
                            //13NOV2007 Mental block cleared, append not new, duh
                            //using (StreamWriter op = new StreamWriter(path + "/" + m_Killer.Name + ".html"))
                            //using (StreamWriter op = File.AppendText(path + "/" + Encode(m_Killer.Name) + ".html"))
                            using (StreamWriter op = File.AppendText(path + "/index.html"))
                            {
                                op.WriteLine("<html>");
                                op.WriteLine("   <body bgcolor=\"black\">");
                                op.WriteLine("      <font color='yellow'>{0}</font><font color='white'> has killed {1} people.  {2}'s last kill was </font><font color='cyan'>{3}</font> ", Encode(m_Killer.Name), book.TotKills, Encode(m_Killer.Name), Encode(owner.Name));
                                op.WriteLine("      <font color='white'>in </font><font color='gold'>{0}</font> ", m.Region.Name);
                                op.WriteLine("      <font color='white'>(</font> <font color=\"khaki\">{0}, {1}, {2}</font>)<font color='white'>) in the land of {3}</font> ", from.X, from.Y, from.Z, from.Map);
                                op.WriteLine("      <font color='white'>on </font><font color=\"red\">{0}.</font><br>", DateTime.Now);
                                op.WriteLine("   </body>");
                                op.WriteLine("</html>");
                            }
                        }
                        //28MAR2007 Adding Web Based List *** END   ***
                    }
                }
            }

            if (owner != null && owner.Player && m_Killer != null && m_Killer.Player)
            {
                KillBook deathbook = owner.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (deathbook != null)
                {
                    if (owner == deathbook.BookOwner)
                    {
                        if (deathbook.TotDeaths >= 0)
                        {
                            deathbook.TotDeaths++;
                        }
                    }
                }
            }
        }