Beispiel #1
0
        /// <summary>
        ///     Sends the PrivSound command
        /// </summary>
        /// <param name="sound">The sound index to play</param>
        /// <param name="modifier">The command modifier</param>
        public void DoPrivSound(int sound, string modifier)
        {
            var cmd = m_PrivSound.Replace("{sound}", sound.ToString());

            cmd = ApplyModifier(cmd, modifier);
            Pandora.SendToUO(cmd, true);
        }
Beispiel #2
0
        /// <summary>
        ///     Set the ItemID
        /// </summary>
        private void cmSetItemID_Click(object sender, EventArgs e)
        {
            Pandora.SendToUO(string.Format("Set ItemID {0}", SelectedItem.ItemID), true);

            Pandora.Prop.DisplayedProp  = "ItemID";
            Pandora.Prop.DisplayedValue = SelectedItem.ItemID.ToString();
        }
Beispiel #3
0
        /// <summary>
        ///     Performs the Tell command
        /// </summary>
        /// <param name="text">The message to send</param>
        /// <param name="modifier">The modifier for the command</param>
        public void DoTell(string text, string modifier)
        {
            var cmd = m_Tell.Replace("{text}", text);

            cmd = ApplyModifier(cmd, modifier);
            Pandora.SendToUO(cmd, true);
        }
Beispiel #4
0
        /// <summary>
        ///     Performs the open browser command
        /// </summary>
        /// <param name="url">The url to open</param>
        /// <param name="modifier">The command modifier</param>
        public void DoOpenBrowser(string url, string modifier)
        {
            var cmd = m_OpenBrowser.Replace("{url}", url);

            cmd = ApplyModifier(cmd, modifier);
            Pandora.SendToUO(cmd, true);
        }
Beispiel #5
0
        /// <summary>
        /// Performs the dupe in bag command
        /// </summary>
        /// <param name="useamount">States wheter an amount should be specified</param>
        /// <param name="amount">The amount of items to be duped</param>
        public void DoDupeInBag(bool useamount, int amount)
        {
            string cmd = useamount ?
                         m_AmountDupeInBag.Replace("{amount}", amount.ToString()) :
                         m_DupeInBag;

            Pandora.SendToUO(cmd, true);
        }
