Exemplo n.º 1
0
            public RobotSchematicsGump(Mobile from, RobotSchematics gBook) : base(25, 25)
            {
                m_Book = gBook;
                RobotSchematics pedia = (RobotSchematics)gBook;

                string sText = "This schematic contains the knowledge to construct a robot. With these plans you will see what you need to obtain in order to have it constructed. These items are particularly used in the construction of robots. You will need metal, bolts, engine parts, circuit boards, gears, transistors, oil, and xormite for the tinker's fee. The tinker that can actually construct this robot is at the location shown at the bottom of this screen. If you have any tinkering skill, they may refund some of the xormite for the help you may provide in the construction. These robots are programmed for combat and will consume 3 follower slots to accompany you. As you find materials, simply drag and drop them onto this data pad to add to the materials. The top half of the screen will track what you have obtained thus far. When every item is acquired, give this data pad to a tinker and they will construct your robot. The robot built will be yours alone, and it will have a limited amount of charges. A charge is used whenever you power on the robot to travel with you. You will have to obtain more batteries in order to add more charges, where each battery will add an extra charge. A robot can only hold 100 charges at a time. Robots are controlled just like tamed beasts or summoned creatures. They can be told to follow, stay, or stop. You can also dismiss the robot, where the robot item will reappear in your pack. They are automatons so they do not need to be fed, other than the batteries already mentioned. Remember, they are not transferable once constructed. The one giving the tinker the book will own the robot that is constructed.";

                this.Closable   = true;
                this.Disposable = true;
                this.Dragable   = true;
                this.Resizable  = false;

                AddPage(0);
                AddImage(0, 0, 30521);
                AddItem(596, 33, 13697);

                AddHtml(46, 42, 310, 20, @"<BODY><BASEFONT Color=#00FF06>Robot Schematics</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(45, 81, 13636);
                AddHtml(85, 83, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Sheet Metal</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(245, 83, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveMetalQty.ToString() + "/" + gBook.NeedMetalQty.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(46, 114, 13505);
                AddHtml(85, 116, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Engine Parts</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(245, 116, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveEngineParts.ToString() + "/" + gBook.NeedEngineParts.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(44, 149, 13421);
                AddHtml(85, 151, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Curcuit Board</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(245, 151, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveCircuitBoard.ToString() + "/" + gBook.NeedCircuitBoard.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(46, 183, 13382);
                AddHtml(85, 185, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Transistors</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(245, 185, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveTransistors.ToString() + "/" + gBook.NeedTransistors.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(46, 218, 8238);
                AddHtml(85, 220, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Gears</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(245, 220, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveGears.ToString() + "/" + gBook.NeedGears.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(396, 184, 13635);
                AddHtml(435, 185, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Oil</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(595, 185, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveOil.ToString() + "/" + gBook.NeedOil.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(394, 218, 8225);
                AddHtml(435, 220, 136, 20, @"<BODY><BASEFONT Color=#00FF06>Bolts</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
                AddHtml(595, 220, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveBolts.ToString() + "/" + gBook.NeedBolts.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddItem(398, 41, 3823, 0xB96);
                AddHtml(439, 43, 136, 20, @"<BODY><BASEFONT Color=#00FF06>" + gBook.HaveXormite.ToString() + "/" + gBook.NeedXormite.ToString() + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddHtml(55, 256, 660, 321, @"<BODY><BASEFONT Color=#00FF06>" + sText + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);

                AddHtml(55, 593, 653, 20, @"<BODY><BASEFONT Color=#00FF06>Bring Gathered Materials to the Tinker in " + gBook.TinkerLocation + "</BIG></BASEFONT></BODY>", (bool)false, (bool)false);
            }
Exemplo n.º 2
0
        public static bool ProcessRobotBook(Mobile m, Mobile tinker, Item dropped)
        {
            RobotSchematics book = (RobotSchematics)dropped;

            if (Server.Misc.Worlds.GetRegionName(tinker.Map, tinker.Location) != book.TinkerLocation)
            {
                return(false);
            }

            int tinkerSkill = (int)(m.Skills[SkillName.Tinkering].Value);

            if (tinkerSkill > 100)
            {
                tinkerSkill = 100;
            }

            int XormiteReturn = 0;

            if (tinkerSkill > 0)
            {
                XormiteReturn = (int)(book.NeedXormite * (tinkerSkill * 0.005));
            }

            int HaveIngredients = 0;

            if (book.HaveEngineParts >= book.NeedEngineParts)
            {
                HaveIngredients++;
            }
            if (book.HaveCircuitBoard >= book.NeedCircuitBoard)
            {
                HaveIngredients++;
            }
            if (book.HaveGears >= book.NeedGears)
            {
                HaveIngredients++;
            }
            if (book.HaveTransistors >= book.NeedTransistors)
            {
                HaveIngredients++;
            }
            if (book.HaveXormite >= book.NeedXormite)
            {
                HaveIngredients++;
            }
            if (book.HaveOil >= book.NeedOil)
            {
                HaveIngredients++;
            }
            if (book.HaveMetalQty >= book.NeedMetalQty)
            {
                HaveIngredients++;
            }
            if (book.HaveBolts >= book.NeedBolts)
            {
                HaveIngredients++;
            }

            if (HaveIngredients < 8)
            {
                return(false);
            }

            if (XormiteReturn > 0)
            {
                m.AddToBackpack(new DDXormite(XormiteReturn)); tinker.Say("Here is " + XormiteReturn.ToString() + " xormite back for all of your help.");
            }

            RobotItem ball = new RobotItem();

            ball.RobotOwner = m.Serial;
            ball.Hue        = 0;

            m.AddToBackpack(ball);

            LoggingFunctions.LogGenericQuest(m, "had a robot built");

            m.PrivateOverheadMessage(MessageType.Regular, 1153, false, "My robot has been built.", m.NetState);
            m.SendSound(0x559);

            dropped.Delete();

            return(true);
        }