Ejemplo n.º 1
0
        private static void OnAddRace(CommandEventArgs e)
        {
            Mobile      from      = e.Mobile;
            RaceControl r_control = null;
            bool        r_active  = false;

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

            if (r_active)
            {
                RaceOrb r_orb = new RaceOrb();

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

                if (r_control != null)
                {
                    r_orb.RaceNumber    = r_control.A_Races + 1;
                    r_control.A_Current = r_orb.RaceNumber;
                }

                from.SendGump(new AddRaceGump(from, r_orb));
            }
        }
Ejemplo n.º 2
0
        public PlayerShapeChange(Mobile from, RaceOrb orb)
            : base(20, 30)
        {
            m_From = from;
            int h    = 60;
            int rise = 0;

            for (int i = 0; i < 5; i++)
            {
                if (orb.BodyValue[i] != 0)
                {
                    rise += 1;
                }
            }

            AddPage(0);
            AddBackground(0, 0, 340, (rise * 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, "Shapeshift to which Form:");

            for (int i = 0; i < 5; i++)
            {
                if (orb.BodyValue[i] != 0)
                {
                    AddButton(11, h, 0x15E3, 0x15E7, i, GumpButtonType.Reply, 1);
                    AddLabel(30, h - 1, 0, orb.SS_Name[i]);
                    h += 25;
                }
            }
        }
Ejemplo n.º 3
0
        public AddShapeChangeGump(Mobile from, RaceOrb orb)
            : base(20, 30)
        {
            m_From = from;

            AddPage(0);
            AddBackground(0, 0, 340, 180, 5054);

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

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

            AddLabel(30, 34, 0, "Add Shapeshift:");

            AddLabel(30, 65, 0, "Shapeshift Name: ");
            AddImageTiled(135, 63, 150, 23, 0x52);
            AddImageTiled(136, 64, 151, 23, 0xBBC);
            AddTextEntry(140, 63, 144, 20, 1334, 1, "");

            AddLabel(30, 95, 0, "Shapeshift Body: ");
            AddImageTiled(135, 93, 50, 23, 0x52);
            AddImageTiled(136, 94, 51, 23, 0xBBC);
            AddTextEntry(140, 93, 45, 20, 1334, 2, "0");

            AddLabel(30, 125, 0, "Shapeshift Hue: ");
            AddImageTiled(135, 123, 50, 23, 0x52);
            AddImageTiled(136, 124, 51, 23, 0xBBC);
            AddTextEntry(140, 123, 45, 20, 1334, 3, "0");

            AddButton(11, 155, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 1);
            AddLabel(30, 154, 0, "Done");
        }
Ejemplo n.º 4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from      = sender.Mobile;
            RaceOrb     r_orb     = null;
            RaceControl r_control = null;

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (info.ButtonID == r_orb.RaceNumber)
                    {
                        r_control.R_Current = r_orb.RaceNumber;
                        from.SendGump(new ShapeChangeGump2(from, r_orb));
                    }
                }
            }


            if (info.ButtonID == 0)
            {
            }
        }
Ejemplo n.º 5
0
        private static void OnClean(CommandEventArgs e)
        {
            Mobile       from     = e.Mobile;
            bool         r_active = false;
            Bag          c_bag    = new Bag();
            ClassOrb     c_orb    = null;
            RaceOrb      r_orb    = null;
            BonusPackOrb b_orb    = null;

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

            if (r_active)
            {
                foreach (Item i in World.Items.Values)
                {
                    if (i is ClassOrb)
                    {
                        c_orb = i as ClassOrb;
                        if (!c_orb.Activated)
                        {
                            c_bag.AddItem(c_orb);
                        }
                    }
                }

                foreach (Item i in World.Items.Values)
                {
                    if (i is RaceOrb)
                    {
                        r_orb = i as RaceOrb;
                        if (!r_orb.Activated)
                        {
                            c_bag.AddItem(r_orb);
                        }
                    }
                }

                foreach (Item i in World.Items.Values)
                {
                    if (i is BonusPackOrb)
                    {
                        b_orb = i as BonusPackOrb;
                        if (!b_orb.Activated)
                        {
                            c_bag.AddItem(b_orb);
                        }
                    }
                }

                c_bag.Delete();
            }
        }
Ejemplo n.º 6
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from      = sender.Mobile;
            RaceOrb     r_orb     = null;
            RaceControl r_control = null;
            RCCONTROL   rc        = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL;

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (rc.Race == r_orb.RaceName)
                    {
                        break;
                    }
                }
            }

            for (int i = 0; i < 5; i++)
            {
                if (info.ButtonID == i)
                {
                    if (r_orb.BodyValue[i] != 0)
                    {
                        if (from.Mount != null)
                        {
                            from.Mount.Rider = null;
                        }
                        from.PlaySound(0x228);
                        from.BodyMod = r_orb.BodyValue[i];
                        from.HueMod  = r_orb.SS_Hue[i];
                        from.NameMod = r_orb.SS_Name[i];
                    }
                }
            }

            if (info.ButtonID == 0)
            {
            }
        }
