From 2f49debafd8881c6755736fc6933e11cc1139f6c Mon Sep 17 00:00:00 2001 From: brotalnia Date: Wed, 11 Dec 2019 02:47:17 +0200 Subject: [PATCH] Update AND and OR conditions. --- .../FormConditionFinder.Designer.cs | 175 ++++++++++++++---- .../DataFinderForms/FormConditionFinder.cs | 137 +++++++++----- 2 files changed, 232 insertions(+), 80 deletions(-) diff --git a/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs b/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs index 3491335..f97c4c4 100644 --- a/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs +++ b/ScriptEditor/DataFinderForms/FormConditionFinder.Designer.cs @@ -36,10 +36,8 @@ private void InitializeComponent() this.columnValue3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnValue4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.frmConditionNot = new System.Windows.Forms.Panel(); - this.btnConditionNotCondition2 = new System.Windows.Forms.Button(); this.btnConditionNotCondition1 = new System.Windows.Forms.Button(); - this.lblConditionNotCondition2 = new System.Windows.Forms.Label(); - this.lblConditionNotCondition1 = new System.Windows.Forms.Label(); + this.lblConditionNotCondition = new System.Windows.Forms.Label(); this.lblConditionNotTooltip = new System.Windows.Forms.Label(); this.cmbConditionType = new System.Windows.Forms.ComboBox(); this.btnSave = new System.Windows.Forms.Button(); @@ -169,6 +167,16 @@ private void InitializeComponent() this.lblMapEventTargetsConditionId = new System.Windows.Forms.Label(); this.lblMapEventTargetsEventId = new System.Windows.Forms.Label(); this.lblConditionMapEventTargetsTooltip = new System.Windows.Forms.Label(); + this.frmConditionAnd = new System.Windows.Forms.Panel(); + this.btnConditionAndCondition3 = new System.Windows.Forms.Button(); + this.btnConditionAndCondition1 = new System.Windows.Forms.Button(); + this.lblConditionAndCondition3 = new System.Windows.Forms.Label(); + this.lblConditionAndCondition1 = new System.Windows.Forms.Label(); + this.lblConditionAndTooltip = new System.Windows.Forms.Label(); + this.btnConditionAndCondition4 = new System.Windows.Forms.Button(); + this.btnConditionAndCondition2 = new System.Windows.Forms.Button(); + this.lblConditionAndCondition4 = new System.Windows.Forms.Label(); + this.lblConditionAndCondition2 = new System.Windows.Forms.Label(); this.frmConditionNot.SuspendLayout(); this.frmConditionAura.SuspendLayout(); this.frmConditionItem.SuspendLayout(); @@ -189,6 +197,7 @@ private void InitializeComponent() this.frmConditionMapEventData.SuspendLayout(); this.frmConditionUnknown.SuspendLayout(); this.frmConditionMapEventTargets.SuspendLayout(); + this.frmConditionAnd.SuspendLayout(); this.SuspendLayout(); // // lstData @@ -241,10 +250,8 @@ private void InitializeComponent() // frmConditionNot // this.frmConditionNot.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.frmConditionNot.Controls.Add(this.btnConditionNotCondition2); this.frmConditionNot.Controls.Add(this.btnConditionNotCondition1); - this.frmConditionNot.Controls.Add(this.lblConditionNotCondition2); - this.frmConditionNot.Controls.Add(this.lblConditionNotCondition1); + this.frmConditionNot.Controls.Add(this.lblConditionNotCondition); this.frmConditionNot.Controls.Add(this.lblConditionNotTooltip); this.frmConditionNot.Location = new System.Drawing.Point(12, 212); this.frmConditionNot.Name = "frmConditionNot"; @@ -252,16 +259,6 @@ private void InitializeComponent() this.frmConditionNot.TabIndex = 9; this.frmConditionNot.Visible = false; // - // btnConditionNotCondition2 - // - this.btnConditionNotCondition2.Location = new System.Drawing.Point(100, 101); - this.btnConditionNotCondition2.Name = "btnConditionNotCondition2"; - this.btnConditionNotCondition2.Size = new System.Drawing.Size(536, 23); - this.btnConditionNotCondition2.TabIndex = 4; - this.btnConditionNotCondition2.Text = "-NONE-"; - this.btnConditionNotCondition2.UseVisualStyleBackColor = true; - this.btnConditionNotCondition2.Click += new System.EventHandler(this.btnConditionNotCondition2_Click); - // // btnConditionNotCondition1 // this.btnConditionNotCondition1.Location = new System.Drawing.Point(100, 68); @@ -272,23 +269,14 @@ private void InitializeComponent() this.btnConditionNotCondition1.UseVisualStyleBackColor = true; this.btnConditionNotCondition1.Click += new System.EventHandler(this.btnConditionNotCondition1_Click); // - // lblConditionNotCondition2 - // - this.lblConditionNotCondition2.AutoSize = true; - this.lblConditionNotCondition2.Location = new System.Drawing.Point(11, 106); - this.lblConditionNotCondition2.Name = "lblConditionNotCondition2"; - this.lblConditionNotCondition2.Size = new System.Drawing.Size(75, 13); - this.lblConditionNotCondition2.TabIndex = 2; - this.lblConditionNotCondition2.Text = "Condition Id 2:"; + // lblConditionNotCondition // - // lblConditionNotCondition1 - // - this.lblConditionNotCondition1.AutoSize = true; - this.lblConditionNotCondition1.Location = new System.Drawing.Point(11, 73); - this.lblConditionNotCondition1.Name = "lblConditionNotCondition1"; - this.lblConditionNotCondition1.Size = new System.Drawing.Size(75, 13); - this.lblConditionNotCondition1.TabIndex = 1; - this.lblConditionNotCondition1.Text = "Condition Id 1:"; + this.lblConditionNotCondition.AutoSize = true; + this.lblConditionNotCondition.Location = new System.Drawing.Point(11, 73); + this.lblConditionNotCondition.Name = "lblConditionNotCondition"; + this.lblConditionNotCondition.Size = new System.Drawing.Size(75, 13); + this.lblConditionNotCondition.TabIndex = 1; + this.lblConditionNotCondition.Text = "Condition Id 1:"; // // lblConditionNotTooltip // @@ -1624,11 +1612,117 @@ private void InitializeComponent() this.lblConditionMapEventTargetsTooltip.TabIndex = 0; this.lblConditionMapEventTargetsTooltip.Text = "Returns true if all of the extra targets part of the scripted map event satisfy t" + "he specified condition."; + // + // frmConditionAnd + // + this.frmConditionAnd.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.frmConditionAnd.Controls.Add(this.btnConditionAndCondition4); + this.frmConditionAnd.Controls.Add(this.btnConditionAndCondition2); + this.frmConditionAnd.Controls.Add(this.lblConditionAndCondition4); + this.frmConditionAnd.Controls.Add(this.lblConditionAndCondition2); + this.frmConditionAnd.Controls.Add(this.btnConditionAndCondition3); + this.frmConditionAnd.Controls.Add(this.btnConditionAndCondition1); + this.frmConditionAnd.Controls.Add(this.lblConditionAndCondition3); + this.frmConditionAnd.Controls.Add(this.lblConditionAndCondition1); + this.frmConditionAnd.Controls.Add(this.lblConditionAndTooltip); + this.frmConditionAnd.Location = new System.Drawing.Point(12, 212); + this.frmConditionAnd.Name = "frmConditionAnd"; + this.frmConditionAnd.Size = new System.Drawing.Size(650, 150); + this.frmConditionAnd.TabIndex = 39; + this.frmConditionAnd.Visible = false; + // + // btnConditionAndCondition3 + // + this.btnConditionAndCondition3.Location = new System.Drawing.Point(100, 101); + this.btnConditionAndCondition3.Name = "btnConditionAndCondition3"; + this.btnConditionAndCondition3.Size = new System.Drawing.Size(218, 23); + this.btnConditionAndCondition3.TabIndex = 4; + this.btnConditionAndCondition3.Text = "-NONE-"; + this.btnConditionAndCondition3.UseVisualStyleBackColor = true; + this.btnConditionAndCondition3.Click += new System.EventHandler(this.btnConditionAndCondition3_Click); + // + // btnConditionAndCondition1 + // + this.btnConditionAndCondition1.Location = new System.Drawing.Point(100, 68); + this.btnConditionAndCondition1.Name = "btnConditionAndCondition1"; + this.btnConditionAndCondition1.Size = new System.Drawing.Size(218, 23); + this.btnConditionAndCondition1.TabIndex = 3; + this.btnConditionAndCondition1.Text = "-NONE-"; + this.btnConditionAndCondition1.UseVisualStyleBackColor = true; + this.btnConditionAndCondition1.Click += new System.EventHandler(this.btnConditionAndCondition1_Click); + // + // lblConditionAndCondition3 + // + this.lblConditionAndCondition3.AutoSize = true; + this.lblConditionAndCondition3.Location = new System.Drawing.Point(11, 106); + this.lblConditionAndCondition3.Name = "lblConditionAndCondition3"; + this.lblConditionAndCondition3.Size = new System.Drawing.Size(75, 13); + this.lblConditionAndCondition3.TabIndex = 2; + this.lblConditionAndCondition3.Text = "Condition Id 3:"; + // + // lblConditionAndCondition1 + // + this.lblConditionAndCondition1.AutoSize = true; + this.lblConditionAndCondition1.Location = new System.Drawing.Point(11, 73); + this.lblConditionAndCondition1.Name = "lblConditionAndCondition1"; + this.lblConditionAndCondition1.Size = new System.Drawing.Size(75, 13); + this.lblConditionAndCondition1.TabIndex = 1; + this.lblConditionAndCondition1.Text = "Condition Id 1:"; + // + // lblConditionAndTooltip + // + this.lblConditionAndTooltip.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lblConditionAndTooltip.Location = new System.Drawing.Point(12, 8); + this.lblConditionAndTooltip.Name = "lblConditionAndTooltip"; + this.lblConditionAndTooltip.Size = new System.Drawing.Size(624, 42); + this.lblConditionAndTooltip.TabIndex = 0; + this.lblConditionAndTooltip.Text = "Returns true only if all of the specified conditions return true. The referenced " + + "conditions need to have an entry Id that is lower than that of the current condi" + + "tion."; + // + // btnConditionAndCondition4 + // + this.btnConditionAndCondition4.Location = new System.Drawing.Point(412, 101); + this.btnConditionAndCondition4.Name = "btnConditionAndCondition4"; + this.btnConditionAndCondition4.Size = new System.Drawing.Size(218, 23); + this.btnConditionAndCondition4.TabIndex = 8; + this.btnConditionAndCondition4.Text = "-NONE-"; + this.btnConditionAndCondition4.UseVisualStyleBackColor = true; + this.btnConditionAndCondition4.Click += new System.EventHandler(this.btnConditionAndCondition4_Click); + // + // btnConditionAndCondition2 + // + this.btnConditionAndCondition2.Location = new System.Drawing.Point(412, 68); + this.btnConditionAndCondition2.Name = "btnConditionAndCondition2"; + this.btnConditionAndCondition2.Size = new System.Drawing.Size(218, 23); + this.btnConditionAndCondition2.TabIndex = 7; + this.btnConditionAndCondition2.Text = "-NONE-"; + this.btnConditionAndCondition2.UseVisualStyleBackColor = true; + this.btnConditionAndCondition2.Click += new System.EventHandler(this.btnConditionAndCondition2_Click); + // + // lblConditionAndCondition4 + // + this.lblConditionAndCondition4.AutoSize = true; + this.lblConditionAndCondition4.Location = new System.Drawing.Point(323, 106); + this.lblConditionAndCondition4.Name = "lblConditionAndCondition4"; + this.lblConditionAndCondition4.Size = new System.Drawing.Size(75, 13); + this.lblConditionAndCondition4.TabIndex = 6; + this.lblConditionAndCondition4.Text = "Condition Id 4:"; + // + // lblConditionAndCondition2 + // + this.lblConditionAndCondition2.AutoSize = true; + this.lblConditionAndCondition2.Location = new System.Drawing.Point(323, 73); + this.lblConditionAndCondition2.Name = "lblConditionAndCondition2"; + this.lblConditionAndCondition2.Size = new System.Drawing.Size(75, 13); + this.lblConditionAndCondition2.TabIndex = 5; + this.lblConditionAndCondition2.Text = "Condition Id 2:"; // // FormConditionFinder // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.ClientSize = new System.Drawing.Size(674, 395); + this.Controls.Add(this.frmConditionAnd); this.Controls.Add(this.frmConditionMapEventTargets); this.Controls.Add(this.frmConditionUnknown); this.Controls.Add(this.frmConditionMapEventData); @@ -1699,6 +1793,7 @@ private void InitializeComponent() this.Controls.SetChildIndex(this.frmConditionMapEventData, 0); this.Controls.SetChildIndex(this.frmConditionUnknown, 0); this.Controls.SetChildIndex(this.frmConditionMapEventTargets, 0); + this.Controls.SetChildIndex(this.frmConditionAnd, 0); this.frmConditionNot.ResumeLayout(false); this.frmConditionNot.PerformLayout(); this.frmConditionAura.ResumeLayout(false); @@ -1739,6 +1834,8 @@ private void InitializeComponent() this.frmConditionUnknown.PerformLayout(); this.frmConditionMapEventTargets.ResumeLayout(false); this.frmConditionMapEventTargets.PerformLayout(); + this.frmConditionAnd.ResumeLayout(false); + this.frmConditionAnd.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -1753,10 +1850,8 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnValue3; private System.Windows.Forms.ColumnHeader columnValue4; private System.Windows.Forms.Panel frmConditionNot; - private System.Windows.Forms.Button btnConditionNotCondition2; private System.Windows.Forms.Button btnConditionNotCondition1; - private System.Windows.Forms.Label lblConditionNotCondition2; - private System.Windows.Forms.Label lblConditionNotCondition1; + private System.Windows.Forms.Label lblConditionNotCondition; private System.Windows.Forms.Label lblConditionNotTooltip; private System.Windows.Forms.ComboBox cmbConditionType; private System.Windows.Forms.Button btnSave; @@ -1886,5 +1981,15 @@ private void InitializeComponent() private System.Windows.Forms.Label lblMapEventTargetsConditionId; private System.Windows.Forms.Label lblMapEventTargetsEventId; private System.Windows.Forms.Label lblConditionMapEventTargetsTooltip; + private System.Windows.Forms.Panel frmConditionAnd; + private System.Windows.Forms.Button btnConditionAndCondition4; + private System.Windows.Forms.Button btnConditionAndCondition2; + private System.Windows.Forms.Label lblConditionAndCondition4; + private System.Windows.Forms.Label lblConditionAndCondition2; + private System.Windows.Forms.Button btnConditionAndCondition3; + private System.Windows.Forms.Button btnConditionAndCondition1; + private System.Windows.Forms.Label lblConditionAndCondition3; + private System.Windows.Forms.Label lblConditionAndCondition1; + private System.Windows.Forms.Label lblConditionAndTooltip; } } diff --git a/ScriptEditor/DataFinderForms/FormConditionFinder.cs b/ScriptEditor/DataFinderForms/FormConditionFinder.cs index e166322..7120905 100644 --- a/ScriptEditor/DataFinderForms/FormConditionFinder.cs +++ b/ScriptEditor/DataFinderForms/FormConditionFinder.cs @@ -66,12 +66,17 @@ private void ResetBaseControls() private void ResetAndHideConditionSpecificForms() { // CONDITION_NOT (-3) - // CONDITION_OR (-2) - // CONDITION_AND (-1) btnConditionNotCondition1.Text = "-NONE-"; - btnConditionNotCondition2.Text = "-NONE-"; frmConditionNot.Visible = false; + // CONDITION_OR (-2) + // CONDITION_AND (-1) + btnConditionAndCondition1.Text = "-NONE-"; + btnConditionAndCondition2.Text = "-NONE-"; + btnConditionAndCondition3.Text = "-NONE-"; + btnConditionAndCondition4.Text = "-NONE-"; + frmConditionAnd.Visible = false; + // CONDITION_AURA (1) // CONDITION_SPELL (17) btnAuraSpellId.Text = "-NONE-"; @@ -198,49 +203,48 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition) switch (selectedCondition.Type) { case -3: // CONDITION_NOT + { + lblConditionNotTooltip.Text = "Returns true if the specified condition is false. The referenced condition needs to have an entry Id that is lower than that of the current condition."; + lblConditionNotCondition.Text = "Condition Id:"; + lblConditionNotCondition.Visible = true; + btnConditionNotCondition1.Visible = true; + uint conditionId1 = selectedCondition.Value1; + if (conditionId1 > 0) + btnConditionNotCondition1.Text = conditionId1.ToString() + " - " + GameData.FindConditionName(conditionId1); + frmConditionNot.Visible = true; + break; + } case -2: // CONDITION_OR case -1: // CONDITION_AND { switch (selectedCondition.Type) { - case -3: // CONDITION_NOT - { - lblConditionNotTooltip.Text = "Returns true if the specified condition is false. The referenced condition needs to have an entry Id that is lower than that of the current condition."; - lblConditionNotCondition1.Text = "Condition Id:"; - lblConditionNotCondition2.Visible = false; - btnConditionNotCondition2.Visible = false; - break; - } case -2: // CONDITION_OR { - lblConditionNotTooltip.Text = "Returns true if either one of specified conditions is true. The referenced conditions need to have an entry Id that is lower than that of the current condition."; - lblConditionNotCondition1.Text = "Condition Id 1:"; - lblConditionNotCondition2.Visible = true; - btnConditionNotCondition2.Visible = true; + lblConditionAndTooltip.Text = "Returns true if any of specified conditions are true. The referenced conditions need to have an entry Id that is lower than that of the current condition."; break; } case -1: // CONDITION_AND { - lblConditionNotTooltip.Text = "Returns true only if both of the specified conditions return true. The referenced conditions need to have an entry Id that is lower than that of the current condition."; - lblConditionNotCondition1.Text = "Condition Id 1:"; - lblConditionNotCondition2.Visible = true; - btnConditionNotCondition2.Visible = true; + lblConditionAndTooltip.Text = "Returns true only if all of the specified conditions return true. The referenced conditions need to have an entry Id that is lower than that of the current condition."; break; } } - lblConditionNotCondition1.Visible = true; - btnConditionNotCondition1.Visible = true; - uint conditionId1 = selectedCondition.Value1; if (conditionId1 > 0) - btnConditionNotCondition1.Text = conditionId1.ToString() + " - " + GameData.FindConditionName(conditionId1); + btnConditionAndCondition1.Text = conditionId1.ToString() + " - " + GameData.FindConditionName(conditionId1); uint conditionId2 = selectedCondition.Value2; if (conditionId2 > 0) - btnConditionNotCondition2.Text = conditionId2.ToString() + " - " + GameData.FindConditionName(conditionId2); - - - frmConditionNot.Visible = true; + btnConditionAndCondition2.Text = conditionId2.ToString() + " - " + GameData.FindConditionName(conditionId2); + uint conditionId3 = selectedCondition.Value3; + if (conditionId3 > 0) + btnConditionAndCondition3.Text = conditionId3.ToString() + " - " + GameData.FindConditionName(conditionId3); + uint conditionId4 = selectedCondition.Value4; + if (conditionId4 > 0) + btnConditionAndCondition4.Text = conditionId4.ToString() + " - " + GameData.FindConditionName(conditionId4); + + frmConditionAnd.Visible = true; break; } case 0: // CONDITION_NONE @@ -264,59 +268,57 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition) } case 10: // CONDITION_AD_COMMISSION_AURA { - lblConditionNotTooltip.Text = "Returns true if the target Player has an Argent Dawn commission aura."; + lblConditionNotTooltip.Text = "Returns true if the target Player has an Argent Dawn commission aura. This condition has no additional parameters."; break; } case 13: // CONDITION_CANT_PATH_TO_VICTIM { - lblConditionNotTooltip.Text = "Returns true if the source Creature cannot find a path to its victim."; + lblConditionNotTooltip.Text = "Returns true if the source Creature cannot find a path to its victim. This condition has no additional parameters."; break; } case 37: // CONDITION_LINE_OF_SIGHT { - lblConditionNotTooltip.Text = "Returns true if the source and target WorldObjects are within line of sight of each other."; + lblConditionNotTooltip.Text = "Returns true if the source and target WorldObjects are within line of sight of each other. This condition has no additional parameters."; break; } case 39: // CONDITION_IS_MOVING { - lblConditionNotTooltip.Text = "Returns true if the target WorldObject is currently moving."; + lblConditionNotTooltip.Text = "Returns true if the target WorldObject is currently moving. This condition has no additional parameters."; break; } case 40: // CONDITION_HAS_PET { - lblConditionNotTooltip.Text = "Returns true if the target Unit has a pet."; + lblConditionNotTooltip.Text = "Returns true if the target Unit has a pet. This condition has no additional parameters."; break; } case 43: // CONDITION_IS_IN_COMBAT { - lblConditionNotTooltip.Text = "Returns true if the target Unit is in combat."; + lblConditionNotTooltip.Text = "Returns true if the target Unit is in combat. This condition has no additional parameters."; break; } case 44: // CONDITION_IS_HOSTILE_TO { - lblConditionNotTooltip.Text = "Returns true if the source and target Units are hostile to each other."; + lblConditionNotTooltip.Text = "Returns true if the source and target Units are hostile to each other. This condition has no additional parameters."; break; } case 45: // CONDITION_IS_IN_GROUP { - lblConditionNotTooltip.Text = "Returns true if the target Player is currently in a group."; + lblConditionNotTooltip.Text = "Returns true if the target Player is currently in a group. This condition has no additional parameters."; break; } case 46: // CONDITION_IS_ALIVE { - lblConditionNotTooltip.Text = "Returns true if the target Unit is alive."; + lblConditionNotTooltip.Text = "Returns true if the target Unit is alive. This condition has no additional parameters."; break; } case 48: // CONDITION_OBJECT_IS_SPAWNED { - lblConditionNotTooltip.Text = "Returns true if the target GameObject is currently spawned."; + lblConditionNotTooltip.Text = "Returns true if the target GameObject is currently spawned. This condition has no additional parameters."; break; } } - lblConditionNotCondition1.Visible = false; - lblConditionNotCondition2.Visible = false; + lblConditionNotCondition.Visible = false; btnConditionNotCondition1.Visible = false; - btnConditionNotCondition2.Visible = false; frmConditionNot.Visible = true; break; } @@ -1443,8 +1445,6 @@ private void btnSaveAll_Click(object sender, EventArgs e) } // CONDITION_NOT - // CONDITION_OR - // CONDITION_AND private void btnConditionNotCondition1_Click(object sender, EventArgs e) { FormConditionFinder frm = new FormConditionFinder(); @@ -1460,7 +1460,24 @@ private void btnConditionNotCondition1_Click(object sender, EventArgs e) SetScriptFieldFromValue(returnId, "Value1"); } } - private void btnConditionNotCondition2_Click(object sender, EventArgs e) + // CONDITION_OR + // CONDITION_AND + private void btnConditionAndCondition1_Click(object sender, EventArgs e) + { + FormConditionFinder frm = new FormConditionFinder(); + if (frm.ShowDialog(GetScriptFieldValue("Value1")) == System.Windows.Forms.DialogResult.OK) + { + int returnId = frm.ReturnValue; + + if (returnId > 0) + btnConditionAndCondition1.Text = returnId.ToString() + " - " + GameData.FindConditionName((uint)returnId); + else + btnConditionAndCondition1.Text = "-NONE-"; + + SetScriptFieldFromValue(returnId, "Value1"); + } + } + private void btnConditionAndCondition2_Click(object sender, EventArgs e) { FormConditionFinder frm = new FormConditionFinder(); if (frm.ShowDialog(GetScriptFieldValue("Value2")) == System.Windows.Forms.DialogResult.OK) @@ -1468,13 +1485,43 @@ private void btnConditionNotCondition2_Click(object sender, EventArgs e) int returnId = frm.ReturnValue; if (returnId > 0) - btnConditionNotCondition2.Text = returnId.ToString() + " - " + GameData.FindConditionName((uint)returnId); + btnConditionAndCondition2.Text = returnId.ToString() + " - " + GameData.FindConditionName((uint)returnId); else - btnConditionNotCondition2.Text = "-NONE-"; + btnConditionAndCondition2.Text = "-NONE-"; SetScriptFieldFromValue(returnId, "Value2"); } } + private void btnConditionAndCondition3_Click(object sender, EventArgs e) + { + FormConditionFinder frm = new FormConditionFinder(); + if (frm.ShowDialog(GetScriptFieldValue("Value3")) == System.Windows.Forms.DialogResult.OK) + { + int returnId = frm.ReturnValue; + + if (returnId > 0) + btnConditionAndCondition3.Text = returnId.ToString() + " - " + GameData.FindConditionName((uint)returnId); + else + btnConditionAndCondition3.Text = "-NONE-"; + + SetScriptFieldFromValue(returnId, "Value3"); + } + } + private void btnConditionAndCondition4_Click(object sender, EventArgs e) + { + FormConditionFinder frm = new FormConditionFinder(); + if (frm.ShowDialog(GetScriptFieldValue("Value4")) == System.Windows.Forms.DialogResult.OK) + { + int returnId = frm.ReturnValue; + + if (returnId > 0) + btnConditionAndCondition4.Text = returnId.ToString() + " - " + GameData.FindConditionName((uint)returnId); + else + btnConditionAndCondition4.Text = "-NONE-"; + + SetScriptFieldFromValue(returnId, "Value4"); + } + } // CONDITION_AURA // CONDITION_SPELL private void btnAuraSpellId_Click(object sender, EventArgs e)