Ejemplo n.º 1
0
        private static void OnAddBP(CommandEventArgs e)
        {
            Mobile           from      = e.Mobile;
            BonusPackControl b_control = null;
            bool             r_active  = false;

            foreach (Item i in World.Items.Values)
            {
                if (i is RCChest)
                {
                    r_active = true;
                }
            }

            if (r_active)
            {
                BonusPackOrb b_orb = new BonusPackOrb();

                foreach (Item i in World.Items.Values)
                {
                    if (i is BonusPackControl)
                    {
                        b_control = i as BonusPackControl;
                    }
                }

                if (b_control != null)
                {
                    b_orb.BPNumber      = b_control.A_BP + 1;
                    b_control.B_Current = b_orb.BPNumber;
                }

                from.SendGump(new BonusPackGump(from, b_orb));
            }
        }
Ejemplo n.º 2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile           from      = sender.Mobile;
            BonusPackOrb     b_orb     = null;
            RCCONTROL        rc        = null;
            BonusPackControl b_control = null;
            Bag d_bag = new Bag();

            foreach (Item h in World.Items.Values)
            {
                if (h is BonusPackControl)
                {
                    b_control = h as BonusPackControl;
                }
            }

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackOrb)
                {
                    b_orb = i as BonusPackOrb;
                    if (info.ButtonID == b_orb.BPNumber)
                    {
                        foreach (Item j in World.Items.Values)
                        {
                            if (j is RCCONTROL)
                            {
                                rc = j as RCCONTROL;
                                if (rc.BonusPack == b_orb.BPName)
                                {
                                    d_bag.AddItem(rc);
                                }
                            }
                        }
                        d_bag.Delete();
                        foreach (Item k in World.Items.Values)
                        {
                            if (k is Bag && k.Name == b_orb.BPName + " Bonus Pack")
                            {
                                k.Delete();
                                break;
                            }
                        }
                        b_control.A_BP -= 1;
                        resetBOrbNums();
                        break;
                    }
                }
            }


            if (info.ButtonID == 0)
            {
            }
        }