Beispiel #6
0
        /// <summary>
        ///     Tiles a scripted item
        /// </summary>
        /// <param name="z">The tiling height</param>
        /// <param name="item">The item constructor</param>
        public void DoTileItem(int z, string item)
        {
            var cmd = m_Tile.Replace("{z}", z.ToString());

            cmd = cmd.Replace("{item}", item);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #7
0
        /// <summary>
        ///     Sets a single skill on a targeted mobile
        /// </summary>
        /// <param name="skill">The name of the skill</param>
        /// <param name="value">The value of the skill</param>
        public void DoSetSkill(string skill, decimal value)
        {
            var cmd = m_SetSkill.Replace("{skill}", skill);

            cmd = cmd.Replace("{value}", value.ToString());

            Pandora.SendToUO(cmd, true);
        }
Beispiel #8
0
        /// <summary>
        ///     Send command
        /// </summary>
        private void m_Def_SendCommand(object sender, SendCommandEventArgs e)
        {
            OnSendCommand(e);

            if (m_IsActive && !e.Sent)
            {
                Pandora.SendToUO(e.Command, e.UsePrefix);
            }
        }
Beispiel #9
0
        public void DoSet(string prop, string value, string modifier)
        {
            var cmd = m_Set.Replace("{prop}", prop);

            cmd = cmd.Replace("{value}", value);

            cmd = ApplyModifier(cmd, modifier);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #10
0
        /// <summary>
        ///     Sends the Send command to UO
        /// </summary>
        /// <param name="x">The target X coordinate</param>
        /// <param name="y">The target Y coordinate</param>
        /// <param name="z">The target Z coordinate</param>
        /// <param name="map">The target map</param>
        public void DoSend(int x, int y, int z, int map)
        {
            var cmd = m_SendFormat;

            cmd = cmd.Replace("{x}", x.ToString());
            cmd = cmd.Replace("{y}", y.ToString());
            cmd = cmd.Replace("{z}", z.ToString());
            cmd = cmd.Replace("{map}", map.ToString());

            Pandora.SendToUO(cmd, true);
        }
Beispiel #11
0
        /// <summary>
        ///     Performs the nudge down command
        /// </summary>
        /// <param name="z">The amount to nudge</param>
        /// <param name="modifier">The command modifier</param>
        public void DoNudgeDown(int z, string modifier)
        {
            var nudge = m_NudgeDown.Replace("{z}", z.ToString());

            if (modifier != null)
            {
                nudge = string.Format("{0} {1}", modifier, nudge);
            }

            Pandora.SendToUO(nudge, true);
        }
Beispiel #12
0
        public void DoAddMobile(string mobile, params string[] additional)
        {
            var cmd = string.Format("{0} {1}", m_AddMobile, mobile);

            foreach (var s in additional)
            {
                cmd += " " + s;
            }

            Pandora.SendToUO(cmd, true);
        }
Beispiel #13
0
        /// <summary>
        ///     Spawns an item
        /// </summary>
        /// <param name="item">The item name</param>
        public void DoSpawnItem(string item)
        {
            var cmd = m_SpawnFormat;

            cmd = cmd.Replace("{creature}", item);
            cmd = cmd.Replace("{amount}", Pandora.Profile.Items.Amount.ToString());
            cmd = cmd.Replace("{min}", Pandora.Profile.Items.MinDelay.ToString());
            cmd = cmd.Replace("{max}", Pandora.Profile.Items.MaxDelay.ToString());
            cmd = cmd.Replace("{team}", Pandora.Profile.Items.Team.ToString());
            cmd = cmd.Replace("{range}", Pandora.Profile.Items.Range.ToString());
            cmd = cmd.Replace("{extra}", Pandora.Profile.Items.Extra.ToString());

            Pandora.SendToUO(cmd, true);
        }
Beispiel #14
0
        public void DoSet(string prop, string value, string filter, string modifier)
        {
            var cmd = m_Set.Replace("{prop}", prop);

            cmd = cmd.Replace("{value}", value);

            if (filter != null && filter.Length > 0)
            {
                cmd += " " + filter;
            }

            cmd = ApplyModifier(cmd, modifier);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #15
0
        public void DoAddToPack(string item, string modifier, params string[] additional)
        {
            var cmd = string.Format("{0} {1}", m_AddToPack, item);

            if (modifier != null)
            {
                cmd = string.Format("{0} {1}", modifier, cmd);
            }

            foreach (var s in additional)
            {
                cmd += " " + s;
            }

            Pandora.SendToUO(cmd, true);
        }
Beispiel #16
0
        /// <summary>
        ///     Sends the Go command to UO
        /// </summary>
        /// <param name="x">The target X coordinate</param>
        /// <param name="y">The target Y coordinate</param>
        /// <param name="z">The target Z coordinate</param>
        /// <param name="map">The target map</param>
        public void DoGo(int x, int y, int z, int map)
        {
            var cmd = m_GoFormat;

            cmd = cmd.Replace("{x}", x.ToString());
            cmd = cmd.Replace("{y}", y.ToString());
            cmd = cmd.Replace("{z}", z.ToString());
            cmd = cmd.Replace("{map}", map.ToString());

            if (m_SetMapOnGo)
            {
                DoSet("map", map.ToString(), "Self");
            }

            Pandora.SendToUO(cmd, true);
        }
Beispiel #17
0
        /// <summary>
        ///     Sends the tile command
        /// </summary>
        /// <param name="z">Height at which tiling occurs</param>
        /// <param name="id">ID of the item being added</param>
        /// <param name="movable">States whether the item can be moved or not</param>
        /// <param name="hue">The hue value</param>
        /// <param name="rnd">The randomization amount. Use 0 to disable</param>
        public void DoTile(int z, int id, bool movable, int hue, int rnd)
        {
            var    item = m_Deco;
            string tile = null;

            if (rnd == 0)
            {
                item = item.Replace("{id}", id.ToString());
            }
            else
            {
                item = item.Replace("{id}", string.Format("{0} {1}", id, rnd));
            }
            item = item.Replace("{movable}", movable.ToString());
            item = item.Replace("{hue}", hue.ToString());

            tile = m_Tile.Replace("{item}", item);
            tile = tile.Replace("{z}", z.ToString());

            Pandora.SendToUO(tile, true);
        }
Beispiel #18
0
        /// <summary>
        ///     Sends the IncXYZ command to UO
        /// </summary>
        /// <param name="modifier">The modifier for the command</param>
        /// <param name="x">The X Offset</param>
        /// <param name="y">The Y Offset</param>
        public void DoMove(string modifier, int x, int y)
        {
            var cmd = "Inc";

            if (modifier != null)
            {
                cmd = modifier + " " + cmd;
            }

            if (x != 0)
            {
                cmd += string.Format(" X {0}", x);
            }

            if (y != 0)
            {
                cmd += string.Format(" Y {0}", y);
            }

            Pandora.SendToUO(cmd, true);
        }
Beispiel #19
0
        /// <summary>
        ///     Sets all the skills of a targeted mobile
        /// </summary>
        /// <param name="value">The value that should be set</param>
        public void DoSetAllSkills(decimal value)
        {
            var cmd = m_SetAllSkills.Replace("{value}", value.ToString());

            Pandora.SendToUO(cmd, true);
        }
Beispiel #20
0
        /// <summary>
        ///     Broadcasts a message to staff only
        /// </summary>
        /// <param name="text">The message text</param>
        public void DoStaffMessage(string text)
        {
            var cmd = m_StaffMessage.Replace("{text}", text);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #21
0
        /// <summary>
        ///     Sends the Sound command
        /// </summary>
        /// <param name="sound">The sound index to play</param>
        public void DoSound(int sound)
        {
            var cmd = m_Sound.Replace("{sound}", sound.ToString());

            Pandora.SendToUO(cmd, true);
        }
Beispiel #22
0
 private void bCheck_Click(object sender, EventArgs e)
 {
     Pandora.SendToUO("Condition " + m_Filter, true);
 }
Beispiel #23
0
        /// <summary>
        ///     Sends the global light command
        /// </summary>
        /// <param name="amount">The light level</param>
        public void DoGlobalLight(int amount)
        {
            var cmd = m_GlobalLight.Replace("{level}", amount.ToString());

            Pandora.SendToUO(cmd, true);
        }
Beispiel #24
0
        /// <summary>
        ///     Performs the dupe command
        /// </summary>
        /// <param name="useamount">States wheter an amount should be specified</param>
        /// <param name="amount">The amount of items to be duped</param>
        public void DoDupe(bool useamount, int amount)
        {
            var cmd = useamount ? m_AmountDupe.Replace("{amount}", amount.ToString()) : m_Dupe;

            Pandora.SendToUO(cmd, true);
        }
Beispiel #25
0
 /// <summary>
 ///     Sends the Skills command
 /// </summary>
 public void DoGetAllSkills()
 {
     Pandora.SendToUO(m_GetAllSkills, true);
 }
Beispiel #26
0
        /// <summary>
        ///     Performs the FindByName command
        /// </summary>
        /// <param name="item">The item name to search for</param>
        public void DoFindByName(string item)
        {
            var cmd = m_FindByName.Replace("{item}", item);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #27
0
        /// <summary>
        ///     Broadcasts a message
        /// </summary>
        /// <param name="text">The message text</param>
        public void DoBroadcast(string text)
        {
            var cmd = m_Broadcast.Replace("{text}", text);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #28
0
        public void DoGet(string prop)
        {
            var cmd = m_Get.Replace("{prop}", prop);

            Pandora.SendToUO(cmd, true);
        }
Beispiel #29
0
        /// <summary>
        ///     Does classic generation of the roof
        /// </summary>
        /// <param name="mode">The mode for this generation</param>
        /// <param name="height">The height at which the tiling occurs</param>
        /// <param name="hue">The hue for the roof</param>
        /// <returns>True if generation is succesful</returns>
        public bool GenerateClassic(TestMode mode, int height, int hue)
        {
            var roofIDs = new int[m_RoofImage.Width * m_RoofImage.Height];
            var fail    = false;

            // Revert any sign changes due to image processing
            for (var i = 0; i < m_RoofImage.Width * m_RoofImage.Height; i++)
            {
                // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                if (m_RoofImage.Data[i] < 0)
                {
                    m_RoofImage.Data[i] = -m_RoofImage.Data[i];
                }
                // Issue 10 - End
            }

            // Calculate the roof ids
            for (var i = 0; i < m_RoofImage.Width * m_RoofImage.Height; i++)
            {
                // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                if (m_RoofImage.Data[i] == 0)
                // Issue 10 - End
                {
                    roofIDs[i] = 0;
                }
                else
                {
                    var flags = RoofingHelper.GetFlags(MakeLine(i - m_RoofImage.Width), MakeLine(i), MakeLine(i + m_RoofImage.Width));
                    roofIDs[i] = TileSet.FindID(flags);

                    if (roofIDs[i] == 0)
                    {
                        // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                        m_RoofImage.Data[i] = -m_RoofImage.Data[i];
                        // Issue 10 - End
                        fail = true;
                    }

                    if (mode != TestMode.NoTest)
                    {
                        var corner = !((flags & ~0x88878778) != 0) || !((flags & ~0x88887877) != 0) || !((flags & ~0x77878888) != 0) ||
                                     !((flags & ~0x87787888) != 0) || !((flags & ~0x87777777) != 0) || !((flags & ~0x77877777) != 0) ||
                                     !((flags & ~0x77777877) != 0) || !((flags & ~0x77777778) != 0);

                        if (mode == TestMode.Test && !corner)
                        {
                            roofIDs[i] = 0;
                        }

                        if (mode == TestMode.Rest && corner)
                        {
                            roofIDs[i] = 0;
                        }
                    }
                }
            }

            if (fail)
            {
                m_RoofImage.CreateImage();

                // Request redraw image
                if (RoofImageChanged != null)
                {
                    RoofImageChanged(this, new EventArgs());
                }

                if (MessageBox.Show(
                        Pandora.Localization.TextProvider["Roofing.MissTiles"],
                        "",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question) == DialogResult.No)
                {
                    return(false);
                }
            }

            var idFormat = hue > 0 ? "static {0} set hue " + hue : "static {0}";

            var dx = 0;
            var dy = 0;
            var p  = 0;

            var tilex = 0;
            var tiley = 0;
            var tilew = 0;
            var tileh = 0;

            var tilez  = 0;
            var tileid = 0;

            for (var y = 0; y < m_RoofImage.Height; y++)
            {
                for (var x = 0; x < m_RoofImage.Width; x++, p++)
                {
                    if (roofIDs[p] == 0)
                    {
                        continue;
                    }

                    for (dx = 1; dx + x < m_RoofImage.Width; dx++)
                    {
                        // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                        if ((roofIDs[p + dx] != roofIDs[p]) || (m_RoofImage.Data[p] != m_RoofImage.Data[p + dx]))
                        // Issue 10 - End
                        {
                            break;
                        }
                    }

                    for (dy = 1; dy + y < m_RoofImage.Height; dy++)
                    {
                        if ((roofIDs[p + m_RoofImage.Width * dy] != roofIDs[p]) ||
                            // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                            (m_RoofImage.Data[p] != m_RoofImage.Data[p + m_RoofImage.Width * dy]))
                        // Issue 10 - End
                        {
                            break;
                        }
                    }

                    dx--;
                    dy--;

                    // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                    tilez = height + (3 * m_RoofImage.Data[p]) - 3;
                    // Issue 10 - End
                    tileid = roofIDs[p];

                    if (dx > 0 || dy > 0)
                    {
                        tilex = m_BasePoint.X + x;
                        tiley = m_BasePoint.Y + y;

                        if (dy > dx)
                        {
                            tilew = 1;
                            tileh = dy + 1;

                            while (dy >= 0)
                            {
                                roofIDs[p + m_RoofImage.Width * dy] = 0;
                                dy--;
                            }
                        }
                        else
                        {
                            tilew = dx + 1;
                            tileh = 1;

                            while (dx >= 0)
                            {
                                roofIDs[p + dx] = 0;
                                dx--;
                            }
                        }

                        x += dx;
                        p += dx;
                    }
                    else
                    {
                        tilex = m_BasePoint.X + x;
                        tiley = m_BasePoint.Y + y;
                        tilew = 1;
                        tileh = 1;
                    }

                    // Build command
                    var item = string.Format(idFormat, tileid);
                    var cmd  = string.Format("TileXYZ {0} {1} {2} {3} {4} {5}", tilex, tiley, tilew, tileh, tilez, item);
                    Pandora.SendToUO(cmd, true);
                }
            }

            return(true);
        }
Beispiel #30
0
        /// <summary>
        ///     Gets the value of a skill on a targeted mobile
        /// </summary>
        /// <param name="skill">The name of the skill to get</param>
        public void DoGetSkill(string skill)
        {
            var cmd = m_GetSkill.Replace("{skill}", skill);

            Pandora.SendToUO(cmd, true);
        }