Skip to content

Commit 57f2565

Browse files
committed
Add random gameobject target and extra fields to source entry condition.
1 parent 720f73e commit 57f2565

File tree

5 files changed

+33
-63
lines changed

5 files changed

+33
-63
lines changed

ScriptEditor/DataFinderForms/FormConditionFinder.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ private void ResetAndHideConditionSpecificForms()
176176

177177
// CONDITION_WAR_EFFORT_STAGE (11)
178178
// CONDITION_LEVEL (15)
179-
// CONDITION_SOURCE_ENTRY (16)
180179
// CONDITION_LAST_WAYPOINT (32)
181180
// CONDITION_MAP_EVENT_ACTIVE (36)
182181
// CONDITION_DISTANCE (38)
@@ -238,11 +237,14 @@ private void ResetAndHideConditionSpecificForms()
238237
frmConditionMapEventData.Visible = false;
239238

240239
// CONDITION_MAP_EVENT_TARGETS (47)
240+
// CONDITION_OBJECT_FIT_CONDITION (50)
241241
txtMapEventTargetsEventId.Text = "";
242242
btnMapEventTargetsConditionId.Text = "-NONE-";
243243
frmConditionMapEventTargets.Visible = false;
244244

245+
// CONDITION_SOURCE_ENTRY (16)
245246
// CONDITION_DB_GUID (52)
247+
// CONDITION_DISTANCE_TO_POSITION (54)
246248
txtConditionDbGuid1.Text = "";
247249
txtConditionDbGuid2.Text = "";
248250
txtConditionDbGuid3.Text = "";
@@ -616,7 +618,6 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
616618
}
617619
case 11: // CONDITION_WAR_EFFORT_STAGE
618620
case 15: // CONDITION_LEVEL
619-
case 16: // CONDITION_SOURCE_ENTRY
620621
case 26: // CONDITION_ACTIVE_HOLIDAY
621622
case 32: // CONDITION_LAST_WAYPOINT
622623
case 36: // CONDITION_MAP_EVENT_ACTIVE
@@ -645,14 +646,6 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
645646
lblWarEffortStage.Text = "Level:";
646647
break;
647648
}
648-
case 16: // CONDITION_SOURCE_ENTRY
649-
{
650-
lblConditionWarEffortTooltip.Text = "Returns true if the source WorldObject's entry Id matches the one specified.";
651-
cmbWarEffortComparison.Visible = false;
652-
lblWarEffortComparison.Visible = false;
653-
lblWarEffortStage.Text = "Entry:";
654-
break;
655-
}
656649
case 26: // CONDITION_ACTIVE_HOLIDAY
657650
{
658651
lblConditionWarEffortTooltip.Text = "Returns true if the specified holiday is currently active.";
@@ -820,11 +813,22 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
820813
frmConditionMapEventTargets.Visible = true;
821814
break;
822815
}
816+
case 16: // CONDITION_SOURCE_ENTRY
823817
case 52: // CONDITION_DB_GUID
824818
case 54: // CONDITION_DISTANCE_TO_POSITION
825819
{
826820
switch (selectedCondition.Type)
827821
{
822+
case 16: // CONDITION_SOURCE_ENTRY
823+
{
824+
lblConditionDbGuidTooltip.Text = "Returns true if the source object\'s entry matches any of the ones specified.";
825+
lblConditionDbGuid1.Text = "Entry 1:";
826+
lblConditionDbGuid2.Text = "Entry 2:";
827+
lblConditionDbGuid3.Text = "Entry 3:";
828+
lblConditionDbGuid4.Text = "Entry 4:";
829+
830+
break;
831+
}
828832
case 52: // CONDITION_DB_GUID
829833
{
830834
lblConditionDbGuidTooltip.Text = "Returns true if the source object\'s database guid matches any of the ones specified.";

ScriptEditor/FormEventEditor.Designer.cs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ScriptEditor/FormScriptEditor.Designer.cs

Lines changed: 11 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ScriptEditor/FormScriptEditor.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ private void LoadControls()
187187
cmbTargetType.Items.Add(new ComboboxPair("Nearest Hostile Player", 24));
188188
cmbTargetType.Items.Add(new ComboboxPair("Nearest Friendly Player", 25));
189189
cmbTargetType.Items.Add(new ComboboxPair("Random Creature", 26));
190+
cmbTargetType.Items.Add(new ComboboxPair("Random Gameobject", 27));
190191
cmbTargetType.SelectedIndex = 0;
191192

192193
// Add chat types to combo box.
@@ -697,7 +698,6 @@ private void ResetAndHideCommandSpecificForms()
697698
// Update Entry (27)
698699
// Remove Guardians (56)
699700
btnUpdateEntryCreatureId.Text = "-NONE-";
700-
cmbUpdateEntryTeam.SelectedIndex = 0;
701701
frmCommandUpdateEntry.Visible = false;
702702

703703
// Set Stand State (28)
@@ -1575,24 +1575,19 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
15751575
{
15761576
case 27: // Update Entry
15771577
{
1578-
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.";
1579-
lblUpdateEntryTeam.Visible = true;
1580-
cmbUpdateEntryTeam.Visible = true;
1578+
lblUpdateEntryTooltip.Text = "Temporarily changes the source Creature\'s entry, but preserves the same AI.";
15811579
break;
15821580
}
15831581
case 56: // Remove Guardians
15841582
{
15851583
lblUpdateEntryTooltip.Text = "Unsummons all Guardian Pets with the given creature Id that are owned by the source Unit. If no creature Id is provided, it unsummons all of them.";
1586-
cmbUpdateEntryTeam.Visible = false;
1587-
lblUpdateEntryTeam.Visible = false;
15881584
break;
15891585
}
15901586
}
15911587

15921588
uint creatureId = selectedAction.Datalong;
15931589
if (creatureId > 0)
15941590
btnUpdateEntryCreatureId.Text = GameData.FindCreatureName(creatureId) + " (" + creatureId.ToString() + ")";
1595-
cmbUpdateEntryTeam.SelectedIndex = (int)selectedAction.Datalong2;
15961591
frmCommandUpdateEntry.Visible = true;
15971592
break;
15981593
}
@@ -2484,6 +2479,7 @@ private void SetTargetControlsBasedOnType(int target_type)
24842479
case 8: // Nearest Creature with Entry
24852480
case 11: // Nearest GameObject with Entry
24862481
case 26: // Random Creature with Entry
2482+
case 27: // Random GameObject with Entry
24872483
{
24882484

24892485
lblTargetParam1.Text = "Entry:";
@@ -2633,6 +2629,7 @@ private void btnTargetParam1_Click(object sender, EventArgs e)
26332629
break;
26342630
}
26352631
case 11: // Nearest GameObject with Entry
2632+
case 27: // Random GameObject with Entry
26362633
{
26372634
SetScriptFieldFromDataFinderForm<FormGameObjectFinder>(btnTargetParam1, null, null, "TargetParam1");
26382635
break;
@@ -4039,10 +4036,6 @@ private void btnUpdateEntryCreatureId_Click(object sender, EventArgs e)
40394036
{
40404037
SetScriptFieldFromDataFinderForm<FormCreatureFinder>(btnUpdateEntryCreatureId, null, GameData.FindCreatureName, "Datalong");
40414038
}
4042-
private void cmbUpdateEntryTeam_SelectedIndexChanged(object sender, EventArgs e)
4043-
{
4044-
SetScriptFieldFromCombobox(cmbUpdateEntryTeam, "Datalong2", false);
4045-
}
40464039

40474040
// SCRIPT_COMMAND_STAND_STATE (28)
40484041
private void cmbSetStandState_SelectedIndexChanged(object sender, EventArgs e)

ScriptEditor/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("7.9.0.0")]
36-
[assembly: AssemblyFileVersion("7.9.0.0")]
35+
[assembly: AssemblyVersion("8.0.0.0")]
36+
[assembly: AssemblyFileVersion("8.0.0.0")]

0 commit comments

Comments
 (0)