Ejemplo n.º 7
0
        public void resetROrbNums()
        {
            RaceOrb r_orb   = null;
            int     new_num = 1;

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb            = i as RaceOrb;
                    r_orb.RaceNumber = new_num;
                    new_num         += 1;
                }
            }
        }
Ejemplo n.º 8
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from      = sender.Mobile;
            RaceOrb     r_orb     = null;
            RCCONTROL   rc        = null;
            RaceControl r_control = null;
            Bag         d_bag     = new Bag();

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (info.ButtonID == r_orb.RaceNumber)
                    {
                        foreach (Item j in World.Items.Values)
                        {
                            if (j is RCCONTROL)
                            {
                                rc = j as RCCONTROL;
                                if (rc.Race == r_orb.RaceName)
                                {
                                    d_bag.AddItem(rc);
                                }
                            }
                        }
                        d_bag.Delete();
                        r_orb.Delete();
                        r_control.A_Races -= 1;
                        resetROrbNums();
                        break;
                    }
                }
            }

            if (info.ButtonID == 0)
            {
            }
        }
Ejemplo n.º 9
0
        public HueEditGump3(Mobile from, RaceOrb orb, int hue)
            : base(20, 30)
        {
            m_From = from;
            int h   = 45;
            int b_v = 12;

            if (from.Female)
            {
                b_v = 13;
            }

            AddPage(0);
            AddBackground(0, 0, 310, 360, 5054);

            AddImageTiled(10, 10, 290, 23, 0x52);
            AddImageTiled(11, 11, 288, 21, 0xBBC);

            AddLabel(95, 11, 0, orb.RaceName + " Hair Colors");

            for (int i = 0; i < 10; i++)
            {
                AddLabel(30, h, orb.HairHues[i] - 1, "Hue " + (i + 1));
                AddImageTiled(90, h, 50, 23, 0x52);
                AddImageTiled(91, h - 1, 51, 23, 0xBBC);
                AddTextEntry(95, h, 45, 20, 1334, i + 11, orb.HairHues[i] + "");
                AddButton(150, h + 1, 0x15E3, 0x15E7, i + 11, GumpButtonType.Reply, 1);
                h += 25;
            }

            AddImage(145, 10, b_v, orb.BodyHues[0] - 1); //Body
            AddImage(145, 10, 50701, hue - 1);           //Hair
            if (!from.Female)
            {
                AddImage(145, 10, 50806, hue - 1); //Beard
            }
            h += 10;
            AddLabel(30, h, 0, "Finish");
            AddButton(11, h + 1, 0x15E3, 0x15E7, 25, GumpButtonType.Reply, 1);

            AddLabel(15, 330, 0, "Right click to return to the Race List");
        }
