Exemple #1
0
        public override void OnResponse(NetState ns, RelayInfo info)
        {
            Mobile mob_m = ns.Mobile;

            PlayerMobile pm = mob_m as PlayerMobile;

            UOETool dd = i_Tool as UOETool;

            if (pm == null || dd == null)
            {
                return;
            }

            int si;

            if (dd.StcT == true)
            {
                TextRelay entry1 = info.GetTextEntry(1);
                string    text1  = (entry1 == null ? "" : entry1.Text.Trim());
                bool      r1     = Int32.TryParse(text1, out si);
                if (r1 != false)
                {
                    dd.StcID = si;
                }

                if (dd.MultiT == false)
                {
                    TextRelay entry2 = info.GetTextEntry(2);
                    string    text2  = (entry2 == null ? "" : entry2.Text.Trim());
                    bool      r2     = Int32.TryParse(text2, out si);
                    if (r2 != false)
                    {
                        dd.StcX = si;
                    }

                    TextRelay entry3 = info.GetTextEntry(3);
                    string    text3  = (entry3 == null ? "" : entry3.Text.Trim());
                    bool      r3     = Int32.TryParse(text3, out si);
                    if (r3 != false)
                    {
                        dd.StcY = si;
                    }

                    TextRelay entry4 = info.GetTextEntry(4);
                    string    text4  = (entry4 == null ? "" : entry4.Text.Trim());
                    bool      r4     = Int32.TryParse(text4, out si);
                    if (r4 != false)
                    {
                        dd.StcZ = si;
                    }
                }
            }

            if (dd.LndT == true)
            {
                TextRelay entry1 = info.GetTextEntry(1);
                string    text1  = (entry1 == null ? "" : entry1.Text.Trim());
                bool      r1     = Int32.TryParse(text1, out si);
                if (r1 != false)
                {
                    dd.LndID = si;
                }

                if (dd.MultiT == false)
                {
                    TextRelay entry2 = info.GetTextEntry(2);
                    string    text2  = (entry2 == null ? "" : entry2.Text.Trim());
                    bool      r2     = Int32.TryParse(text2, out si);
                    if (r2 != false)
                    {
                        dd.LndX = si;
                    }

                    TextRelay entry3 = info.GetTextEntry(3);
                    string    text3  = (entry3 == null ? "" : entry3.Text.Trim());
                    bool      r3     = Int32.TryParse(text3, out si);
                    if (r3 != false)
                    {
                        dd.LndY = si;
                    }

                    TextRelay entry4 = info.GetTextEntry(4);
                    string    text4  = (entry4 == null ? "" : entry4.Text.Trim());
                    bool      r4     = Int32.TryParse(text4, out si);
                    if (r4 != false)
                    {
                        dd.LndZ = si;
                    }
                }
            }

            switch (info.ButtonID)
            {
            case 0:
            {
                pm.SendMessage(pm.Name + ", Thanks for using the UO Editor!");

                dd.SendSYSBCK(pm, dd);

                break;
            }

            case 1:
            {
                bool MapCheck = dd.MapCKUOE(pm, dd);

                if (MapCheck == false)
                {
                    pm.SendMessage(pm.Name + ", You entered improper values in the XYZ fields!");

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd7);
                    }

                    break;
                }

                bool IDCheck = dd.IDCKUOE(pm, dd);

                if (IDCheck == false)
                {
                    pm.SendMessage(pm.Name + ", You entered improper values in the ID field!");

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd7);
                    }

                    break;
                }

                bool HueCK = dd.HueCKUOE(pm, dd);

                if (HueCK == false)
                {
                    pm.SendMessage(pm.Name + ", You can only enter 1-3000 for the value!");

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd7);
                    }

                    break;
                }

                if (dd.StcT == true)
                {
                    if (dd.MultiT == true)
                    {
                        CommandSystem.Handle(pm, String.Format("{0}m addStatic {1}", CommandSystem.Prefix, dd.StcID));
                    }
                    if (dd.StcX == 0 || dd.StcY == 0)
                    {
                        CommandSystem.Handle(pm, String.Format("{0}addStatic {1}", CommandSystem.Prefix, dd.StcID));
                    }
                    else
                    {
                        new UltimaLive.AddStatic(pm.Map.MapID, dd.StcID, dd.StcZ, dd.StcX, dd.StcY, dd.Hue_S).DoOperation();
                    }

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd5);
                    }

                    break;
                }

                if (dd.LndT == true)
                {
                    if (dd.MultiT == true)
                    {
                        CommandSystem.Handle(pm, String.Format("{0}m setLandId {1}", CommandSystem.Prefix, dd.LndID));
                    }
                    if (dd.StcX == 0 || dd.StcY == 0)
                    {
                        CommandSystem.Handle(pm, String.Format("{0}setLandId {1}", CommandSystem.Prefix, dd.LndID));
                    }
                    if (IDCheck == true)
                    {
                        new UltimaLive.SetLandID(dd.LndX, dd.LndY, pm.Map.MapID, dd.LndID).DoOperation();
                        new UltimaLive.SetLandAltitude(dd.LndX, dd.LndY, pm.Map.MapID, dd.LndZ).DoOperation();
                    }

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd5);
                    }

                    break;
                }

                dd.SendSYSBCK(pm, dd);

                break;
            }
            }
        }
