Beispiel #1
0
 public static void BeginStaEx(Mobile mob, string file)
 {
     BoundingBoxPicker.Begin(mob, new BoundingBoxCallback(StaExBox_Callback), new object[] { file });
 }
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0)
                {
                    return;
                }

                foreach (TextRelay text in info.TextEntries)
                {
                    switch (text.EntryID)
                    {
                    case 0:                             // Name, 0

                        m_State[0] = text.Text;

                        break;

                    case 1:                             // Description, 1

                        m_State[1] = text.Text;

                        break;

                    case 2:                             // Min Z, 5

                        m_State[5] = text.Text;

                        break;

                    case 3:                             // Max Z, 6

                        m_State[6] = text.Text;

                        break;
                    }
                }

                // Reset checks
                m_State[2] = false;                 // raw capture
                m_State[3] = false;                 // Remove foundation
                m_State[4] = false;                 // specify Z
                m_State[7] = false;                 // Patch Tiles

                foreach (int check in info.Switches)
                {
                    switch (check)
                    {
                    case 0: m_State[2] = true; continue;

                    case 1: m_State[3] = true; continue;

                    case 3: m_State[4] = true; continue;

                    case 2: m_State[7] = true; continue;
                    }
                }


                if (Verify(sender.Mobile, m_State))
                {
                    BoundingBoxPicker.Begin(sender.Mobile, new BoundingBoxCallback(HouseGenerator.PickerCallback), m_State);
                }
                else
                {
                    sender.Mobile.SendGump(new InternalGump(sender.Mobile, m_State));
                }
            }
Beispiel #3
0
 public static void Unfreeze_OnCommand(CommandEventArgs e)
 {
     BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(UnfreezeBox_Callback), null);
 }
 public override void Process(Mobile from, BaseCommand command, string[] args)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(OnTarget), new object[] { command, args });
 }
Beispiel #5
0
 public static void BeginWipe(Mobile from, WipeType type)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(WipeBox_Callback), type);
 }
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0)
                {
                    return;
                }

                foreach (var text in info.TextEntries)
                {
                    int index;

                    if (text.EntryID >= 1000)
                    {
                        continue;
                    }

                    if (text.EntryID > 1)
                    {
                        index = text.EntryID + 7;
                    }
                    else
                    {
                        index = text.EntryID;
                    }

                    _State[index] = text.Text ?? String.Empty;
                }

                // Reset checks
                for (var x = 2; x <= 8; x++)
                {
                    _State[x] = false;
                }

                foreach (var check in info.Switches)
                {
                    _State[check + 2] = true;                     // Offset by 2 in the state object
                }

                try
                {
                    _State[17] = info.GetTextEntry(1004).Text ?? String.Empty;
                }
                catch
                { }

                try
                {
                    var duraH = info.GetTextEntry(1005).Text ?? String.Empty;
                    var duraM = info.GetTextEntry(1006).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(duraH))
                    {
                        duraH = "0";
                    }

                    if (String.IsNullOrWhiteSpace(duraM))
                    {
                        duraM = "0";
                    }

                    TimeSpan time;

                    if (TimeSpan.TryParse("0:" + duraH + ":" + duraM + ":0", out time))
                    {
                        _State[18] = time;
                    }
                }
                catch
                { }

                try
                {
                    var lockH = info.GetTextEntry(1007).Text ?? String.Empty;
                    var lockM = info.GetTextEntry(1008).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(lockH))
                    {
                        lockH = "0";
                    }

                    if (String.IsNullOrWhiteSpace(lockM))
                    {
                        lockM = "0";
                    }

                    TimeSpan time;

                    if (TimeSpan.TryParse("0:" + lockH + ":" + lockM + ":0", out time))
                    {
                        _State[19] = time;
                    }
                }
                catch
                { }

                try
                {
                    var enX = info.GetTextEntry(1009).Text ?? String.Empty;
                    var enY = info.GetTextEntry(1010).Text ?? String.Empty;
                    var enZ = info.GetTextEntry(1011).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(enX))
                    {
                        enX = "0";
                    }

                    if (String.IsNullOrWhiteSpace(enY))
                    {
                        enY = "0";
                    }

                    if (String.IsNullOrWhiteSpace(enZ))
                    {
                        enZ = "0";
                    }

                    int px, py, pz;

                    if (Int32.TryParse(enX, out px) | Int32.TryParse(enY, out py) | Int32.TryParse(enZ, out pz))
                    {
                        _State[20] = new Point3D(px, py, pz);
                    }
                }
                catch
                { }

                try
                {
                    var exX = info.GetTextEntry(1012).Text ?? String.Empty;
                    var exY = info.GetTextEntry(1013).Text ?? String.Empty;
                    var exZ = info.GetTextEntry(1014).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(exX))
                    {
                        exX = "0";
                    }

                    if (String.IsNullOrWhiteSpace(exY))
                    {
                        exY = "0";
                    }

                    if (String.IsNullOrWhiteSpace(exZ))
                    {
                        exZ = "0";
                    }

                    int px, py, pz;

                    if (Int32.TryParse(exX, out px) | Int32.TryParse(exY, out py) | Int32.TryParse(exZ, out pz))
                    {
                        _State[21] = new Point3D(px, py, pz);
                    }
                }
                catch
                { }

                try
                {
                    var grpMax = info.GetTextEntry(1015).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(grpMax))
                    {
                        grpMax = "0";
                    }

                    int groupMax;

                    if (Int32.TryParse(grpMax, out groupMax))
                    {
                        _State[22] = groupMax;
                    }
                }
                catch
                { }

                try
                {
                    var lootF = info.GetTextEntry(1016).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(lootF))
                    {
                        lootF = "0";
                    }

                    double lootFactor;

                    if (Double.TryParse(lootF, out lootFactor))
                    {
                        _State[23] = lootFactor;
                    }
                }
                catch
                { }

                try
                {
                    var spawnF = info.GetTextEntry(1017).Text ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(spawnF))
                    {
                        spawnF = "0";
                    }

                    double spawnFactor;

                    if (Double.TryParse(spawnF, out spawnFactor))
                    {
                        _State[24] = spawnFactor;
                    }
                }
                catch
                { }

                try
                {
                    _State[25] = info.GetTextEntry(1018).Text ?? String.Empty;
                }
                catch
                { }

                if (Verify(sender.Mobile, _State))
                {
                    BoundingBoxPicker.Begin(sender.Mobile, PickerCallback, _State);
                }
                else
                {
                    sender.Mobile.SendMessage(0x40, "Please review the generation parameters, some are invalid.");
                    sender.Mobile.SendGump(new InternalGump(sender.Mobile, _State));
                }
            }
 public void ChooseArea(Mobile m)
 {
     BoundingBoxPicker.Begin(m, new BoundingBoxCallback(CustomRegion_Callback), this);
 }
 public override void Process(Mobile from, BaseCommand command, string[] args)
 {
     BoundingBoxPicker.Begin(from, (map, start, end) => OnTarget(from, map, start, end, command, args));
 }
