diff --git a/ScriptEditor/DataFinderForms/FormTextFinder.cs b/ScriptEditor/DataFinderForms/FormTextFinder.cs index 534d862..4ae42af 100644 --- a/ScriptEditor/DataFinderForms/FormTextFinder.cs +++ b/ScriptEditor/DataFinderForms/FormTextFinder.cs @@ -34,14 +34,15 @@ public FormTextFinder() languages[33] = "Gutterspeak"; // Chat Type Names - chattypes = new string[7]; + chattypes = new string[8]; chattypes[0] = "Say"; chattypes[1] = "Yell"; chattypes[2] = "Emote"; - chattypes[3] = "Zone Emote"; + chattypes[3] = "Boss Emote"; chattypes[4] = "Whisper"; chattypes[5] = "Boss Whisper"; chattypes[6] = "Zone Yell"; + chattypes[7] = "Zone Emote"; } protected override void AddAllData() { diff --git a/ScriptEditor/Form1.Designer.cs b/ScriptEditor/Form1.Designer.cs index 4f12e19..0f8a467 100644 --- a/ScriptEditor/Form1.Designer.cs +++ b/ScriptEditor/Form1.Designer.cs @@ -63,13 +63,15 @@ private void InitializeComponent() this.tsmiFlagsUnitDynamicUF = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFlagsNpcUF = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFlagsPlayerUF = new System.Windows.Forms.ToolStripMenuItem(); - this.tsmiFlagsSpellMechanic = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.tsmiFlagsSpellAttributes = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFlagsSpellAttributesEx = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFlagsSpellAttributesEx2 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFlagsSpellAttributesEx3 = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFlagsSpellAttributesEx4 = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiFlagsSpellMechanic = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiFlagsSpellProc = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiFlagsSpellProcEx = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.picScriptEditor)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picEventEditor)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picGitLink)).BeginInit(); @@ -311,7 +313,9 @@ private void InitializeComponent() this.tsmiFlagsSpellAttributesEx2, this.tsmiFlagsSpellAttributesEx3, this.tsmiFlagsSpellAttributesEx4, - this.tsmiFlagsSpellMechanic}); + this.tsmiFlagsSpellMechanic, + this.tsmiFlagsSpellProc, + this.tsmiFlagsSpellProcEx}); this.tsmiFlags.Name = "tsmiFlags"; this.tsmiFlags.Size = new System.Drawing.Size(152, 22); this.tsmiFlags.Text = "Flags"; @@ -363,12 +367,6 @@ private void InitializeComponent() this.tsmiFlagsPlayerUF.Size = new System.Drawing.Size(203, 22); this.tsmiFlagsPlayerUF.Text = "Player (UF)"; // - // tsmiFlagsSpellMechanic - // - this.tsmiFlagsSpellMechanic.Name = "tsmiFlagsSpellMechanic"; - this.tsmiFlagsSpellMechanic.Size = new System.Drawing.Size(203, 22); - this.tsmiFlagsSpellMechanic.Text = "Spell Mechanic"; - // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; @@ -404,6 +402,24 @@ private void InitializeComponent() this.tsmiFlagsSpellAttributesEx4.Size = new System.Drawing.Size(203, 22); this.tsmiFlagsSpellAttributesEx4.Text = "Spell AttributesEx4"; // + // tsmiFlagsSpellMechanic + // + this.tsmiFlagsSpellMechanic.Name = "tsmiFlagsSpellMechanic"; + this.tsmiFlagsSpellMechanic.Size = new System.Drawing.Size(203, 22); + this.tsmiFlagsSpellMechanic.Text = "Spell Mechanic"; + // + // tsmiFlagsSpellProc + // + this.tsmiFlagsSpellProc.Name = "tsmiFlagsSpellProc"; + this.tsmiFlagsSpellProc.Size = new System.Drawing.Size(203, 22); + this.tsmiFlagsSpellProc.Text = "Spell Proc"; + // + // tsmiFlagsSpellProcEx + // + this.tsmiFlagsSpellProcEx.Name = "tsmiFlagsSpellProcEx"; + this.tsmiFlagsSpellProcEx.Size = new System.Drawing.Size(203, 22); + this.tsmiFlagsSpellProcEx.Text = "Spell Proc Ex"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -479,5 +495,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem tsmiFlagsSpellAttributesEx2; private System.Windows.Forms.ToolStripMenuItem tsmiFlagsSpellAttributesEx3; private System.Windows.Forms.ToolStripMenuItem tsmiFlagsSpellAttributesEx4; + private System.Windows.Forms.ToolStripMenuItem tsmiFlagsSpellProc; + private System.Windows.Forms.ToolStripMenuItem tsmiFlagsSpellProcEx; } } \ No newline at end of file diff --git a/ScriptEditor/Form1.cs b/ScriptEditor/Form1.cs index 3082a29..a62b36a 100644 --- a/ScriptEditor/Form1.cs +++ b/ScriptEditor/Form1.cs @@ -167,6 +167,16 @@ public Form1() uint flags = 0; Helpers.ShowFlagInputDialog(ref flags, "Spell Mechanic Mask", GameData.SpellMechanicMaskList); }; + tsmiFlagsSpellProc.Click += (sender, e) => + { + uint flags = 0; + Helpers.ShowFlagInputDialog(ref flags, "Spell Proc Flags", GameData.SpellProcFlagsList); + }; + tsmiFlagsSpellProcEx.Click += (sender, e) => + { + uint flags = 0; + Helpers.ShowFlagInputDialog(ref flags, "Spell Proc Flags Ex", GameData.SpellProcFlagsExList); + }; } private void picScriptEditor_MouseEnter(object sender, EventArgs e) diff --git a/ScriptEditor/FormEventEditor.Designer.cs b/ScriptEditor/FormEventEditor.Designer.cs index b2d2a81..576e3c3 100644 --- a/ScriptEditor/FormEventEditor.Designer.cs +++ b/ScriptEditor/FormEventEditor.Designer.cs @@ -335,9 +335,9 @@ private void InitializeComponent() this.chkEventFlag4.AutoSize = true; this.chkEventFlag4.Location = new System.Drawing.Point(116, 20); this.chkEventFlag4.Name = "chkEventFlag4"; - this.chkEventFlag4.Size = new System.Drawing.Size(82, 17); + this.chkEventFlag4.Size = new System.Drawing.Size(81, 17); this.chkEventFlag4.TabIndex = 2; - this.chkEventFlag4.Text = "Debug Only"; + this.chkEventFlag4.Text = "Not Casting"; this.chkEventFlag4.UseVisualStyleBackColor = true; this.chkEventFlag4.CheckedChanged += new System.EventHandler(this.chkEventFlag4_CheckedChanged); // diff --git a/ScriptEditor/FormEventEditor.cs b/ScriptEditor/FormEventEditor.cs index dfbb16c..efc9c98 100644 --- a/ScriptEditor/FormEventEditor.cs +++ b/ScriptEditor/FormEventEditor.cs @@ -59,7 +59,7 @@ public partial class FormEventEditor : Form "Target Missing Aura", // 28 "Movement Inform", // 29 "Leave Combat", // 30 - "Map Event Happened", // 31 + "Script Event Happened", // 31 "Group Member Died", // 32 "Victim Rooted", // 33 "Hit By Aura", // 34 @@ -1063,20 +1063,20 @@ private void lstEvents_ColumnClick(object sender, ColumnClickEventArgs e) private void btnEventAdd_Click(object sender, EventArgs e) { // First we find the highest id in the event list. - uint max_id = 0; + uint maxId = currentCreatureId * 100; foreach (ListViewItem item in lstEvents.Items) { - CreatureEvent creature_event = (CreatureEvent)item.Tag; + CreatureEvent creatureEvent = (CreatureEvent)item.Tag; - if (creature_event.Id > max_id) - max_id = creature_event.Id; + if (creatureEvent.Id > maxId) + maxId = creatureEvent.Id; } - max_id++; + maxId++; ListViewItem newItem = new ListViewItem(); - CreatureEvent newEvent= new CreatureEvent(max_id, currentCreatureId); + CreatureEvent newEvent= new CreatureEvent(maxId, currentCreatureId); // We show only id, event type, and comment in the listview. newItem.Text = newEvent.Id.ToString(); @@ -1184,13 +1184,23 @@ private string GenerateSaveQuery() query = "-- Removing unused script actions.\nDELETE FROM `creature_ai_scripts` WHERE `id` IN (" + unusedScripts + ");\n\n"; } query += "-- Events list for " + GameData.FindCreatureName(currentCreatureId) + "\nDELETE FROM `creature_ai_events` WHERE `creature_id`=" + currentCreatureId.ToString() + ";\n"; - foreach (ListViewItem lvi in lstEvents.Items) + if (lstEvents.Items.Count > 0) { - // Get the associated CreatureEvent. - CreatureEvent currentEvent = (CreatureEvent)lvi.Tag; + query += "INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES\n"; + for (int i = 0; i < lstEvents.Items.Count; ++i) + { + // Get the associated CreatureEvent. + ListViewItem lvi = lstEvents.Items[i]; + CreatureEvent currentEvent = (CreatureEvent)lvi.Tag; - query += "INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (" + currentEvent.Id.ToString() + ", " + currentEvent.CreatureId.ToString() + ", " + currentEvent.ConditionId.ToString() + ", " + currentEvent.Type.ToString() + ", " + currentEvent.InversePhaseMask.ToString() + ", " + currentEvent.Chance.ToString() + ", " + currentEvent.Flags.ToString() + ", " + currentEvent.Param1.ToString() + ", " + currentEvent.Param2.ToString() + ", " + currentEvent.Param3.ToString() + ", " + currentEvent.Param4.ToString() + ", " + currentEvent.ScriptId1.ToString() + ", " + currentEvent.ScriptId2.ToString() + ", " + currentEvent.ScriptId3.ToString() + ", '" + Helpers.MySQLEscape(currentEvent.Comment) + "');\n"; + if (i > 0) + query += ",\n"; + + query += "(" + currentEvent.Id.ToString() + ", " + currentEvent.CreatureId.ToString() + ", " + currentEvent.ConditionId.ToString() + ", " + currentEvent.Type.ToString() + ", " + currentEvent.InversePhaseMask.ToString() + ", " + currentEvent.Chance.ToString() + ", " + currentEvent.Flags.ToString() + ", " + currentEvent.Param1.ToString() + ", " + currentEvent.Param2.ToString() + ", " + currentEvent.Param3.ToString() + ", " + currentEvent.Param4.ToString() + ", " + currentEvent.ScriptId1.ToString() + ", " + currentEvent.ScriptId2.ToString() + ", " + currentEvent.ScriptId3.ToString() + ", '" + Helpers.MySQLEscape(currentEvent.Comment) + "')"; + } + query += ";\n"; } + return query; } private void btnSave_Click(object sender, EventArgs e) diff --git a/ScriptEditor/GameData.cs b/ScriptEditor/GameData.cs index fd80157..6a87254 100644 --- a/ScriptEditor/GameData.cs +++ b/ScriptEditor/GameData.cs @@ -53,6 +53,8 @@ public static class GameData public static readonly List> SpellAttributesEx2List = new List>(); public static readonly List> SpellAttributesEx3List = new List>(); public static readonly List> SpellAttributesEx4List = new List>(); + public static readonly List> SpellProcFlagsList = new List>(); + public static readonly List> SpellProcFlagsExList = new List>(); public static int FindIndexOfMap(uint id) { @@ -2588,6 +2590,54 @@ static GameData() SpellAttributesEx4List.Add(new Tuple("Allow Cast While Casting", 128)); SpellAttributesEx4List.Add(new Tuple("Ignore Damage Taken Modifiers", 256)); SpellAttributesEx4List.Add(new Tuple("Combat Feedback When Usable", 512)); + + // Spell Proc Flags + SpellProcFlagsList.Add(new Tuple("Heartbeat", 1)); + SpellProcFlagsList.Add(new Tuple("Kill", 2)); + SpellProcFlagsList.Add(new Tuple("Deal Melee Swing", 4)); + SpellProcFlagsList.Add(new Tuple("Take Melee Swing", 8)); + SpellProcFlagsList.Add(new Tuple("Deal Melee Ability", 16)); + SpellProcFlagsList.Add(new Tuple("Take Melee Ability", 32)); + SpellProcFlagsList.Add(new Tuple("Deal Ranged Attack", 64)); + SpellProcFlagsList.Add(new Tuple("Take Ranged Attack", 128)); + SpellProcFlagsList.Add(new Tuple("Deal Ranged Ability", 256)); + SpellProcFlagsList.Add(new Tuple("Take Ranged Ability", 512)); + SpellProcFlagsList.Add(new Tuple("Deal Helpful Ability", 1024)); + SpellProcFlagsList.Add(new Tuple("Take Helpful Ability", 2048)); + SpellProcFlagsList.Add(new Tuple("Deal Harmful Ability", 4096)); + SpellProcFlagsList.Add(new Tuple("Take Harmful Ability", 8192)); + SpellProcFlagsList.Add(new Tuple("Deal Helpful Spell", 16384)); + SpellProcFlagsList.Add(new Tuple("Take Helpful Spell", 32768)); + SpellProcFlagsList.Add(new Tuple("Deal Harmful Spell", 65536)); + SpellProcFlagsList.Add(new Tuple("Take Harmful Spell", 131072)); + SpellProcFlagsList.Add(new Tuple("Deal Harmful Periodic", 262144)); + SpellProcFlagsList.Add(new Tuple("Take Harmful Periodic", 524288)); + SpellProcFlagsList.Add(new Tuple("Taken Any Damage", 1048576)); + SpellProcFlagsList.Add(new Tuple("On Trap Activation", 2097152)); + SpellProcFlagsList.Add(new Tuple("Main Hand Weapon Swing", 4194304)); + SpellProcFlagsList.Add(new Tuple("Off Hand Weapon Swing", 8388608)); + + // Spell Proc Flags Ex + SpellProcFlagsExList.Add(new Tuple("Normal Hit", 1)); + SpellProcFlagsExList.Add(new Tuple("Critical Hit", 2)); + SpellProcFlagsExList.Add(new Tuple("Miss", 4)); + SpellProcFlagsExList.Add(new Tuple("Resist", 8)); + SpellProcFlagsExList.Add(new Tuple("Dodge", 16)); + SpellProcFlagsExList.Add(new Tuple("Parry", 32)); + SpellProcFlagsExList.Add(new Tuple("Block", 64)); + SpellProcFlagsExList.Add(new Tuple("Evade", 128)); + SpellProcFlagsExList.Add(new Tuple("Immune", 256)); + SpellProcFlagsExList.Add(new Tuple("Deflect", 512)); + SpellProcFlagsExList.Add(new Tuple("Absorb", 1024)); + SpellProcFlagsExList.Add(new Tuple("Reflect", 2048)); + SpellProcFlagsExList.Add(new Tuple("Interrupt", 4096)); + SpellProcFlagsExList.Add(new Tuple("Reserved1", 8192)); + SpellProcFlagsExList.Add(new Tuple("Reserved2", 16384)); + SpellProcFlagsExList.Add(new Tuple("Reserved3", 32768)); + SpellProcFlagsExList.Add(new Tuple("Trigger Always", 65536)); + SpellProcFlagsExList.Add(new Tuple("No Periodic", 131072)); + SpellProcFlagsExList.Add(new Tuple("Periodic Positive", 262144)); + SpellProcFlagsExList.Add(new Tuple("Cast End", 524288)); } } public struct BroadcastText diff --git a/ScriptEditor/Helpers.cs b/ScriptEditor/Helpers.cs index d4d724d..64329f2 100644 --- a/ScriptEditor/Helpers.cs +++ b/ScriptEditor/Helpers.cs @@ -99,7 +99,9 @@ public static DialogResult ShowFlagInputDialog(ref uint flags, string name, List { foreach (var item in valuesList) { - int neededSize = 20 + item.Item1.Length * 6; + int neededSize = 20; + foreach (char chr in item.Item1) + neededSize += (Char.IsUpper(chr) ? 9 : 6); if (neededSize > columnSize) columnSize = neededSize; } diff --git a/ScriptEditor/Properties/AssemblyInfo.cs b/ScriptEditor/Properties/AssemblyInfo.cs index a906f9a..45cc502 100644 --- a/ScriptEditor/Properties/AssemblyInfo.cs +++ b/ScriptEditor/Properties/AssemblyInfo.cs @@ -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.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")]