Exemple #2
0
        public override void OnResponse(NetState ns, RelayInfo info)
        {
            Mobile mob_m = ns.Mobile;

            PlayerMobile pm = mob_m as PlayerMobile;

            UOETool dd = i_Tool as UOETool;

            if (pm == null || dd == null)
            {
                return;
            }

            int si;

            if (dd.StcT == true)
            {
                TextRelay entry1 = info.GetTextEntry(1);
                string    text1  = (entry1 == null ? "" : entry1.Text.Trim());
                bool      r1     = Int32.TryParse(text1, out si);
                if (r1 != false)
                {
                    dd.StcID = si;
                }
            }

            if (dd.LndT == true)
            {
                TextRelay entry1 = info.GetTextEntry(1);
                string    text1  = (entry1 == null ? "" : entry1.Text.Trim());
                bool      r1     = Int32.TryParse(text1, out si);
                if (r1 != false)
                {
                    dd.LndID = si;
                }
            }

            switch (info.ButtonID)
            {
            case 0:
            {
                pm.SendMessage(pm.Name + ", Thanks for using the UO Editor!");

                dd.SendSYSBCK(pm, dd);

                break;
            }

            case 1:
            {
                bool IDCheck = dd.IDCKUOE(pm, dd);

                if (IDCheck == false)
                {
                    pm.SendMessage(pm.Name + ", You entered improper values in the ID field!");

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd7);
                    }

                    break;
                }

                if (dd.StcT == true)
                {
                    if (dd.MultiT == true)
                    {
                        CommandSystem.Handle(pm, String.Format("{0}m setStaticId {1}", CommandSystem.Prefix, dd.StcID));
                    }
                    else
                    {
                        CommandSystem.Handle(pm, String.Format("{0}setStaticId {1}", CommandSystem.Prefix, dd.StcID));
                    }

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd5);
                    }

                    break;
                }

                if (dd.LndT == true)
                {
                    if (dd.MultiT == true)
                    {
                        CommandSystem.Handle(pm, String.Format("{0}m setLandId {1}", CommandSystem.Prefix, dd.LndID));
                    }
                    else
                    {
                        CommandSystem.Handle(pm, String.Format("{0}setLandId {1}", CommandSystem.Prefix, dd.LndID));
                    }

                    dd.SendSYSBCK(pm, dd);

                    if (dd.SndOn == true)
                    {
                        pm.PlaySound(dd.Snd5);
                    }

                    break;
                }

                dd.SendSYSBCK(pm, dd);

                break;
            }
            }
        }