Ejemplo n.º 10
0
        public ShapeChangeGump(Mobile from)
            : base(20, 30)
        {
            m_From = from;
            RaceOrb     r_orb     = null;
            RaceControl r_control = null;
            int         h         = 60;

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

            AddPage(0);
            AddBackground(0, 0, 340, (r_control.A_Races * 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, "Edit Shapeshift for which Race?");

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (r_orb.Activated)
                    {
                        AddButton(11, h, 0x15E3, 0x15E7, r_orb.RaceNumber, GumpButtonType.Reply, 1);
                        AddLabel(30, h - 1, 0, r_orb.RaceName);
                        h += 25;
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public ShapeChangeGump2(Mobile from, RaceOrb orb)
            : base(20, 30)
        {
            m_From = from;
            int h    = 60;
            int rise = 0;

            for (int i = 0; i < 5; i++)
            {
                if (orb.BodyValue[i] != 0)
                {
                    rise += 1;
                }
            }

            AddPage(0);
            AddBackground(0, 0, 340, (rise * 25) + 120, 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 a Current Shapeshift");

            for (int i = 0; i < 5; i++)
            {
                if (orb.BodyValue[i] != 0)
                {
                    AddButton(11, h, 0x15E3, 0x15E7, i, GumpButtonType.Reply, 1);
                    AddLabel(30, h - 1, 0, orb.SS_Name[i] + " (Body: " + orb.BodyValue[i] + " Hue: " + orb.SS_Hue[i] + ")");
                    h += 25;
                }
            }

            h += 10;
            AddButton(11, h, 0x15E3, 0x15E7, 10, GumpButtonType.Reply, 1);
            AddLabel(30, h - 1, 0, "Add a new Shapeshift");
        }
Ejemplo n.º 12
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from      = sender.Mobile;
            RaceControl r_control = null;
            RaceOrb     r_orb     = null;
            RaceOrb     t_orb     = null;
            bool        name_used = false;
            bool        isInt     = true;
            bool        is_void   = false;
            string      c_name    = null;
            string      n_name    = null;

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (r_orb.RaceNumber == r_control.A_Current)
                    {
                        break;
                    }
                }
            }

            Map map = null;

            for (int i = 0; i < info.Switches.Length; i++)
            {
                int m = info.Switches[i];
                switch (m)
                {
                case 6:  map = Map.Trammel;  break;

                case 7:  map = Map.Felucca;  break;

                case 8:  map = Map.Malas;    break;

                case 9:  map = Map.Ilshenar; break;

                case 10: map = Map.Tokuno;   break;
                }
            }


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

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

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

                    TextRelay m_desc    = info.GetTextEntry(22);
                    string    text_desc = (m_desc == null ? "" : m_desc.Text.Trim());

                    if (text_desc.Length == 0)
                    {
                        m_From.SendMessage(0x35, "You must enter a Race Description.");
                        if (!is_void)
                        {
                            m_From.SendGump(new AddRaceGump(from, r_orb));
                            is_void = true;
                        }
                    }
                    else
                    {
                        r_orb.Description = text_desc;
                    }

                    TextRelay m_x    = info.GetTextEntry(23);
                    string    text_x = (m_x == null ? "" : m_x.Text.Trim());

                    if (text_x.Length == 0)
                    {
                        m_From.SendMessage(0x35, "You must enter a X Coordinate");
                        if (!is_void)
                        {
                            m_From.SendGump(new AddRaceGump(from, r_orb));
                            is_void = true;
                        }
                    }
                    else
                    {
                        isInt = true;
                        try
                        {
                            int ix = Convert.ToInt32(text_x);
                        }
                        catch
                        {
                            from.SendMessage(0x35, "Coordinates must be numbers!");
                            if (!is_void)
                            {
                                m_From.SendGump(new AddRaceGump(from, r_orb));
                                is_void = true;
                            }
                            isInt = false;
                        }
                        if (isInt)
                        {
                            int r_x = Convert.ToInt32(text_x);
                            r_orb.Race_X = r_x;
                        }
                    }

                    TextRelay m_y    = info.GetTextEntry(24);
                    string    text_y = (m_y == null ? "" : m_y.Text.Trim());

                    if (text_y.Length == 0)
                    {
                        m_From.SendMessage(0x35, "You must enter a Y Coordinate");
                        if (!is_void)
                        {
                            m_From.SendGump(new AddRaceGump(from, r_orb));
                            is_void = true;
                        }
                    }
                    else
                    {
                        isInt = true;
                        try
                        {
                            int iy = Convert.ToInt32(text_y);
                        }
                        catch
                        {
                            from.SendMessage(0x35, "Coordinates must be numbers!");
                            if (!is_void)
                            {
                                m_From.SendGump(new AddRaceGump(from, r_orb));
                                is_void = true;
                            }
                            isInt = false;
                        }
                        if (isInt)
                        {
                            int r_y = Convert.ToInt32(text_y);
                            r_orb.Race_Y = r_y;
                        }
                    }

                    TextRelay m_z    = info.GetTextEntry(25);
                    string    text_z = (m_z == null ? "" : m_z.Text.Trim());

                    if (text_z.Length == 0)
                    {
                        m_From.SendMessage(0x35, "You must enter a Z Coordinate");
                        if (!is_void)
                        {
                            m_From.SendGump(new AddRaceGump(from, r_orb));
                            is_void = true;
                        }
                    }
                    else
                    {
                        isInt = true;
                        try
                        {
                            int iz = Convert.ToInt32(text_x);
                        }
                        catch
                        {
                            from.SendMessage(0x35, "Coordinates must be numbers!");
                            if (!is_void)
                            {
                                m_From.SendGump(new AddRaceGump(from, r_orb));
                                is_void = true;
                            }
                            isInt = false;
                        }
                        if (isInt)
                        {
                            int r_z = Convert.ToInt32(text_z);
                            r_orb.Race_Z = r_z;
                        }
                    }

                    for (int i = 1; i < 11; i++)
                    {
                        TextRelay m_hue_body    = info.GetTextEntry(i);
                        string    text_hue_body = (m_hue_body == null ? "" : m_hue_body.Text.Trim());

                        if (text_hue_body.Length == 0)
                        {
                            if (r_orb.AmountBodyHues == 0)
                            {
                                from.SendMessage(0x35, "You must enter at least one Body Hue");
                                if (!is_void)
                                {
                                    m_From.SendGump(new AddRaceGump(from, r_orb));
                                    is_void = true;
                                }
                                break;
                            }
                        }
                        else
                        {
                            isInt = true;
                            try
                            {
                                int ihue = Convert.ToInt32(text_hue_body);
                            }
                            catch
                            {
                                from.SendMessage(0x35, "Hues must be numbers!");
                                if (!is_void)
                                {
                                    m_From.SendGump(new AddRaceGump(from, r_orb));
                                    is_void = true;
                                }
                                isInt = false;
                            }
                            if (isInt)
                            {
                                int r_hue = Convert.ToInt32(text_hue_body);
                                r_orb.BodyHues[i - 1] = r_hue;
                                r_orb.AmountBodyHues += 1;
                            }
                        }
                    }

                    for (int i = 11; i < 21; i++)
                    {
                        TextRelay m_hue_hair    = info.GetTextEntry(i);
                        string    text_hue_hair = (m_hue_hair == null ? "" : m_hue_hair.Text.Trim());

                        if (text_hue_hair.Length == 0)
                        {
                            if (r_orb.AmountHairHues == 0)
                            {
                                from.SendMessage(0x35, "You must enter at least one Hair Hue");
                                if (!is_void)
                                {
                                    m_From.SendGump(new AddRaceGump(from, r_orb));
                                    is_void = true;
                                }
                                break;
                            }
                        }
                        else
                        {
                            isInt = true;
                            try
                            {
                                int ihue2 = Convert.ToInt32(text_hue_hair);
                            }
                            catch
                            {
                                from.SendMessage(0x35, "Hues must be numbers!");
                                if (!is_void)
                                {
                                    m_From.SendGump(new AddRaceGump(from, r_orb));
                                    is_void = true;
                                }
                                isInt = false;
                            }
                            if (isInt)
                            {
                                int r_hue2 = Convert.ToInt32(text_hue_hair);
                                r_orb.HairHues[i - 11] = r_hue2;
                                r_orb.AmountHairHues  += 1;
                            }
                        }
                    }

                    if (!is_void)
                    {
                        Bag r_bag = new Bag();
                        Bag i_bag = new Bag();

                        r_bag.Name = r_orb.RaceName + " Race";
                        i_bag.Name = r_orb.RaceName + " Items";

                        r_bag.AddItem(i_bag);
                        r_bag.AddItem(r_orb);

                        foreach (Item i in World.Items.Values)
                        {
                            if (i is Bag && i.Name == "RACES")
                            {
                                i.AddItem(r_bag);
                            }
                        }

                        r_orb.Race_Map     = map;
                        r_orb.Name         = r_orb.RaceName + " Race Orb";
                        r_control.A_Races += 1;
                        r_orb.Activated    = true;
                        from.SendMessage(6, "Race has been Generated!");
                    }
                }
            }
        }
