private void EnhancedScavengerEditItemProps_Load(object sender, EventArgs e)
        {
            comboboxProp.DataSource = m_default_prop;
            lName.Text     = m_name;
            lGraphics.Text = m_graphics;
            lColor.Text    = m_color;

            int color  = 0;
            int itemid = 0;

            if (m_graphics != "All")
            {
                itemid = Convert.ToInt32(m_graphics, 16);
            }

            if (m_color != "All")
            {
                color = Convert.ToInt32(m_color, 16);
            }

            if (m_proplist != null)
            {
                foreach (AutoLoot.AutoLootItem.Property prop in m_proplist)
                {
                    autolootpropGridView.Rows.Add(new object[] { prop.Name, prop.Minimum.ToString(), prop.Maximum.ToString() });
                }
            }

            // Immagine
            Bitmap m_itemimage = Ultima.Art.GetStatic(itemid);
            {
                if (m_itemimage != null && color > 0)
                {
                    bool onlyHueGrayPixels = (color & 0x8000) != 0;
                    color = (color & 0x3FFF) - 1;
                    Ultima.Hue m_hue = Ultima.Hues.GetHue(color);
                    m_hue.ApplyTo(m_itemimage, onlyHueGrayPixels);
                }
                imagepanel.BackgroundImage = m_itemimage;
            }
        }
Ejemplo n.º 2
0
        private void EnhancedItemInspector_Load(object sender, EventArgs e)
        {
            // general
            lSerial.Text   = "0x" + m_itemTarg.Serial.Value.ToString("X8");
            lItemID.Text   = "0x" + m_itemTarg.ItemID.Value.ToString("X4");
            lColor.Text    = "0x" + m_itemTarg.Hue.ToString("X4");
            lPosition.Text = m_itemTarg.Position.ToString();
            // Details
            Assistant.PlayerData tempdata;
            Assistant.Item       tempdata2;
            if (m_itemTarg.OnGround)
            {
                lContainer.Text     = "None";
                lRootContainer.Text = "None";
            }
            else
            {
                if (m_itemTarg.Container is Assistant.PlayerData)
                {
                    tempdata        = (Assistant.PlayerData)m_itemTarg.Container;
                    lContainer.Text = tempdata.Serial.ToString();
                }
                if (m_itemTarg.Container is Assistant.Item)
                {
                    tempdata2       = (Assistant.Item)m_itemTarg.Container;
                    lContainer.Text = tempdata2.Serial.ToString();
                }

                if (m_itemTarg.RootContainer is Assistant.PlayerData)
                {
                    tempdata            = (Assistant.PlayerData)m_itemTarg.RootContainer;
                    lRootContainer.Text = tempdata.Serial.ToString();
                    if (tempdata.Serial == Assistant.World.Player.Serial)
                    {
                        lOwned.Text = "Yes";
                    }
                }
                if (m_itemTarg.RootContainer is Assistant.Item)
                {
                    tempdata2           = (Assistant.Item)m_itemTarg.RootContainer;
                    lRootContainer.Text = tempdata2.Serial.ToString();
                    if (tempdata2.Serial == Assistant.World.Player.Backpack.Serial)
                    {
                        lOwned.Text = "Yes";
                    }
                }
            }

            // Su OSI il valore amount viene usato per altro se un item è dichiarato non stackabile nei files.
            if (m_itemTarg.Amount == 0)
            {
                lAmount.Text = "1";
            }
            else
            {
                if ((Ultima.TileData.ItemTable[m_itemTarg.ItemID].Flags & Ultima.TileFlag.Generic) != 0)
                {
                    lAmount.Text = m_itemTarg.Amount.ToString();
                }
                else
                {
                    lAmount.Text = "1";
                }
            }

            lLayer.Text = m_itemTarg.Layer.ToString();

            // Flag
            containerflaglabel.Text      = (m_itemTarg.IsContainer) ? "Yes" : "No";
            containerflaglabel.ForeColor = (m_itemTarg.IsContainer) ? Color.Green : Color.Red;

            corpseflaglabel.Text      = (m_itemTarg.IsCorpse) ? "Yes" : "No";
            corpseflaglabel.ForeColor = (m_itemTarg.IsCorpse) ? Color.Green : Color.Red;

            doorflaglabel.Text      = (m_itemTarg.IsDoor) ? "Yes" : "No";
            doorflaglabel.ForeColor = (m_itemTarg.IsDoor) ? Color.Green : Color.Red;

            multiflaglabel.Text      = (m_itemTarg.IsMulti) ? "Yes" : "No";
            multiflaglabel.ForeColor = (m_itemTarg.IsMulti) ? Color.Green : Color.Red;

            potionflaglabel.Text      = (m_itemTarg.IsPotion) ? "Yes" : "No";
            potionflaglabel.ForeColor = (m_itemTarg.IsPotion) ? Color.Green : Color.Red;

            movableflaglabel.Text      = (m_itemTarg.Movable) ? "Yes" : "No";
            movableflaglabel.ForeColor = (m_itemTarg.Movable) ? Color.Green : Color.Red;

            twohandflaglabel.Text      = (m_itemTarg.IsTwoHanded) ? "Yes" : "No";
            twohandflaglabel.ForeColor = (m_itemTarg.IsTwoHanded) ? Color.Green : Color.Red;

            groudflaglabel.Text      = (m_itemTarg.OnGround) ? "Yes" : "No";
            groudflaglabel.ForeColor = (m_itemTarg.OnGround) ? Color.Green : Color.Red;

            visibleflaglabel.Text      = (m_itemTarg.Visible) ? "Yes" : "No";
            visibleflaglabel.ForeColor = (m_itemTarg.Visible) ? Color.Green : Color.Red;

            // Immagine
            Bitmap m_itemimage = new Bitmap(Ultima.Art.GetStatic(m_itemTarg.ItemID));

            {
                if (m_itemTarg.Hue > 0)
                {
                    int  hue = m_itemTarg.Hue;
                    bool onlyHueGrayPixels = (hue & 0x8000) != 0;
                    hue = (hue & 0x3FFF) - 1;
                    Ultima.Hue m_hue = Ultima.Hues.GetHue(hue);
                    m_hue.ApplyTo(m_itemimage, onlyHueGrayPixels);
                }
                imagepanel.BackgroundImage = m_itemimage;
            }
            // Attributes
            m_ProcessInfo = new Thread(ProcessInfoThread);
            m_ProcessInfo.Start();
        }
