namespace ns1
{
    using iQuest;
    using ns0;
    using ns2;
    using ns3;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Runtime.Serialization.Formatters.Binary;
    using System.Windows.Forms;

    internal class frmMain : Form
    {
        private Button btnDeleteItem;
        private Button btnDeleteMob;
        private Button btnDeleteQuest;
        private Button btnDeleteReward;
        private Button btnDialogEditor;
        private Button btnduplicate;
        private Button btnModDescID;
        private Button btnModDescription;
        private Button btnModUnk;
        private Button btnResDesc;
        private Button btnSaveAction;
        private Button btnSaveDefault;
        private Button btnSaveFile;
        private Button btnSaveFinishScript;
        private Button btnSaveItemGrid;
        private Button btnSaveMobFile;
        private Button BtnSaveMobSettings;
        private Button btnSaveRes;
        private Button btnSaveRew;
        private Button btnSaveStartScript;
        private Button btnSearch;
        private Button button1;
        private Button button2;
        public Class2 class2_0;
        public Class3 class3_0;
        public Class7 class7_0;
        public Class7 class7_1;
        public Class7 class7_2;
        private ComboBox cmbIsNPC;
        private ComboBox cmbItemEnabled;
        private ComboBox cmbMobEnabled;
        private ComboBox cmbRewardType;
        private ComboBox cmbRewSelective;
        public Dictionary<ushort, string> dictionary_0 = new Dictionary<ushort, string>();
        public Dictionary<ushort, string> dictionary_1 = new Dictionary<ushort, string>();
        public Dictionary<ushort, string> dictionary_2 = new Dictionary<ushort, string>();
        public fMassEdit fMassEdit_0 = new fMassEdit();
        public frmResEditor frmResEditor_0;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private GroupBox groupBox3;
        private GroupBox groupBox4;
        private GroupBox groupBox5;
        private GroupBox groupBox6;
        private GroupBox grpDefault;
        private GroupBox grpItemInfo;
        private GroupBox grpMobSettings;
        private GroupBox grpRewardEdit;
        private IContainer icontainer_0 = null;
        private DataGridView ItemGrid;
        private Label label1;
        private Label label10;
        private Label label11;
        private Label label12;
        private Label label13;
        private Label label14;
        private Label label15;
        private Label label16;
        private Label label17;
        private Label label18;
        private Label label19;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;
        private Label lbl123456;
        private Label lblMobName;
        private Label lblPreQuest;
        private Label lblQuestCount;
        private Label lblQuestName;
        private Label lblQuestTitle;
        private Label lblStartNPC;
        private ToolStripStatusLabel lblStatus;
        private ListView lstItems;
        private ListView lstMobs;
        private ListBox lstQuests;
        private ListView lstRewards;
        private DataGridView MobGrid;
        private NumericUpDown nmrItemAmount;
        private NumericUpDown nmrMaxLevel;
        private NumericUpDown nmrMinLevel;
        private NumericUpDown nmrMobAmount;
        private StatusStrip statusStrip1;
        private string string_0 = "";
        private string[] string_1 = new string[] { "QuestDialog.shn", "ItemInfo.shn", "QuestData.shn", "MobInfo.shn" };
        private TabControl tabControl1;
        private TabPage tabPage1;
        private TabPage tabPage2;
        private TabPage tabPage3;
        private TabPage tabPage4;
        private TabPage tabPage5;
        private TabPage tabPage6;
        private TabPage tabPage7;
        private TextBox txtActionScript;
        private TextBox txtDebug;
        private TextBox txtDesc;
        private TextBox txtDescription;
        private TextBox txtFinishScript;
        private TextBox txtItemID;
        private TextBox txtItemType;
        private TextBox txtMobID;
        private TextBox txtPreQuest;
        private TextBox txtQuestTitle;
        private TextBox txtRewAmount;
        private TextBox txtRewID;
        private TextBox txtRewUnk;
        private TextBox txtSearchQuest;
        private TextBox txtStartingNPC;
        private TextBox txtStartScript;

        public frmMain()
        {
            this.InitializeComponent();
            this.string_0 = Path.GetDirectoryName(Application.ExecutablePath) + @"\";
            string str = "";
            foreach (string str2 in this.string_1)
            {
                if (!File.Exists(this.string_0 + str2))
                {
                    str = str + "\r\n" + str2;
                }
            }
            if (str.Length > 1)
            {
                MessageBox.Show("Can't find following files: " + str);
            }
            else
            {
                this.method_1();
            }
        }

        private void btnDeleteQuest_Click(object sender, EventArgs e)
        {
            this.class2_0.list_0.Remove(this.class3_0);
            this.class3_0 = null;
            this.method_19();
            this.method_6(this.txtSearchQuest.Text);
            this.method_7();
            this.method_0("Quest deleted!");
        }

        private void btnDialogEditor_Click(object sender, EventArgs e)
        {
            if (this.frmResEditor_0 == null)
            {
                this.frmResEditor_0 = new frmResEditor(this);
            }
            this.frmResEditor_0.Show();
        }

        private void btnduplicate_Click(object sender, EventArgs e)
        {
            new frmNewQuest(this).ShowDialog();
        }

        private void btnModDescID_Click(object sender, EventArgs e)
        {
            try
            {
                this.class3_0.Description = Convert.ToUInt16(this.txtDesc.Text);
                this.method_7();
                this.method_0("Desc. ID changed!");
            }
            catch
            {
                MessageBox.Show("Invalid ID");
            }
        }

        private void btnModDescription_Click(object sender, EventArgs e)
        {
            if (((ushort) this.txtDescription.Tag) != 0)
            {
                int num = this.class7_0.method_12(0, this.txtDescription.Tag.ToString());
                if (num > -1)
                {
                    this.class7_0.dataTable_0.Rows[num][1] = this.txtDescription.Text;
                }
                this.method_2();
                this.method_6("");
            }
        }

        private void btnModUnk_Click(object sender, EventArgs e)
        {
            try
            {
                this.class3_0.method_1(this.txtRewUnk.Text);
                this.method_0("UnkBytes applied.");
            }
            catch
            {
                MessageBox.Show("Ooops.. something went wrong!");
            }
        }

        private void btnResDesc_Click(object sender, EventArgs e)
        {
            if (this.frmResEditor_0 == null)
            {
                this.frmResEditor_0 = new frmResEditor(this);
            }
            this.frmResEditor_0.Show();
            this.frmResEditor_0.method_1(this.class3_0.Description);
        }

        private void btnSaveAction_Click(object sender, EventArgs e)
        {
            this.class3_0.ActionScript = this.txtActionScript.Text;
            this.method_0("Changes saved.");
        }

        private void btnSaveDefault_Click(object sender, EventArgs e)
        {
            try
            {
                this.class3_0.MinLevel = (byte) this.nmrMinLevel.Value;
                this.class3_0.MaxLevel = (byte) this.nmrMaxLevel.Value;
                this.class3_0.Title = Convert.ToUInt16(this.txtQuestTitle.Text);
                this.class3_0.Predesessor = Convert.ToUInt16(this.txtPreQuest.Text);
                this.class3_0.StartingNPC = Convert.ToUInt16(this.txtStartingNPC.Text);
                this.method_7();
            }
            catch
            {
                MessageBox.Show("Please enter a valid value!");
            }
        }

        private void btnSaveFile_Click(object sender, EventArgs e)
        {
            this.class2_0.method_4(this.string_0 + "QuestData.shn");
            this.method_0("File saved!");
        }

        private void btnSaveFinishScript_Click(object sender, EventArgs e)
        {
            this.class3_0.FinishScript = this.txtFinishScript.Text;
            this.method_0("Changes saved.");
        }

