Skip to content

Commit

Permalink
Fix movement types and add spell attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
brotalnia committed Sep 3, 2023
1 parent 11260b3 commit 131a9b9
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 54 deletions.
27 changes: 20 additions & 7 deletions ScriptEditor/DataFinderForms/FormConditionFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ private string DescribeCondition(ConditionInfo condition, bool targetsSwapped)
}
case 44: // Is Hostile To
{
description += targetName + " Is Hostile To " + sourceName;
description += targetName + "'s Reaction To " + sourceName + " Is " + GetComparisonOperatorName(condition.Value2) + " " + GameData.FindReputationRankName((uint)condition.Value1);
break;
}
case 45: // Is In Group
Expand Down Expand Up @@ -703,6 +703,7 @@ private void ResetAndHideConditionSpecificForms()
frmConditionNearbyObject.Visible = false;

// CONDITION_WOW_PATCH (24)
// CONDITION_REACTION (44)
cmbContentPatch.SelectedIndex = 0;
cmbContentPatchComparison.SelectedIndex = 0;
frmConditionContentPatch.Visible = false;
Expand Down Expand Up @@ -821,7 +822,6 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
case 39: // CONDITION_IS_MOVING
case 40: // CONDITION_HAS_PET
case 43: // CONDITION_IS_IN_COMBAT
case 44: // CONDITION_IS_HOSTILE_TO
case 45: // CONDITION_IS_IN_GROUP
case 46: // CONDITION_IS_ALIVE
case 48: // CONDITION_OBJECT_IS_SPAWNED
Expand Down Expand Up @@ -864,11 +864,6 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
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. 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. This condition has no additional parameters.";
Expand Down Expand Up @@ -1264,7 +1259,25 @@ private void ShowConditionSpecificForm(ConditionInfo selectedCondition)
break;
}
case 24: // CONDITION_WOW_PATCH
case 44: // CONDITION_REACTION
{
switch (selectedCondition.Type)
{
case 24: // CONDITION_WOW_PATCH
{
lblConditionContentPatchTooltip.Text = "Returns true if the current content patch matches the one specified.";
cmbContentPatch.DataSource = GameData.ContentPatchesList;
lblContentPatch.Text = "Patch:";
break;
}
case 44: // CONDITION_REACTION
{
lblConditionContentPatchTooltip.Text = "Returns true if the target WorldObject's reaction to the source WorldObject matches the criteria.";
cmbContentPatch.DataSource = GameData.ReputationRankList;
lblContentPatch.Text = "Reaction:";
break;
}
}
cmbContentPatch.SelectedIndex = (int)selectedCondition.Value1;
cmbContentPatchComparison.SelectedIndex = (int)selectedCondition.Value2;
frmConditionContentPatch.Visible = true;
Expand Down
55 changes: 54 additions & 1 deletion ScriptEditor/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 31 additions & 5 deletions ScriptEditor/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ public Form1()
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Player Flags (UF)", GameData.UnitNpcFlagsList);
};
tsmiFlagsSpellMechanic.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell Mechanic Mask", GameData.SpellMechanicMaskList);
};
tsmiFlagsUnitDynamicUF.Click += (sender, e) =>
{
uint flags = 0;
Expand All @@ -141,6 +136,37 @@ public Form1()
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Unit Flags (UF)", GameData.UnitFieldFlagsList);
};

tsmiFlagsSpellAttributes.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell Attributes", GameData.SpellAttributesList);
};
tsmiFlagsSpellAttributesEx.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell AttributesEx", GameData.SpellAttributesExList);
};
tsmiFlagsSpellAttributesEx2.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell AttributesEx2", GameData.SpellAttributesEx2List);
};
tsmiFlagsSpellAttributesEx3.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell AttributesEx3", GameData.SpellAttributesEx3List);
};
tsmiFlagsSpellAttributesEx4.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell AttributesEx4", GameData.SpellAttributesEx4List);
};
tsmiFlagsSpellMechanic.Click += (sender, e) =>
{
uint flags = 0;
Helpers.ShowFlagInputDialog(ref flags, "Spell Mechanic Mask", GameData.SpellMechanicMaskList);
};
}