Ejemplo n.º 3
0
        public RemoveBPGump(Mobile from)
            : base(20, 30)
        {
            m_From = from;
            BonusPackOrb     b_orb     = null;
            BonusPackControl b_control = null;
            int h = 60;

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackControl)
                {
                    b_control = i as BonusPackControl;
                }
            }

            AddPage(0);
            AddBackground(0, 0, 340, (b_control.A_BP * 25) + 80, 5054);

            AddImageTiled(10, 10, 320, 23, 0x52);
            AddImageTiled(11, 11, 318, 23, 0xBBC);

            AddLabel(100, 11, 0, "Race/Class System");

            AddLabel(30, 34, 0, "Remove Which Bonus Pack?");

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackOrb)
                {
                    b_orb = i as BonusPackOrb;
                    if (b_orb.Activated)
                    {
                        AddButton(11, h, 0x15E3, 0x15E7, b_orb.BPNumber, GumpButtonType.Reply, 1);
                        AddLabel(30, h - 1, 0, b_orb.BPName + " Bonus Pack");
                        h += 25;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile           from      = sender.Mobile;
            BonusPackControl b_control = null;
            BonusPackOrb     b_orb     = null;
            BonusPackOrb     t_orb     = null;
            bool             name_used = false;
            bool             is_void   = false;
            bool             isInt     = true;
            string           c_name    = null;
            string           n_name    = null;

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackControl)
                {
                    b_control = i as BonusPackControl;
                }
            }

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackOrb)
                {
                    b_orb = i as BonusPackOrb;
                    if (b_orb.BPNumber == b_control.B_Current)
                    {
                        break;
                    }
                }
            }

            if (info.ButtonID == 0)
            {
                b_orb.Delete();
            }

            if (info.ButtonID == 1)
            {
                if (b_orb != null)
                {
                    TextRelay m_name    = info.GetTextEntry(1);
                    string    text_name = (m_name == null ? "" : m_name.Text.Trim());

                    if (text_name.Length == 0)
                    {
                        m_From.SendMessage(0x35, "You must enter a Bonus Pack Name.");
                        m_From.SendGump(new BonusPackGump(from, b_orb));
                        is_void = true;
                    }
                    else
                    {
                        foreach (Item x in World.Items.Values)
                        {
                            if (x is BonusPackOrb)
                            {
                                t_orb = x as BonusPackOrb;
                                if (text_name != null)
                                {
                                    n_name = text_name.ToLower();
                                }
                                if (t_orb.BPName != null)
                                {
                                    c_name = t_orb.BPName.ToLower();
                                }
                                if (c_name == n_name)
                                {
                                    name_used = true;
                                }
                            }
                        }
                        if (name_used)
                        {
                            m_From.SendMessage(0x35, "That Bonus Pack Name is already used.");
                            if (!is_void)
                            {
                                m_From.SendGump(new BonusPackGump(from, b_orb));
                                is_void = true;
                            }
                        }
                        else
                        {
                            b_orb.BPName     = text_name;
                            b_orb.BackUpName = text_name;
                        }
                    }

                    TextRelay m_bp    = info.GetTextEntry(2);
                    string    text_bp = (m_bp == null ? "" : m_bp.Text.Trim());

                    if (text_bp.Length == 0)
                    {
                        m_From.SendMessage(0x35, "You must enter a Secondary Skill Value");
                        if (!is_void)
                        {
                            m_From.SendGump(new BonusPackGump(from, b_orb));
                            is_void = true;
                        }
                    }
                    else
                    {
                        isInt = true;
                        try
                        {
                            int ibp = Convert.ToInt32(text_bp);
                        }
                        catch
                        {
                            from.SendMessage(0x35, "Value must be a number!");
                            if (!is_void)
                            {
                                m_From.SendGump(new BonusPackGump(from, b_orb));
                                is_void = true;
                            }
                            isInt = false;
                        }
                        if (isInt)
                        {
                            int r_bp = Convert.ToInt32(text_bp);
                            if (r_bp > 9)
                            {
                                from.SendMessage(0x35, "Value must be under 10");
                                if (!is_void)
                                {
                                    m_From.SendGump(new BonusPackGump(from, b_orb));
                                    is_void = true;
                                }
                            }
                            else
                            if (r_bp < 1)
                            {
                                from.SendMessage(0x35, "Value must be over 0");
                                if (!is_void)
                                {
                                    m_From.SendGump(new BonusPackGump(from, b_orb));
                                    is_void = true;
                                }
                            }
                            else
                            {
                                b_orb.Sec_Skill_Cost = r_bp;
                            }
                        }
                    }

                    if (!is_void)
                    {
                        m_From.SendGump(new BonusPickGump(from, b_orb));
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile           from      = sender.Mobile;
            BonusPackControl b_control = null;
            BonusPackOrb     b_orb     = null;
            bool             isInt     = true;

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackControl)
                {
                    b_control = i as BonusPackControl;
                }
            }

            foreach (Item i in World.Items.Values)
            {
                if (i is BonusPackOrb)
                {
                    b_orb = i as BonusPackOrb;
                    if (b_orb.BPNumber == b_control.B_Current)
                    {
                        break;
                    }
                }
            }

            for (int i = 0; i < 54; i++)
            {
                if ((i + 1) == info.ButtonID)
                {
                    if (b_orb.AmountSkills != 5)
                    {
                        b_orb.BPSkills[b_orb.AmountSkills] = from.Skills[i].Name;

                        TextRelay m_bo    = info.GetTextEntry(1);
                        string    text_bo = (m_bo == null ? "" : m_bo.Text.Trim());

                        if (text_bo.Length == 0)
                        {
                            m_From.SendMessage(0x35, "You must enter a Value");
                            b_orb.BPSkills[b_orb.AmountSkills] = null;
                            m_From.SendGump(new BonusPickGump(from, b_orb));
                        }
                        else
                        {
                            isInt = true;
                            try
                            {
                                int ibp = Convert.ToInt32(text_bo);
                            }
                            catch
                            {
                                from.SendMessage(0x35, "Value must be a number!");
                                b_orb.BPSkills[b_orb.AmountSkills] = null;
                                m_From.SendGump(new BonusPickGump(from, b_orb));
                                isInt = false;
                            }
                            if (isInt)
                            {
                                int b_pri = Convert.ToInt32(text_bo);
                                if (b_pri > 120)
                                {
                                    m_From.SendMessage(0x35, "Value is above 120");
                                    b_orb.BPSkills[b_orb.AmountSkills] = null;
                                    m_From.SendGump(new BonusPickGump(from, b_orb));
                                }
                                else
                                if (b_pri < 0)
                                {
                                    m_From.SendMessage(0x35, "Value is below 0");
                                    b_orb.BPSkills[b_orb.AmountSkills] = null;
                                    m_From.SendGump(new BonusPickGump(from, b_orb));
                                }
                                else
                                {
                                    b_orb.BPValues[b_orb.AmountSkills] = b_pri;
                                    b_orb.AmountSkills += 1;
                                    m_From.SendGump(new BonusPickGump(from, b_orb));
                                    m_From.SendMessage(6, b_orb.BPSkills[b_orb.AmountSkills - 1] + " added as a Bonus Pack Skill with a cap of " + b_orb.BPValues[b_orb.AmountSkills - 1]);
                                }
                            }
                        }
                    }
                    else
                    {
                        m_From.SendMessage(0x35, "You have reached the Maximum Bonus Pack Skills");
                        m_From.SendGump(new BonusPickGump(from, b_orb));
                    }
                }
            }

            if (info.ButtonID == 0)
            {
                for (int i = 0; i < 5; i++)
                {
                    b_orb.BPSkills[i] = null;
                }
                m_From.SendGump(new BonusPackGump(from, b_orb));
            }

            if (info.ButtonID == 60)
            {
                if (b_orb.AmountSkills == 0)
                {
                    m_From.SendMessage(0x35, "You have not chosen any Skills");
                    m_From.SendGump(new BonusPickGump(from, b_orb));
                }
                else
                {
                    Bag b_bag = new Bag();
                    b_bag.Name = b_orb.BPName + " Bonus Pack";

                    Bag i_bag = new Bag();
                    i_bag.Name = b_orb.BPName + " Items";

                    b_bag.AddItem(i_bag);

                    b_orb.Name      = b_orb.BPName + " Bonus Pack";
                    b_control.A_BP += 1;
                    b_orb.Activated = true;
                    b_bag.AddItem(b_orb);
                    foreach (Item i in World.Items.Values)
                    {
                        if (i is Bag && i.Name == "BONUS PACKS")
                        {
                            i.AddItem(b_bag);
                        }
                    }
                    m_From.SendMessage(6, "Bonus Pack Generated");
                }
            }
        }