Beispiel #9
0
 public void TargetArea(Mobile m)
 {
     BoundingBoxPicker.Begin(m, new BoundingBoxCallback(DefineArea), this);
 }
 public void DefineChallengeArea(Mobile m)
 {
     BoundingBoxPicker.Begin(m, new BoundingBoxCallback(ChallengeRegionArea_Callback), this);
 }
Beispiel #11
0
 public static void BeginWipe(Mobile from, WipeType type)
 {
     BoundingBoxPicker.Begin(from, (map, start, end) => DoWipe(from, map, start, end, type));
 }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 1:
            {
                caller.Prompt = new SetArenaNamePrompt(survivorStone);
                caller.SendMessage("Digite o nome da arena.");
                break;
            }

            case 2:
            {
                caller.SendMessage("Forme o retangulo da arena com 2 cliques.");
                BoundingBoxPicker.Begin(caller, new BoundingBoxCallback(SetBoundingBoxArea_Callback), survivorStone);
                break;
            }

            case 21:
            {
                from.BeginTarget(-1, true, TargetFlags.None, new TargetStateCallback(EndArenaAreaAPoint), survivorStone);
                caller.SendMessage("Clique na Primeira Posicao para formar a Area da Arena.");
                break;
            }

            case 22:
            {
                from.BeginTarget(-1, true, TargetFlags.None, new TargetStateCallback(EndArenaAreaBPoint), survivorStone);
                caller.SendMessage("Clique na Segunda Posicao para formar a Area da Arena.");
                break;
            }

            case 3:
            {
                from.BeginTarget(-1, true, TargetFlags.None, new TargetStateCallback(EndArenaRespawnPointTarget), survivorStone);
                caller.SendMessage("Clique na Posicao Central da Arena.");
                break;
            }

            case 4:
            {
                from.BeginTarget(-1, true, TargetFlags.None, new TargetStateCallback(EndArenaRespawnPointATarget), survivorStone);
                caller.SendMessage("Clique na Posicao Time A da Arena.");
                break;
            }

            case 5:
            {
                from.BeginTarget(-1, true, TargetFlags.None, new TargetStateCallback(EndArenaRespawnPointBTarget), survivorStone);
                caller.SendMessage("Clique na Posicao Time A da Arena.");
                break;
            }


            case 0:
            default:
                from.SendGump(new SurvivorGump(from, survivorStone));
                break;
            }
        }
Beispiel #13
0
 public void ChooseSpectatorArea(Mobile m)
 {
     BoundingBoxPicker.Begin(m, new BoundingBoxCallback(SpectatorRegion_Callback), this);
 }
Beispiel #14
0
 public void ChooseArea(Mobile from, bool duel)
 {
     BoundingBoxPicker.Begin(from, new BoundingBoxCallback(TArenaRegion_Callback), duel);
 }
 public void DefineMobFactionArea(Mobile m)
 {
     BoundingBoxPicker.Begin(m, new BoundingBoxCallback(MobFactionRegionArea_Callback), this);
 }
Beispiel #16
0
 public static void BeginArea(Mobile mob)
 {
     BoundingBoxPicker.Begin(mob, new BoundingBoxCallback(Area_Callback), new object[] { "area.txt" });
 }
Beispiel #17
0
 private static void AddTable_OnCom(CommandEventArgs e)
 {
     BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(AddCase_Callback), 0);
 }
Beispiel #18
0
        private static void GenRug(Mobile m, RugType typ)
        {
            Rug rug = Rug.GetRug(typ);

            BoundingBoxPicker.Begin(m, new BoundingBoxCallback(AddRug_Callback), rug);
        }