Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Farthest Hostile target in Scripts editor and Spell List ed… #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ScriptEditor/FormCastFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public bool ShowDialog(ref uint flags, ref uint script, uint targettype, ref uin
case 3: // Last Aggro
case 4: // Random
case 5: // Random Not Top
case 28: // Farthest Hostile
{
grpTargetParams.Enabled = true;
lblTargetParam1.Text = "Select Flags:";
Expand Down
3 changes: 2 additions & 1 deletion ScriptEditor/FormCastsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private List<ComboboxPair> GetSpellTargetsList()
new ComboboxPair("Friendly In CC", 19),
new ComboboxPair("Nearest Player", 23),
new ComboboxPair("Hostile Player", 24),
new ComboboxPair("Friendly Player", 25)
new ComboboxPair("Friendly Player", 25),
new ComboboxPair("Farthest Hostile", 28)
};
}
private void LoadControls()
Expand Down
4 changes: 4 additions & 0 deletions ScriptEditor/FormScriptEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ private void LoadControls()
cmbTargetType.Items.Add(new ComboboxPair("Nearest Friendly Player", 25));
cmbTargetType.Items.Add(new ComboboxPair("Random Creature", 26));
cmbTargetType.Items.Add(new ComboboxPair("Random Gameobject", 27));
cmbTargetType.Items.Add(new ComboboxPair("Farthest Hostile", 28));
cmbTargetType.SelectedIndex = 0;

// Add chat types to combo box.
Expand Down Expand Up @@ -242,6 +243,7 @@ private void LoadControls()
cmbSummonCreatureAttackTarget.Items.Add(new ComboboxPair("Random Not Top", 5));
cmbSummonCreatureAttackTarget.Items.Add(new ComboboxPair("Owner or Self", 6));
cmbSummonCreatureAttackTarget.Items.Add(new ComboboxPair("Owner", 7));
cmbSummonCreatureAttackTarget.Items.Add(new ComboboxPair("Farthest Hostile", 28));

// Add options to Summon Creature Despawn Type combo box.
cmbSummonCreatureDespawnType.Items.Add(new ComboboxPair("Timer OOC or Disappear", 1));
Expand Down Expand Up @@ -2438,6 +2440,7 @@ private void SetTargetControlsBasedOnType(int target_type)
case 3: // Last Aggro
case 4: // Random
case 5: // Random Not Top
case 28: // Farthest Hostile
{
lblTargetParam1.Text = "Flags:";
lblTargetParam2.Text = "N/A:";
Expand Down Expand Up @@ -2623,6 +2626,7 @@ private void btnTargetParam1_Click(object sender, EventArgs e)
case 3: // Last Aggro
case 4: // Random
case 5: // Random Not Top
case 28: // Farthest Hostile
{
FormTargetSelectFlags frm = new FormTargetSelectFlags(GetScriptFieldValue<uint>("TargetParam1"));
if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Expand Down