Ejemplo n.º 3
0
        private void EnhancedItemInspector_Load(object sender, EventArgs e)
        {
            if (m_itemTarg == null)
            {
                this.Close();
            }

            // general
            ToolTip toolTip = new ToolTip
            {
                // Set up the delays for the ToolTip.
                AutoPopDelay = 10000,
                InitialDelay = 1000,
                ReshowDelay  = 500,
                // Force the ToolTip text to be displayed whether or not the form is active.
                ShowAlways = true
            };

            lSerial.Text = "0x" + m_itemTarg.Serial.Value.ToString("X8");
            toolTip.SetToolTip(lItemID, m_itemTarg.ItemID.Value.ToString());
            lItemID.Text = "0x" + m_itemTarg.ItemID.Value.ToString("X4");
            toolTip.SetToolTip(lColor, m_itemTarg.Hue.ToString());
            lColor.Text    = "0x" + m_itemTarg.Hue.ToString("x4");
            lPosition.Text = m_itemTarg.Position.ToString();
            // Details
            Assistant.PlayerData tempdata;
            Assistant.Item       tempdata2;
            if (m_itemTarg.OnGround)
            {
                lContainer.Text     = "None";
                lRootContainer.Text = "None";
            }
            else
            {
                if (m_itemTarg.Container is Assistant.PlayerData)
                {
                    tempdata        = (Assistant.PlayerData)m_itemTarg.Container;
                    lContainer.Text = tempdata.Serial.ToString();
                }
                if (m_itemTarg.Container is Assistant.Item)
                {
                    tempdata2       = (Assistant.Item)m_itemTarg.Container;
                    lContainer.Text = tempdata2.Serial.ToString();
                }

                if (m_itemTarg.RootContainer is Assistant.PlayerData)
                {
                    tempdata            = (Assistant.PlayerData)m_itemTarg.RootContainer;
                    lRootContainer.Text = tempdata.Serial.ToString();
                    if (tempdata.Serial == Assistant.World.Player.Serial)
                    {
                        lOwned.Text = "Yes";
                    }
                }
                if (m_itemTarg.RootContainer is Assistant.Item)
                {
                    tempdata2           = (Assistant.Item)m_itemTarg.RootContainer;
                    lRootContainer.Text = tempdata2.Serial.ToString();
                    if (tempdata2.Serial == Assistant.World.Player.Backpack.Serial)
                    {
                        lOwned.Text = "Yes";
                    }
                }
            }

            if (m_itemTarg.Amount == 0)
            {
                lAmount.Text = "1";
            }
            else
            {
                lAmount.Text = m_itemTarg.Amount.ToString();
            }

            lLayer.Text = m_itemTarg.Layer.ToString();

            // Flag
            containerflaglabel.Text      = (m_itemTarg.IsContainer) ? "Yes" : "No";
            containerflaglabel.ForeColor = (m_itemTarg.IsContainer) ? Color.Green : Color.Red;

            corpseflaglabel.Text      = (m_itemTarg.IsCorpse) ? "Yes" : "No";
            corpseflaglabel.ForeColor = (m_itemTarg.IsCorpse) ? Color.Green : Color.Red;

            doorflaglabel.Text      = (m_itemTarg.IsDoor) ? "Yes" : "No";
            doorflaglabel.ForeColor = (m_itemTarg.IsDoor) ? Color.Green : Color.Red;

            multiflaglabel.Text      = (m_itemTarg.IsMulti) ? "Yes" : "No";
            multiflaglabel.ForeColor = (m_itemTarg.IsMulti) ? Color.Green : Color.Red;

            potionflaglabel.Text      = (m_itemTarg.IsPotion) ? "Yes" : "No";
            potionflaglabel.ForeColor = (m_itemTarg.IsPotion) ? Color.Green : Color.Red;

            movableflaglabel.Text      = (m_itemTarg.Movable) ? "Yes" : "No";
            movableflaglabel.ForeColor = (m_itemTarg.Movable) ? Color.Green : Color.Red;

            twohandflaglabel.Text      = (m_itemTarg.IsTwoHanded) ? "Yes" : "No";
            twohandflaglabel.ForeColor = (m_itemTarg.IsTwoHanded) ? Color.Green : Color.Red;

            groudflaglabel.Text      = (m_itemTarg.OnGround) ? "Yes" : "No";
            groudflaglabel.ForeColor = (m_itemTarg.OnGround) ? Color.Green : Color.Red;

            visibleflaglabel.Text      = (m_itemTarg.Visible) ? "Yes" : "No";
            visibleflaglabel.ForeColor = (m_itemTarg.Visible) ? Color.Green : Color.Red;

            // Immagine
            Bitmap m_itemimage = Ultima.Art.GetStatic(m_itemTarg.ItemID);

            {
                if (m_itemimage != null && m_itemTarg.Hue > 0)
                {
                    int  hue = m_itemTarg.Hue;
                    bool onlyHueGrayPixels = (hue & 0x8000) != 0;
                    hue = (hue & 0x3FFF) - 1;
                    Ultima.Hue m_hue = Ultima.Hues.GetHue(hue);
                    m_hue.ApplyTo(m_itemimage, onlyHueGrayPixels);
                }
                imagepanel.BackgroundImage = m_itemimage;
            }
            // Attributes
            m_ProcessInfo = new Thread(ProcessInfoThread);
            m_ProcessInfo.Start();
        }
