Example #1
0
        private void RandomiseBtn_Click(object sender, EventArgs e)
        {
            if (this.fParcel.MagicItemID != Guid.Empty)
            {
                MagicItem magicItem = Treasure.RandomMagicItem(this.fParcel.FindItemLevel());
                if (magicItem != null)
                {
                    this.fParcel.SetAsMagicItem(magicItem);
                }
                this.set_controls();
                return;
            }
            if (this.fParcel.ArtifactID != Guid.Empty)
            {
                Artifact artifact = Treasure.RandomArtifact(this.fParcel.FindItemTier());
                if (artifact != null)
                {
                    this.fParcel.SetAsArtifact(artifact);
                }
                this.set_controls();
                return;
            }
            int value = this.fParcel.Value;

            if (value == 0)
            {
                value = Treasure.GetItemValue(Session.Project.Party.Level);
            }
            this.fParcel         = Treasure.CreateParcel(value, false);
            this.NameBox.Text    = this.fParcel.Name;
            this.DetailsBox.Text = this.fParcel.Details;
            this.set_controls();
        }
Example #2
0
        private void RandomiseBtn_Click(object sender, EventArgs e)
        {
            if (fParcel.MagicItemID != Guid.Empty)
            {
                // Select a random item
                MagicItem item = Treasure.RandomMagicItem(fParcel.FindItemLevel());
                if (item != null)
                {
                    fParcel.SetAsMagicItem(item);
                }

                set_controls();
            }
            else if (fParcel.ArtifactID != Guid.Empty)
            {
                // Select a random artifact
                Artifact item = Treasure.RandomArtifact(fParcel.FindItemTier());
                if (item != null)
                {
                    fParcel.SetAsArtifact(item);
                }

                set_controls();
            }
            else
            {
                int value = fParcel.Value;
                if (value == 0)
                {
                    value = Treasure.GetItemValue(Session.Project.Party.Level);
                }

                // Create random parcel of this value
                fParcel = Treasure.CreateParcel(value, false);

                NameBox.Text    = fParcel.Name;
                DetailsBox.Text = fParcel.Details;

                set_controls();
            }
        }