Skip to content

Commit

Permalink
Add condition 56 and command 89.
Browse files Browse the repository at this point in the history
  • Loading branch information
brotalnia committed Aug 30, 2022
1 parent af9a89c commit 6d3a61c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
21 changes: 21 additions & 0 deletions ScriptEditor/DataFinderForms/FormConditionFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ private void AddControlsToLists()
new ComboboxPair("Including Player Pets", 1)
};

private ComboboxPair[] ConditionNearbyPlayer_ComboOptions =
{
new ComboboxPair("Any", 0),
new ComboboxPair("Hostile", 1),
new ComboboxPair("Friendly", 2)
};

public void ShowStandalone()
{
this.ControlBox = true;
Expand Down Expand Up @@ -567,6 +574,11 @@ private string DescribeCondition(ConditionInfo condition, bool targetsSwapped)
description += targetName + " GameObject's GO State Is " + GameData.FindGOStateName((uint)condition.Value1);
break;
}
case 56: // Nearby Player
{
description += ConditionNearbyPlayer_ComboOptions[condition.Value1].Text + " Player Within " + condition.Value2 + " Yards Of The " + targetName;
break;
}
}

return description + (((condition.Flags & 1) != 0) ? ")" : "");
Expand Down Expand Up @@ -1018,6 +1030,7 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
}
case 7: // CONDITION_SKILL
case 29: // CONDITION_SKILL_BELOW
case 56: // CONDITION_NEARBY_PLAYER
{
switch (selectedCondition.Type)
{
Expand All @@ -1037,6 +1050,14 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
lblSkillLevel.Text = "Skill Level:";
break;
}
case 56: // CONDITION_NEARBY_PLAYER
{
lblConditionSkillTooltip.Text = "Returns true if there is a player within a given distance of the target.";
cmbSkillId.DataSource = ConditionNearbyPlayer_ComboOptions;
lblSkillId.Text = "Reaction:";
lblSkillLevel.Text = "Distance:";
break;
}
}

cmbSkillId.SelectedIndex = ComboboxPair.GetIndexFromComboboxPairValue(cmbSkillId, (int)selectedCondition.Value1);
Expand Down
11 changes: 11 additions & 0 deletions ScriptEditor/FormScriptEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public partial class FormScriptEditor : Form
"Set PvP", // 86
"Reset Door or Button", // 87
"Set Command State", // 88
"Play Custom Anim", // 89
};

// Options for combo boxes.
Expand All @@ -132,6 +133,8 @@ public partial class FormScriptEditor : Form
public string[] CommandSendScriptedMapEvent_ComboOptions = { "Main Targets Only", "Additional Targets Only", "All Targets" };
public string[] CommandSetGOState_ComboOptions = { "Active", "Ready", "Active Alternative" };
public string[] CommandSetCommandState_ComboOptions = { "Stay", "Follow", "Attack", "Dismiss" };
public string[] CommandPlayCustomAnim_ComboOptions = { "Anim 0", "Anim 1", "Anim 2", "Anim 3" };

public FormScriptEditor()
{
InitializeComponent();
Expand Down Expand Up @@ -1864,6 +1867,7 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
case 71: // Respawn Creature
case 80: // Set GO State
case 88: // Set Command State
case 89: // Play Custom Anim
{
switch (selectedAction.Command)
{
Expand Down Expand Up @@ -1909,6 +1913,13 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
cmbFleeMode.DataSource = CommandSetCommandState_ComboOptions;
break;
}
case 89: // Play Custom Anim
{
lblFleeTooltip.Text = "The source GameObject plays one of four possible animations tied to its model.";
lblFleeMode.Text = "Anim:";
cmbFleeMode.DataSource = CommandPlayCustomAnim_ComboOptions;
break;
}
}
lblFleeMode.Location = new Point(cmbFleeMode.Location.X - lblFleeMode.Size.Width - 4, lblFleeMode.Location.Y);
cmbFleeMode.SelectedIndex = (int)selectedAction.Datalong;
Expand Down
1 change: 1 addition & 0 deletions ScriptEditor/GameData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,7 @@ static GameData()
ConditionNamesList.Add(new ComboboxPair("LOCAL_TIME", 53));
ConditionNamesList.Add(new ComboboxPair("DISTANCE_TO_POSITION", 54));
ConditionNamesList.Add(new ComboboxPair("OBJECT_GO_STATE", 55));
ConditionNamesList.Add(new ComboboxPair("NEARBY_PLAYER", 56));

// Add skill names.
SkillsList.Add(new ComboboxPair("Frost", 6));
Expand Down
4 changes: 2 additions & 2 deletions ScriptEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("8.3.0.0")]
[assembly: AssemblyFileVersion("8.3.0.0")]
[assembly: AssemblyVersion("8.4.0.0")]
[assembly: AssemblyFileVersion("8.4.0.0")]

0 comments on commit 6d3a61c

Please sign in to comment.