From ca892baf770a1d8fd5d0be51794db2c37d185dd0 Mon Sep 17 00:00:00 2001 From: brotalnia Date: Fri, 15 Jun 2018 20:34:01 +0300 Subject: [PATCH] New commands and search by range option. --- .../DataFinderForms/FormAreaFinder.cs | 8 ++ .../FormConditionFinder.Designer.cs | 23 ++++- .../DataFinderForms/FormConditionFinder.cs | 15 ++++ .../DataFinderForms/FormCreatureFinder.cs | 8 ++ .../DataFinderForms/FormDataFinder.cs | 41 ++++++++- .../DataFinderForms/FormEventFinder.cs | 8 ++ .../FormFactionTemplateFinder.cs | 8 ++ .../DataFinderForms/FormGameObjectFinder.cs | 8 ++ .../DataFinderForms/FormItemFinder.cs | 8 ++ .../DataFinderForms/FormQuestFinder.cs | 8 ++ .../DataFinderForms/FormSoundFinder.cs | 8 ++ .../DataFinderForms/FormSpellFinder.cs | 8 ++ .../DataFinderForms/FormTaxiFinder.cs | 8 ++ .../DataFinderForms/FormTextFinder.cs | 8 ++ .../DataFinderForms/FormWeaponFinder.cs | 8 ++ ScriptEditor/FormEventEditor.Designer.cs | 83 ++++++++++++++++++- ScriptEditor/FormEventEditor.cs | 27 +++++- ScriptEditor/FormScriptEditor.Designer.cs | 62 +++++++++++++- ScriptEditor/FormScriptEditor.cs | 51 ++++++++++-- ScriptEditor/GameData.cs | 17 ++-- ScriptEditor/Properties/AssemblyInfo.cs | 4 +- 21 files changed, 395 insertions(+), 24 deletions(-) diff --git a/ScriptEditor/DataFinderForms/FormAreaFinder.cs b/ScriptEditor/DataFinderForms/FormAreaFinder.cs index a28019f..c40602f 100644 --- a/ScriptEditor/DataFinderForms/FormAreaFinder.cs +++ b/ScriptEditor/DataFinderForms/FormAreaFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddAreaToListView(area); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (AreaInfo area in GameData.AreaInfoList) + { + if ((area.ID >= minId) && (area.ID <= maxId)) + AddAreaToListView(area); + } + } protected override void AddByText(string searchText) { foreach (AreaInfo area in GameData.AreaInfoList) diff --git a/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs b/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs index ab7a67a..f8ba6e6 100644 --- a/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs +++ b/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs @@ -32,6 +32,8 @@ private void InitializeComponent() this.columnValue1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnValue2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnFlags = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnValue3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnValue4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.SuspendLayout(); // // lstData @@ -40,6 +42,8 @@ private void InitializeComponent() this.columnType, this.columnValue1, this.columnValue2, + this.columnValue3, + this.columnValue4, this.columnFlags}); // // label1 @@ -50,29 +54,40 @@ private void InitializeComponent() // columnType // this.columnType.Text = "Type"; - this.columnType.Width = 200; + this.columnType.Width = 145; // // columnValue1 // this.columnValue1.Text = "Value 1"; - this.columnValue1.Width = 100; + this.columnValue1.Width = 90; // // columnValue2 // this.columnValue2.Text = "Value 2"; - this.columnValue2.Width = 100; + this.columnValue2.Width = 90; // // columnFlags // this.columnFlags.Text = "Flags"; this.columnFlags.Width = 90; // + // columnValue3 + // + this.columnValue3.Text = "Value 3"; + this.columnValue3.Width = 90; + // + // columnValue4 + // + this.columnValue4.Text = "Value 4"; + this.columnValue4.Width = 90; + // // FormConditionFinder // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.ClientSize = new System.Drawing.Size(672, 393); this.Name = "FormConditionFinder"; this.Text = "Condition Finder"; + this.ResizeEnd += new System.EventHandler(this.FormConditionFinder_ResizeEnd); this.ResumeLayout(false); this.PerformLayout(); @@ -84,5 +99,7 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnValue1; private System.Windows.Forms.ColumnHeader columnValue2; private System.Windows.Forms.ColumnHeader columnFlags; + private System.Windows.Forms.ColumnHeader columnValue3; + private System.Windows.Forms.ColumnHeader columnValue4; } } diff --git a/ScriptEditor/DataFinderForms/FormConditionFinder.cs b/ScriptEditor/DataFinderForms/FormConditionFinder.cs index b409ed2..dec76ce 100644 --- a/ScriptEditor/DataFinderForms/FormConditionFinder.cs +++ b/ScriptEditor/DataFinderForms/FormConditionFinder.cs @@ -30,6 +30,14 @@ protected override void AddById(uint id) AddConditionToListView(condition); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (ConditionInfo condition in GameData.ConditionInfoList) + { + if ((condition.ID >= minId) && (condition.ID <= maxId)) + AddConditionToListView(condition); + } + } private void AddConditionToListView(ConditionInfo condition) { ListViewItem lvi = new ListViewItem(); @@ -37,10 +45,17 @@ private void AddConditionToListView(ConditionInfo condition) lvi.SubItems.Add(GameData.FindConditionName(condition.Type)); lvi.SubItems.Add(condition.Value1.ToString()); lvi.SubItems.Add(condition.Value2.ToString()); + lvi.SubItems.Add(condition.Value3.ToString()); + lvi.SubItems.Add(condition.Value4.ToString()); lvi.SubItems.Add(condition.Flags.ToString()); // Add this condition to the listview. lstData.Items.Add(lvi); } + + private void FormConditionFinder_ResizeEnd(object sender, EventArgs e) + { + lstData.Columns[1].Width = lstData.ClientSize.Width - lstData.Columns[0].Width - lstData.Columns[2].Width - lstData.Columns[3].Width - lstData.Columns[4].Width - lstData.Columns[5].Width - lstData.Columns[6].Width; + } } } diff --git a/ScriptEditor/DataFinderForms/FormCreatureFinder.cs b/ScriptEditor/DataFinderForms/FormCreatureFinder.cs index 7918ebf..750a7df 100644 --- a/ScriptEditor/DataFinderForms/FormCreatureFinder.cs +++ b/ScriptEditor/DataFinderForms/FormCreatureFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddCreatureToListView(creature); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (CreatureInfo creature in GameData.CreatureInfoList) + { + if ((creature.ID >= minId) && (creature.ID <= maxId)) + AddCreatureToListView(creature); + } + } protected override void AddByText(string searchText) { foreach (CreatureInfo creature in GameData.CreatureInfoList) diff --git a/ScriptEditor/DataFinderForms/FormDataFinder.cs b/ScriptEditor/DataFinderForms/FormDataFinder.cs index 4460280..ec3da92 100644 --- a/ScriptEditor/DataFinderForms/FormDataFinder.cs +++ b/ScriptEditor/DataFinderForms/FormDataFinder.cs @@ -71,22 +71,56 @@ private void btnSelectNone_Click(object sender, EventArgs e) Close(); } + private bool ExtractIdRange(ref uint minEntryId, ref uint maxEntryId) + { + if (txtSearch.Text.Contains("-")) + { + string[] idRanges = txtSearch.Text.Split('-'); + + if (idRanges.Length == 2) + { + uint minId = 0; + uint maxId = 0; + if (uint.TryParse(idRanges[0], out minId) && uint.TryParse(idRanges[1], out maxId)) + { + if (minId < maxId) + { + minEntryId = minId; + maxEntryId = maxId; + return true; + } + } + } + } + return false; + } + private void btnSearch_Click(object sender, EventArgs e) { lstData.Items.Clear(); - uint itemId; + uint minEntryId = 0; + uint maxEntryId = 0; if (txtSearch.Text == "") // Display all texts. { lstData.ListViewItemSorter = null; // Disable sorter or it will take forever. AddAllData(); } - else if (uint.TryParse(txtSearch.Text, out itemId)) // If content is numeric search for id. + else if (uint.TryParse(txtSearch.Text, out minEntryId)) // If content is numeric search for id. { - AddById(itemId); + AddById(minEntryId); lstData.ListViewItemSorter = textComparer; } + else if (ExtractIdRange(ref minEntryId, ref maxEntryId)) // Check if a range is provided + { + if (minEntryId + 1000 < maxEntryId) + lstData.ListViewItemSorter = null; + else + lstData.ListViewItemSorter = textComparer; + + AddByIdRange(minEntryId, maxEntryId); + } else // Add items that contain this text. { AddByText(txtSearch.Text); @@ -95,6 +129,7 @@ private void btnSearch_Click(object sender, EventArgs e) } protected virtual void AddAllData() { } protected virtual void AddById(uint id) { } + protected virtual void AddByIdRange(uint minId, uint maxId) { } protected virtual void AddByText(string searchText) { } private void lstData_ColumnClick(object sender, ColumnClickEventArgs e) { diff --git a/ScriptEditor/DataFinderForms/FormEventFinder.cs b/ScriptEditor/DataFinderForms/FormEventFinder.cs index 72904f4..5bf6c6a 100644 --- a/ScriptEditor/DataFinderForms/FormEventFinder.cs +++ b/ScriptEditor/DataFinderForms/FormEventFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddGameEventToListView(game_event); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (GameEventInfo game_event in GameData.GameEventInfoList) + { + if ((game_event.ID >= minId) && (game_event.ID <= maxId)) + AddGameEventToListView(game_event); + } + } protected override void AddByText(string searchText) { foreach (GameEventInfo game_event in GameData.GameEventInfoList) diff --git a/ScriptEditor/DataFinderForms/FormFactionTemplateFinder.cs b/ScriptEditor/DataFinderForms/FormFactionTemplateFinder.cs index 4575a15..f727d04 100644 --- a/ScriptEditor/DataFinderForms/FormFactionTemplateFinder.cs +++ b/ScriptEditor/DataFinderForms/FormFactionTemplateFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddFactionToListView(faction); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (FactionTemplateInfo faction in GameData.FactionTemplateInfoList) + { + if ((faction.ID >= minId) && (faction.ID <= maxId)) + AddFactionToListView(faction); + } + } protected override void AddByText(string searchText) { foreach (FactionTemplateInfo faction in GameData.FactionTemplateInfoList) diff --git a/ScriptEditor/DataFinderForms/FormGameObjectFinder.cs b/ScriptEditor/DataFinderForms/FormGameObjectFinder.cs index a46fd0e..bd13c38 100644 --- a/ScriptEditor/DataFinderForms/FormGameObjectFinder.cs +++ b/ScriptEditor/DataFinderForms/FormGameObjectFinder.cs @@ -30,6 +30,14 @@ protected override void AddById(uint id) AddGameObjectToListView(gameobject); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (GameObjectInfo gameobject in GameData.GameObjectInfoList) + { + if ((gameobject.ID >= minId) && (gameobject.ID <= maxId)) + AddGameObjectToListView(gameobject); + } + } protected override void AddByText(string searchText) { foreach (GameObjectInfo gameobject in GameData.GameObjectInfoList) diff --git a/ScriptEditor/DataFinderForms/FormItemFinder.cs b/ScriptEditor/DataFinderForms/FormItemFinder.cs index 0b27909..6c00f7e 100644 --- a/ScriptEditor/DataFinderForms/FormItemFinder.cs +++ b/ScriptEditor/DataFinderForms/FormItemFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddItemToListView(item); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (ItemInfo item in GameData.ItemInfoList) + { + if ((item.ID >= minId) && (item.ID <= maxId)) + AddItemToListView(item); + } + } protected override void AddByText(string searchText) { foreach (ItemInfo item in GameData.ItemInfoList) diff --git a/ScriptEditor/DataFinderForms/FormQuestFinder.cs b/ScriptEditor/DataFinderForms/FormQuestFinder.cs index d2150ec..f1cffa7 100644 --- a/ScriptEditor/DataFinderForms/FormQuestFinder.cs +++ b/ScriptEditor/DataFinderForms/FormQuestFinder.cs @@ -30,6 +30,14 @@ protected override void AddById(uint id) AddQuestToListView(quest); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (QuestInfo quest in GameData.QuestInfoList) + { + if ((quest.ID >= minId) && (quest.ID <= maxId)) + AddQuestToListView(quest); + } + } protected override void AddByText(string searchText) { foreach (QuestInfo quest in GameData.QuestInfoList) diff --git a/ScriptEditor/DataFinderForms/FormSoundFinder.cs b/ScriptEditor/DataFinderForms/FormSoundFinder.cs index 03d95d0..1412afc 100644 --- a/ScriptEditor/DataFinderForms/FormSoundFinder.cs +++ b/ScriptEditor/DataFinderForms/FormSoundFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddSoundToListView(sound); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (SoundInfo sound in GameData.SoundInfoList) + { + if ((sound.ID >= minId) && (sound.ID <= maxId)) + AddSoundToListView(sound); + } + } protected override void AddByText(string searchText) { foreach (SoundInfo sound in GameData.SoundInfoList) diff --git a/ScriptEditor/DataFinderForms/FormSpellFinder.cs b/ScriptEditor/DataFinderForms/FormSpellFinder.cs index dc64ad5..c4c83a1 100644 --- a/ScriptEditor/DataFinderForms/FormSpellFinder.cs +++ b/ScriptEditor/DataFinderForms/FormSpellFinder.cs @@ -163,6 +163,14 @@ protected override void AddById(uint id) AddSpellToListView(spell); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (SpellInfo spell in GameData.SpellInfoList) + { + if ((spell.ID >= minId) && (spell.ID <= maxId)) + AddSpellToListView(spell); + } + } protected override void AddByText(string searchText) { foreach (SpellInfo spell in GameData.SpellInfoList) diff --git a/ScriptEditor/DataFinderForms/FormTaxiFinder.cs b/ScriptEditor/DataFinderForms/FormTaxiFinder.cs index 2c0292a..d1cfd42 100644 --- a/ScriptEditor/DataFinderForms/FormTaxiFinder.cs +++ b/ScriptEditor/DataFinderForms/FormTaxiFinder.cs @@ -29,6 +29,14 @@ protected override void AddById(uint id) AddPathToListView(path); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (TaxiInfo path in GameData.TaxiInfoList) + { + if ((path.ID >= minId) && (path.ID <= maxId)) + AddPathToListView(path); + } + } protected override void AddByText(string searchText) { foreach (TaxiInfo path in GameData.TaxiInfoList) diff --git a/ScriptEditor/DataFinderForms/FormTextFinder.cs b/ScriptEditor/DataFinderForms/FormTextFinder.cs index ea2a0f1..6c7431e 100644 --- a/ScriptEditor/DataFinderForms/FormTextFinder.cs +++ b/ScriptEditor/DataFinderForms/FormTextFinder.cs @@ -58,6 +58,14 @@ protected override void AddById(uint id) AddTextToListView(bc); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (BroadcastText bc in GameData.BroadcastTextsList) + { + if ((bc.ID >= minId) && (bc.ID <= maxId)) + AddTextToListView(bc); + } + } protected override void AddByText(string searchText) { foreach (BroadcastText bc in GameData.BroadcastTextsList) diff --git a/ScriptEditor/DataFinderForms/FormWeaponFinder.cs b/ScriptEditor/DataFinderForms/FormWeaponFinder.cs index 71444a4..6adf045 100644 --- a/ScriptEditor/DataFinderForms/FormWeaponFinder.cs +++ b/ScriptEditor/DataFinderForms/FormWeaponFinder.cs @@ -42,6 +42,14 @@ protected override void AddById(uint id) AddItemToListView(item); } } + protected override void AddByIdRange(uint minId, uint maxId) + { + foreach (ItemInfo item in GameData.ItemInfoList) + { + if ((item.ID >= minId) && (item.ID <= maxId)) + AddItemToListView(item); + } + } protected override void AddByText(string searchText) { foreach (ItemInfo item in GameData.ItemInfoList) diff --git a/ScriptEditor/FormEventEditor.Designer.cs b/ScriptEditor/FormEventEditor.Designer.cs index e59af0a..1699d12 100644 --- a/ScriptEditor/FormEventEditor.Designer.cs +++ b/ScriptEditor/FormEventEditor.Designer.cs @@ -124,6 +124,12 @@ private void InitializeComponent() this.lblMovementInformType = new System.Windows.Forms.Label(); this.lblMovementInformPoint = new System.Windows.Forms.Label(); this.lblEventMovementInformTooltip = new System.Windows.Forms.Label(); + this.frmEventGroupMemberDied = new System.Windows.Forms.Panel(); + this.btnGroupMemberDiedCreatureId = new System.Windows.Forms.Button(); + this.lblGroupMemberDiedCreatureId = new System.Windows.Forms.Label(); + this.lblGroupMemberDiedIsLeader = new System.Windows.Forms.Label(); + this.lblGroupMemberDiedTooltip = new System.Windows.Forms.Label(); + this.cmbGroupMemberDiedIsLeader = new System.Windows.Forms.ComboBox(); this.grpGeneral.SuspendLayout(); this.grpEventFlags.SuspendLayout(); this.frmEventTimerCombat.SuspendLayout(); @@ -133,6 +139,7 @@ private void InitializeComponent() this.frmEventSummonedUnit.SuspendLayout(); this.frmEventReceiveEmote.SuspendLayout(); this.frmEventMovementInform.SuspendLayout(); + this.frmEventGroupMemberDied.SuspendLayout(); this.SuspendLayout(); // // lstEvents @@ -993,7 +1000,7 @@ private void InitializeComponent() this.txtMovementInformType.Location = new System.Drawing.Point(99, 58); this.txtMovementInformType.MinimumSize = new System.Drawing.Size(82, 21); this.txtMovementInformType.Name = "txtMovementInformType"; - this.txtMovementInformType.Size = new System.Drawing.Size(118, 21); + this.txtMovementInformType.Size = new System.Drawing.Size(118, 20); this.txtMovementInformType.TabIndex = 15; this.txtMovementInformType.Leave += new System.EventHandler(this.txtMovementInformType_Leave); // @@ -1076,12 +1083,78 @@ private void InitializeComponent() this.lblEventMovementInformTooltip.TabIndex = 0; this.lblEventMovementInformTooltip.Text = "Expires upon reaching a waypoint or finishing point movement. For special waypoin" + "ts, the provided path Id is added to the motion type."; + // + // frmEventGroupMemberDied + // + this.frmEventGroupMemberDied.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.frmEventGroupMemberDied.Controls.Add(this.cmbGroupMemberDiedIsLeader); + this.frmEventGroupMemberDied.Controls.Add(this.btnGroupMemberDiedCreatureId); + this.frmEventGroupMemberDied.Controls.Add(this.lblGroupMemberDiedCreatureId); + this.frmEventGroupMemberDied.Controls.Add(this.lblGroupMemberDiedIsLeader); + this.frmEventGroupMemberDied.Controls.Add(this.lblGroupMemberDiedTooltip); + this.frmEventGroupMemberDied.Location = new System.Drawing.Point(433, 289); + this.frmEventGroupMemberDied.Name = "frmEventGroupMemberDied"; + this.frmEventGroupMemberDied.Size = new System.Drawing.Size(495, 275); + this.frmEventGroupMemberDied.TabIndex = 68; + this.frmEventGroupMemberDied.Visible = false; + // + // btnGroupMemberDiedCreatureId + // + this.btnGroupMemberDiedCreatureId.Location = new System.Drawing.Point(99, 58); + this.btnGroupMemberDiedCreatureId.Name = "btnGroupMemberDiedCreatureId"; + this.btnGroupMemberDiedCreatureId.Size = new System.Drawing.Size(374, 23); + this.btnGroupMemberDiedCreatureId.TabIndex = 13; + this.btnGroupMemberDiedCreatureId.Text = "-NONE-"; + this.btnGroupMemberDiedCreatureId.UseVisualStyleBackColor = true; + this.btnGroupMemberDiedCreatureId.Click += new System.EventHandler(this.btnGroupMemberDiedCreatureId_Click); + // + // lblGroupMemberDiedCreatureId + // + this.lblGroupMemberDiedCreatureId.AutoSize = true; + this.lblGroupMemberDiedCreatureId.Location = new System.Drawing.Point(33, 61); + this.lblGroupMemberDiedCreatureId.Name = "lblGroupMemberDiedCreatureId"; + this.lblGroupMemberDiedCreatureId.Size = new System.Drawing.Size(62, 13); + this.lblGroupMemberDiedCreatureId.TabIndex = 4; + this.lblGroupMemberDiedCreatureId.Text = "Creature Id:"; + // + // lblGroupMemberDiedIsLeader + // + this.lblGroupMemberDiedIsLeader.AutoSize = true; + this.lblGroupMemberDiedIsLeader.Location = new System.Drawing.Point(41, 91); + this.lblGroupMemberDiedIsLeader.Name = "lblGroupMemberDiedIsLeader"; + this.lblGroupMemberDiedIsLeader.Size = new System.Drawing.Size(54, 13); + this.lblGroupMemberDiedIsLeader.TabIndex = 3; + this.lblGroupMemberDiedIsLeader.Text = "Is Leader:"; + // + // lblGroupMemberDiedTooltip + // + this.lblGroupMemberDiedTooltip.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lblGroupMemberDiedTooltip.Location = new System.Drawing.Point(20, 10); + this.lblGroupMemberDiedTooltip.Name = "lblGroupMemberDiedTooltip"; + this.lblGroupMemberDiedTooltip.Size = new System.Drawing.Size(453, 32); + this.lblGroupMemberDiedTooltip.TabIndex = 0; + this.lblGroupMemberDiedTooltip.Text = "Expires when a member of the creature\'s group dies. The group must have the appop" + + "riate flag for the event to trigger."; + // + // cmbGroupMemberDiedIsLeader + // + this.cmbGroupMemberDiedIsLeader.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbGroupMemberDiedIsLeader.FormattingEnabled = true; + this.cmbGroupMemberDiedIsLeader.Items.AddRange(new object[] { + "False", + "True"}); + this.cmbGroupMemberDiedIsLeader.Location = new System.Drawing.Point(99, 88); + this.cmbGroupMemberDiedIsLeader.Name = "cmbGroupMemberDiedIsLeader"; + this.cmbGroupMemberDiedIsLeader.Size = new System.Drawing.Size(374, 21); + this.cmbGroupMemberDiedIsLeader.TabIndex = 14; + this.cmbGroupMemberDiedIsLeader.SelectedIndexChanged += new System.EventHandler(this.cmbGroupMemberDiedIsLeader_SelectedIndexChanged); // // FormEventEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(944, 600); + this.Controls.Add(this.frmEventGroupMemberDied); this.Controls.Add(this.frmEventMovementInform); this.Controls.Add(this.frmEventReceiveEmote); this.Controls.Add(this.frmEventSummonedUnit); @@ -1125,6 +1198,8 @@ private void InitializeComponent() this.frmEventReceiveEmote.PerformLayout(); this.frmEventMovementInform.ResumeLayout(false); this.frmEventMovementInform.PerformLayout(); + this.frmEventGroupMemberDied.ResumeLayout(false); + this.frmEventGroupMemberDied.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -1227,5 +1302,11 @@ private void InitializeComponent() private System.Windows.Forms.Label lblMovementInformPoint; private System.Windows.Forms.Label lblEventMovementInformTooltip; private System.Windows.Forms.TextBox txtMovementInformType; + private System.Windows.Forms.Panel frmEventGroupMemberDied; + private System.Windows.Forms.ComboBox cmbGroupMemberDiedIsLeader; + private System.Windows.Forms.Button btnGroupMemberDiedCreatureId; + private System.Windows.Forms.Label lblGroupMemberDiedCreatureId; + private System.Windows.Forms.Label lblGroupMemberDiedIsLeader; + private System.Windows.Forms.Label lblGroupMemberDiedTooltip; } } \ No newline at end of file diff --git a/ScriptEditor/FormEventEditor.cs b/ScriptEditor/FormEventEditor.cs index e829579..b8f73c0 100644 --- a/ScriptEditor/FormEventEditor.cs +++ b/ScriptEditor/FormEventEditor.cs @@ -59,7 +59,8 @@ public partial class FormEventEditor : Form "Target Missing Aura", // 28 "Movement Inform", // 29 "Leave Combat", // 30 - "Map Event Happened" // 31 + "Map Event Happened", // 31 + "Group Member Died" // 32 }; public FormEventEditor() @@ -235,6 +236,11 @@ private void ResetAndHideEventSpecificForms() txtMovementInformRepeatMax.Text = ""; frmEventMovementInform.Visible = false; + // EVENT_T_GROUP_MEMBER_DIED (32) + btnGroupMemberDiedCreatureId.Text = "-NONE-"; + cmbGroupMemberDiedIsLeader.SelectedIndex = 0; + frmEventGroupMemberDied.Visible = false; + dontUpdate = false; } @@ -556,6 +562,15 @@ private void ShowEventSpecificForm(CreatureEvent selectedEvent) frmEventMovementInform.Visible = true; break; } + case 32: // EVENT_T_GROUP_MEMBER_DIED + { + uint creatureId = (uint)selectedEvent.Param1; + if (creatureId > 0) + btnGroupMemberDiedCreatureId.Text = GameData.FindCreatureName(creatureId) + " (" + creatureId.ToString() + ")"; + cmbGroupMemberDiedIsLeader.SelectedIndex = selectedEvent.Param2; + frmEventGroupMemberDied.Visible = true; + break; + } } dontUpdate = false; } @@ -1334,5 +1349,15 @@ private void txtMovementInformRepeatMax_Leave(object sender, EventArgs e) { SetScriptFieldFromTextbox(txtMovementInformRepeatMax, "Param4"); } + + private void btnGroupMemberDiedCreatureId_Click(object sender, EventArgs e) + { + SetScriptFieldFromDataFinderForm(btnGroupMemberDiedCreatureId, null, GameData.FindCreatureName, "Param1"); + } + + private void cmbGroupMemberDiedIsLeader_SelectedIndexChanged(object sender, EventArgs e) + { + SetScriptFieldFromCombobox(cmbGroupMemberDiedIsLeader, "Param2", false); + } } } diff --git a/ScriptEditor/FormScriptEditor.Designer.cs b/ScriptEditor/FormScriptEditor.Designer.cs index 1eb24dd..30cfd89 100644 --- a/ScriptEditor/FormScriptEditor.Designer.cs +++ b/ScriptEditor/FormScriptEditor.Designer.cs @@ -134,6 +134,8 @@ private void InitializeComponent() this.txtTeleportX = new System.Windows.Forms.TextBox(); this.lblTeleportTooltip = new System.Windows.Forms.Label(); this.frmCommandQuestComplete = new System.Windows.Forms.Panel(); + this.lblQuestCompleteGroup = new System.Windows.Forms.Label(); + this.cmbQuestCompleteGroup = new System.Windows.Forms.ComboBox(); this.lblQuestCompleteId = new System.Windows.Forms.Label(); this.lblQuestCompleteDistance = new System.Windows.Forms.Label(); this.txtQuestCompleteDistance = new System.Windows.Forms.TextBox(); @@ -257,6 +259,8 @@ private void InitializeComponent() this.lblSetFactionId = new System.Windows.Forms.Label(); this.lblSetFactionTooltip = new System.Windows.Forms.Label(); this.frmCommandMorphOrMount = new System.Windows.Forms.Panel(); + this.cmbMorphOrMountPermanent = new System.Windows.Forms.ComboBox(); + this.lblMorphOrMountPermanent = new System.Windows.Forms.Label(); this.cmbMorphOrMountType = new System.Windows.Forms.ComboBox(); this.lblMorphOrMountId = new System.Windows.Forms.Label(); this.lblMorphOrMountType = new System.Windows.Forms.Label(); @@ -1678,6 +1682,8 @@ private void InitializeComponent() // frmCommandQuestComplete // this.frmCommandQuestComplete.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.frmCommandQuestComplete.Controls.Add(this.lblQuestCompleteGroup); + this.frmCommandQuestComplete.Controls.Add(this.cmbQuestCompleteGroup); this.frmCommandQuestComplete.Controls.Add(this.lblQuestCompleteId); this.frmCommandQuestComplete.Controls.Add(this.lblQuestCompleteDistance); this.frmCommandQuestComplete.Controls.Add(this.txtQuestCompleteDistance); @@ -1689,6 +1695,28 @@ private void InitializeComponent() this.frmCommandQuestComplete.TabIndex = 15; this.frmCommandQuestComplete.Visible = false; // + // lblQuestCompleteGroup + // + this.lblQuestCompleteGroup.AutoSize = true; + this.lblQuestCompleteGroup.Location = new System.Drawing.Point(57, 125); + this.lblQuestCompleteGroup.Name = "lblQuestCompleteGroup"; + this.lblQuestCompleteGroup.Size = new System.Drawing.Size(39, 13); + this.lblQuestCompleteGroup.TabIndex = 6; + this.lblQuestCompleteGroup.Text = "Group:"; + // + // cmbQuestCompleteGroup + // + this.cmbQuestCompleteGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbQuestCompleteGroup.FormattingEnabled = true; + this.cmbQuestCompleteGroup.Items.AddRange(new object[] { + "False", + "True"}); + this.cmbQuestCompleteGroup.Location = new System.Drawing.Point(99, 121); + this.cmbQuestCompleteGroup.Name = "cmbQuestCompleteGroup"; + this.cmbQuestCompleteGroup.Size = new System.Drawing.Size(374, 21); + this.cmbQuestCompleteGroup.TabIndex = 5; + this.cmbQuestCompleteGroup.SelectedIndexChanged += new System.EventHandler(this.cmbQuestCompleteGroup_SelectedIndexChanged); + // // lblQuestCompleteId // this.lblQuestCompleteId.AutoSize = true; @@ -2950,6 +2978,8 @@ private void InitializeComponent() // frmCommandMorphOrMount // this.frmCommandMorphOrMount.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.frmCommandMorphOrMount.Controls.Add(this.cmbMorphOrMountPermanent); + this.frmCommandMorphOrMount.Controls.Add(this.lblMorphOrMountPermanent); this.frmCommandMorphOrMount.Controls.Add(this.cmbMorphOrMountType); this.frmCommandMorphOrMount.Controls.Add(this.lblMorphOrMountId); this.frmCommandMorphOrMount.Controls.Add(this.lblMorphOrMountType); @@ -2961,6 +2991,28 @@ private void InitializeComponent() this.frmCommandMorphOrMount.TabIndex = 29; this.frmCommandMorphOrMount.Visible = false; // + // cmbMorphOrMountPermanent + // + this.cmbMorphOrMountPermanent.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbMorphOrMountPermanent.FormattingEnabled = true; + this.cmbMorphOrMountPermanent.Items.AddRange(new object[] { + "False", + "True"}); + this.cmbMorphOrMountPermanent.Location = new System.Drawing.Point(99, 120); + this.cmbMorphOrMountPermanent.Name = "cmbMorphOrMountPermanent"; + this.cmbMorphOrMountPermanent.Size = new System.Drawing.Size(374, 21); + this.cmbMorphOrMountPermanent.TabIndex = 7; + this.cmbMorphOrMountPermanent.SelectedIndexChanged += new System.EventHandler(this.cmbMorphOrMountPermanent_SelectedIndexChanged); + // + // lblMorphOrMountPermanent + // + this.lblMorphOrMountPermanent.AutoSize = true; + this.lblMorphOrMountPermanent.Location = new System.Drawing.Point(35, 123); + this.lblMorphOrMountPermanent.Name = "lblMorphOrMountPermanent"; + this.lblMorphOrMountPermanent.Size = new System.Drawing.Size(61, 13); + this.lblMorphOrMountPermanent.TabIndex = 6; + this.lblMorphOrMountPermanent.Text = "Permanent:"; + // // cmbMorphOrMountType // this.cmbMorphOrMountType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -3607,9 +3659,9 @@ private void InitializeComponent() this.lblUpdateEntryTooltip.Name = "lblUpdateEntryTooltip"; this.lblUpdateEntryTooltip.Size = new System.Drawing.Size(453, 32); this.lblUpdateEntryTooltip.TabIndex = 0; - this.lblUpdateEntryTooltip.Text = "Temporarily changes the creature\'s entry, but preserves the same AI. The team set" + - "ting determines which display Id will be used if there is a different one for ea" + - "ch faction."; + this.lblUpdateEntryTooltip.Text = "Temporarily changes the source Creature\'s entry, but preserves the same AI. The t" + + "eam setting determines which display Id will be used if there is a different one" + + " for each faction."; // // frmCommandSetStandState // @@ -6651,6 +6703,10 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtUnknownCommandZ; private System.Windows.Forms.Label lblUnknownCommandO; private System.Windows.Forms.Label lblUnknownCommandZ; + private System.Windows.Forms.Label lblQuestCompleteGroup; + private System.Windows.Forms.ComboBox cmbQuestCompleteGroup; + private System.Windows.Forms.ComboBox cmbMorphOrMountPermanent; + private System.Windows.Forms.Label lblMorphOrMountPermanent; } } diff --git a/ScriptEditor/FormScriptEditor.cs b/ScriptEditor/FormScriptEditor.cs index bd42fc2..bb69782 100644 --- a/ScriptEditor/FormScriptEditor.cs +++ b/ScriptEditor/FormScriptEditor.cs @@ -101,7 +101,9 @@ public partial class FormScriptEditor : Form "Start Script For All", // 68 "Edit Map Event", // 69 "Fail Quest", // 70 - "Respawn Creature" // 71 + "Respawn Creature", // 71 + "Assist Unit", // 72 + "Combat Stop", // 73 }; // Options for combo boxes. @@ -532,6 +534,7 @@ private void ResetAndHideCommandSpecificForms() // Quest Complete (7) btnQuestCompleteId.Text = "-NONE-"; txtQuestCompleteDistance.Text = ""; + cmbQuestCompleteGroup.SelectedIndex = 0; frmCommandQuestComplete.Visible = false; // Kill Credit (8) @@ -637,6 +640,7 @@ private void ResetAndHideCommandSpecificForms() // Morph (23) and Mount (24) btnMorphOrMountId.Text = "-NONE-"; cmbMorphOrMountType.SelectedIndex = 0; + cmbMorphOrMountPermanent.SelectedIndex = 0; frmCommandMorphOrMount.Visible = false; // Set Run (25) @@ -1002,13 +1006,20 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction) { lblQuestCompleteTooltip.Text = "Completes the specified quest for the player. If a maximum distance is provided, but the player is out of range, the quest will be marked as failed instead."; txtQuestCompleteDistance.Text = selectedAction.Datalong2.ToString(); - txtQuestCompleteDistance.Enabled = true; + lblQuestCompleteDistance.Visible = true; + txtQuestCompleteDistance.Visible = true; + cmbQuestCompleteGroup.SelectedIndex = (int)selectedAction.Datalong3; + cmbQuestCompleteGroup.Visible = true; + lblQuestCompleteGroup.Visible = true; break; } case 70: // Fail Quest { lblQuestCompleteTooltip.Text = "Fails the specified quest for the player and his group."; - txtQuestCompleteDistance.Enabled = false; + txtQuestCompleteDistance.Visible = false; + lblQuestCompleteDistance.Visible = false; + lblQuestCompleteGroup.Visible = false; + cmbQuestCompleteGroup.Visible = false; break; } } @@ -1099,6 +1110,8 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction) case 26: // Start Attack case 33: // Enter Evade Mode case 41: // Remove Object + case 72: // Assist Unit + case 73: // Combat Stop { txtDoorGuid.Visible = false; txtDoorResetDelay.Visible = false; @@ -1123,7 +1136,17 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction) } case 41: { - lblDoorTooltip.Text = "The source gameobject has its loot state changed to deactivated and is removed from the map. This command has no additional parameters."; + lblDoorTooltip.Text = "The source GameObject has its loot state changed to deactivated and is removed from the map. This command has no additional parameters."; + break; + } + case 72: + { + lblDoorTooltip.Text = "The source Creature begins attacking the target Unit's attacker, but only if it does not already have a victim. This command has no additional parameters."; + break; + } + case 73: + { + lblDoorTooltip.Text = "The source Creature leaves combat without entering evade mode. This command has no additional parameters."; break; } } @@ -1368,9 +1391,18 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction) } if (selectedAction.Command == 23) + { lblMorphOrMountTooltip.Text = "Sets the source Creature's display Id to the provided value. Select NONE to restore the Creature's original display Id."; + lblMorphOrMountPermanent.Visible = false; + cmbMorphOrMountPermanent.Visible = false; + } else + { lblMorphOrMountTooltip.Text = "The source Creature gets mounted to the provided creature or display Id. Select NONE to unmount."; + lblMorphOrMountPermanent.Visible = true; + cmbMorphOrMountPermanent.Visible = true; + cmbMorphOrMountPermanent.SelectedIndex = (int)selectedAction.Datalong3; + } frmCommandMorphOrMount.Visible = true; break; @@ -1388,7 +1420,7 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction) { case 27: // Update Entry { - lblUpdateEntryTooltip.Text = "Temporarily changes the creature\'s entry, but preserves the same AI. The team setting determines which display Id will be used if there is a different one for each faction."; + lblUpdateEntryTooltip.Text = "Temporarily changes the source Creature\'s entry, but preserves the same AI. The team setting determines which display Id will be used if there is a different one for each faction."; lblUpdateEntryTeam.Visible = true; cmbUpdateEntryTeam.Visible = true; break; @@ -3211,6 +3243,10 @@ private void txtQuestCompleteDistance_Leave(object sender, EventArgs e) { SetScriptFieldFromTextbox(txtQuestCompleteDistance, "Datalong2"); } + private void cmbQuestCompleteGroup_SelectedIndexChanged(object sender, EventArgs e) + { + SetScriptFieldFromCombobox(cmbQuestCompleteGroup, "Datalong3", false); + } // SCRIPT_COMMAND_KILL_CREDIT (8) private void cmbKillCreditType_SelectedIndexChanged(object sender, EventArgs e) @@ -3707,6 +3743,11 @@ private void cmbMorphOrMountType_SelectedIndexChanged(object sender, EventArgs e btnMorphOrMountId.Text = "-NONE-"; } + private void cmbMorphOrMountPermanent_SelectedIndexChanged(object sender, EventArgs e) + { + SetScriptFieldFromCombobox(cmbMorphOrMountPermanent, "Datalong3", false); + } + // SCRIPT_COMMAND_SET_RUN (25) private void cmbSetRunMode_SelectedIndexChanged(object sender, EventArgs e) { diff --git a/ScriptEditor/GameData.cs b/ScriptEditor/GameData.cs index 8e98817..2728712 100644 --- a/ScriptEditor/GameData.cs +++ b/ScriptEditor/GameData.cs @@ -482,7 +482,7 @@ public static void LoadSpells(string connString) MySqlConnection conn = new MySqlConnection(connString); MySqlCommand command = conn.CreateCommand(); - command.CommandText = "SELECT ID, effect1, effect2, effect3, name1, description1 FROM spell_template ORDER BY ID"; + command.CommandText = "SELECT ID, effect1, effect2, effect3, name1, description1 FROM spell_template WHERE build=5875 ORDER BY ID"; try { conn.Open(); @@ -532,7 +532,7 @@ public static void LoadCondition(string connString) MySqlConnection conn = new MySqlConnection(connString); MySqlCommand command = conn.CreateCommand(); - command.CommandText = "SELECT condition_entry, type, value1, value2, flags FROM conditions ORDER BY condition_entry"; + command.CommandText = "SELECT condition_entry, type, value1, value2, value3, value4, flags FROM conditions ORDER BY condition_entry"; try { conn.Open(); @@ -541,7 +541,7 @@ public static void LoadCondition(string connString) while (reader.Read()) { // Add the new condition entry to the list. - ConditionInfoList.Add(new ConditionInfo(reader.GetUInt32(0), reader.GetInt32(1), reader.GetUInt32(2), reader.GetUInt32(3), reader.GetUInt32(4))); + ConditionInfoList.Add(new ConditionInfo(reader.GetUInt32(0), reader.GetInt32(1), reader.GetUInt32(2), reader.GetUInt32(3), reader.GetUInt32(4), reader.GetUInt32(5), reader.GetUInt32(6))); } reader.Close(); } @@ -607,7 +607,7 @@ public static void LoadFactions(string connString) MySqlConnection conn = new MySqlConnection(connString); MySqlCommand command = conn.CreateCommand(); - command.CommandText = "SELECT ID, name1, description1 FROM faction ORDER BY ID"; + command.CommandText = "SELECT ID, name1, description1 FROM faction WHERE build=5875 ORDER BY ID"; try { conn.Open(); @@ -632,7 +632,7 @@ public static void LoadFactionTemplates(string connString) MySqlConnection conn = new MySqlConnection(connString); MySqlCommand command = conn.CreateCommand(); - command.CommandText = "SELECT ID, factionId, factionFlags FROM faction_template ORDER BY ID"; + command.CommandText = "SELECT ID, factionId, factionFlags FROM faction_template WHERE build=5875 ORDER BY ID"; try { conn.Open(); @@ -1621,6 +1621,7 @@ static GameData() ConditionNamesList.Add(new ComboboxPair("IS_HOSTILE_TO", 44)); ConditionNamesList.Add(new ComboboxPair("IS_IN_GROUP", 45)); ConditionNamesList.Add(new ComboboxPair("IS_ALIVE", 46)); + ConditionNamesList.Add(new ComboboxPair("MAP_EVENT_TARGETS", 47)); } } public struct BroadcastText @@ -1740,13 +1741,17 @@ public struct ConditionInfo public int Type; public uint Value1; public uint Value2; + public uint Value3; + public uint Value4; public uint Flags; - public ConditionInfo(uint id, int type, uint value1, uint value2, uint flags) + public ConditionInfo(uint id, int type, uint value1, uint value2, uint value3, uint value4, uint flags) { ID = id; Type = type; Value1 = value1; Value2 = value2; + Value3 = value3; + Value4 = value4; Flags = flags; } } diff --git a/ScriptEditor/Properties/AssemblyInfo.cs b/ScriptEditor/Properties/AssemblyInfo.cs index 9375d81..d87a036 100644 --- a/ScriptEditor/Properties/AssemblyInfo.cs +++ b/ScriptEditor/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.3.0.0")] -[assembly: AssemblyFileVersion("4.3.0.0")] +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")]