Ejemplo n.º 13
0
        private static void OnSC(CommandEventArgs e)
        {
            Mobile    from      = e.Mobile;
            bool      r_active  = false;
            RCCONTROL rc        = null;
            RaceOrb   r_orb     = null;
            int       rc_Exists = from.Backpack.GetAmount(typeof(RCCONTROL));
            int       a_ss      = 0;

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

            if (rc_Exists != 0)
            {
                rc = from.Backpack.FindItemByType(typeof(RCCONTROL)) as RCCONTROL;

                foreach (Item i in World.Items.Values)
                {
                    if (i is RaceOrb)
                    {
                        r_orb = i as RaceOrb;
                        if (rc.Race == r_orb.RaceName)
                        {
                            break;
                        }
                    }
                }

                if (r_active)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        if (r_orb.BodyValue[i] != 0)
                        {
                            a_ss += 1;
                        }
                    }

                    if (a_ss == 0)
                    {
                        from.SendMessage(6, "Your Race Cannot Shapeshift");
                    }
                    if (a_ss == 1)
                    {
                        if (from.BodyMod != 0)
                        {
                            from.PlaySound(0x228);
                            from.BodyMod = 0;
                            from.HueMod  = -1;
                            from.NameMod = null;
                        }

                        else
                        {
                            for (int i = 0; i < 5; i++)
                            {
                                if (r_orb.BodyValue[i] != 0)
                                {
                                    if (from.Mount != null)
                                    {
                                        from.Mount.Rider = null;
                                    }
                                    from.PlaySound(0x228);
                                    from.BodyMod = r_orb.BodyValue[i];
                                    from.HueMod  = r_orb.SS_Hue[i];
                                    from.NameMod = r_orb.SS_Name[i];
                                }
                            }
                        }
                    }

                    if (a_ss > 1)
                    {
                        if (from.BodyMod != 0)
                        {
                            from.PlaySound(0x228);
                            from.BodyMod = 0;
                            from.HueMod  = -1;
                            from.NameMod = null;
                        }
                        else
                        {
                            from.SendGump(new PlayerShapeChange(from, r_orb));
                        }
                    }
                }
            }
        }
Ejemplo n.º 14
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from      = sender.Mobile;
            RaceOrb     r_orb     = null;
            RaceControl r_control = null;
            int         num       = 0;

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (r_orb.RaceNumber == r_control.R_Current)
                    {
                        break;
                    }
                }
            }

            for (int i = 0; i < 5; i++)
            {
                if (info.ButtonID == i)
                {
                    r_orb.BodyValue[i] = 0;
                    r_orb.SS_Hue[i]    = 0;
                    r_orb.SS_Name[i]   = null;
                }
            }

            if (info.ButtonID == 10)
            {
                for (int i = 0; i < 5; i++)
                {
                    if (r_orb.BodyValue[i] != 0)
                    {
                        num += 1;
                    }
                }
                if (num == 5)
                {
                    m_From.SendMessage(0x35, "Race already has 5 Shapeshift Forms, remove one to add.");
                }
                else
                {
                    from.SendGump(new AddShapeChangeGump(from, r_orb));
                }
            }

            if (info.ButtonID == 0)
            {
                from.SendGump(new ShapeChangeGump(from));
            }
        }