private void picScriptEditor_MouseEnter(object sender, EventArgs e)
Expand Down
24 changes: 12 additions & 12 deletions ScriptEditor/FormScriptEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
cmbSetMovementClearMotionMaster.SelectedIndex = (int)selectedAction.Datalong4;
break;
}
case 5: // CHASE_MOTION_TYPE
case 6: // CHASE_MOTION_TYPE
{
cmbSetMovementBoolParam.Enabled = true;
cmbSetMovementBoolParam.SelectedIndex = (int)selectedAction.Datalong2;
Expand All @@ -1441,7 +1441,7 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
txtSetMovementAngle.Text = selectedAction.O.ToString();
break;
}
case 9: // FLEEING_MOTION_TYPE
case 10: // FLEEING_MOTION_TYPE
{
cmbSetMovementBoolParam.Enabled = true;
cmbSetMovementBoolParam.SelectedIndex = (int)selectedAction.Datalong2;
Expand All @@ -1451,22 +1451,22 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
lblSetMovementIntParam.Text = "Time:";
break;
}
case 10: // DISTRACT_MOTION_TYPE
case 11: // DISTRACT_MOTION_TYPE
{
txtSetMovementIntParam.Enabled = true;
txtSetMovementIntParam.Text = selectedAction.Datalong3.ToString();
lblSetMovementIntParam.Text = "Time:";
break;
}
case 14: // FOLLOW_MOTION_TYPE
case 15: // FOLLOW_MOTION_TYPE
{
txtSetMovementDistance.Enabled = true;
txtSetMovementDistance.Text = selectedAction.X.ToString();
txtSetMovementAngle.Enabled = true;
txtSetMovementAngle.Text = selectedAction.O.ToString();
break;
}
case 17: // CHARGE_MOTION_TYPE
case 18: // CHARGE_MOTION_TYPE
{
cmbSetMovementBoolParam.Enabled = true;
cmbSetMovementBoolParam.SelectedIndex = (int)selectedAction.Datalong2;
Expand All @@ -1476,7 +1476,7 @@ private void ShowCommandSpecificForm(ScriptAction selectedAction)
lblSetMovementIntParam.Text = "Delay:";
break;
}
case 18: // DISTANCING_MOTION_TYPE
case 19: // DISTANCING_MOTION_TYPE
{
txtSetMovementDistance.Enabled = true;
txtSetMovementDistance.Text = selectedAction.X.ToString();
Expand Down Expand Up @@ -3500,7 +3500,7 @@ private void cmbSetMovementType_SelectedIndexChanged(object sender, EventArgs e)
cmbSetMovementClearMotionMaster.Enabled = true;
break;
}
case 5: // CHASE_MOTION_TYPE
case 6: // CHASE_MOTION_TYPE
{
cmbSetMovementBoolParam.Enabled = true;
cmbSetMovementBoolParam.SelectedIndex = 0;
Expand All @@ -3511,7 +3511,7 @@ private void cmbSetMovementType_SelectedIndexChanged(object sender, EventArgs e)
txtSetMovementAngle.Text = "0";
break;
}
case 9: // FLEEING_MOTION_TYPE
case 10: // FLEEING_MOTION_TYPE
{
cmbSetMovementBoolParam.Enabled = true;
cmbSetMovementBoolParam.SelectedIndex = 0;
Expand All @@ -3521,22 +3521,22 @@ private void cmbSetMovementType_SelectedIndexChanged(object sender, EventArgs e)
lblSetMovementIntParam.Text = "Time:";
break;
}
case 10: // DISTRACT_MOTION_TYPE
case 11: // DISTRACT_MOTION_TYPE
{
txtSetMovementIntParam.Enabled = true;
txtSetMovementIntParam.Text = "0";
lblSetMovementIntParam.Text = "Time:";
break;
}
case 14: // FOLLOW_MOTION_TYPE
case 15: // FOLLOW_MOTION_TYPE
{
txtSetMovementDistance.Enabled = true;
txtSetMovementDistance.Text = "0";
txtSetMovementAngle.Enabled = true;
txtSetMovementAngle.Text = "0";
break;
}
case 17: // CHARGE_MOTION_TYPE
case 18: // CHARGE_MOTION_TYPE
{
cmbSetMovementBoolParam.Enabled = true;
cmbSetMovementBoolParam.SelectedIndex = 0;
Expand All @@ -3546,7 +3546,7 @@ private void cmbSetMovementType_SelectedIndexChanged(object sender, EventArgs e)
lblSetMovementIntParam.Text = "Delay:";
break;
}
case 18: // DISTANCING_MOTION_TYPE
case 19: // DISTANCING_MOTION_TYPE
{
txtSetMovementDistance.Enabled = true;
txtSetMovementDistance.Text = "0";
Expand Down
Loading

0 comments on commit 131a9b9

Please sign in to comment.