Ejemplo n.º 4
0
        private void EnhancedScavengerEditItemProps_Load(object sender, EventArgs e)
        {
            // Popola combobox props
            comboboxProp.Items.Add("Balanced");
            comboboxProp.Items.Add("Cold Resist");
            comboboxProp.Items.Add("Damage Increase");
            comboboxProp.Items.Add("Defense Chance Increase");
            comboboxProp.Items.Add("Dexterity Bonus");
            comboboxProp.Items.Add("Energy Resists");
            comboboxProp.Items.Add("Faster Cast Recovery");
            comboboxProp.Items.Add("Enhance Potion");
            comboboxProp.Items.Add("Energy Damage");
            comboboxProp.Items.Add("Poison Damage");
            comboboxProp.Items.Add("Fire Damage");
            comboboxProp.Items.Add("Cold Damage");
            comboboxProp.Items.Add("Physical Damage");
            comboboxProp.Items.Add("Faster Casting");
            comboboxProp.Items.Add("Gold Increase");
            comboboxProp.Items.Add("Fire Resist");
            comboboxProp.Items.Add("Hit Chance Increase");
            comboboxProp.Items.Add("Hit Energy Area");
            comboboxProp.Items.Add("Hit Dispel");
            comboboxProp.Items.Add("Hit Cold Area");
            comboboxProp.Items.Add("Hit Fire Area");
            comboboxProp.Items.Add("Hit Fireball");
            comboboxProp.Items.Add("Hit Life Leech");
            comboboxProp.Items.Add("Hit Point Increase");
            comboboxProp.Items.Add("Hit Point Regeneration");
            comboboxProp.Items.Add("Hit Stamina Leech");
            comboboxProp.Items.Add("Hit Poison Area");
            comboboxProp.Items.Add("Hit Physical Area");
            comboboxProp.Items.Add("Hit Mana Leech");
            comboboxProp.Items.Add("Hit Magic Arrow");
            comboboxProp.Items.Add("Hit Lower Defense");
            comboboxProp.Items.Add("Hit Lower Attack");
            comboboxProp.Items.Add("Hit Lightning");
            comboboxProp.Items.Add("Hit Harm");
            comboboxProp.Items.Add("Intelligence Bonus");
            comboboxProp.Items.Add("Lower Mana Cost");
            comboboxProp.Items.Add("Lower Reagent Cost");
            comboboxProp.Items.Add("Lower Requirements");
            comboboxProp.Items.Add("Luck");
            comboboxProp.Items.Add("Mana Increase");
            comboboxProp.Items.Add("Mana Regeneration");
            comboboxProp.Items.Add("Physical Resist");
            comboboxProp.Items.Add("Poison Resist");
            comboboxProp.Items.Add("Night Sight");
            comboboxProp.Items.Add("Spell Channeling");
            comboboxProp.Items.Add("Spell Damage Increase");
            comboboxProp.Items.Add("Splintering Weapon");
            comboboxProp.Items.Add("Stamina Increase");
            comboboxProp.Items.Add("Stamina Regeneration");
            comboboxProp.Items.Add("Swing Speed Increase");
            comboboxProp.Items.Add("Velocity");
            comboboxProp.Items.Add("Balanced");
            comboboxProp.Items.Add("Self Repair");
            comboboxProp.Items.Add("Reflect Physical Damage");
            comboboxProp.Items.Add("Night Sight");
            comboboxProp.Items.Add("Mage Armor");
            comboboxProp.Items.Add("Swing Speed Increase");
            comboboxProp.Items.Add("Strenght Bonus");
            comboboxProp.Items.Add("Water Elemental Slayer");
            comboboxProp.Items.Add("Troll Slayer");
            comboboxProp.Items.Add("Undead Slayer");
            comboboxProp.Items.Add("Terathan Slayer");
            comboboxProp.Items.Add("Spider Slayer");
            comboboxProp.Items.Add("Snow Elemental Slayer");
            comboboxProp.Items.Add("Snake Slayer");
            comboboxProp.Items.Add("Scorpion Slayer");
            comboboxProp.Items.Add("Reptile Slayer");
            comboboxProp.Items.Add("Repond Slayer");
            comboboxProp.Items.Add("Poison Elemental Slayer");
            comboboxProp.Items.Add("Orc Slayer");
            comboboxProp.Items.Add("Ophidian Slayer");
            comboboxProp.Items.Add("Ogre Slayer");
            comboboxProp.Items.Add("Lizardman Slayer");
            comboboxProp.Items.Add("Gargoyle Slayer");
            comboboxProp.Items.Add("Fire Elemental Slayer");
            comboboxProp.Items.Add("Elemental Slayer");
            comboboxProp.Items.Add("Earth Elemental Slayer");
            comboboxProp.Items.Add("Dragon Slayer");
            comboboxProp.Items.Add("Demon Slayer");
            comboboxProp.Items.Add("Blood Elemental Slayer");
            comboboxProp.Items.Add("Arachnid Slayer");
            comboboxProp.Items.Add("Air Elemental Slayer");
            comboboxProp.Items.Add("Magic Arrow Charges");
            comboboxProp.Items.Add("Lightning Charges");
            comboboxProp.Items.Add("Healing Charges");
            comboboxProp.Items.Add("Harm Charges");
            comboboxProp.Items.Add("Greater Healing Charges");
            comboboxProp.Items.Add("Fireball Charges");

            lName.Text     = m_name;
            lGraphics.Text = m_graphics;
            lColor.Text    = m_color;

            int color  = 0;
            int itemid = Convert.ToInt32(m_graphics, 16);

            if (m_color != "All")
            {
                color = Convert.ToInt32(m_color, 16);
            }

            if (m_proplist != null)
            {
                foreach (AutoLoot.AutoLootItem.Property prop in m_proplist)
                {
                    autolootpropGridView.Rows.Add(new object[] { prop.Name, prop.Minimum.ToString(), prop.Maximum.ToString() });
                }
            }

            // Immagine
            Bitmap m_itemimage = new Bitmap(Ultima.Art.GetStatic(itemid));
            {
                if (color > 0)
                {
                    bool onlyHueGrayPixels = (color & 0x8000) != 0;
                    color = (color & 0x3FFF) - 1;
                    Ultima.Hue m_hue = Ultima.Hues.GetHue(color);
                    m_hue.ApplyTo(m_itemimage, onlyHueGrayPixels);
                }
                imagepanel.BackgroundImage = m_itemimage;
            }
        }