        private void btnSaveItemGrid_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.ItemGrid.Columns.Count; i++)
            {
                this.class7_2.dictionary_0.Add(this.ItemGrid.Columns[i].DisplayIndex, i);
            }
            bool flag = this.class7_2.method_6(this.string_0 + "ItemInfo.shn");
            this.class7_2.dictionary_0.Clear();
            if (flag)
            {
                this.method_0("Item file saved!");
            }
            else
            {
                this.method_0("Item file could not be saved!");
            }
        }

        private void btnSaveMobFile_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.MobGrid.Columns.Count; i++)
            {
                this.class7_1.dictionary_0.Add(this.MobGrid.Columns[i].DisplayIndex, i);
            }
            bool flag = this.class7_1.method_6(this.string_0 + "MobInfo.shn");
            this.class7_1.dictionary_0.Clear();
            if (flag)
            {
                this.method_0("Mob file saved!");
            }
            else
            {
                this.method_0("Mob file could not be saved!");
            }
        }

        private void BtnSaveMobSettings_Click(object sender, EventArgs e)
        {
            if (this.btnDeleteMob.Tag != null)
            {
                Class4 tag = (Class4) this.btnDeleteMob.Tag;
                try
                {
                    tag.isActive = Convert.ToBoolean((this.cmbMobEnabled.SelectedIndex == 0) ? 1 : 0);
                    tag.Amount = (byte) this.nmrMobAmount.Value;
                    tag.HasToBeKilled = Convert.ToBoolean(this.cmbIsNPC.SelectedIndex);
                    tag.ID = Convert.ToUInt16(this.txtMobID.Text);
                    this.method_8(this.class3_0);
                }
                catch
                {
                    MessageBox.Show("Please enter valid numbers!");
                }
            }
        }

        private void btnSaveRes_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.class7_0.dataTable_0.Columns.Count; i++)
            {
                this.class7_0.dictionary_0.Add(i, i);
            }
            bool flag = this.class7_0.method_6(this.string_0 + "QuestDialog.shn");
            this.class7_0.dictionary_0.Clear();
            if (flag)
            {
                this.method_0("Dialog file saved!");
            }
            else
            {
                this.method_0("Dialog file could not be saved!");
            }
        }

        private void btnSaveRew_Click(object sender, EventArgs e)
        {
            if (this.btnDeleteReward.Tag != null)
            {
                QuestReward tag = (QuestReward) this.btnDeleteReward.Tag;
                try
                {
                    QuestReward.RewardType type = (QuestReward.RewardType) Convert.ToByte(this.cmbRewardType.Text.Substring(0, 1));
                    tag.Type = type;
                    if (type == QuestReward.RewardType.Item)
                    {
                        tag.ItemCount = Convert.ToUInt16(this.txtRewAmount.Text);
                        tag.Value = Convert.ToUInt16(this.txtRewID.Text);
                        tag.isGiven = (byte) this.cmbRewSelective.SelectedIndex;
                    }
                    else
                    {
                        tag.Amount = Convert.ToUInt64(this.txtRewAmount.Text);
                        tag.isGiven = (byte) this.cmbRewSelective.SelectedIndex;
                    }
                    this.method_9(this.class3_0);
                }
                catch
                {
                    MessageBox.Show("Incorrect values!");
                }
            }
        }

        private void btnSaveStartScript_Click(object sender, EventArgs e)
        {
            this.class3_0.StartScript = this.txtStartScript.Text;
            this.method_0("Changes saved.");
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            this.method_6(this.txtSearchQuest.Text);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.btnDeleteItem.Tag != null)
            {
                Class5 tag = (Class5) this.btnDeleteItem.Tag;
                try
                {
                    switch (this.cmbItemEnabled.SelectedIndex)
                    {
                        case 0:
                            tag.isActive = 1;
                            break;

                        case 1:
                            tag.isActive = 0;
                            break;

                        case 2:
                            tag.isActive = 0x37;
                            break;
                    }
                    tag.ID = Convert.ToUInt16(this.txtItemID.Text);
                    tag.Type = Convert.ToByte(this.txtItemType.Text);
                    tag.Amount = (ushort) this.nmrItemAmount.Value;
                    this.method_10(this.class3_0);
                }
                catch
                {
                    MessageBox.Show("Please enter valid numbers!");
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.fMassEdit_0.ShowDialog();
        }

        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            switch (MessageBox.Show("Save before exiting?", "Herp derp", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
            {
                case DialogResult.Yes:
                    this.class2_0.method_4(this.string_0 + "QuestData.shn");
                    break;

                case DialogResult.No:
                    try
                    {
                        this.fMassEdit_0.Close();
                    }
                    catch
                    {
                    }
                    Environment.Exit(0);
                    break;

                case DialogResult.Cancel:
                    e.Cancel = true;
                    break;
            }
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            this.grpDefault.Enabled = false;
            this.lstMobs.Columns.Add("ID", 100);
            this.lstMobs.Columns.Add("canKill", 50);
            this.lstMobs.Columns.Add("Amount", 60);
            this.lstMobs.Columns.Add("Enabled", 80);
            this.cmbIsNPC.Items.Clear();
            this.cmbIsNPC.Items.Add("False");
            this.cmbIsNPC.Items.Add("True");
            this.grpMobSettings.Enabled = false;
            this.lstItems.Columns.Add("ID", 100);
            this.lstItems.Columns.Add("Amount", 50);
            this.lstItems.Columns.Add("Type", 50);
            this.lstItems.Columns.Add("Enabled", 80);
            this.grpItemInfo.Enabled = false;
            this.lstRewards.Columns.Add("Type", 100);
            this.lstRewards.Columns.Add("ID", 130);
            this.lstRewards.Columns.Add("Amount", 90);
            this.lstRewards.Columns.Add("Selective", 90);
            this.grpRewardEdit.Enabled = false;
            this.cmbRewardType.Items.Clear();
            this.cmbRewardType.Items.Add("0 - Exp");
            this.cmbRewardType.Items.Add("1 - Money");
            this.cmbRewardType.Items.Add("2 - Item");
            this.cmbRewardType.Items.Add("4 - Fame");
            this.cmbRewardType.SelectedIndex = 0;
            this.cmbRewSelective.Items.Clear();
            this.cmbRewSelective.Items.Add("Disabled");
            this.cmbRewSelective.Items.Add("Fixed");
            this.cmbRewSelective.Items.Add("Chosen");
            this.cmbRewSelective.SelectedIndex = 0;
            this.cmbItemEnabled.Items.Clear();
            this.cmbItemEnabled.Items.Add("True");
            this.cmbItemEnabled.Items.Add("False");
            this.cmbItemEnabled.Items.Add("Unknown");
            this.cmbItemEnabled.SelectedIndex = 1;
            this.cmbMobEnabled.Items.Clear();
            this.cmbMobEnabled.Items.Add("True");
            this.cmbMobEnabled.Items.Add("False");
            this.cmbMobEnabled.SelectedIndex = 1;
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(frmMain));
            this.groupBox1 = new GroupBox();
            this.lblQuestCount = new Label();
            this.btnSearch = new Button();
            this.txtSearchQuest = new TextBox();
            this.lstQuests = new ListBox();
            this.statusStrip1 = new StatusStrip();
            this.lblStatus = new ToolStripStatusLabel();
            this.btnSaveFile = new Button();
            this.label3 = new Label();
            this.btnDialogEditor = new Button();
            this.btnSaveRes = new Button();
            this.tabPage6 = new TabPage();
            this.grpRewardEdit = new GroupBox();
            this.btnSaveRew = new Button();
            this.txtRewAmount = new TextBox();
            this.txtRewID = new TextBox();
            this.cmbRewSelective = new ComboBox();
            this.label14 = new Label();
            this.label13 = new Label();
            this.label12 = new Label();
            this.cmbRewardType = new ComboBox();
            this.label7 = new Label();
            this.groupBox4 = new GroupBox();
            this.lstRewards = new ListView();
            this.tabPage5 = new TabPage();
            this.btnSaveItemGrid = new Button();
            this.ItemGrid = new DataGridView();
            this.grpItemInfo = new GroupBox();
            this.cmbItemEnabled = new ComboBox();
            this.label16 = new Label();
            this.button1 = new Button();
            this.nmrItemAmount = new NumericUpDown();
            this.txtItemType = new TextBox();
            this.txtItemID = new TextBox();
            this.label6 = new Label();
            this.label5 = new Label();
            this.label4 = new Label();
            this.groupBox3 = new GroupBox();
            this.lstItems = new ListView();
            this.tabPage4 = new TabPage();
            this.btnSaveMobFile = new Button();
            this.MobGrid = new DataGridView();
            this.groupBox2 = new GroupBox();
            this.grpMobSettings = new GroupBox();
            this.cmbMobEnabled = new ComboBox();
            this.label17 = new Label();
            this.BtnSaveMobSettings = new Button();
            this.lblMobName = new Label();
            this.nmrMobAmount = new NumericUpDown();
            this.label2 = new Label();
            this.cmbIsNPC = new ComboBox();
            this.label1 = new Label();
            this.txtMobID = new TextBox();
            this.lbl123456 = new Label();
            this.lstMobs = new ListView();
            this.tabPage3 = new TabPage();
            this.btnSaveFinishScript = new Button();
            this.txtFinishScript = new TextBox();
            this.tabPage2 = new TabPage();
            this.btnSaveAction = new Button();
            this.txtActionScript = new TextBox();
            this.tabPage1 = new TabPage();
            this.btnSaveStartScript = new Button();
            this.txtStartScript = new TextBox();
            this.tabPage7 = new TabPage();
            this.groupBox6 = new GroupBox();
            this.txtDebug = new TextBox();
            this.btnModUnk = new Button();
            this.txtRewUnk = new TextBox();
            this.groupBox5 = new GroupBox();
            this.btnResDesc = new Button();
            this.btnModDescID = new Button();
            this.txtDesc = new TextBox();
            this.label15 = new Label();
            this.btnModDescription = new Button();
            this.txtDescription = new TextBox();
            this.grpDefault = new GroupBox();
            this.btnduplicate = new Button();
            this.btnDeleteQuest = new Button();
            this.lblQuestTitle = new Label();
            this.txtQuestTitle = new TextBox();
            this.btnSaveDefault = new Button();
            this.lblPreQuest = new Label();
            this.txtPreQuest = new TextBox();
            this.lblStartNPC = new Label();
            this.txtStartingNPC = new TextBox();
            this.nmrMaxLevel = new NumericUpDown();
            this.nmrMinLevel = new NumericUpDown();
            this.label11 = new Label();
            this.label10 = new Label();
            this.label9 = new Label();
            this.label8 = new Label();
            this.lblQuestName = new Label();
            this.tabControl1 = new TabControl();
            this.label18 = new Label();
            this.button2 = new Button();
            this.btnDeleteReward = new Button();
            this.btnDeleteMob = new Button();
            this.btnDeleteItem = new Button();
            this.label19 = new Label();
            this.groupBox1.SuspendLayout();
            this.statusStrip1.SuspendLayout();
            this.tabPage6.SuspendLayout();
            this.grpRewardEdit.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.tabPage5.SuspendLayout();
            ((ISupportInitialize) this.ItemGrid).BeginInit();
            this.grpItemInfo.SuspendLayout();
            this.nmrItemAmount.BeginInit();
            this.groupBox3.SuspendLayout();
            this.tabPage4.SuspendLayout();
            ((ISupportInitialize) this.MobGrid).BeginInit();
            this.groupBox2.SuspendLayout();
            this.grpMobSettings.SuspendLayout();
            this.nmrMobAmount.BeginInit();
            this.tabPage3.SuspendLayout();
            this.tabPage2.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.tabPage7.SuspendLayout();
            this.groupBox6.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.grpDefault.SuspendLayout();
            this.nmrMaxLevel.BeginInit();
            this.nmrMinLevel.BeginInit();
            this.tabControl1.SuspendLayout();
            base.SuspendLayout();
            this.groupBox1.Controls.Add(this.lblQuestCount);
            this.groupBox1.Controls.Add(this.btnSearch);
            this.groupBox1.Controls.Add(this.txtSearchQuest);
            this.groupBox1.Controls.Add(this.lstQuests);
            this.groupBox1.Location = new Point(0x11, 40);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x10d, 0x28c);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Quest List:";
            this.groupBox1.Enter += new EventHandler(this.groupBox1_Enter);
            this.lblQuestCount.AutoSize = true;
            this.lblQuestCount.Location = new Point(9, 0x290);
            this.lblQuestCount.Name = "lblQuestCount";
            this.lblQuestCount.Size = new Size(0x2b, 13);
            this.lblQuestCount.TabIndex = 4;
            this.lblQuestCount.Text = "Quests:";
            this.btnSearch.Location = new Point(0xc1, 0x11);
            this.btnSearch.Name = "btnSearch";
            this.btnSearch.Size = new Size(0x40, 0x15);
            this.btnSearch.TabIndex = 3;
            this.btnSearch.Text = "Search";
            this.btnSearch.UseVisualStyleBackColor = true;
            this.btnSearch.Click += new EventHandler(this.btnSearch_Click);
            this.txtSearchQuest.Location = new Point(6, 0x12);
            this.txtSearchQuest.Name = "txtSearchQuest";
            this.txtSearchQuest.Size = new Size(0xb5, 20);
            this.txtSearchQuest.TabIndex = 2;
            this.lstQuests.FormattingEnabled = true;
            this.lstQuests.Location = new Point(6, 0x33);
            this.lstQuests.Name = "lstQuests";
            this.lstQuests.Size = new Size(0xfb, 0x24d);
            this.lstQuests.TabIndex = 1;
            this.lstQuests.SelectedIndexChanged += new EventHandler(this.lstQuests_SelectedIndexChanged);
            this.lstQuests.MouseDoubleClick += new MouseEventHandler(this.lstQuests_MouseDoubleClick);
            this.statusStrip1.Items.AddRange(new ToolStripItem[] { this.lblStatus });
            this.statusStrip1.Location = new Point(0, 0x2b7);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new Size(0x3b3, 0x16);
            this.statusStrip1.TabIndex = 2;
            this.statusStrip1.Text = "statusStrip1";
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Size = new Size(0x2a, 0x11);
            this.lblStatus.Text = "Ready.";
            this.btnSaveFile.Location = new Point(12, 5);
            this.btnSaveFile.Name = "btnSaveFile";
            this.btnSaveFile.Size = new Size(0x47, 0x1a);
            this.btnSaveFile.TabIndex = 3;
            this.btnSaveFile.Text = "Save File";
            this.btnSaveFile.UseVisualStyleBackColor = true;
            this.btnSaveFile.Click += new EventHandler(this.btnSaveFile_Click);
            this.label3.AutoSize = true;
            this.label3.Location = new Point(0x336, 2);
            this.label3.Name = "label3";
            this.label3.Size = new Size(100, 13);
            this.label3.TabIndex = 4;
            this.label3.Text = "Written by Csharp™";
            this.btnDialogEditor.Location = new Point(0x59, 5);
            this.btnDialogEditor.Name = "btnDialogEditor";
            this.btnDialogEditor.Size = new Size(0x3e, 0x1a);
            this.btnDialogEditor.TabIndex = 5;
            this.btnDialogEditor.Text = "Resource";
            this.btnDialogEditor.UseVisualStyleBackColor = true;
            this.btnDialogEditor.Click += new EventHandler(this.btnDialogEditor_Click);
            this.btnSaveRes.Location = new Point(0x9d, 5);
            this.btnSaveRes.Name = "btnSaveRes";
            this.btnSaveRes.Size = new Size(0x3f, 0x1b);
            this.btnSaveRes.TabIndex = 6;
            this.btnSaveRes.Text = "Save Res";
            this.btnSaveRes.UseVisualStyleBackColor = true;
            this.btnSaveRes.Click += new EventHandler(this.btnSaveRes_Click);
            this.tabPage6.Controls.Add(this.grpRewardEdit);
            this.tabPage6.Controls.Add(this.groupBox4);
            this.tabPage6.Location = new Point(4, 0x16);
            this.tabPage6.Name = "tabPage6";
            this.tabPage6.Size = new Size(0x26e, 0x282);
            this.tabPage6.TabIndex = 5;
            this.tabPage6.Text = "Rewards";
            this.tabPage6.UseVisualStyleBackColor = true;
            this.grpRewardEdit.Controls.Add(this.btnSaveRew);
            this.grpRewardEdit.Controls.Add(this.txtRewAmount);
            this.grpRewardEdit.Controls.Add(this.txtRewID);
            this.grpRewardEdit.Controls.Add(this.cmbRewSelective);
            this.grpRewardEdit.Controls.Add(this.label14);
            this.grpRewardEdit.Controls.Add(this.label13);
            this.grpRewardEdit.Controls.Add(this.label12);
            this.grpRewardEdit.Controls.Add(this.cmbRewardType);
            this.grpRewardEdit.Controls.Add(this.label7);
            this.grpRewardEdit.Location = new Point(20, 0x145);
            this.grpRewardEdit.Name = "grpRewardEdit";
            this.grpRewardEdit.Size = new Size(0x181, 0xb5);
            this.grpRewardEdit.TabIndex = 1;
            this.grpRewardEdit.TabStop = false;
            this.grpRewardEdit.Text = "Reward Info:";
            this.btnSaveRew.Location = new Point(0x100, 0x57);
            this.btnSaveRew.Name = "btnSaveRew";
            this.btnSaveRew.Size = new Size(0x5c, 40);
            this.btnSaveRew.TabIndex = 8;
            this.btnSaveRew.Text = "Save Changes";
            this.btnSaveRew.UseVisualStyleBackColor = true;
            this.btnSaveRew.Click += new EventHandler(this.btnSaveRew_Click);
            this.txtRewAmount.Location = new Point(0x45, 0x6b);
            this.txtRewAmount.Name = "txtRewAmount";
            this.txtRewAmount.Size = new Size(0x5e, 20);
            this.txtRewAmount.TabIndex = 7;
            this.txtRewID.Location = new Point(0x5e, 0x43);
            this.txtRewID.Name = "txtRewID";
            this.txtRewID.Size = new Size(0x45, 20);
            this.txtRewID.TabIndex = 6;
            this.cmbRewSelective.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbRewSelective.FormattingEnabled = true;
            this.cmbRewSelective.Location = new Point(0x105, 0x1b);
            this.cmbRewSelective.Name = "cmbRewSelective";
            this.cmbRewSelective.Size = new Size(0x58, 0x15);
            this.cmbRewSelective.TabIndex = 5;
            this.label14.AutoSize = true;
            this.label14.Location = new Point(0xc9, 30);
            this.label14.Name = "label14";
            this.label14.Size = new Size(0x36, 13);
            this.label14.TabIndex = 4;
            this.label14.Text = "Selective:";
            this.label13.AutoSize = true;
            this.label13.Location = new Point(0x11, 110);
            this.label13.Name = "label13";
            this.label13.Size = new Size(0x2e, 13);
            this.label13.TabIndex = 3;
            this.label13.Text = "Amount:";
            this.label12.AutoSize = true;
            this.label12.Location = new Point(0x11, 70);
            this.label12.Name = "label12";
            this.label12.Size = new Size(0x29, 13);
            this.label12.TabIndex = 2;
            this.label12.Text = "ItemID:";
            this.cmbRewardType.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbRewardType.FormattingEnabled = true;
            this.cmbRewardType.Location = new Point(0x38, 0x1b);
            this.cmbRewardType.Name = "cmbRewardType";
            this.cmbRewardType.Size = new Size(0x65, 0x15);
            this.cmbRewardType.TabIndex = 1;
            this.label7.AutoSize = true;
            this.label7.Location = new Point(0x11, 0x1d);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x22, 13);
            this.label7.TabIndex = 0;
            this.label7.Text = "Type:";
            this.groupBox4.Controls.Add(this.lstRewards);
            this.groupBox4.Location = new Point(0x11, 11);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new Size(600, 0x109);
            this.groupBox4.TabIndex = 0;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "Rewards:";
            this.lstRewards.Location = new Point(11, 0x13);
            this.lstRewards.Name = "lstRewards";
            this.lstRewards.Size = new Size(0x247, 0xf1);
            this.lstRewards.TabIndex = 0;
            this.lstRewards.UseCompatibleStateImageBehavior = false;
            this.lstRewards.View = View.Details;
            this.lstRewards.SelectedIndexChanged += new EventHandler(this.lstRewards_SelectedIndexChanged);
            this.lstRewards.MouseClick += new MouseEventHandler(this.lstRewards_MouseClick);
            this.tabPage5.Controls.Add(this.btnSaveItemGrid);
            this.tabPage5.Controls.Add(this.ItemGrid);
            this.tabPage5.Controls.Add(this.grpItemInfo);
            this.tabPage5.Controls.Add(this.groupBox3);
            this.tabPage5.Location = new Point(4, 0x16);
            this.tabPage5.Name = "tabPage5";
            this.tabPage5.Size = new Size(0x287, 0x275);
            this.tabPage5.TabIndex = 4;
            this.tabPage5.Text = "Items";
            this.tabPage5.UseVisualStyleBackColor = true;
            this.btnSaveItemGrid.Location = new Point(0x12, 0x25f);
            this.btnSaveItemGrid.Name = "btnSaveItemGrid";
            this.btnSaveItemGrid.Size = new Size(0x4f, 0x13);
            this.btnSaveItemGrid.TabIndex = 3;
            this.btnSaveItemGrid.Text = "Save";
            this.btnSaveItemGrid.UseVisualStyleBackColor = true;
            this.btnSaveItemGrid.Click += new EventHandler(this.btnSaveItemGrid_Click);
            this.ItemGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.ItemGrid.Location = new Point(15, 0xf4);
            this.ItemGrid.Name = "ItemGrid";
            this.ItemGrid.Size = new Size(0x24a, 0x165);
            this.ItemGrid.TabIndex = 2;
            this.grpItemInfo.Controls.Add(this.cmbItemEnabled);
            this.grpItemInfo.Controls.Add(this.label16);
            this.grpItemInfo.Controls.Add(this.button1);
            this.grpItemInfo.Controls.Add(this.nmrItemAmount);
            this.grpItemInfo.Controls.Add(this.txtItemType);
            this.grpItemInfo.Controls.Add(this.txtItemID);
            this.grpItemInfo.Controls.Add(this.label6);
            this.grpItemInfo.Controls.Add(this.label5);
            this.grpItemInfo.Controls.Add(this.label4);
            this.grpItemInfo.Location = new Point(0x159, 10);
            this.grpItemInfo.Name = "grpItemInfo";
            this.grpItemInfo.Size = new Size(260, 0xdf);
            this.grpItemInfo.TabIndex = 1;
            this.grpItemInfo.TabStop = false;
            this.grpItemInfo.Text = "Info:";
            this.cmbItemEnabled.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbItemEnabled.FormattingEnabled = true;
            this.cmbItemEnabled.Location = new Point(0x41, 0x68);
            this.cmbItemEnabled.Name = "cmbItemEnabled";
            this.cmbItemEnabled.Size = new Size(0x58, 0x15);
            this.cmbItemEnabled.TabIndex = 12;
            this.label16.AutoSize = true;
            this.label16.Location = new Point(10, 0x6b);
            this.label16.Name = "label16";
            this.label16.Size = new Size(0x31, 13);
            this.label16.TabIndex = 11;
            this.label16.Text = "Enabled:";
            this.button1.Location = new Point(0x1c, 0x83);
            this.button1.Name = "button1";
            this.button1.Size = new Size(0x5d, 0x20);
            this.button1.TabIndex = 6;
            this.button1.Text = "Save Changes";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new EventHandler(this.button1_Click);
            this.nmrItemAmount.Location = new Point(0x41, 0x30);
            int[] bits = new int[4];
            bits[0] = 0xff;
            this.nmrItemAmount.Maximum = new decimal(bits);
            this.nmrItemAmount.Name = "nmrItemAmount";
            this.nmrItemAmount.Size = new Size(0x2b, 20);
            this.nmrItemAmount.TabIndex = 5;
            this.txtItemType.Location = new Point(0x41, 0x4e);
            this.txtItemType.Name = "txtItemType";
            this.txtItemType.Size = new Size(0x37, 20);
            this.txtItemType.TabIndex = 4;
            this.txtItemID.Location = new Point(0x41, 20);
            this.txtItemID.Name = "txtItemID";
            this.txtItemID.Size = new Size(0x44, 20);
            this.txtItemID.TabIndex = 3;
            this.label6.AutoSize = true;
            this.label6.Location = new Point(0x19, 0x51);
            this.label6.Name = "label6";
            this.label6.Size = new Size(0x22, 13);
            this.label6.TabIndex = 2;
            this.label6.Text = "Type:";
            this.label5.AutoSize = true;
            this.label5.Location = new Point(13, 0x33);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x2e, 13);
            this.label5.TabIndex = 1;
            this.label5.Text = "Amount:";
            this.label4.AutoSize = true;
            this.label4.Location = new Point(0x26, 0x17);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x15, 13);
            this.label4.TabIndex = 0;
            this.label4.Text = "ID:";
            this.groupBox3.Controls.Add(this.lstItems);
            this.groupBox3.Location = new Point(15, 10);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new Size(0x141, 0xe4);
            this.groupBox3.TabIndex = 0;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Items:";
            this.lstItems.Location = new Point(6, 13);
            this.lstItems.Name = "lstItems";
            this.lstItems.Size = new Size(0x135, 210);
            this.lstItems.TabIndex = 0;
            this.lstItems.UseCompatibleStateImageBehavior = false;
            this.lstItems.View = View.Details;
            this.lstItems.SelectedIndexChanged += new EventHandler(this.lstItems_SelectedIndexChanged);
            this.lstItems.MouseClick += new MouseEventHandler(this.lstItems_MouseClick);
            this.tabPage4.Controls.Add(this.btnSaveMobFile);
            this.tabPage4.Controls.Add(this.MobGrid);
            this.tabPage4.Controls.Add(this.groupBox2);
            this.tabPage4.Location = new Point(4, 0x16);
            this.tabPage4.Name = "tabPage4";
            this.tabPage4.Size = new Size(0x287, 0x275);
            this.tabPage4.TabIndex = 3;
            this.tabPage4.Text = "Mobs";
            this.tabPage4.UseVisualStyleBackColor = true;
            this.btnSaveMobFile.Location = new Point(0x13, 0x25d);
            this.btnSaveMobFile.Name = "btnSaveMobFile";
            this.btnSaveMobFile.Size = new Size(0x4d, 0x15);
            this.btnSaveMobFile.TabIndex = 2;
            this.btnSaveMobFile.Text = "Save";
            this.btnSaveMobFile.UseVisualStyleBackColor = true;
            this.btnSaveMobFile.Click += new EventHandler(this.btnSaveMobFile_Click);
            this.MobGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.MobGrid.Location = new Point(0x13, 250);
            this.MobGrid.Name = "MobGrid";
            this.MobGrid.Size = new Size(0x248, 0x15d);
            this.MobGrid.TabIndex = 1;
            this.groupBox2.Controls.Add(this.grpMobSettings);
            this.groupBox2.Controls.Add(this.lstMobs);
            this.groupBox2.Location = new Point(0x11, 0x18);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0x250, 0xd6);
            this.groupBox2.TabIndex = 0;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Monsters:";
            this.grpMobSettings.Controls.Add(this.cmbMobEnabled);
            this.grpMobSettings.Controls.Add(this.label17);
            this.grpMobSettings.Controls.Add(this.BtnSaveMobSettings);
            this.grpMobSettings.Controls.Add(this.lblMobName);
            this.grpMobSettings.Controls.Add(this.nmrMobAmount);
            this.grpMobSettings.Controls.Add(this.label2);
            this.grpMobSettings.Controls.Add(this.cmbIsNPC);
            this.grpMobSettings.Controls.Add(this.label1);
            this.grpMobSettings.Controls.Add(this.txtMobID);
            this.grpMobSettings.Controls.Add(this.lbl123456);
            this.grpMobSettings.Location = new Point(0x137, 0x13);
            this.grpMobSettings.Name = "grpMobSettings";
            this.grpMobSettings.Size = new Size(0x113, 180);
            this.grpMobSettings.TabIndex = 8;
            this.grpMobSettings.TabStop = false;
            this.grpMobSettings.Text = "Info:";
            this.cmbMobEnabled.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbMobEnabled.FormattingEnabled = true;
            this.cmbMobEnabled.Location = new Point(0x49, 0x6d);
            this.cmbMobEnabled.Name = "cmbMobEnabled";
            this.cmbMobEnabled.Size = new Size(0x58, 0x15);
            this.cmbMobEnabled.TabIndex = 0x12;
            this.label17.AutoSize = true;
            this.label17.Location = new Point(0x19, 0x70);
            this.label17.Name = "label17";
            this.label17.Size = new Size(0x31, 13);
            this.label17.TabIndex = 0x11;
            this.label17.Text = "Enabled:";
            this.BtnSaveMobSettings.Location = new Point(0xae, 100);
            this.BtnSaveMobSettings.Name = "BtnSaveMobSettings";
            this.BtnSaveMobSettings.Size = new Size(0x59, 30);
            this.BtnSaveMobSettings.TabIndex = 0x10;
            this.BtnSaveMobSettings.Text = "Apply Changes";
            this.BtnSaveMobSettings.UseVisualStyleBackColor = true;
            this.BtnSaveMobSettings.Click += new EventHandler(this.BtnSaveMobSettings_Click);
            this.lblMobName.AutoSize = true;
            this.lblMobName.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.lblMobName.Location = new Point(70, 0x35);
            this.lblMobName.Name = "lblMobName";
            this.lblMobName.Size = new Size(0x23, 13);
            this.lblMobName.TabIndex = 15;
            this.lblMobName.Text = "Name";
            this.nmrMobAmount.Location = new Point(200, 30);
            bits = new int[4];
            bits[0] = 0xff;
            this.nmrMobAmount.Maximum = new decimal(bits);
            this.nmrMobAmount.Name = "nmrMobAmount";
            this.nmrMobAmount.Size = new Size(0x3f, 20);
            this.nmrMobAmount.TabIndex = 13;
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0x90, 0x21);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x2e, 13);
            this.label2.TabIndex = 12;
            this.label2.Text = "Amount:";
            this.cmbIsNPC.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbIsNPC.FormattingEnabled = true;
            this.cmbIsNPC.Location = new Point(0x49, 0x4d);
            this.cmbIsNPC.Name = "cmbIsNPC";
            this.cmbIsNPC.Size = new Size(50, 0x15);
            this.cmbIsNPC.TabIndex = 11;
            this.label1.AutoSize = true;
            this.label1.Location = new Point(0x19, 80);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x20, 13);
            this.label1.TabIndex = 10;
            this.label1.Text = "toKill:";
            this.txtMobID.Location = new Point(0x49, 30);
            this.txtMobID.Name = "txtMobID";
            this.txtMobID.Size = new Size(50, 20);
            this.txtMobID.TabIndex = 9;
            this.lbl123456.AutoSize = true;
            this.lbl123456.Location = new Point(0x19, 0x21);
            this.lbl123456.Name = "lbl123456";
            this.lbl123456.Size = new Size(0x2a, 13);
            this.lbl123456.TabIndex = 8;
            this.lbl123456.Text = "MobID:";
            this.lstMobs.Location = new Point(11, 0x13);
            this.lstMobs.MultiSelect = false;
            this.lstMobs.Name = "lstMobs";
            this.lstMobs.Size = new Size(0x126, 180);
            this.lstMobs.TabIndex = 0;
            this.lstMobs.UseCompatibleStateImageBehavior = false;
            this.lstMobs.View = View.Details;
            this.lstMobs.MouseClick += new MouseEventHandler(this.lstMobs_MouseClick);
            this.tabPage3.Controls.Add(this.btnSaveFinishScript);
            this.tabPage3.Controls.Add(this.txtFinishScript);
            this.tabPage3.Location = new Point(4, 0x16);
            this.tabPage3.Name = "tabPage3";
            this.tabPage3.Size = new Size(0x26e, 0x282);
            this.tabPage3.TabIndex = 2;
            this.tabPage3.Text = "FinishScript";
            this.tabPage3.UseVisualStyleBackColor = true;
            this.btnSaveFinishScript.Location = new Point(6, 0x264);
            this.btnSaveFinishScript.Name = "btnSaveFinishScript";
            this.btnSaveFinishScript.Size = new Size(0x59, 0x17);
            this.btnSaveFinishScript.TabIndex = 3;
            this.btnSaveFinishScript.Text = "Apply Changes";
            this.btnSaveFinishScript.UseVisualStyleBackColor = true;
            this.btnSaveFinishScript.Click += new EventHandler(this.btnSaveFinishScript_Click);
            this.txtFinishScript.Location = new Point(6, 7);
            this.txtFinishScript.Multiline = true;
            this.txtFinishScript.Name = "txtFinishScript";
            this.txtFinishScript.ScrollBars = ScrollBars.Vertical;
            this.txtFinishScript.Size = new Size(610, 0x25b);
            this.txtFinishScript.TabIndex = 2;
            this.tabPage2.Controls.Add(this.btnSaveAction);
            this.tabPage2.Controls.Add(this.txtActionScript);
            this.tabPage2.Location = new Point(4, 0x16);
            this.tabPage2.Name = "tabPage2";
            this.tabPage2.Padding = new Padding(3);
            this.tabPage2.Size = new Size(0x26e, 0x282);
            this.tabPage2.TabIndex = 1;
            this.tabPage2.Text = "ActionScript";
            this.tabPage2.UseVisualStyleBackColor = true;
            this.btnSaveAction.Location = new Point(6, 0x264);
            this.btnSaveAction.Name = "btnSaveAction";
            this.btnSaveAction.Size = new Size(0x59, 0x17);
            this.btnSaveAction.TabIndex = 3;
            this.btnSaveAction.Text = "Apply Changes";
            this.btnSaveAction.UseVisualStyleBackColor = true;
            this.btnSaveAction.Click += new EventHandler(this.btnSaveAction_Click);
            this.txtActionScript.Location = new Point(6, 7);
            this.txtActionScript.Multiline = true;
            this.txtActionScript.Name = "txtActionScript";
            this.txtActionScript.ScrollBars = ScrollBars.Vertical;
            this.txtActionScript.Size = new Size(610, 0x25b);
            this.txtActionScript.TabIndex = 2;
            this.tabPage1.Controls.Add(this.btnSaveStartScript);
            this.tabPage1.Controls.Add(this.txtStartScript);
            this.tabPage1.Location = new Point(4, 0x16);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Padding = new Padding(3);
            this.tabPage1.Size = new Size(0x26e, 0x282);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text = "StartScript";
            this.tabPage1.UseVisualStyleBackColor = true;
            this.btnSaveStartScript.Location = new Point(6, 0x265);
            this.btnSaveStartScript.Name = "btnSaveStartScript";
            this.btnSaveStartScript.Size = new Size(0x59, 0x17);
            this.btnSaveStartScript.TabIndex = 1;
            this.btnSaveStartScript.Text = "Apply Changes";
            this.btnSaveStartScript.UseVisualStyleBackColor = true;
            this.btnSaveStartScript.Click += new EventHandler(this.btnSaveStartScript_Click);
            this.txtStartScript.Location = new Point(6, 8);
            this.txtStartScript.Multiline = true;
            this.txtStartScript.Name = "txtStartScript";
            this.txtStartScript.ScrollBars = ScrollBars.Vertical;
            this.txtStartScript.Size = new Size(610, 0x25b);
            this.txtStartScript.TabIndex = 0;
            this.txtStartScript.TextChanged += new EventHandler(this.txtStartScript_TextChanged);
            this.tabPage7.Controls.Add(this.groupBox6);
            this.tabPage7.Controls.Add(this.groupBox5);
            this.tabPage7.Controls.Add(this.grpDefault);
            this.tabPage7.Location = new Point(4, 0x16);
            this.tabPage7.Name = "tabPage7";
            this.tabPage7.Size = new Size(0x26e, 0x282);
            this.tabPage7.TabIndex = 6;
            this.tabPage7.Text = "DefaultData";
            this.tabPage7.UseVisualStyleBackColor = true;
            this.tabPage7.Click += new EventHandler(this.tabPage7_Click);
            this.groupBox6.Controls.Add(this.txtDebug);
            this.groupBox6.Controls.Add(this.btnModUnk);
            this.groupBox6.Controls.Add(this.txtRewUnk);
            this.groupBox6.Location = new Point(0x162, 0x11);
            this.groupBox6.Name = "groupBox6";
            this.groupBox6.Size = new Size(0xf9, 0x16e);
            this.groupBox6.TabIndex = 10;
            this.groupBox6.TabStop = false;
            this.groupBox6.Text = "unkData:";
            this.txtDebug.Location = new Point(0x13, 0x73);
            this.txtDebug.Multiline = true;
            this.txtDebug.Name = "txtDebug";
            this.txtDebug.Size = new Size(0xca, 0xea);
            this.txtDebug.TabIndex = 2;
            this.btnModUnk.Location = new Point(6, 0x44);
            this.btnModUnk.Name = "btnModUnk";
            this.btnModUnk.Size = new Size(100, 0x22);
            this.btnModUnk.TabIndex = 1;
            this.btnModUnk.Text = "Modify";
            this.btnModUnk.UseVisualStyleBackColor = true;
            this.btnModUnk.Click += new EventHandler(this.btnModUnk_Click);
            this.txtRewUnk.BackColor = Color.Navy;
            this.txtRewUnk.ForeColor = Color.White;
            this.txtRewUnk.Location = new Point(6, 0x13);
            this.txtRewUnk.Multiline = true;
            this.txtRewUnk.Name = "txtRewUnk";
            this.txtRewUnk.Size = new Size(0xed, 0x2b);
            this.txtRewUnk.TabIndex = 0;
            this.groupBox5.Controls.Add(this.btnResDesc);
            this.groupBox5.Controls.Add(this.btnModDescID);
            this.groupBox5.Controls.Add(this.txtDesc);
            this.groupBox5.Controls.Add(this.label15);
            this.groupBox5.Controls.Add(this.btnModDescription);
            this.groupBox5.Controls.Add(this.txtDescription);
            this.groupBox5.Location = new Point(0x1d, 0x148);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new Size(0x13b, 0x129);
            this.groupBox5.TabIndex = 9;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "Description:";
            this.btnResDesc.Location = new Point(0xc4, 0x12);
            this.btnResDesc.Name = "btnResDesc";
            this.btnResDesc.Size = new Size(0x71, 0x13);
            this.btnResDesc.TabIndex = 5;
            this.btnResDesc.Text = "Res. Edit";
            this.btnResDesc.UseVisualStyleBackColor = true;
            this.btnResDesc.Click += new EventHandler(this.btnResDesc_Click);
            this.btnModDescID.Location = new Point(0x88, 0x11);
            this.btnModDescID.Name = "btnModDescID";
            this.btnModDescID.Size = new Size(0x36, 0x15);
            this.btnModDescID.TabIndex = 4;
            this.btnModDescID.Text = "Mod. ID";
            this.btnModDescID.UseVisualStyleBackColor = true;
            this.btnModDescID.Click += new EventHandler(this.btnModDescID_Click);
            this.txtDesc.Location = new Point(0x44, 0x12);
            this.txtDesc.Name = "txtDesc";
            this.txtDesc.Size = new Size(0x39, 20);
            this.txtDesc.TabIndex = 3;
            this.label15.AutoSize = true;
            this.label15.Location = new Point(0x10, 0x17);
            this.label15.Name = "label15";
            this.label15.Size = new Size(0x2e, 13);
            this.label15.TabIndex = 2;
            this.label15.Text = "DescID:";
            this.btnModDescription.Location = new Point(0x10, 0x10c);
            this.btnModDescription.Name = "btnModDescription";
            this.btnModDescription.Size = new Size(0x4c, 0x17);
            this.btnModDescription.TabIndex = 1;
            this.btnModDescription.Text = "Modify - h";
            this.btnModDescription.UseVisualStyleBackColor = true;
            this.btnModDescription.Visible = false;
            this.btnModDescription.Click += new EventHandler(this.btnModDescription_Click);
            this.txtDescription.BackColor = Color.FromArgb(0x40, 0x40, 0x40);
            this.txtDescription.ForeColor = Color.White;
            this.txtDescription.Location = new Point(11, 0x2c);
            this.txtDescription.Multiline = true;
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.ReadOnly = true;
            this.txtDescription.ScrollBars = ScrollBars.Both;
            this.txtDescription.Size = new Size(0x12a, 0xf7);
            this.txtDescription.TabIndex = 0;
            this.grpDefault.Controls.Add(this.btnduplicate);
            this.grpDefault.Controls.Add(this.btnDeleteQuest);
            this.grpDefault.Controls.Add(this.lblQuestTitle);
            this.grpDefault.Controls.Add(this.txtQuestTitle);
            this.grpDefault.Controls.Add(this.btnSaveDefault);
            this.grpDefault.Controls.Add(this.lblPreQuest);
            this.grpDefault.Controls.Add(this.txtPreQuest);
            this.grpDefault.Controls.Add(this.lblStartNPC);
            this.grpDefault.Controls.Add(this.txtStartingNPC);
            this.grpDefault.Controls.Add(this.nmrMaxLevel);
            this.grpDefault.Controls.Add(this.nmrMinLevel);
            this.grpDefault.Controls.Add(this.label11);
            this.grpDefault.Controls.Add(this.label10);
            this.grpDefault.Controls.Add(this.label9);
            this.grpDefault.Controls.Add(this.label8);
            this.grpDefault.Controls.Add(this.lblQuestName);
            this.grpDefault.Location = new Point(0x1a, 0x17);
            this.grpDefault.Name = "grpDefault";
            this.grpDefault.Size = new Size(0x13e, 0x127);
            this.grpDefault.TabIndex = 8;
            this.grpDefault.TabStop = false;
            this.grpDefault.Text = "QuestInfo:";
            this.btnduplicate.Location = new Point(0xc7, 0xf7);
            this.btnduplicate.Name = "btnduplicate";
            this.btnduplicate.Size = new Size(0x6f, 0x23);
            this.btnduplicate.TabIndex = 0x17;
            this.btnduplicate.Text = "Duplicate this Quest";
            this.btnduplicate.UseVisualStyleBackColor = true;
            this.btnduplicate.Click += new EventHandler(this.btnduplicate_Click);
            this.btnDeleteQuest.Location = new Point(0xc7, 0xc4);
            this.btnDeleteQuest.Name = "btnDeleteQuest";
            this.btnDeleteQuest.Size = new Size(0x6f, 0x21);
            this.btnDeleteQuest.TabIndex = 0x16;
            this.btnDeleteQuest.Text = "Delete this Quest";
            this.btnDeleteQuest.UseVisualStyleBackColor = true;
            this.btnDeleteQuest.Click += new EventHandler(this.btnDeleteQuest_Click);
            this.lblQuestTitle.AutoSize = true;
            this.lblQuestTitle.ForeColor = Color.FromArgb(0, 0, 0xc0);
            this.lblQuestTitle.Location = new Point(0x9e, 0x19);
            this.lblQuestTitle.Name = "lblQuestTitle";
            this.lblQuestTitle.Size = new Size(10, 13);
            this.lblQuestTitle.TabIndex = 0x15;
            this.lblQuestTitle.Text = "-";
            this.lblQuestTitle.Click += new EventHandler(this.lblQuestTitle_Click);
            this.txtQuestTitle.Location = new Point(0x41, 0x16);
            this.txtQuestTitle.Name = "txtQuestTitle";
            this.txtQuestTitle.Size = new Size(0x4b, 20);
            this.txtQuestTitle.TabIndex = 20;
            this.btnSaveDefault.Location = new Point(0x16, 0x101);
            this.btnSaveDefault.Name = "btnSaveDefault";
            this.btnSaveDefault.Size = new Size(0x6a, 0x15);
            this.btnSaveDefault.TabIndex = 0x13;
            this.btnSaveDefault.Text = "Save Changes";
            this.btnSaveDefault.UseVisualStyleBackColor = true;
            this.btnSaveDefault.Click += new EventHandler(this.btnSaveDefault_Click);
            this.lblPreQuest.AutoSize = true;
            this.lblPreQuest.Location = new Point(0x9e, 0xb0);
            this.lblPreQuest.Name = "lblPreQuest";
            this.lblPreQuest.Size = new Size(10, 13);
            this.lblPreQuest.TabIndex = 0x12;
            this.lblPreQuest.Text = "-";
            this.txtPreQuest.Location = new Point(0x5e, 0xad);
            this.txtPreQuest.Name = "txtPreQuest";
            this.txtPreQuest.Size = new Size(0x3a, 20);
            this.txtPreQuest.TabIndex = 0x11;
            this.lblStartNPC.AutoSize = true;
            this.lblStartNPC.Location = new Point(0x9e, 0x92);
            this.lblStartNPC.Name = "lblStartNPC";
            this.lblStartNPC.Size = new Size(10, 13);
            this.lblStartNPC.TabIndex = 0x10;
            this.lblStartNPC.Text = "-";
            this.txtStartingNPC.Location = new Point(0x5e, 0x8f);
            this.txtStartingNPC.Name = "txtStartingNPC";
            this.txtStartingNPC.Size = new Size(0x3a, 20);
            this.txtStartingNPC.TabIndex = 15;
            this.nmrMaxLevel.Location = new Point(0x53, 0x56);
            bits = new int[4];
            bits[0] = 160;
            this.nmrMaxLevel.Maximum = new decimal(bits);
            this.nmrMaxLevel.Name = "nmrMaxLevel";
            this.nmrMaxLevel.Size = new Size(0x2a, 20);
            this.nmrMaxLevel.TabIndex = 14;
            this.nmrMinLevel.Location = new Point(0x53, 0x3a);
            bits = new int[4];
            bits[0] = 160;
            this.nmrMinLevel.Maximum = new decimal(bits);
            this.nmrMinLevel.Name = "nmrMinLevel";
            this.nmrMinLevel.Size = new Size(0x2a, 20);
            this.nmrMinLevel.TabIndex = 13;
            this.label11.AutoSize = true;
            this.label11.Location = new Point(0x15, 0xb0);
            this.label11.Name = "label11";
            this.label11.Size = new Size(0x36, 13);
            this.label11.TabIndex = 12;
            this.label11.Text = "PreQuest:";
            this.label10.AutoSize = true;
            this.label10.Location = new Point(20, 0x92);
            this.label10.Name = "label10";
            this.label10.Size = new Size(0x44, 13);
            this.label10.TabIndex = 11;
            this.label10.Text = "StartingNPC:";
            this.label9.AutoSize = true;
            this.label9.Location = new Point(0x13, 90);
            this.label9.Name = "label9";
            this.label9.Size = new Size(0x3b, 13);
            this.label9.TabIndex = 10;
            this.label9.Text = "Max Level:";
            this.label8.AutoSize = true;
            this.label8.Location = new Point(0x13, 60);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x38, 13);
            this.label8.TabIndex = 9;
            this.label8.Text = "Min Level:";
            this.lblQuestName.AutoSize = true;
            this.lblQuestName.Location = new Point(0x15, 0x19);
            this.lblQuestName.Name = "lblQuestName";
            this.lblQuestName.Size = new Size(0x1b, 13);
            this.lblQuestName.TabIndex = 8;
            this.lblQuestName.Text = "Title";
            this.tabControl1.Controls.Add(this.tabPage7);
            this.tabControl1.Controls.Add(this.tabPage1);
            this.tabControl1.Controls.Add(this.tabPage2);
            this.tabControl1.Controls.Add(this.tabPage3);
            this.tabControl1.Controls.Add(this.tabPage4);
            this.tabControl1.Controls.Add(this.tabPage5);
            this.tabControl1.Controls.Add(this.tabPage6);
            this.tabControl1.Location = new Point(0x124, 0x29);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new Size(0x28f, 0x28f);
            this.tabControl1.TabIndex = 1;
            this.label18.AutoSize = true;
            this.label18.Location = new Point(0x336, 15);
            this.label18.Name = "label18";
            this.label18.Size = new Size(0x4f, 13);
            this.label18.TabIndex = 0x13;
            this.label18.Text = "Fixed by Sorien";
            this.button2.Location = new Point(0xe2, 5);
            this.button2.Name = "button2";
            this.button2.Size = new Size(0x3f, 0x1b);
            this.button2.TabIndex = 20;
            this.button2.Text = "Mass Edit";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new EventHandler(this.button2_Click);
            this.btnDeleteReward.Location = new Point(0x156, 7);
            this.btnDeleteReward.Name = "btnDeleteReward";
            this.btnDeleteReward.Size = new Size(0x4b, 0x17);
            this.btnDeleteReward.TabIndex = 0x15;
            this.btnDeleteReward.Text = "button3";
            this.btnDeleteReward.UseVisualStyleBackColor = true;
            this.btnDeleteReward.Visible = false;
            this.btnDeleteMob.Location = new Point(0x1a7, 7);
            this.btnDeleteMob.Name = "btnDeleteMob";
            this.btnDeleteMob.Size = new Size(0x4b, 0x17);
            this.btnDeleteMob.TabIndex = 0x16;
            this.btnDeleteMob.Text = "button3";
            this.btnDeleteMob.UseVisualStyleBackColor = true;
            this.btnDeleteMob.Visible = false;
            this.btnDeleteItem.Location = new Point(0x1f8, 7);
            this.btnDeleteItem.Name = "btnDeleteItem";
            this.btnDeleteItem.Size = new Size(0x4b, 0x17);
            this.btnDeleteItem.TabIndex = 0x17;
            this.btnDeleteItem.Text = "button3";
            this.btnDeleteItem.UseVisualStyleBackColor = true;
            this.btnDeleteItem.Visible = false;
            this.label19.AutoSize = true;
            this.label19.Location = new Point(0x336, 0x1c);
            this.label19.Name = "label19";
            this.label19.Size = new Size(0x71, 13);
            this.label19.TabIndex = 0x18;
            this.label19.Text = "OSFile Fixed by Buster";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x3b3, 0x2cd);
            base.Controls.Add(this.label19);
            base.Controls.Add(this.btnDeleteItem);
            base.Controls.Add(this.btnDeleteMob);
            base.Controls.Add(this.btnDeleteReward);
            base.Controls.Add(this.button2);
            base.Controls.Add(this.label18);
            base.Controls.Add(this.btnSaveRes);
            base.Controls.Add(this.btnDialogEditor);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.btnSaveFile);
            base.Controls.Add(this.statusStrip1);
            base.Controls.Add(this.tabControl1);
            base.Controls.Add(this.groupBox1);
            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.MaximizeBox = false;
            base.Name = "frmMain";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "iQuest";
            base.FormClosing += new FormClosingEventHandler(this.frmMain_FormClosing);
            base.FormClosed += new FormClosedEventHandler(this.frmMain_FormClosed);
            base.Load += new EventHandler(this.frmMain_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            this.tabPage6.ResumeLayout(false);
            this.grpRewardEdit.ResumeLayout(false);
            this.grpRewardEdit.PerformLayout();
            this.groupBox4.ResumeLayout(false);
            this.tabPage5.ResumeLayout(false);
            ((ISupportInitialize) this.ItemGrid).EndInit();
            this.grpItemInfo.ResumeLayout(false);
            this.grpItemInfo.PerformLayout();
            this.nmrItemAmount.EndInit();
            this.groupBox3.ResumeLayout(false);
            this.tabPage4.ResumeLayout(false);
            ((ISupportInitialize) this.MobGrid).EndInit();
            this.groupBox2.ResumeLayout(false);
            this.grpMobSettings.ResumeLayout(false);
            this.grpMobSettings.PerformLayout();
            this.nmrMobAmount.EndInit();
            this.tabPage3.ResumeLayout(false);
            this.tabPage3.PerformLayout();
            this.tabPage2.ResumeLayout(false);
            this.tabPage2.PerformLayout();
            this.tabPage1.ResumeLayout(false);
            this.tabPage1.PerformLayout();
            this.tabPage7.ResumeLayout(false);
            this.groupBox6.ResumeLayout(false);
            this.groupBox6.PerformLayout();
            this.groupBox5.ResumeLayout(false);
            this.groupBox5.PerformLayout();
            this.grpDefault.ResumeLayout(false);
            this.grpDefault.PerformLayout();
            this.nmrMaxLevel.EndInit();
            this.nmrMinLevel.EndInit();
            this.tabControl1.ResumeLayout(false);
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void lblQuestTitle_Click(object sender, EventArgs e)
        {
            if (this.frmResEditor_0 == null)
            {
                this.frmResEditor_0 = new frmResEditor(this);
            }
            this.frmResEditor_0.Show();
            this.frmResEditor_0.method_1(Convert.ToUInt16(this.txtQuestTitle.Text));
        }

        private void lstItems_MouseClick(object sender, MouseEventArgs e)
        {
            if (this.lstItems.SelectedItems.Count >= 0)
            {
                Class5 class2 = this.method_12((ushort) this.lstItems.SelectedItems[0].Tag);
                this.grpItemInfo.Enabled = true;
                if (class2 != null)
                {
                    this.txtItemID.Text = class2.ID.ToString();
                    this.nmrItemAmount.Value = class2.Amount;
                    this.btnDeleteItem.Tag = class2;
                    this.txtItemType.Text = class2.Type.ToString();
                    byte isActive = class2.isActive;
                    switch (isActive)
                    {
                        case 0:
                            this.cmbItemEnabled.SelectedIndex = 0;
                            break;

                        case 1:
                            this.cmbItemEnabled.SelectedIndex = 1;
                            break;

                        default:
                            if (isActive == 0x37)
                            {
                                this.cmbItemEnabled.SelectedIndex = 2;
                            }
                            break;
                    }
                    int num4 = this.class7_2.method_12(0, class2.ID.ToString());
                    if (num4 > 0)
                    {
                        this.ItemGrid.FirstDisplayedCell = this.ItemGrid[0, num4];
                    }
                }
            }
        }

        private void lstItems_SelectedIndexChanged(object sender, EventArgs e)
        {
        }

        private void lstMobs_MouseClick(object sender, MouseEventArgs e)
        {
            if (this.lstMobs.SelectedItems.Count >= 0)
            {
                Class4 class2 = this.method_11((ushort) this.lstMobs.SelectedItems[0].Tag);
                this.lblMobName.Text = this.lstMobs.SelectedItems[0].Text;
                this.grpMobSettings.Enabled = true;
                if (class2 != null)
                {
                    this.txtMobID.Text = class2.ID.ToString();
                    this.cmbIsNPC.SelectedIndex = Convert.ToByte(class2.HasToBeKilled);
                    this.nmrMobAmount.Value = class2.Amount;
                    this.cmbMobEnabled.SelectedIndex = class2.isActive ? 0 : 1;
                    this.btnDeleteMob.Tag = class2;
                    int num2 = this.class7_1.method_12(0, class2.ID.ToString());
                    if (num2 > 0)
                    {
                        this.MobGrid.FirstDisplayedCell = this.MobGrid[0, num2];
                    }
                }
            }
        }

        private void lstQuests_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.class3_0 = this.class2_0[ushort.Parse(this.lstQuests.Text.Split(new char[] { ' ' })[0])];
            if (this.class3_0 != null)
            {
                this.method_7();
            }
        }

        private void lstQuests_SelectedIndexChanged(object sender, EventArgs e)
        {
        }

        private void lstRewards_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                if ((this.lstRewards.SelectedItems.Count >= 0) && (this.lstRewards.SelectedItems[0].Tag != null))
                {
                    this.grpRewardEdit.Enabled = true;
                    QuestReward tag = (QuestReward) this.lstRewards.SelectedItems[0].Tag;
                    switch (tag.Type)
                    {
                        case QuestReward.RewardType.Exp:
                            this.cmbRewardType.SelectedIndex = 0;
                            break;

                        case QuestReward.RewardType.Money:
                            this.cmbRewardType.SelectedIndex = 1;
                            break;

                        case QuestReward.RewardType.Item:
                            this.cmbRewardType.SelectedIndex = 2;
                            break;

                        case QuestReward.RewardType.Fame:
                            this.cmbRewardType.SelectedIndex = 3;
                            break;
                    }
                    this.cmbRewSelective.SelectedIndex = tag.isGiven;
                    this.txtRewID.Text = (tag.Type == QuestReward.RewardType.Item) ? tag.Value.ToString() : "";
                    this.txtRewAmount.Text = (tag.Type == QuestReward.RewardType.Item) ? tag.ItemCount.ToString() : tag.Amount.ToString();
                    this.btnDeleteReward.Tag = tag;
                }
            }
            catch
            {
            }
        }

        private void lstRewards_SelectedIndexChanged(object sender, EventArgs e)
        {
        }

        public void method_0(string string_2)
        {
            this.lblStatus.Text = string_2;
        }

        private void method_1()
        {
            DateTime now = DateTime.Now;
            this.class2_0 = new Class2(this.string_0 + "QuestData.shn");
            this.class7_0 = new Class7(this.string_0 + "QuestDialog.shn");
            this.class7_2 = new Class7(this.string_0 + "ItemInfo.shn");
            this.class7_1 = new Class7(this.string_0 + "MobInfo.shn");
            TimeSpan span = (TimeSpan) (DateTime.Now - now);
            this.method_5();
            this.MobGrid.DataSource = this.class7_1.dataTable_0;
            this.ItemGrid.DataSource = this.class7_2.dataTable_0;
            this.Text = "iQuest v1.3 - loaded in " + Math.Round(span.TotalMilliseconds, 0).ToString() + "ms";
        }

        public void method_10(Class3 class3_1)
        {
            this.lstItems.Items.Clear();
            this.lstItems.Tag = class3_1.ID;
            foreach (Class5 class2 in class3_1.list_2)
            {
                ListViewItem item = new ListViewItem {
                    Text = this.dictionary_2.ContainsKey(class2.ID) ? this.dictionary_2[class2.ID] : class2.ID.ToString(),
                    Tag = class2.ID
                };
                item.SubItems.Add(class2.Amount.ToString());
                item.SubItems.Add(class2.Type.ToString());
                byte isActive = class2.isActive;
                switch (isActive)
                {
                    case 0:
                        item.SubItems.Add("False");
                        break;

                    case 1:
                        item.SubItems.Add("True");
                        break;

                    default:
                        if (isActive == 0x37)
                        {
                            item.SubItems.Add("Unknown");
                        }
                        break;
                }
                this.lstItems.Items.Add(item);
            }
        }

        private Class4 method_11(ushort ushort_0)
        {
            foreach (Class4 class2 in this.class3_0.list_0)
            {
                if (class2.ID == ushort_0)
                {
                    return class2;
                }
            }
            return null;
        }

        private Class5 method_12(ushort ushort_0)
        {
            foreach (Class5 class2 in this.class3_0.list_2)
            {
                if (class2.ID == ushort_0)
                {
                    return class2;
                }
            }
            return null;
        }

        private void method_13(object sender, EventArgs e)
        {
            if (this.btnDeleteMob.Tag != null)
            {
                this.class3_0.list_0.Remove((Class4) this.btnDeleteMob.Tag);
                this.method_8(this.class3_0);
                this.grpMobSettings.Enabled = false;
            }
        }

        private void method_14(object sender, EventArgs e)
        {
            if (this.class3_0 != null)
            {
                new frmAddMob(this).ShowDialog();
            }
        }

        private void method_15(object sender, EventArgs e)
        {
            if (this.btnDeleteItem.Tag != null)
            {
                this.class3_0.list_2.Remove((Class5) this.btnDeleteItem.Tag);
                this.method_10(this.class3_0);
                this.grpItemInfo.Enabled = false;
            }
        }

        private void method_16(object sender, EventArgs e)
        {
            if (this.class3_0 != null)
            {
                new frmAddItem(this).ShowDialog();
            }
        }

        private void method_17(object sender, EventArgs e)
        {
            if (this.class3_0 != null)
            {
                new frmAddReward(this).ShowDialog();
            }
        }

        private void method_18(object sender, EventArgs e)
        {
            if ((this.btnDeleteReward.Tag != null) && (this.class3_0 != null))
            {
                this.grpRewardEdit.Enabled = false;
                this.class3_0.list_1.Remove((QuestReward) this.btnDeleteReward.Tag);
                this.method_9(this.class3_0);
                this.method_0("Reward removed.");
            }
        }

        public void method_19()
        {
            ushort num = 1;
            foreach (Class3 class2 in this.class2_0.list_0)
            {
                class2.ID = num;
                num = (ushort) (num + 1);
            }
        }

        public void method_2()
        {
            this.dictionary_0.Clear();
            foreach (DataRow row in this.class7_0.dataTable_0.Rows)
            {
                if (!this.dictionary_0.ContainsKey((ushort) row[0]))
                {
                    this.dictionary_0.Add((ushort) row[0], (string) row[1]);
                }
            }
        }

        public ushort method_20()
        {
            for (ushort i = 100; i < 0xffff; i = (ushort) (i + 1))
            {
                if (!this.dictionary_0.ContainsKey(i))
                {
                    return i;
                }
            }
            return 0;
        }

        private void method_21(object sender, EventArgs e)
        {
        }

        private void method_22(object sender, EventArgs e)
        {
        }

        private string method_23(object object_0)
        {
            using (MemoryStream stream = new MemoryStream())
            {
                new BinaryFormatter().Serialize(stream, object_0);
                return Convert.ToBase64String(stream.ToArray());
            }
        }

        private object method_24(string string_2)
        {
            using (MemoryStream stream = new MemoryStream(Convert.FromBase64String(string_2)))
            {
                BinaryFormatter formatter = new BinaryFormatter();
                return formatter.Deserialize(stream);
            }
        }

        private void method_3()
        {
            this.dictionary_1.Clear();
            foreach (DataRow row in this.class7_1.dataTable_0.Rows)
            {
                if (!this.dictionary_1.ContainsKey((ushort) row[0]))
                {
                    this.dictionary_1.Add((ushort) row[0], (string) row[2]);
                }
            }
        }

        private void method_4()
        {
            this.dictionary_2.Clear();
            foreach (DataRow row in this.class7_2.dataTable_0.Rows)
            {
                if (!this.dictionary_2.ContainsKey((ushort) row[0]))
                {
                    this.dictionary_2.Add((ushort) row[0], (string) row[2]);
                }
            }
        }

        private void method_5()
        {
            this.method_2();
            this.method_4();
            this.method_3();
            this.method_6("");
        }

        public void method_6(string string_2)
        {
            string str;
            this.lstQuests.Items.Clear();
            if (string_2 == "")
            {
                foreach (Class3 class2 in this.class2_0.list_0)
                {
                    str = this.dictionary_0.ContainsKey(class2.Title) ? this.dictionary_0[class2.Title] : class2.ID.ToString();
                    this.lstQuests.Items.Add(class2.ID + " - " + str);
                }
            }
            else
            {
                foreach (Class3 class2 in this.class2_0.list_0)
                {
                    try
                    {
                        string str2 = string_2.Split(new char[] { '=' })[0];
                        string s = string_2.Split(new char[] { '=' })[1];
                        str = this.dictionary_0.ContainsKey(class2.Title) ? this.dictionary_0[class2.Title] : class2.ID.ToString();
                        if ((str2 == "Name") && str.ToLower().Contains(s.ToLower()))
                        {
                            this.lstQuests.Items.Add(class2.ID + " - " + str);
                        }
                        if ((str2 == "NPC") && (class2.StartingNPC.ToString() == s))
                        {
                            this.lstQuests.Items.Add(class2.ID + " - " + str);
                        }
                        if ((str2 == "Level") && smethod_0(class2.MinLevel, class2.MaxLevel, int.Parse(s)))
                        {
                            this.lstQuests.Items.Add(class2.ID + " - " + str);
                        }
                        if ((str2 == "StartLevel") && (class2.MinLevel == int.Parse(s)))
                        {
                            this.lstQuests.Items.Add(class2.ID + " - " + str);
                        }
                        if ((str2 == "EndLevel") && (class2.MaxLevel == int.Parse(s)))
                        {
                            this.lstQuests.Items.Add(class2.ID + " - " + str);
                        }
                    }
                    catch
                    {
                        MessageBox.Show("Malformed Search.\n\n<exp>=<value>\n\nExp = Name, NPC, Level, StartLevel, EndLevel");
                        return;
                    }
                }
            }
            this.lblQuestCount.Text = "Quests: " + this.lstQuests.Items.Count.ToString();
        }

        public void method_7()
        {
            if (this.class3_0 != null)
            {
                this.txtDebug.Text = string.Empty;
                this.grpDefault.Enabled = true;
                this.grpRewardEdit.Enabled = false;
                this.grpItemInfo.Enabled = false;
                this.grpMobSettings.Enabled = false;
                this.txtStartScript.Text = this.class3_0.StartScript;
                this.txtActionScript.Text = this.class3_0.ActionScript;
                this.txtFinishScript.Text = this.class3_0.FinishScript;
                this.nmrMinLevel.Value = this.class3_0.MinLevel;
                this.nmrMaxLevel.Value = this.class3_0.MaxLevel;
                this.lblQuestTitle.Text = this.dictionary_0.ContainsKey(this.class3_0.Title) ? this.dictionary_0[this.class3_0.Title] : this.class3_0.ID.ToString();
                this.txtQuestTitle.Text = this.class3_0.Title.ToString();
                this.txtStartingNPC.Text = this.class3_0.StartingNPC.ToString();
                this.txtDesc.Text = this.class3_0.Description.ToString();
                if (this.dictionary_0.ContainsKey(this.class3_0.Description))
                {
                    this.txtDescription.Text = this.dictionary_0[this.class3_0.Description];
                    this.txtDescription.Tag = this.class3_0.Description;
                }
                else
                {
                    this.txtDescription.Text = "-";
                    this.txtDescription.Tag = (ushort) 0;
                }
                if (this.dictionary_1.ContainsKey(this.class3_0.StartingNPC))
                {
                    this.lblStartNPC.Text = this.dictionary_1[this.class3_0.StartingNPC];
                }
                else
                {
                    this.lblStartNPC.Text = "-";
                }
                this.txtPreQuest.Text = this.class3_0.Predesessor.ToString();
                try
                {
                    this.lblPreQuest.Text = this.dictionary_0[this.class2_0.list_0[this.class3_0.Predesessor - 1].Title];
                }
                catch
                {
                    this.lblPreQuest.Text = "-";
                }
                this.method_8(this.class3_0);
                this.method_10(this.class3_0);
                this.method_9(this.class3_0);
                this.txtRewUnk.Text = this.class3_0.method_0();
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 0).ToString() + " (static short)\r\n\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 2).ToString() + " (rel short)\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 4).ToString() + " (static short)\r\n\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 6).ToString() + " (rel short)\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 8).ToString() + " (static short)\r\n\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 10).ToString() + " (rel short)\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt16(this.class3_0.RewardData, 12).ToString() + " (static short)\r\n\r\n";
                this.txtDebug.Text = this.txtDebug.Text + BitConverter.ToUInt32(this.class3_0.RewardData, 14).ToString() + " (static int)";
            }
        }

        public void method_8(Class3 class3_1)
        {
            this.lstMobs.Items.Clear();
            this.lstMobs.Tag = class3_1.ID;
            foreach (Class4 class2 in class3_1.list_0)
            {
                ListViewItem item = new ListViewItem {
                    Text = this.dictionary_1.ContainsKey(class2.ID) ? this.dictionary_1[class2.ID] : class2.ID.ToString(),
                    Tag = class2.ID
                };
                item.SubItems.Add(class2.HasToBeKilled.ToString());
                item.SubItems.Add(class2.Amount.ToString());
                item.SubItems.Add(class2.isActive.ToString());
                this.lstMobs.Items.Add(item);
            }
        }

        public void method_9(Class3 class3_1)
        {
            this.lstRewards.Items.Clear();
            this.lstRewards.Tag = class3_1.ID;
            short num = 0;
            foreach (QuestReward reward in class3_1.list_1)
            {
                ListViewItem item = new ListViewItem {
                    Text = reward.Type.ToString()
                };
                if (reward.Type == QuestReward.RewardType.Item)
                {
                    item.SubItems.Add(this.dictionary_2.ContainsKey(reward.Value) ? this.dictionary_2[reward.Value] : reward.Value.ToString());
                    item.SubItems.Add(reward.ItemCount.ToString());
                }
                else
                {
                    item.SubItems.Add("None");
                    item.SubItems.Add(reward.Amount.ToString());
                }
                switch (reward.isGiven)
                {
                    case 0:
                        item.SubItems.Add("Disabled");
                        break;

                    case 1:
                        item.SubItems.Add("Fixed");
                        break;

                    case 2:
                        item.SubItems.Add("Chosen");
                        break;
                }
                if (reward.isGiven == 2)
                {
                    num = (short) (num + 1);
                }
                item.Tag = reward;
                this.lstRewards.Items.Add(item);
            }
        }

        public static bool smethod_0(int int_0, int int_1, int int_2)
        {
            return ((int_1 > int_0) ? ((int_2 > int_0) && (int_2 < int_1)) : ((int_2 > int_1) && (int_2 < int_0)));
        }

        public void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer_0 != null))
            {
                this.icontainer_0.Dispose();
            }
            base.Dispose(disposing);
        }

        private void tabPage7_Click(object sender, EventArgs e)
        {
        }

        private void txtStartScript_TextChanged(object sender, EventArgs e)
        {
        }
    }
}