Ejemplo n.º 15
0
        private static void OnUpdate(CommandEventArgs e)
        {
            Mobile       from     = e.Mobile;
            bool         r_active = false;
            ClassOrb     c_orb    = null;
            RaceOrb      r_orb    = null;
            BonusPackOrb b_orb    = null;
            Bag          c_bag    = null;
            RCCONTROL    rc       = null;

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

            if (r_active)
            {
                ArrayList items = new ArrayList(World.Items.Values);

                foreach (Item h in items)
                {
                    if (h is ClassOrb)
                    {
                        c_orb = h as ClassOrb;
                        foreach (Item i in items)
                        {
                            if (i is Bag && i.Name == c_orb.ClassName + " Class")
                            {
                                c_bag = i as Bag;
                                Bag n_bag = new Bag();
                                n_bag.Name = c_orb.ClassName + " Restricted Armors";
                                Bag n_bag2 = new Bag();
                                n_bag2.Name = c_orb.ClassName + " Restricted Weapons";
                                c_bag.AddItem(n_bag);
                                c_bag.AddItem(n_bag2);
                                break;
                            }
                        }
                    }
                }

                foreach (Item h in World.Items.Values)
                {
                    if (h is RCCONTROL)
                    {
                        rc = h as RCCONTROL;

                        foreach (Item i in World.Items.Values)
                        {
                            if (i is Bag && i.Name == rc.P_Class + " Restricted Armors")
                            {
                                rc.A_Bag = i as Bag;
                                break;
                            }
                        }

                        foreach (Item i in World.Items.Values)
                        {
                            if (i is Bag && i.Name == rc.P_Class + " Restricted Weapons")
                            {
                                rc.W_Bag = i as Bag;
                                break;
                            }
                        }

                        foreach (Item i in World.Items.Values)
                        {
                            if (i is ClassOrb)
                            {
                                c_orb            = i as ClassOrb;
                                c_orb.BackUpName = c_orb.ClassName;
                            }
                        }

                        foreach (Item i in World.Items.Values)
                        {
                            if (i is RaceOrb)
                            {
                                r_orb            = i as RaceOrb;
                                r_orb.BackUpName = r_orb.RaceName;
                            }
                        }

                        foreach (Item i in World.Items.Values)
                        {
                            if (i is BonusPackOrb)
                            {
                                b_orb            = i as BonusPackOrb;
                                b_orb.BackUpName = b_orb.BPName;
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 16
0
        private static void OnRaceBag(CommandEventArgs e)
        {
            int amount = 0;

            if (e.Length >= 1)
            {
                amount = e.GetInt32(0);
            }

            Mobile      from      = e.Mobile;
            bool        r_active  = false;
            RaceOrb     r_orb     = null;
            Bag         m_bag     = null;
            RaceControl r_control = null;

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

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

            if (r_active)
            {
                foreach (Item i in World.Items.Values)
                {
                    if (i is RaceOrb)
                    {
                        r_orb = i as RaceOrb;
                        if (r_orb.RaceNumber == amount)
                        {
                            Bag r_bag = new Bag();
                            r_bag.Name = r_orb.RaceName + " Race";
                            Bag i_bag = new Bag();
                            i_bag.Name = r_orb.RaceName + " Items";
                            r_bag.AddItem(i_bag);
                            r_bag.AddItem(r_orb);
                            foreach (Item k in World.Items.Values)
                            {
                                if (k is Bag && k.Name == "RACES")
                                {
                                    m_bag = k as Bag;
                                    m_bag.AddItem(r_bag);
                                    break;
                                }
                            }
                            r_orb.Activated = true;
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 17
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from      = sender.Mobile;
            RaceOrb     r_orb     = null;
            RaceControl r_control = null;
            bool        is_void   = false;
            bool        isInt     = true;

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (r_orb.RaceNumber == r_control.R_Current)
                    {
                        break;
                    }
                }
            }


            for (int i = 0; i < 10; i++)
            {
                if (info.ButtonID == i + 11)
                {
                    TextRelay m_hue_hair    = info.GetTextEntry(i + 11);
                    string    text_hue_hair = (m_hue_hair == null ? "" : m_hue_hair.Text.Trim());

                    if (text_hue_hair.Length == 0)
                    {
                        if (i == 0)
                        {
                            from.SendMessage(0x35, "Hue 1 cannot be blank");
                            if (!is_void)
                            {
                                m_From.SendGump(new HueEditGump3(from, r_orb, r_orb.HairHues[0]));
                                is_void = true;
                            }
                            break;
                        }
                        else
                        {
                            m_From.SendGump(new HueEditGump3(from, r_orb, r_orb.HairHues[0]));
                        }
                    }
                    else
                    {
                        isInt = true;
                        try
                        {
                            int ihue = Convert.ToInt32(text_hue_hair);
                        }
                        catch
                        {
                            from.SendMessage(0x35, "Hues must be numbers!");
                            if (!is_void)
                            {
                                m_From.SendGump(new HueEditGump3(from, r_orb, r_orb.HairHues[0]));
                                is_void = true;
                            }
                            isInt = false;
                        }
                        if (isInt)
                        {
                            int r_hue = Convert.ToInt32(text_hue_hair);
                            if (i == 0 && r_hue == 0)
                            {
                                from.SendMessage(0x35, "Hue 1 cannot be 0");
                                if (!is_void)
                                {
                                    m_From.SendGump(new HueEditGump3(from, r_orb, r_orb.HairHues[0]));
                                    is_void = true;
                                }
                            }
                            else
                            {
                                if (r_orb.HairHues[i] == 0 && r_hue != 0)
                                {
                                    r_orb.AmountHairHues += 1;
                                }

                                if (r_orb.HairHues[i] != 0 && r_hue == 0)
                                {
                                    r_orb.AmountHairHues -= 1;
                                }

                                r_orb.HairHues[i] = r_hue;
                                from.SendGump(new HueEditGump3(from, r_orb, r_orb.HairHues[i]));
                            }
                        }
                    }
                }
            }


            if (info.ButtonID == 25)
            {
            }

            if (info.ButtonID == 0)
            {
                m_From.SendGump(new HueEditGump(from));
            }
        }
Ejemplo n.º 18
0
        private static void OnSyncNames(CommandEventArgs e)
        {
            Mobile       from     = e.Mobile;
            bool         r_active = false;
            ClassOrb     c_orb    = null;
            RCCONTROL    rc       = null;
            RaceOrb      r_orb    = null;
            BonusPackOrb b_orb    = null;

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


            if (r_active)
            {
                foreach (Item i in World.Items.Values)
                {
                    if (i is ClassOrb)
                    {
                        c_orb = i as ClassOrb;
                        if (c_orb.ClassName != c_orb.BackUpName)
                        {
                            c_orb.Name = c_orb.ClassName + " Orb";
                            foreach (Item j in World.Items.Values)
                            {
                                if (j is Bag && j.Name == c_orb.BackUpName + " Class")
                                {
                                    j.Name = c_orb.ClassName + " Class";
                                }
                                if (j is Bag && j.Name == c_orb.BackUpName + " Items")
                                {
                                    j.Name = c_orb.ClassName + " Items";
                                }
                                if (j is Bag && j.Name == c_orb.BackUpName + " Equip")
                                {
                                    j.Name = c_orb.ClassName + " Equip";
                                }
                                if (j is Bag && j.Name == c_orb.BackUpName + " Restricted Armors")
                                {
                                    j.Name = c_orb.ClassName + " Restricted Armors";
                                }
                                if (j is Bag && j.Name == c_orb.BackUpName + " Restricted Weapons")
                                {
                                    j.Name = c_orb.ClassName + " Restricted Weapons";
                                }
                            }
                            foreach (Item k in World.Items.Values)
                            {
                                if (k is RCCONTROL)
                                {
                                    rc = k as RCCONTROL;
                                    if (rc.P_Class == c_orb.BackUpName)
                                    {
                                        rc.P_Class = c_orb.ClassName;
                                    }
                                }
                            }

                            c_orb.BackUpName = c_orb.ClassName;
                        }
                    }
                }

                foreach (Item i in World.Items.Values)
                {
                    if (i is RaceOrb)
                    {
                        r_orb = i as RaceOrb;
                        if (r_orb.RaceName != r_orb.BackUpName)
                        {
                            r_orb.Name = r_orb.RaceName + " Orb";
                            foreach (Item j in World.Items.Values)
                            {
                                if (j is Bag && j.Name == r_orb.BackUpName + " Race")
                                {
                                    j.Name = r_orb.RaceName + " Race";
                                }
                                if (j is Bag && j.Name == r_orb.BackUpName + " Items")
                                {
                                    j.Name = r_orb.RaceName + " Items";
                                }
                            }
                            foreach (Item k in World.Items.Values)
                            {
                                if (k is RCCONTROL)
                                {
                                    rc = k as RCCONTROL;
                                    if (rc.Race == r_orb.BackUpName)
                                    {
                                        rc.Race = r_orb.RaceName;
                                    }
                                }
                            }

                            r_orb.BackUpName = r_orb.RaceName;
                        }
                    }
                }

                foreach (Item i in World.Items.Values)
                {
                    if (i is BonusPackOrb)
                    {
                        b_orb = i as BonusPackOrb;
                        if (b_orb.BPName != b_orb.BackUpName)
                        {
                            b_orb.Name = b_orb.BPName + " Orb";
                            foreach (Item j in World.Items.Values)
                            {
                                if (j is Bag && j.Name == b_orb.BackUpName + " Bonus Pack")
                                {
                                    j.Name = b_orb.BPName + " Bonus Pack";
                                }
                                if (j is Bag && j.Name == b_orb.BackUpName + " Items")
                                {
                                    j.Name = b_orb.BPName + " Items";
                                }
                            }
                            foreach (Item k in World.Items.Values)
                            {
                                if (k is RCCONTROL)
                                {
                                    rc = k as RCCONTROL;
                                    if (rc.BonusPack == b_orb.BackUpName)
                                    {
                                        rc.BonusPack = b_orb.BPName;
                                    }
                                }
                            }

                            b_orb.BackUpName = b_orb.BPName;
                        }
                    }
                }
            }
        }
Ejemplo n.º 19
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile       from      = sender.Mobile;
            RaceOrb      r_orb     = null;
            RaceControl  r_control = null;
            ClassOrb     c_orb     = null;
            ClassControl c_control = null;

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

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (r_orb.RaceNumber == r_control.R_Current)
                    {
                        break;
                    }
                }
            }

            foreach (Item i in World.Items.Values)
            {
                if (i is ClassOrb)
                {
                    c_orb = i as ClassOrb;
                    if (info.ButtonID == c_orb.ClassNumber)
                    {
                        if (r_orb.Res_Class_Num != 5)
                        {
                            for (int j = 0; j < 5; j++)
                            {
                                if (r_orb.Restricted_C[j] == null)
                                {
                                    r_orb.Restricted_C[j] = c_orb.ClassName;
                                    r_orb.Res_Class_Num  += 1;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            m_From.SendMessage(0x35, "You have reached the Maximum Restricted Classes");
                        }
                    }
                }
            }

            for (int i = 0; i < 5; i++)
            {
                if (info.ButtonID == i + 100)
                {
                    r_orb.Restricted_C[i] = null;
                    r_orb.Res_Class_Num  -= 1;
                }
            }


            if (info.ButtonID == 0)
            {
                from.SendGump(new RestrictClassGump(from));
            }
        }
Ejemplo n.º 20
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile      from          = sender.Mobile;
            RaceOrb     r_orb         = null;
            RaceControl r_control     = null;
            bool        is_void       = false;
            bool        isInt         = true;
            int         current_shift = 0;

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

            foreach (Item i in World.Items.Values)
            {
                if (i is RaceOrb)
                {
                    r_orb = i as RaceOrb;
                    if (r_orb.RaceNumber == r_control.R_Current)
                    {
                        break;
                    }
                }
            }

            for (int i = 0; i < 5; i++)
            {
                if (r_orb.BodyValue[i] != 0)
                {
                    current_shift += 1;
                }
                else
                {
                    break;
                }
            }


            if (info.ButtonID == 0)
            {
                m_From.SendMessage(0x35, "No Shapeshift Form Added");
            }

            if (info.ButtonID == 1)
            {
                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 Shapeshift Name.");
                    m_From.SendGump(new AddShapeChangeGump(from, r_orb));
                    is_void = true;
                }
                else
                {
                    r_orb.SS_Name[current_shift] = text_name;
                }

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

                if (text_bv.Length == 0)
                {
                    m_From.SendMessage(0x35, "You must Enter a Body Value");
                    if (!is_void)
                    {
                        m_From.SendGump(new AddShapeChangeGump(from, r_orb));
                        is_void = true;
                    }
                }
                else
                {
                    isInt = true;
                    try
                    {
                        int ibv = Convert.ToInt32(text_bv);
                    }
                    catch
                    {
                        from.SendMessage(0x35, "Body Values must be numbers!");
                        if (!is_void)
                        {
                            m_From.SendGump(new AddShapeChangeGump(from, r_orb));
                            is_void = true;
                        }
                        isInt = false;
                    }
                    if (isInt)
                    {
                        int r_bv = Convert.ToInt32(text_bv);

                        if (r_bv == 0)
                        {
                            from.SendMessage(0x35, "Body Values cannot be 0");
                            if (!is_void)
                            {
                                m_From.SendGump(new AddShapeChangeGump(from, r_orb));
                                is_void = true;
                            }
                        }

                        else
                        {
                            r_orb.BodyValue[current_shift] = r_bv;
                        }
                    }
                }

                TextRelay m_hue    = info.GetTextEntry(3);
                string    text_hue = (m_hue == null ? "" : m_hue.Text.Trim());

                if (text_hue.Length == 0)
                {
                    m_From.SendMessage(0x35, "You must Enter a Hue Value");
                    if (!is_void)
                    {
                        m_From.SendGump(new AddShapeChangeGump(from, r_orb));
                        is_void = true;
                    }
                }
                else
                {
                    isInt = true;
                    try
                    {
                        int ihue = Convert.ToInt32(text_hue);
                    }
                    catch
                    {
                        from.SendMessage(0x35, "Hue Values must be numbers!");
                        if (!is_void)
                        {
                            m_From.SendGump(new AddShapeChangeGump(from, r_orb));
                            is_void = true;
                        }
                        isInt = false;
                    }
                    if (isInt)
                    {
                        int r_hue = Convert.ToInt32(text_hue);
                        r_orb.SS_Hue[current_shift] = r_hue;
                    }
                }

                if (!is_void)
                {
                    from.SendMessage(6, "Shapeshift has been added");
                }
            }
        }
Ejemplo n.º 21
0
        public AddRaceGump(Mobile from, RaceOrb orb) : base(20, 30)
        {
            m_From = from;
            int b_distance = 45;
            int b_button   = 1;
            Map map        = Map.Trammel;

            orb.AmountBodyHues = 0;
            orb.AmountHairHues = 0;

            AddPage(0);
            AddBackground(0, 0, 720, 400, 5054);

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

            AddLabel(270, 11, 0, "Race/Class System *Add Race*");

            AddLabel(30, 45, 0, "Race Name: ");
            AddImageTiled(115, 43, 150, 23, 0x52);
            AddImageTiled(116, 44, 151, 23, 0xBBC);
            AddTextEntry(120, 43, 144, 20, 1334, 21, "");

            AddLabel(30, 75, 0, "Race Description: ");
            AddImageTiled(36, 105, 250, 120, 0x52);
            AddImageTiled(37, 106, 251, 120, 0xBBC);
            AddTextEntry(43, 105, 240, 105, 1334, 22, "");


            for (int i = 0; i < 10; i++)
            {
                AddLabel(367, b_distance, 0, "Add Body Hue: ");
                AddImageTiled(455, b_distance - 2, 50, 23, 0x52);
                AddImageTiled(456, b_distance - 1, 51, 23, 0xBBC);
                AddTextEntry(460, b_distance - 2, 45, 20, 1334, b_button, "");
                b_distance += 25;
                b_button   += 1;
            }

            b_distance = 45;

            for (int i = 0; i < 10; i++)
            {
                AddLabel(545, b_distance, 0, "Add Hair Hue: ");
                AddImageTiled(630, b_distance - 2, 50, 23, 0x52);
                AddImageTiled(631, b_distance - 1, 51, 23, 0xBBC);
                AddTextEntry(635, b_distance - 2, 45, 20, 1334, b_button, "");
                b_distance += 25;
                b_button   += 1;
            }

            AddLabel(30, 240, 0, "Start Location:");

            AddLabel(55, 260, 0, "Trammel");
            AddRadio(25, 260, 208, 209, (map == Map.Trammel ? true : false), 6);

            AddLabel(55, 285, 0, "Felucca");
            AddRadio(25, 285, 208, 209, (map == Map.Felucca ? true : false), 7);

            AddLabel(55, 310, 0, "Malas");
            AddRadio(25, 310, 208, 209, (map == Map.Malas ? true : false), 8);

            AddLabel(195, 260, 0, "Ilshenar");
            AddRadio(165, 260, 208, 209, (map == Map.Ilshenar ? true : false), 9);

            AddLabel(195, 285, 0, "Tokuno");
            AddRadio(165, 285, 208, 209, (map == Map.Tokuno ? true : false), 10);

            AddLabel(30, 335, 0, "X: ");
            AddImageTiled(60, 333, 50, 23, 0x52);
            AddImageTiled(61, 334, 51, 23, 0xBBC);
            AddTextEntry(65, 333, 45, 20, 1334, 23, "");

            AddLabel(130, 335, 0, "Y: ");
            AddImageTiled(160, 333, 50, 23, 0x52);
            AddImageTiled(161, 334, 51, 23, 0xBBC);
            AddTextEntry(165, 333, 45, 20, 1334, 24, "");

            AddLabel(230, 335, 0, "Z: ");
            AddImageTiled(260, 333, 50, 23, 0x52);
            AddImageTiled(261, 334, 51, 23, 0xBBC);
            AddTextEntry(265, 333, 45, 20, 1334, 25, "");

            AddLabel(30, 370, 0, "Click Here to Add the Race");
            AddButton(11, 371, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 1);
        }
Ejemplo n.º 22
0
        public RestrictClassGump2(Mobile from, RaceOrb orb)
            : base(20, 30)
        {
            m_From = from;
            RaceControl  r_control    = null;
            ClassControl c_control    = null;
            ClassOrb     c_orb        = null;
            int          h            = 60;
            bool         isRestricted = false;

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

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

            AddPage(0);
            AddBackground(0, 0, 340, (c_control.A_Classes * 25) + 160, 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 Restricted Classes:");

            for (int i = 0; i < 5; i++)
            {
                if (orb.Restricted_C[i] != null)
                {
                    AddButton(11, h, 0x15E3, 0x15E7, i + 100, GumpButtonType.Reply, 1);
                    AddLabel(30, h - 1, 0, orb.Restricted_C[i]);
                    h += 25;
                }
            }

            h += 30;

            AddLabel(30, h, 0, "Add Restricted Class:");

            h += 25;

            foreach (Item k in World.Items.Values)
            {
                if (k is ClassOrb)
                {
                    c_orb = k as ClassOrb;
                    if (c_orb.Activated)
                    {
                        isRestricted = false;

                        for (int j = 0; j < 5; j++)
                        {
                            if (c_orb.ClassName == orb.Restricted_C[j])
                            {
                                isRestricted = true;
                            }
                        }

                        if (!isRestricted)
                        {
                            AddButton(11, h, 0x15E3, 0x15E7, c_orb.ClassNumber, GumpButtonType.Reply, 1);
                            AddLabel(30, h - 1, 0, c_orb.ClassName);
                            h += 25;
                        }
                    }
                }
            }
        }